Internal Microphone doesn't work properly. Headset Microphone works with noise

Hi guys.

I’m running manjaro on hp spectre x360 and it’s dual booted with windows. I was using kernel 4.19 and the sound couldn’t be recorded at all. so I upgraded to 5.4 and the sound could be recorded. but after some days i needed the microphone again I saw it is not working!!! I mean internal microphone couldn’t record the sound and the headset microphone works with full of noise if I half insert the headset jacket. And if I insert the headset jacket fully, no sound then recorded.

I tried many suggested solutions in other questions but didn’t work for me.
here are some commands that were needed in other questions. I provide you here that might help!

> pacmd list-cards

1 card(s) available.
index: 0
    name: <alsa_card.pci-0000_00_1f.3>
    driver: <module-alsa-card.c>
    owner module: 28
    properties:
            alsa.card = "0"
            alsa.card_name = "HDA Intel PCH"
            alsa.long_card_name = "HDA Intel PCH at 0xdc228000 irq 134"
            alsa.driver_name = "snd_hda_intel"
            device.bus_path = "pci-0000:00:1f.3"
            sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
            device.bus = "pci"
            device.vendor.id = "8086"
            device.vendor.name = "Intel Corporation"
            device.product.id = "9d71"
            device.product.name = "Sunrise Point-LP HD Audio"
            device.form_factor = "internal"
            device.string = "0"
            device.description = "Built-in Audio"
            module-udev-detect.discovered = "1"
            device.icon_name = "audio-card-pci"
    profiles:
            input:analog-stereo: Analog Stereo Input (priority 65, available: unknown)
            output:analog-stereo: Analog Stereo Output (priority 6500, available: unknown)
            output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: unknown)
            output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: no)
            output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (priority 5965, available: no)
            output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 800, available: no)
            output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (priority 865, available: no)
            output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 800, available: no)
            output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analog Stereo Input (priority 865, available: no)
            output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5700, available: no)
            output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Analog Stereo Input (priority 5765, available: no)
            output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 600, available: no)
            output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Analog Stereo Input (priority 665, available: no)
            output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 600, available: no)
            output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Analog Stereo Input (priority 665, available: no)
            output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5700, available: no)
            output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Analog Stereo Input (priority 5765, available: no)
            output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 600, available: no)
            output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Analog Stereo Input (priority 665, available: no)
            output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)
            output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Analog Stereo Input (priority 665, available: no)
            output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no)
            output:hdmi-stereo-extra3+input:analog-stereo: Digital Stereo (HDMI 4) Output + Analog Stereo Input (priority 5765, available: no)
            output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no)
            output:hdmi-surround-extra3+input:analog-stereo: Digital Surround 5.1 (HDMI 4) Output + Analog Stereo Input (priority 665, available: no)
            output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)
            output:hdmi-surround71-extra3+input:analog-stereo: Digital Surround 7.1 (HDMI 4) Output + Analog Stereo Input (priority 665, available: no)
            output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 5700, available: no)
            output:hdmi-stereo-extra4+input:analog-stereo: Digital Stereo (HDMI 5) Output + Analog Stereo Input (priority 5765, available: no)
            output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 600, available: no)
            output:hdmi-surround-extra4+input:analog-stereo: Digital Surround 5.1 (HDMI 5) Output + Analog Stereo Input (priority 665, available: no)
            output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no)
            output:hdmi-surround71-extra4+input:analog-stereo: Digital Surround 7.1 (HDMI 5) Output + Analog Stereo Input (priority 665, available: no)
            off: Off (priority 0, available: unknown)
    active profile: <output:analog-stereo+input:analog-stereo>
    sinks:
            alsa_output.pci-0000_00_1f.3.analog-stereo/#3: Built-in Audio Analog Stereo
    sources:
            alsa_input.pci-0000_00_1f.3.analog-stereo/#3: Built-in Audio Analog Stereo
            alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#5: Monitor of Built-in Audio Analog Stereo
    ports:
            analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
                    properties:
                            device.icon_name = "audio-input-microphone"
            analog-input-headset-mic: Headset Microphone (priority 8800, latency offset 0 usec, available: yes)
                    properties:
                            device.icon_name = "audio-input-microphone"
            analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: no)
                    properties:
                            device.icon_name = "audio-speakers"
            analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: unknown)
                    properties:
                            device.icon_name = "audio-headphones"
            hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
                    properties:
                            device.icon_name = "video-display"
            hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)
                    properties:
                            device.icon_name = "video-display"
            hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)
                    properties:
                            device.icon_name = "video-display"
            hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
                    properties:
                            device.icon_name = "video-display"
            hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)
                    properties:
                            device.icon_name = "video-display"

> sudo dmesg | grep snd

[    2.652570] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
[    2.653215] snd_hda_intel 0000:00:1f.3: Applying patch firmware 'hda-jack-retask.fw'
[    2.920305] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    3.089197] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC295: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[    3.089200] snd_hda_codec_realtek hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    3.089201] snd_hda_codec_realtek hdaudioC0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    3.089203] snd_hda_codec_realtek hdaudioC0D0:    mono: mono_out=0x0
[    3.089204] snd_hda_codec_realtek hdaudioC0D0:    inputs:
[    3.089205] snd_hda_codec_realtek hdaudioC0D0:      Headset Mic=0x19
[    3.089207] snd_hda_codec_realtek hdaudioC0D0:      Internal Mic=0x12

> inxi -Faxzy

System:
  Kernel: 5.4.112-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.4-x86_64 
  root=UUID=0cdeeb92-dda3-4c2d-ac8b-a1b02a022c90 rw quiet apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: KDE Plasma 5.21.4 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM 
  Distro: Manjaro Linux base: Arch Linux 
Machine:
  Type: Convertible System: HP product: HP Spectre x360 Convertible 13-ac0XX 
  v: N/A serial: <filter> Chassis: type: 31 serial: <filter> 
  Mobo: HP model: 827E v: 94.71 serial: <filter> UEFI: American Megatrends 
  v: F.52 date: 12/16/2020 
Battery:
  ID-1: BAT0 charge: 41.2 Wh (100.0%) condition: 41.2/41.2 Wh (100.0%) 
  volts: 13.0 min: 11.6 model: Hewlett-Packard Primary type: Li-ion 
  serial: N/A status: Full 
  Device-1: hid-0018:04F3:22E1.0001-battery model: ELAN0732:00 04F3:22E1 
  serial: N/A charge: N/A status: N/A 
  Device-2: hidpp_battery_0 model: Logitech Wireless Mouse M185 
  serial: <filter> charge: 55% (should be ignored) rechargeable: yes 
  status: Discharging 
CPU:
  Info: Dual Core model: Intel Core i7-7500U bits: 64 type: MT MCP 
  arch: Amber/Kaby Lake note: check family: 6 model-id: 8E (142) stepping: 9 
  microcode: DE cache: L2: 4 MiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 23209 
  Speed: 800 MHz min/max: 400/3500 MHz Core speeds (MHz): 1: 800 2: 800 3: 802 
  4: 800 
  Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds mitigation: Microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel HD Graphics 620 vendor: Hewlett-Packard driver: i915 
  v: kernel bus-ID: 00:02.0 chip-ID: 8086:5916 class-ID: 0300 
  Device-2: Suyin HP TrueVision FHD RGB-IR type: USB driver: uvcvideo 
  bus-ID: 1-5:3 chip-ID: 064e:3401 class-ID: 0e02 serial: <filter> 
  Display: x11 server: X.Org 1.20.11 compositor: kwin_x11 driver: 
  loaded: intel unloaded: modesetting alternate: fbdev,vesa 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: eDP1 res: 1920x1080 hz: 60 dpi: 168 size: 290x170mm (11.4x6.7") 
  diag: 336mm (13.2") 
  OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.0.2 
  direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel alternate: snd_soc_skl bus-ID: 00:1f.3 
  chip-ID: 8086:9d71 class-ID: 0403 
  Sound Server-1: ALSA v: k5.4.112-1-MANJARO running: yes 
  Sound Server-2: JACK v: 0.125.0 running: no 
  Sound Server-3: PulseAudio v: 14.2 running: yes 
  Sound Server-4: PipeWire v: 0.3.25 running: yes 
Network:
  Device-1: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel port: f040 
  bus-ID: 01:00.0 chip-ID: 8086:24fd class-ID: 0280 
  IF: wlp1s0 state: up mac: <filter> 
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8 
  bus-ID: 1-7:4 chip-ID: 8087:0a2b class-ID: e001 
  Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: enabled,running 
  rfk-block: hardware: no software: yes address: see --recommends 
Drives:
  Local Storage: total: 953.87 GiB used: 162.63 GiB (17.0%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: MZVLW1T0HMLH-000H1 
  size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s 
  lanes: 4 rotation: SSD serial: <filter> rev: CXY70H1Q scheme: GPT 
Partition:
  ID-1: / raw-size: 225.94 GiB size: 221.39 GiB (97.99%) 
  used: 162.55 GiB (73.4%) fs: ext4 dev: /dev/nvme0n1p7 maj-min: 259:7 
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%) 
  used: 89.7 MiB (35.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1 
Swap:
  Alert: No swap data was found. 
Sensors:
  System Temperatures: cpu: 47.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 185 Uptime: 31m wakeups: 8 Memory: 15.52 GiB 
  used: 3.23 GiB (20.8%) Init: systemd v: 247 tool: systemctl Compilers: 
  gcc: 10.2.0 alt: 4.4/4.9/4.9.4 Packages: apt: 0 pacman: 1383 lib: 423 
  flatpak: 0 Shell: Zsh v: 5.8 running-in: yakuake inxi: 3.3.04

> pacmd dump

### Configuration dump generated at Sat May  1 12:25:42 2021

load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
load-module module-augment-properties
load-module module-switch-on-port-available
load-module module-alsa-source device=hw:0,0
load-module module-udev-detect
load-module module-jackdbus-detect channels=2
load-module module-bluetooth-policy
load-module module-bluetooth-discover
load-module module-bluez5-discover
load-module module-dbus-protocol
load-module module-native-protocol-unix
load-module module-gsettings
load-module module-default-device-restore
load-module module-always-sink
load-module module-intended-roles
load-module module-suspend-on-idle
load-module module-console-kit
load-module module-systemd-login
load-module module-position-event-sounds
load-module module-role-cork
load-module module-filter-heuristics
load-module module-filter-apply
load-module module-x11-publish display=:0 xauthority=/home/amh/.Xauthority
load-module module-x11-xsmp display=:0 xauthority=/home/amh/.Xauthority session_manager=local/amh:@/tmp/.ICE-unix/1120,unix/amh:/tmp/.ICE-unix/1120
load-module module-alsa-card device_id="0" name="pci-0000_00_1f.3" card_name="alsa_card.pci-0000_00_1f.3" namereg_fail=false tsched=yes fixed_latency_
range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
load-module module-cli-protocol-unix

set-sink-volume alsa_output.pci-0000_00_1f.3.analog-stereo 0x10000
set-sink-mute alsa_output.pci-0000_00_1f.3.analog-stereo no
suspend-sink alsa_output.pci-0000_00_1f.3.analog-stereo yes

set-source-volume alsa_input.hw_0_0 0x10000
set-source-mute alsa_input.hw_0_0 no
suspend-source alsa_input.hw_0_0 yes
set-source-volume alsa_input.pci-0000_00_1f.3.analog-stereo 0xff32
set-source-mute alsa_input.pci-0000_00_1f.3.analog-stereo no
suspend-source alsa_input.pci-0000_00_1f.3.analog-stereo yes
set-source-volume alsa_output.pci-0000_00_1f.3.analog-stereo.monitor 0x10000
set-source-mute alsa_output.pci-0000_00_1f.3.analog-stereo.monitor no
suspend-source alsa_output.pci-0000_00_1f.3.analog-stereo.monitor yes

set-card-profile alsa_card.pci-0000_00_1f.3 output:analog-stereo+input:analog-stereo

set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo
set-default-source alsa_input.pci-0000_00_1f.3.analog-stereo

### EOF

thanks for help!!!

You have 2 sound servers running

  Sound Server-3: PulseAudio v: 14.2 running: yes 
  Sound Server-4: PipeWire v: 0.3.25 running: yes 

see this post for how to disable PipeWire or Replace PulseAudio
Audio to my headphones is way too quiet - #6 by nikgnomic

Your system has a dual array digital microphone (dmic)
v5.4 and legacy driver snd_hda_intel do not support the digital microphone.
You need to install a later kernel - v5.10 or later
and make sure you have package sof-firmware installed
(Linux equivalent of Intel SST driver required for dmic support)

This module in PulseAudio is not usually loaded
load-module module-alsa-source device=hw:0,0
I suspect you added this to try to force the microphone to work

I suggest you remove any changes you made to PulseAudio configuration
and remove the hdajackretask boot overrides for ALSA
I also suggest you delete user configuration files for PulseAudio in user home folder

rm ~/.config/pulse/*

then reboot system and check if audio is working any better

If this is similar to other HP laptops with ALC295 audio codec, more troubleshooting might be required to get audio working.
ALSA kernel developers currently have 16 open bug reports open for x360 laptops
Sound (ALSA) - “x360” | bugzilla.kernel.org

well in fact there are 3 sound servers running!! ALSA, pulseaudio and pipewire. but maybe ALSA is not important since in the link you posted you didn’t mention the ALSA sound server too.

I did the following steps and I got no success:

  1. I stopped pipewire service and socket as you mentioned in the link
  2. I installed sof-firmware
  3. I upgraded linux kernel to 5.10.32
  4. removed the load-module line in /etc/pulse/default.pa (yeah you’re right. It was there since I read in another question that someone has suggested to add this line to the config file.)
  5. I ran rm ~/.config/pulse/*
  6. reboot

everything was the same as before. so I tried to commit the other option you provided in the link. I removed pipewire and install pulseaudio instead. rebooted and In the end I got pipewire sound server is stopped and pulseaudio’s running. in this case even no sound couldn’t be played! so I reverted these steps and now the configurations is as follows:

inxi -Ax
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: 
               Sound Server-1: ALSA v: k5.10.32-1-MANJARO running: yes 
               Sound Server-2: JACK v: 0.125.0 running: no 
               Sound Server-3: PulseAudio v: 14.2 running: yes 
               Sound Server-4: PipeWire v: 0.3.25 running: no 

pacmd dump
## Configuration dump generated at Mon May  3 11:38:43 2021

    load-module module-device-restore
    load-module module-stream-restore
    load-module module-card-restore
    load-module module-augment-properties
    load-module module-switch-on-port-available
    load-module module-udev-detect
    load-module module-alsa-card device_id="0" name="pci-0000_00_1f.3" card_name="alsa_card.pci-0000_00_1f.3" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
    load-module module-jackdbus-detect channels=2
    load-module module-bluetooth-policy
    load-module module-bluetooth-discover
    load-module module-bluez5-discover
    load-module module-dbus-protocol
    load-module module-native-protocol-unix
    load-module module-gsettings
    load-module module-default-device-restore
    load-module module-always-sink
    load-module module-intended-roles
    load-module module-suspend-on-idle
    load-module module-console-kit
    load-module module-systemd-login
    load-module module-position-event-sounds
    load-module module-role-cork
    load-module module-filter-heuristics
    load-module module-filter-apply
    load-module module-x11-publish display=:0 xauthority=/home/amh/.Xauthority
    load-module module-x11-xsmp display=:0 xauthority=/home/amh/.Xauthority session_manager=local/amh:@/tmp/.ICE-unix/1005,unix/amh:/tmp/.ICE-unix/1005
    load-module module-cli-protocol-unix

    set-sink-volume alsa_output.pci-0000_00_1f.3.analog-stereo 0x75b1
    set-sink-mute alsa_output.pci-0000_00_1f.3.analog-stereo no
    suspend-sink alsa_output.pci-0000_00_1f.3.analog-stereo yes

    set-source-volume alsa_output.pci-0000_00_1f.3.analog-stereo.monitor 0x10000
    set-source-mute alsa_output.pci-0000_00_1f.3.analog-stereo.monitor no
    suspend-source alsa_output.pci-0000_00_1f.3.analog-stereo.monitor yes
    set-source-volume alsa_input.pci-0000_00_1f.3.analog-stereo 0x10000
    set-source-mute alsa_input.pci-0000_00_1f.3.analog-stereo no
    suspend-source alsa_input.pci-0000_00_1f.3.analog-stereo yes

    set-card-profile alsa_card.pci-0000_00_1f.3 output:analog-stereo+input:analog-stereo

    set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo
    set-default-source alsa_input.pci-0000_00_1f.3.analog-stereo

If any other options you think might help share with me. thank you.