Bad feedback when using built-in and wired microphone (laptop)

Hello.

I have this issue where my microphone has this terrible audio problem. When I was doing a quick check of my mic in Discord, there is this background noise (like some kind of whirring sound) that rhythmically goes in and out on regular intervals. To check, I booted into Windows and the issue was not present. I tried a couple of simple things such as disconnecting and reconnecting my headset, rebooting my system, and trying the onboard mic. None of these seemed to fix the issue. I understand that I can use Noisetorch, but because of this background noise, it severely affects my sound quality and cuts me off a lot.

My "inxi -Faz":

System:    Kernel: 5.15.5-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=fb4778c3-878f-4280-8097-00f152c54bf0
rw [email protected] quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
systemd.unified_cgroup_hierarchy=1 loglevel=3
Desktop: KDE Plasma 5.23.3 tk: Qt 5.15.2 info: latte-dock wm: kwin_x11 vt: 1 dm: SDDM
Distro: Garuda Linux base: Arch Linux
Machine:   Type: Laptop System: Dell product: Inspiron 15 7000 Gaming v: N/A serial: <superuser required>
Chassis: type: 10 serial: <superuser required>
Mobo: Dell model: 0MK77P v: A00 serial: <superuser required> UEFI: Dell v: 1.11.0
date: 12/04/2019
Battery:   ID-1: BAT0 charge: 52.1 Wh (100.0%) condition: 52.1/74.0 Wh (70.4%) volts: 12.3 min: 11.1
model: Samsung SDI DELL 0GFJ675 type: Li-ion serial: <filter> status: Full
CPU:       Info: Quad Core model: Intel Core i5-7300HQ bits: 64 type: MCP arch: Kaby Lake family: 6
model-id: 9E (158) stepping: 9 microcode: EA cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19999
Speed: 3349 MHz min/max: 800/3500 MHz Core speeds (MHz): 1: 3349 2: 3229 3: 3351 4: 3228
Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled
Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled
Type: mds mitigation: Clear CPU buffers; SMT disabled
Type: meltdown mitigation: PTI
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2
mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: disabled, RSB filling
Type: srbds mitigation: Microcode
Type: tsx_async_abort status: Not affected
Graphics:  Device-1: Intel HD Graphics 630 vendor: Dell driver: i915 v: kernel bus-ID: 00:02.0
chip-ID: 8086:591b class-ID: 0300
Device-2: NVIDIA GP107M [GeForce GTX 1050 Ti Mobile] vendor: Dell driver: nvidia v: 495.44
alternate: nouveau,nvidia_drm bus-ID: 01:00.0 chip-ID: 10de:1c8c class-ID: 0300
Device-3: Sunplus Innovation Integrated_Webcam_HD type: USB driver: uvcvideo bus-ID: 1-12:6
chip-ID: 1bcf:28c1 class-ID: 0e02
Display: x11 server: X.Org 1.21.1.1 compositor: kwin_x11 driver: loaded: modesetting,nvidia
display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") s-diag: 582mm (22.9")
Monitor-1: eDP-1 res: 1920x1080 hz: 60 dpi: 142 size: 344x194mm (13.5x7.6") diag: 395mm (15.5")
OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 21.2.5 direct render: Yes
Audio:     Device-1: Intel CM238 HD Audio vendor: Dell driver: snd_hda_intel v: kernel bus-ID: 00:1f.3
chip-ID: 8086:a171 class-ID: 0403
Device-2: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel v: kernel bus-ID: 01:00.1
chip-ID: 10de:0fb9 class-ID: 0403
Sound Server-1: ALSA v: k5.15.5-zen1-1-zen running: yes
Sound Server-2: JACK v: 1.9.19 running: no
Sound Server-3: PulseAudio v: 15.0 running: no
Sound Server-4: PipeWire v: 0.3.40 running: yes
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Dell driver: r8169
v: kernel port: d000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
IF: enp2s0 state: down mac: <filter>
Device-2: Intel Wireless 3165 driver: iwlwifi v: kernel bus-ID: 03:00.0 chip-ID: 8086:3165
class-ID: 0280
IF: wlp3s0 state: up mac: <filter>
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 bus-ID: 1-4:4
chip-ID: 8087:0a2a class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
RAID:      Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 port: f060
bus-ID: 00:17.0 chip-ID: 8086:282a rev: N/A class-ID: 0104
Drives:    Local Storage: total: 2.05 TiB used: 289.47 GiB (13.8%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 vendor: Micron model: 1100 SATA 256GB size: 238.47 GiB block-size:
physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: L003
scheme: GPT
ID-2: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST2000LX001-1RG174 size: 1.82 TiB
block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400
serial: <filter> rev: SDM1 scheme: GPT
Partition: ID-1: / raw-size: 97.66 GiB size: 97.66 GiB (100.00%) used: 21.35 GiB (21.9%) fs: btrfs
dev: /dev/sda5 maj-min: 8:5
ID-2: /boot/efi raw-size: 100 MiB size: 96 MiB (96.00%) used: 25.7 MiB (26.8%) fs: vfat
dev: /dev/sda1 maj-min: 8:1
ID-3: /home raw-size: 97.66 GiB size: 97.66 GiB (100.00%) used: 21.35 GiB (21.9%) fs: btrfs
dev: /dev/sda5 maj-min: 8:5
ID-4: /var/log raw-size: 97.66 GiB size: 97.66 GiB (100.00%) used: 21.35 GiB (21.9%) fs: btrfs
dev: /dev/sda5 maj-min: 8:5
ID-5: /var/tmp raw-size: 97.66 GiB size: 97.66 GiB (100.00%) used: 21.35 GiB (21.9%) fs: btrfs
dev: /dev/sda5 maj-min: 8:5
Swap:      Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 15.49 GiB used: 1.8 MiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:   System Temperatures: cpu: 54.0 C pch: 49.5 C mobo: 42.0 C sodimm: SODIMM C
Fan Speeds (RPM): cpu: 0
Info:      Processes: 224 Uptime: 20m wakeups: 1 Memory: 15.49 GiB used: 3.76 GiB (24.3%) Init: systemd
v: 249 tool: systemctl Compilers: gcc: 11.1.0 clang: 13.0.0 Packages: pacman: 1560 lib: 419
Shell: fish v: 3.3.1 default: Bash v: 5.1.12 running-in: konsole inxi: 3.3.09

Sounds like you're just hot mic'ing yourself with your speakers active. Make sure the internal mic is muted in pulse or alsa and the live mic can't pick up your speakers i.e. mute them too.

The issue still occurs when I have my headset plugged in. When it is plugged in, the headset and its mic are the only audio devices listed.

Listed in what? Just because Pulse says one thing doesn't mean Alsa agrees. :wink:

In the System settings. I don't know of a different way to check for this.

Open a terminal and enter alsamixer. If it's not installed install it (think it might be alsa-utils). You will need to select the correct card/inputs and ensure they are muted.

Linux audio is a mess which is extra problematic when the average person doesn't understand audio routing at the best of times. So this means you need to understand audio routing principals, your hardware, then all the linux stuff which is becoming more convoluted with Pipewire. OSS => Alsa => Pulse => jackd => Pipe == MESS!

Pulseaudio is a liar a lot of times with certain devices. For example on my rig on a clean install Pulse will tell you my volume is at Unity (0db) but it's not. Anyone unknowing would think "Well shit why is my audio so damned quiet in Linux?!" but the reality is it's not, it's just pulse is a lying sack of crap. If you open Alsa you will see your mains are way low still and in your case I'd wager your internal mic is enabled.

There are a lot of basic features/functions Pulse doesn't handle and need to be set in alsa, like automute if you plug in normal headphones. In your case since a USB headset won't be seen as headphones you will need to mute the internal mic and speakers yourself and set things up manually. A lot of this stuff is done automatically in Windows but in Linux most things are left for the user to decide, not to be assumed or users treated like babies. Having said that it's also problematic for new users when they haven't been smashed in the face yet by the disarray of Linux audio systems involved to make those choices.

While this might all sound horrible and things can certainly be improved don't take it as negative. See it as a learning curve. Linux audio still works. My DAW runs, I can use Windows VST/VSTi just fine and do all my AV work. It just took some head smashing to work through the chain of events to get my complex audio situation sorted.

Using alsamixer, I notice that when I disconnect the headset, the internal mic does not return to zero. When I go into the sound settings in the system settings and change the input(port) to the headset mic, the internal mic sets its gain to 0. Afterwards, the issue seems to go away when listening back to the audio using sneedacity. So it seems like I need to find a way to automate setting the input(port) to the headset mic.

Just to clarify, the headset I am using does not use USB. It uses a 3.5 mm combo jack.

Oh wow! OK Well then if you plug that in Alsa SHOULD in theory automute (your speakers at least). You can script alsa for the behaviors you want. So for example set Alsa so that it's as you need (no horrid feedbackloop) then save your settings. You can trigger/toggle the settings with some commands like I have examples of below. You can add them to application launchers or whatever you use that require the different configs.

alsactl --file $HOME/headset-asound.state' save
and
alsactl --file $HOME/no-headset-asound.state' save

alsactl --file $HOME/headset-asound.state' restore
or
alsactl --file $HOME/no-headset-asound.state' restore

You may have noticed playing in alsamixer there are a lot of things the pulseaudio GUI doesn't show/allow you to change. Things like gain boosts, automute, impedance, clock sync and more depending on your device. My alsamixer is kinda insane, few hundred faders heh.

Despite the additional things alsa exposes things like bitrate and sample rate are still locked behind config files. I really wish this was all fixed i.e. exposed plainly to the user. I suppose we will see if Pipewire finally delivers but alsa promised to be THE ONE...then pulse promised to be THE ONE...kinda feels more like some crappy early access game where it promises tons but as soon as it loses revenue done or not they bring out the next shiny to string you along with and eventually bail on before those promises are delivered on. :wink:

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