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
Ubuntu (18.04 or 20.04),Motherboard M5A78L-M PLUSandSound 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.