Audio sample rate changing constantly

Hello forum users,

I have issues with my build-in microphone which has very loud static noise. (At first I thought it wasn’t working at all, but it is connected and actually records/plays back my voice.)

So I followed this Arch Wiki entry about Static noise in microphone recording. My sound card is hw:1,0. The wiki says the following:

Determine sampling rate of the sound card (2/5)

We aim to find the highest sample rate supported by the hw:0,0 sound card using a trial-and-error procedure starting from a low value. When the top value is reached, we got a warning message:

arecord -f dat -r 60000 -D hw:0,0 -d 5 test.wav

Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 60000 Hz, Stereo
Warning: rate is not accurate (requested = 60000Hz, got = 44100Hz)
please, try the plug plugin

Observe the got = 44100Hz . This is the maximum sampling rate of our card.

Since it says trial-and-error from a low value, I used the arecord-command with different values. However: the got = xzy Hz keeps changing upwards and I don’t know which value to use for my /etc/pulse/daemon.conf (that’s described further in the wiki)!

Is it normal for the value to keep changing? And what is meant by “plug plugin”? And of course, what (else) can I do to stop the noise?

It’s really unsettling, as I’m still new to Linux in general and I have close to zero knowledge about audio issues. I’ll post my terminal output with changing got = xzy Hz below.

Any help is appreciated! Thanks in advance!
Greetings, Ena

Some outputs of arecord -f dat -r (test value) -D hw:1,0 -d 5 test.wav
$ arecord --list-devices
**** Liste der Hardware-Geräte (CAPTURE) ****
Karte 1: PCH [HDA Intel PCH], Gerät 0: 92HD95 Analog [92HD95 Analog]
  Sub-Geräte: 0/1
  Sub-Gerät #0: subdevice #0

$ arecord -f dat -r 6000 -D hw:1,0 -d 5 test.wav
Aufnahme: WAVE 'test.wav' : Signed 16 bit Little Endian, Rate: 6000 Hz, stereo
Warnung: Rate ist nicht exakt (angefordert: 6000 Hz, unterstützt: 44100 Hz)
             probieren Sie bitte das plug-Plugin:
### This is the Warning section from the wiki. It translates to "Warning: rate is not accurate (requested = 6000Hz, got = 44100Hz). please, try the plug plugin"

$ arecord -f dat -r 70000 -D hw:1,0 -d 5 test.wav
    Aufnahme: WAVE 'test.wav' : Signed 16 bit Little Endian, Rate: 70000 Hz, stereo
Warnung: Rate ist nicht exakt (angefordert: 70000 Hz, unterstützt: 88200 Hz)
  probieren Sie bitte das plug-Plugin:

$ arecord -f dat -r 90000 -D hw:1,0 -d 5 test.wav
Aufnahme: WAVE 'test.wav' : Signed 16 bit Little Endian, Rate: 90000 Hz, stereo
$ aplay test.wav
Wiedergabe: WAVE 'test.wav' : Signed 16 bit Little Endian, Rate: 88200 Hz, stereo
### Why does this even work with 90000? And why does it playback with 88200 Hz?

$ arecord -f dat -r 100000 -D hw:1,0 -d 5 test.wav
Aufnahme: WAVE 'test.wav' : Signed 16 bit Little Endian, Rate: 100000 Hz, stereo
Warnung: Rate ist nicht exakt (angefordert: 100000 Hz, unterstützt: 192000 Hz)
         probieren Sie bitte das plug-Plugin:

Common supported sample rates are 44100, 48000, 96000, 192000.
arecord refers to the supported sample rate closest to the one you tried, so that’s fine.

Just set the sample rate to 44100 in /etc/pulse/daemon.conf, everything above that is probably overkill.

1 Like

Thanks for the explanation! It works differently than I thought :sweat_smile:

44100 is/was the default value. I set it to 48000 once to check, and reverted it to 44100 as you said. Sadly, the static noise is still there :’(

I will try googling the issue and report back if I can solve it. But in the meantime I’m always happy for tips! :microphone:

In /etc/pulse/daemon.conf the default-sample-rate = 44100 is, if not manually edited, disabled by a semicolon at the start of the line. Make sure the semicolon is removed, else those settings will have no effect.

1 Like

I removed the semicola from default-sample-rate = 44100 and from avoid-resampling = yes (I read in the Arch Wiki that it helps to set that as well) and rebooted. Nothing changed.
I found a YT-Tutorial for enableing noise cancellation from pulseaudio, I’ll try it too and report whether it worked.

@440Hz Thanks a lot for your answers until now!

Greetings, Ena

EDIT: I have the noise/echo cancellation working, though seemingly, there’s still no change. I found out, however, that with a newly bought headset the voice recording in Zoom etc. works just fine, so I’m sticking with that for now…
The problem persists, but I found a workaround(?), so I’ll mark this thread as solved. I guess I can recommend to buy a new headset when having audio problems. :sweat_smile:

Greetings and good luck, Ena

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.