Microphone distorted sound on ALC892

Bug #1801540 reported by Luca Mastromatteo on 2018-11-03
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Linux
Confirmed
Medium
linux (Ubuntu)
Undecided
Unassigned
pulseaudio (Ubuntu)
Undecided
Unassigned

Bug Description

Not sure if I'll report this upstream but there is definitely an issue with microphone recording on my desktop, this is not happening on my laptop which has a different codec.

Already tried all workarounds possible, no luck. Only with my desktop with this particular motherboard. No issues in Windows, the sound recorded in there is distorted and has some static and robotic tone on high-pitch.

alsa-info on the attachments

affects: alsa-lib (Ubuntu) → alsa-driver (Ubuntu)

Created attachment 279301
alsa-info

I always got this issue only on Linux, every distro I tried including Manjaro Linux, Debian, ubuntu had this problem.

Basically the microphone input sounds always distorted and "robotic" even on high pitch. In all the programs I tried.

Workarounds as listed on the ArchWiki ---> https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Microphone_crackling_with_Realtek_ALC892 have not changed anything.

Interesting thing though is that on FreeBSD this does not happen.

alsa-info on the attachments

Kernel version: Linux luky-MS-7A37 4.18.0-10-generic #11-Ubuntu SMP

alsa-version
Driver version: k4.18.0-10-generic
Library version: 1.1.6
Utilities version: 1.1.6

Obviously this also happens on other kernels.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1801540

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

Changed in linux (Ubuntu):
status: New → Incomplete

I tried running it, I don't know honestly if that worked because when I clicked on that link a browser page just appeared showing nothing relevant

Changed in linux (Ubuntu):
status: Incomplete → Confirmed

https://help.ubuntu.com/community/ReportingBugs
--
Cristian Aravena Romero (caravena)

Changed in linux (Ubuntu):
status: Confirmed → Incomplete

Uhm yes I know that, but apport-collect is just not working as I already said...

Hui Wang (hui.wang) wrote :

Does this issue happen on Front Mic, Rear Mic or LineIn?

set the input volume lower, is the recorded sound better?

tags: added: cosmic
affects: alsa-driver (Ubuntu) → pulseaudio (Ubuntu)

1) Happens with both Front mic and Rear mic.

2) No, it still sounds bad.

Something I found is that on FreeBSD is working fine.

Hui Wang (hui.wang) wrote :

Probably the FreeBSD is working as Windows, they use the software de-noise filter when users record sound.

Please test with "pactl load-module module-echo-cancel", then choose echo-cancelled record device from gnome-sound-setting->input tab. Now record sth, and play it. Is it better now?

If there is sth in the kernel driver to introduce the noise, the thing I can figure out so far is change the micbias reference voltag:
Right now the reference for two mics:
Rear Mic: Pin-ctls: 0x21: IN VREF_50
Front Mic: Pin-ctls: 0x24: IN VREF_80

You can try to set them with different value like "HIZ 50 GRD 80 100", maybe some value can improve the sound quality.

The patch_realtek.c has some sample code to set verf.

So yes even with the module-echo-cancel enabled is still happening, I'll try modifying the realtek patch on the kernel

Tried all those values through HDAAnalyzer, but nothing relevant changed, the noise is still there.

A note: In Windows or FreeBSD i was not using any echo cancel software, the noise is just not present. There is still tjhe normal environmental one, but not the robotic one only present on Linux.

Here is a recording, amplified so you can easily hear the noise in question. If I don't amplify the input, the noise is still there, just the volume is low.

Created attachment 279675
Recording showing the noise

Any updates on this?

Hui Wang (hui.wang) wrote :

@Luca,

I have no idea what is the root cause of this problem and how to fix it.

Please file a bugzilla bug against the mainline linux kernel, let us ask for help from mainline kernel community where realtek engineer probably will be involved.

Yes I already did that but I may not understand how to add the required maintainers into the mailing list

Here is it
https://bugzilla.kernel.org/show_bug.cgi?id=201613

I may confirm that recording without pulseaudio using ffmpeg -alsa produces the same disturbed sound

Hui Wang (hui.wang) wrote :

you might have a try with adding <email address hidden> and <email address hidden> to the CC list.

And send an email to them with cc <email address hidden> would be better.

Done, for sending an email to them using that CC you mean without the bugzilla site?

Should I just put the bugzilla link in that email?

Hui Wang (hui.wang) wrote :

put the bugzilla link in the email.

Motherboard model is an MSI B350M AM4 for Ryzen CPU's

Changed in linux:
importance: Unknown → Medium
status: Unknown → Confirmed
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Paul (p4ul1) wrote :

I have exactly the same problem, and I also have an MSI B350 am4 motherboard...

There are other people having the same issue on the same motherboard model

A partial workaround which doesn't completely fix the issue but improves things is the following:

Adding to /etc/pulse/default.pa, use_ucm=0 tsched=0 right after module-udev-detect

and /etc/pulse/daemon

resample-method = src-sinc-best-quality
default-sample-format = s16le
default-fragment-size-msec=80
default-sample-rate = 48000

Don't know which what specific parameter improved this, because when I test each one of those singularly doesn't totally fix the problem.

The best results I can obtain are with all those combined

Actually this workaround adds another problem, in games the sound is delayed...

Christopher Smith (canadauni) wrote :

Following up that I'm experiencing the same issue on an MSI B450 AM4 motherboard with the same realtek chipset.

Seems to be the same problem as https://bugzilla.kernel.org/show_bug.cgi?id=195303
With ALC1220 codecs

The last comment was

 "I might have found the source of this problem at least for me. A while ago I set my Pulseaudio sample rate to 44100 to reduce crackling in my virtual machine audio but the sound card on my board runs at 48000.

What I did:
arecord --list-devices
arecord -f dat -r 60000 -D hw:CARDIDHERE,DEVICEIDHERE -d 5 test.wav

arecord told me that it could not record of a rate of 60000 and instead got 48000. This means my card has a sample rate of 48000

So I ran:
arecord -f dat -r 48000 -D hw:1,0 -d 5 test.wav

And suddenly I had a clear recording! The only problem is I have changed my sampling rate and alternate sample rate in /etc/pulse/daemon.conf back to 48000 but it still seems to be defaulting to 44100 in all programs.

If I run:
arecord -f cd -d 10 test-mic.wav
I observe it defaulting to 44100 and playing it back sounds awful again. Same with any other recording software, they are all still using 44100 for some reason which is causing the crackling."

This also applies to me, is there a temporary workaround for that I can apply to ALSA or Pulseaudio?

fred (fredmeissner) wrote :

i've the same Problem on Ubuntu 18.10.
I'm running a Asus P9D-X (no Onboard Sound) with a Asus MIO 892 (Realtek)-Card which is detected as Intel-HDA:
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)

cat /proc/asound/cards :
0 [PCH ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xd3210000 irq 35

head -n 1 /proc/asound/card0/codec* :
Codec: Realtek ALC892

lsmod | grep "^snd" | cut -d " " -f 1 :
snd_seq_dummy
snd_hda_codec_hdmi
snd_hda_codec_realtek
snd_hda_codec_generic
snd_hda_intel
snd_hda_codec
snd_hda_core
snd_hwdep
snd_oxygen
snd_oxygen_lib
snd_mpu401_uart
snd_pcm
snd_seq_midi
snd_seq_midi_event
snd_rawmidi
snd_seq
snd_seq_device
snd_timer
snd

fred (fredmeissner) wrote :

Got it fixed by in with my MIO-892:

/etc/pulse/daemon.conf:
default-sample-rate = 48000

/etc/modprobe.d/azalia-microphone.conf
#Valid values for position_fix are:
#0 = Auto
#1 = None
#2 = POSBUF
#3 = FIFO size
options snd-hda-intel position_fix=0

For Echo/Noise Cancellation:
/etc/pulse/default.pa
load-module module-echo-cancel use_master_format=1 aec_method=webrtc aec_args="analog_gain_control=0 digital_gain_control=1" source_name=echoCan$
set-default-source echoCancel_source
set-default-sink echoCancel_sink

Its mainly taken from the arch-wiki - but only 'this' combination worked for me.

Tried that, it does not work for me

Daemon.conf has sample rate of 48000 even in my case, and setting that module parameter still did not fix anything

I'm stuck with an USB sound card again

AMD chipset, ALC892 realtek codec

Just for curiosity, how did you test if it works or not?

I personally use this web program https://webcammictest.com/check-microphone.html

So I can hear myself, and for me it is still present with every workaround I try...

I have the same problem with MSI B450 Tomahawk Motherboard

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.