Audacity records at wrong clock rate
Forum rules
This forum is for Audacity on GNU/Linux.
Please state:
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade (see https://www.audacityteam.org/download/).
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Please state:
- which version of Linux you are using,
- the exact three-section version number of Audacity from Help menu > About Audacity,
- whether you installed your distribution's release, PPA version, or compiled Audacity from source code.
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade (see https://www.audacityteam.org/download/).
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Re: Audacity records at wrong clock rate
Steve, is that really pavucontrol you're talking about, because I can't find any way to configure the sampling rate or anything similar about my sound system, other than setting input/output levels?
Re: Audacity records at wrong clock rate
Yes, pavucontrol.
We should be able to set our desired sample rate in Audacity, then let PulseAudio handle the sample rates automagically.
Assuming that you have it installed:
We should be able to set our desired sample rate in Audacity, then let PulseAudio handle the sample rates automagically.
Assuming that you have it installed:
- Open Audacity
- Select "pulse" as the recording input
- Click on the recording meter. By default this should start monitoring the default capture device, which is probably your microphone.
- Open PulseAudio Volume Control
- Look in the "Recording" tab of pavucontrol - you should see Audacity listed.
- Click on the "ALSA capture from:" box and select the "Monitor" option.
- Close pavucontrol
- Click on the Audacity recording meter to stop monitoring.
- Start playing a YouTube video.
- Click on the recording meter. You should see it responding to the audio that is playing in YouTube.
- Stop the YouTube video - the Audacity recording meter should show absolute silence.
- Press the Record button in Audacity
- Start the video playing.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: Audacity records at wrong clock rate
So this is despite autark is selecting the pulse device [8] to record from, not [4]?steve wrote:You are recording a stream from YouTube?
The audio data most likely has a sample rate of 44100 Hz.
For some reason it appears that your sound card only supports 48 kHz. I don't know whether this is a hardware issue or a driver issue, but the device info shows for playback:So you're trying to capture a 44.1 kHz audio stream through a device that plays only at 48 kHz.Code: Select all
============================== Device ID: 4 Device name: Intel ICH6: Intel ICH6 - IEC958 (hw:0,4) Host name: ALSA Input channels: 0 Output channels: 2 Low Input Latency: -1.000000 Low Output Latency: 0.010667 High Input Latency: -1.000000 High Output Latency: 0.042667 Supported Rates: 48000 ==============================
All the symptoms make sense.
Fortunately you have PulseAudio which can resample on the fly and should be able to let you record streaming media at other rates.
And as 48000 Hz-only devices used to be quite common on Linux, I presume the old solution of recording at 48000 Hz in Audacity would still work when recording from a non-playback input like a microphone?
See http://forum.audacityteam.org/viewtopic ... 20&t=68921 .autark wrote:I'm surprised that Audacity doesn't notice that the recording is going at the wrong speed.
Gale
Last edited by Gale Andrews on Fri Apr 24, 2015 4:07 pm, edited 2 times in total.
Reason: Split out feature request about detecting recording at wrong speed
Reason: Split out feature request about detecting recording at wrong speed
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: Audacity records at wrong clock rate
Can we keep on topic please.
I'm trying to help Andrew4096 and it is very confusing to throw in discussions about feature requests or a partial picture of what is happening on another machine.
I'm trying to help Andrew4096 and it is very confusing to throw in discussions about feature requests or a partial picture of what is happening on another machine.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: Audacity records at wrong clock rate
I've split the feature request as you suggest, but I'm also trying to figure out what's happening on autark''s machine and lay down some guidance to help not only Andrew4096 but others who may read this later on. I can't see it would help much at present to split off the behaviour Per sees.steve wrote:Can we keep on topic please.
I'm trying to help Andrew4096 and it is very confusing to throw in discussions about feature requests or a partial picture of what is happening on another machine.
I am confused if Andrew and Per are both recording a 44100 Hz stream at 48000 Hz and one recording ends up too fast (Andrew) and one (Per) too slow.
So @autark, when you have time, are you recording from YouTube, as Steve asked?
Does installing pavucontrol, choosing "pulse" as input device in Audacity's Device Toolbar, setting Audacity project rate to 48000 Hz then recording as Steve described let you record at the correct speed?
Were you recording from the pulse input in Device Toolbar before, when recording was at the wrong speed (and so pulse won't do on-the-fly-resampling without pavucontrol)? If this a pulse audio limitation it might be better to say so explicitly as I am not sure either way from what's been written.
Also I still assume that setting Audacity project rate to the sole rate the device supports "should" solve the incorrect speed when recording from mic or line-in (that is, not playing a file). At least it was said to work when this came up in the past.
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: Audacity records at wrong clock rate
@Gale:
> are you recording from YouTube, as Steve asked?
I discovered the problem recording from streaming radio (a Flash application, so that's similar to Youtube). But actually I don't think the source is relevant, since the Pulse Audio monitor lies as a layer in-between.
> Does installing pavucontrol, choosing "pulse" as input device in Audacity's Device Toolbar, setting Audacity
> project rate to 48000 Hz then recording as Steve described let you record at the correct speed?
Yes, today it does.
> Were you recording from the pulse input in Device Toolbar before, when recording was at the wrong speed
> (and so pulse won't do on-the-fly-resampling without pavucontrol)?
Yes, I was. Actually, I can't see I'm doing anything differently now than before. It's all very confusing.
> are you recording from YouTube, as Steve asked?
I discovered the problem recording from streaming radio (a Flash application, so that's similar to Youtube). But actually I don't think the source is relevant, since the Pulse Audio monitor lies as a layer in-between.
> Does installing pavucontrol, choosing "pulse" as input device in Audacity's Device Toolbar, setting Audacity
> project rate to 48000 Hz then recording as Steve described let you record at the correct speed?
Yes, today it does.
> Were you recording from the pulse input in Device Toolbar before, when recording was at the wrong speed
> (and so pulse won't do on-the-fly-resampling without pavucontrol)?
Yes, I was. Actually, I can't see I'm doing anything differently now than before. It's all very confusing.
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: Audacity records at wrong clock rate
Thanks, Per. Yes most likely the Flash player defaults to 44100 Hz. If you find using pavucontrol doesn't solve the problem permanently, please let us know.
If pavucontrol is required to do on-the-fly resampling, I cannot understand why it is not installed by default, especially as one-rate-only devices are not unheard of on Linux.
Do you agree we can close the bug you opened (subject to what Andrew finds when he tests)? Your "feature request" will probably get counted.
Gale
If pavucontrol is required to do on-the-fly resampling, I cannot understand why it is not installed by default, especially as one-rate-only devices are not unheard of on Linux.
Do you agree we can close the bug you opened (subject to what Andrew finds when he tests)? Your "feature request" will probably get counted.
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: Audacity records at wrong clock rate
@Gale: Today, my recordings are consistently too slow by the 44.1/48 ratio, regardless of what speed the project is set to, be that 8, 48, or 96 kHz, so today I have to set a different track rate to work around the problem, at the cost of a wildly decreased speed of exporting to FLAC afterwards, as I mentioned in my bug report.
I can only surmise that the successful outcome yesterday was due to the sound system behaving normally, which apparently isn't the case today. So I think it all comes down to Audacity not being able to detect that the input source is outputting at a different rate than requested.
It should be noted that I have always been using pavucontrol since I started recording from the Pulse Audio monitor, since that functionality can only be enabled using pavucontrol, as far as I can see. My question to Steve was triggered by not finding any sampling-speed options in my version of that tool.
Frankly, I'm a bit wary of making a feature out of this. If this "feature" is buried in a preference somewhere I'm sure nobody will find it. In my mind this kind of detection should be the normal behavior. About my bug report, you can close it, because it's not likely to lead to anything anyhow.
@Steve: sorry if this was too much off-topic.
I can only surmise that the successful outcome yesterday was due to the sound system behaving normally, which apparently isn't the case today. So I think it all comes down to Audacity not being able to detect that the input source is outputting at a different rate than requested.
It should be noted that I have always been using pavucontrol since I started recording from the Pulse Audio monitor, since that functionality can only be enabled using pavucontrol, as far as I can see. My question to Steve was triggered by not finding any sampling-speed options in my version of that tool.
Frankly, I'm a bit wary of making a feature out of this. If this "feature" is buried in a preference somewhere I'm sure nobody will find it. In my mind this kind of detection should be the normal behavior. About my bug report, you can close it, because it's not likely to lead to anything anyhow.
@Steve: sorry if this was too much off-topic.
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: Audacity records at wrong clock rate
OK, thanks. I assume the export slowness is because your distro build of Audacity uses libsamplerate (see Help > About Audacity: Build Information).autark wrote:@Gale: Today, my recordings are consistently too slow by the 44.1/48 ratio, regardless of what speed the project is set to, be that 8, 48, or 96 kHz, so today I have to set a different track rate to work around the problem, at the cost of a wildly decreased speed of exporting to FLAC afterwards, as I mentioned in my bug report.
If you build the 2.0.2 tarball, default ./configure will give you libresample which will be much quicker. If you build HEAD (run ./autogen.sh before ./configure at the moment), I think that resampling would now use libsoxr which maybe a bit quicker again. If you build either, you probably want to uninstall your distro build.
Ah, OK, that's true for monitor of analog mix. So perhaps what Pulse should be doing only works fitfully.autark wrote: I can only surmise that the successful outcome yesterday was due to the sound system behaving normally, which apparently isn't the case today. So I think it all comes down to Audacity not being able to detect that the input source is outputting at a different rate than requested.
It should be noted that I have always been using pavucontrol since I started recording from the Pulse Audio monitor, since that functionality can only be enabled using pavucontrol, as far as I can see. My question to Steve was triggered by not finding any sampling-speed options in my version of that tool.
Please see http://forum.audacityteam.org/viewtopic ... 17#p196617 and comment there if you want to.autark wrote:Frankly, I'm a bit wary of making a feature out of this. If this "feature" is buried in a preference somewhere I'm sure nobody will find it. In my mind this kind of detection should be the normal behavior.
OK, subject to anything else that looks like an Audacity "bug" coming out of this.autark wrote: About my bug report, you can close it, because it's not likely to lead to anything anyhow.
By the way, do you know the URL of the stream you want, or you can sniff the URL out, or get the file from the browser cache? If you know the URL you can dump it with mencoder, I think. This should just give you the 44100 Hz file (if that's what it is).
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: Audacity records at wrong clock rate
Possible workaround here: http://forum.audacityteam.org/viewtopic ... 10#p288145