On Mon, 29 Jun 2020 21:08:59 +0300
Matti Pulkkinen <mkjpul(a)utu.fi> wrote:
Hello,
I'm trying to use Audacity to record the line in on my PC, but I
always get the following error:
Error opening recording device.
Error code: -9997 Invalid sample rate
Sounds like an easy-to-fix problem, but the same thing happens
regardless of what sample rate I choose. Checking with "pacmd
list-sinks" I found that the sample rate for my card is 44100 Hz, so
that's what I'm trying to use now that I've checked all possible
sample rate options Audacity offers. Also, Audacity offers a bunch of
different recording devices with names along the lines of "HDA Intel
PCH: ALC892 Alt Analog (hw:0,2): Front Mic:0" but the same error
happens with all of them too.
Based on what I could find online, it seems like people have had this
issue mostly on Windows, and then it was to do with either not having
updated drivers or having set the device's sample rate incorrectly.
Has anyone here run into something like this before on Fedora? Any
ideas where to start trying to fix this?
Without detailed data about your system and how it is configured, I
can't be sure, and maybe not even if I had that data. But, I
understand that what you are doing is trying to record from a mic, and
not what is being played by the soundcard.
Sound systems in linux consist of two components, alsa, which takes care
of low level details on sound devices, and pulse, which sits on top of
alsa and handles routing of sound device output to consumers, so called
sources and sinks. Both have to be set up correctly in order for sound
to work properly. But, if they are set up correctly, you don't need to
do anything fancy to use sound. In audacity, you should just have to
select pulse as the source, and the recording function would work.
So, the first question is, does alsa recognize the recording device you
want to use?
arecord -lv
Is it there? The next question is, what is the default recording device
in pulse? If it isn't the device you are trying to record from, you
won't get any input out of pulse. I find this easier to see from
pavucontrol, in the recording device tab, and it is easier to set the
default there also. But it can be done from pactl, I'm just not
familiar with the invocation.
Once this is set properly, you will be able to get sound in audacity
from your input device using pulse as the setting.
Alternatively, you can turn off the sound device with your recording
device from pulse so it becomes controlled only by alsa, tell audacity
to use alsa, and select the actual device that you want to record with.