Bugzilla – Bug 585
Linux: Requested 44100Hz sample rate not honored on recording
Last modified: 2021-04-16 16:51:03 UTC
My recordings made with Audacity 2.01/Linux (LMDE-Testing) turn out consistently longer than the recording time. That is, if I record audio for about 55 minutes, the recorded audio has a duration of approximately 1 hour. When I export the resulting audio to FLAC, the resulting file has the wrong duration and has a slower tempo than the original audio. I can easily see the wrong behavior by starting a recording and comparing the recording time with the computer clock; after about a minute the difference amounts to some 5 seconds. Generating a minute of silence will generate exactly a minute of silence, so Audacity has not completely lost track of the time.
What source are you recording from? What soundcard? OSS? ALSA? Pulse? What are the results in other audio software using the same card/input/API?
Audio Host: Alsa, Input Device: pulse. I'm recording from "Monitor of Built-in Audio Analog Stereo". Actually I now see that the simple Audio Recorder application exhibits the same behavior recording from the same source, so it's probably the source that is behaving strangely. Still, I think Audacity should detect this happening.
It seems that the input rate is 48000 Hz, which Audacity records at 44100 Hz, giving rise to this difference. I have tried setting the project rate to 48000 Hz, but that doesn't help.
Here's my workaround: 1) Set Project Rate to 44100 2) Tracks -> Add New -> Stereo Track 3) Set Project Rate to 48000 4) Record If you go straight to step 3 you will have both the track and the project at the same rate and that will produce the same time discrepancy. That's the mistake I made in comment 3.
Sorry, my workaround was wrong. Here's how to do it: 1) Set Project Rate to 48000 2) Tracks -> Add New -> Stereo Track 3) Set Project Rate to 44100 4) Record Now, the next problem comes when saving the recorded audio as FLAC. All of a sudden, saving a one-hour recording takes nearly 20 minutes, something which takes "only" some five minutes with a track rate of 44100. And sorry for the bug spam.
(In reply to comment #5) > 1) Set Project Rate to 48000 > 2) Tracks -> Add New -> Stereo Track > 3) Set Project Rate to 44100 > 4) Record > > Now, the next problem comes when saving the recorded audio as FLAC. All of a > sudden, saving a one-hour recording takes nearly 20 minutes something which > takes "only" some five minutes with a track rate of 44100. If you mean exporting, this is expected, especially if you use libsamplerate in "best" mode. Assuming you are not append-recording, delete the empty 48000 Hz trsck using [X] before exporting, then the export will not be delayed by resampling. I suggest you could triage your future issues on the Forum http://forum.audacityteam.org/viewforum.php?f=48 before adding them to bugzilla.
(In reply to comment #6) Per, I have not reproduced your issue. My feeling at present is that your workaround "shouldn't" make any difference (and correcting sound device clock speed errors is a rather advanced feature request). Anyhow there is a report on the Forum from a Linux user http://forum.audacityteam.org/viewtopic.php?f=48&t=68859 that suggests Audacity is recording too fast by a ratio relevant to the difference between 44100 Hz and 48000 Hz. This is not necessarily surprising in itself, but could you please look at that thread, and reply there posting your Audio Device Info from the Audacity "Help" menu, along with any other comments. Also please state there if your workaround involves append-recording into the track that is at a different rate from the project rate. Thanks.
Not reproducable by Gale. Sound card / Driver suspected. Not honoring requested sample rate. Does not affect Windows. So PX to P4 and title changed.
(In reply to comment #8) This is fairly common on Linux if the user is recording a file that is not at the sample rate of the device. There is an example at forum.audacityteam.org/viewtopic.php?f=48&t=83023 - the rate of the file is 22050 Hz, recording the first time is a little too fast (by about the difference between 48000 and 44100 Hz), so plays a little too slow/low pitch. Recording second time is OK. Pulseaudio should handle issues like this. On the occasion above, deleting audacity.cfg fixed it, but there was nothing in the original .cfg to suggest the cause of the problem.
(In reply to Per Ångström from comment #2) > Actually I now see that the simple Audio Recorder application exhibits > the same behavior recording from the same source I think that, along with the absence of other reports over the last 9 years, indicates that this is not an Audacity bug. Closed as "not a bug"