2

I'm looking to fix an ongoing issue with microphone capture. There is a prominent crackle on my microphone input. It is present anytime I use the mic, no matter which program. I've had this issue for close to 1 year and I've tried to fix it several times. It is not a hardware issue, the mic works on my Windows partition (using my mic is one of the few reasons I need to boot into Windows).

Finally decided to make a post and see if I can find an answer.

I've done various research, my main resource was these steps on the Arch wiki which fixes static noise in microphone recording.

Step 1: Find the system sound cards

$ arecord -l

**** List of CAPTURE Hardware Devices ****
card 1: Generic [HD-Audio Generic], device 0: ALC1220 Analog [ALC1220 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 2: ALC1220 Alt Analog [ALC1220 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Step 2-4: Find & set the sample rate

$ arecord -f dat -r 60000 -D hw:1,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 = 48000Hz)
         please, try the plug plugin 

I added the sample rate to /etc/pulse/daemon.conf:

default-sample-rate = 48000

I then restarted pulsaudio with pulseaudio -k && pulseaudio --start

Step 5: Test the output

I ran arecord -f cd -d 10 test-mic.wav (no rate specified), but the outcome is the same. I have tried these steps with sample rates 44100, 38000 just to try. Unfortunately the microphone crackle always remains.

Another possible cause

$ pacmd list-sources | grep 'name:.*input'

    name: <alsa_input.pci-0000_0b_00.3.analog-stereo>

So I added this to /etc/pulse/default.pa:

load-module module-remap-source source_name=record_mono master=alsa_input.pci-0000_0b_00.3.analog-stereo master_channel_map=front-left channel_map=mono
set-default-source record_mono

But this makes little difference, if anything I'd say it's worse, so I have commented these lines out for now.

Other lines in /etc/pulse/daemon.conf (Some I think from past attempts)

flat-volumes = no
default-fragments = 3
default-fragment-size-msec = 5
avoid-resampling = yes
deferred-volume-safety-margin-usec = 1

Other commands I've ran to get info

Output of systemctl --user status pulseaudio.service

I don't think this is related, but I am unsure why this is inactive? If I run pulseaudio -k && pulseaudio --start all sound cuts out and I have to wait for pulseaudio to start..

● pulseaudio.service - Sound Service
   Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

Output of /sbin/lsmod | grep snd

snd_hda_codec_hdmi     49152  1
snd_hda_codec_realtek   102400  1
snd_hda_codec_generic    73728  1 snd_hda_codec_realtek
snd_hda_intel          40960  8
snd_hda_codec         126976  4 snd_hda_intel,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_core           81920  5 snd_hda_intel,snd_hda_codec,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hwdep              20480  1 snd_hda_codec
snd_pcm                98304  5 snd_hda_intel,snd_hda_codec,snd_hda_core,snd_hda_codec_hdmi
snd_seq_midi           16384  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            32768  1 snd_seq_midi
snd_seq                65536  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              32768  3 snd_seq,snd_pcm
snd                    81920  25 snd_hda_intel,snd_hwdep,snd_seq,snd_hda_codec,snd_timer,snd_rawmidi,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_seq_device,snd_hda_codec_realtek,snd_pcm
soundcore              16384  1 snd

Any help you can provide is greatly appreciated. Thanks.

Linux Mint 19.1 Kernel 4.15.0-20-generic Motherboard: ASUS X470-PRO Microphone: Modmic

Update: I have since moved to a new distro and I can no longer confirm if answers work. Thanks to all who gave some input!

5
  • If you found a bug in the alsa driver then report it: alsa-project.org/wiki/Bug_Tracking Commented Apr 21, 2020 at 23:08
  • Thanks I will do, I'll look into ALSA troubleshooting in the meantime Commented Apr 22, 2020 at 17:02
  • Hey, I'm having the exact same problem as you for almost 2 years now, but on Ubuntu (18.04 or 20.04), Motherboard M5A78L-M PLUS and Sound Chip ALC887-VD. Microphone works perfectly on Windows 10. Have tried everything on wiki.archlinux.org/index.php/PulseAudio/Troubleshooting and read through multiple bug reports with no success. If I find the solution I will let you know.
    – joaofbsm
    Commented Jul 13, 2020 at 3:17
  • As commented here bugzilla.kernel.org/show_bug.cgi?id=195303#c283, this error seems to happen only if the volume is set above 10% in PulseAudio (base value), which causes oversaturation and crackling appears.
    – joaofbsm
    Commented Jul 13, 2020 at 3:47
  • Also, is your CPU from AMD? There seems to be a correlation, as you can see in the bug report in my last comment.
    – joaofbsm
    Commented Jul 13, 2020 at 3:53

1 Answer 1

1

I found this Stackexchange question trying to troubleshoot a similar issue. Although I cannot be 100% sure our issues are from the same cause I notice some similarities and hope this will help.

Specifically I see you are trying to capture a microphone and I see in your post that like I did you are using "arecord -f cd" and "arecord -f dat".

I can verify by looking at the physical audio connector plug (which I think is the 3.5mm type) that my microphone is a mono device. My plug has two conductors separated by a rubber ring, which would be one for the shield, and one for the signal, and it looks like what I get when I google "3.5mm mono plug", and not what I get when I google "3.5mm stereo plug".

However when I read the man page for arecord, the "cd" and "dat" formats are both stereo:

          -f cd (16 bit little endian, 44100, stereo) [-f S16_LE -c2 -r44100]
          -f cdr (16 bit big endian, 44100, stereo) [-f S16_BE -c2 -f44100]
          -f dat (16 bit little endian, 48000, stereo) [-f S16_LE -c2 -r4800

So it turned out for me that when I record stereo I get the "tapping" or "clicking" noise on average to high volume, and when I record mono (which is what my input really is), I don't. Transcript of one of my tests:

michael@sequoia:~$ arecord -f S16_LE -c2 -r44100 /tmp/r1.wav 
Recording WAVE '/tmp/r1.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
^CAborted by signal Interrupt...
michael@sequoia:~$ aplay /tmp/r1.wav 
Playing WAVE '/tmp/r1.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
michael@sequoia:~$ #heard tapping
michael@sequoia:~$ arecord -f S16_LE -c1 -r44100 /tmp/r1.wav 
Recording WAVE '/tmp/r1.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
^CAborted by signal Interrupt...
michael@sequoia:~$ aplay /tmp/r1.wav 
Playing WAVE '/tmp/r1.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
michael@sequoia:~$ #No tapping noise

Also I found in the arecord man page 1 channel is the default so the "-c1" is not necessary.

   -c, --channels=#
          The number of channels.  The default is one channel.  Valid val‐
          ues are 1 through 32.

I hope this helps.

1
  • Thanks for your input! I hope helps someone :) I have since moved to a different distro and have left this issue in the past so I can't tell you if it would have fixed my problem. Commented Dec 3, 2020 at 20:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .