Microphone not working

Hi all,

I moved to flake and I got some issues with my internal sound card. The sound works but the mic is not detected. This is my config:

Load snd-hda-intel kernel module with specific options

boot.extraModprobeConfig = ‘’
options snd-hda-intel model=auto
‘’;

Optionally, you can add specific options if needed (example shown below)

boot.kernelModules = [“snd_hda_intel”];
boot.kernelParams = [ “snd-intel-dspcfg.dsp_driver=1” ];

Enable sound with pipewire.

sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
jack.enable = true;


Kernel 6.6.42, nixos vers. 24.05
This is my dmesg:

[ 3.504232] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 3.985870] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC236: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[ 3.985877] snd_hda_codec_realtek hdaudioC0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 3.985879] snd_hda_codec_realtek hdaudioC0D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[ 3.985880] snd_hda_codec_realtek hdaudioC0D0: mono: mono_out=0x0
[ 3.985881] snd_hda_codec_realtek hdaudioC0D0: inputs:
[ 3.985888] snd_hda_codec_realtek hdaudioC0D0: Mic=0x19

ANy advice? Thanks!

1 Like

I do not have a solution necessarily, but my sound/microphone controller completely stopped working with the nixpkgs that bundled kernel 6.6.42 (24.05). I have no idea if it’s an issue with nixpkgs, the kernel, or my config.

Last working boot (linux 6.6.41):

$ nix-info
system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.18.5, channels(root): "home-manager-24.05.tar.gz, nixgl, nixos-24.05", nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Here’s my dmesg:

$ dmesg | grep -C 5 audio
[   21.633634] input: SYNA7DB5:01 06CB:CD41 Mouse as /devices/pci0000:00/0000:00:15.3/i2c_designware.1/i2c-2/i2c-SYNA7DB5:01/0018:06CB:CD41.0003/input/input16
[   21.635082] input: SYNA7DB5:01 06CB:CD41 Touchpad as /devices/pci0000:00/0000:00:15.3/i2c_designware.1/i2c-2/i2c-SYNA7DB5:01/0018:06CB:CD41.0003/input/input17
[   21.641414] hid-multitouch 0018:06CB:CD41.0003: input,hidraw2: I2C HID v1.00 Mouse [SYNA7DB5:01 06CB:CD41] on i2c-SYNA7DB5:01
[   21.662168] mt7921e 0000:02:00.0: enabling device (0000 -> 0002)
[   21.667672] mt7921e 0000:02:00.0: ASIC revision: 79610010
[   21.709155] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[   21.709228] sof-audio-pci-intel-tgl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[   21.709241] sof-audio-pci-intel-tgl 0000:00:1f.3: enabling device (0000 -> 0002)
[   21.709382] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[   21.742107] Bluetooth: hci0: Device setup in 146541 usecs
[   21.742111] Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
[   21.748008] mt7921e 0000:02:00.0: HW/SW Version: 0x8a108a10, Build Time: 20240219110958a

[   21.760351] mt7921e 0000:02:00.0: WM Firmware Version: ____010000, Build Time: 20240219111038
--
[   22.245001] r8169 0000:01:00.0 enp1s0: Link is Down
[   22.581380] mt7921e 0000:02:00.0 wlp2s0: renamed from wlan0
[   22.738945] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 1
[   22.740849] ACPI: video: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[   22.741336] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input19
[   22.741537] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   22.744343] fbcon: i915drmfb (fb0) is primary device
[   22.753997] Console: switching to colour frame buffer device 240x67
[   22.762166] systemd-journald[434]: /var/log/journal/a8b48f1acc7441d89ef762c74937acc3/user-1000.journal: Journal file uses a different sequence number ID, rotating.
[   22.772515] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
[   22.787490] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[   22.819936] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 5
[   22.819940] sof-audio-pci-intel-tgl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[   22.819943] sof-audio-pci-intel-tgl 0000:00:1f.3: DMICs detected in NHLT tables: 2
[   22.825053] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[   22.825058] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[   22.825064] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[   22.933246] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[   22.933251] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[   22.942147] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:22:1 Kernel ABI 3:23:0
[   22.942329] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Parent card not yet available, widget card binding deferred
[   22.960012] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC255: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[   22.960016] snd_hda_codec_realtek ehdaudio0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[   22.960017] snd_hda_codec_realtek ehdaudio0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[   22.960017] snd_hda_codec_realtek ehdaudio0D0:    mono: mono_out=0x0
[   22.960018] snd_hda_codec_realtek ehdaudio0D0:    inputs:
[   22.999449] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3
[   23.015524] input: sof-hda-dsp Front Headphone as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input20
[   23.015588] input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input21
[   23.015645] input: sof-hda-dsp HDMI/DP,pcm=4 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input22
[   23.015710] input: sof-hda-dsp HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input23

Sound config (have not changed recently):

  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  hardware.bluetooth.enable = true;

If there is anything I can do to use an older version of nixpkgs temporarily I would love to hear it :stuck_out_tongue:

This might be relevant:

Try changing to a different kernel, for instance

boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_1

(the previous LTS) worked for me. If you need more up-to-date drivers, try pkgs.linuxKernel.packages.linux_6_10, which is the latest stable.

EDIT:
I had the issue again, seems like 6.1 is also affected. Somebody did a nice chart of affected versions:

This patch as found in the issue above fixed my issue:

    boot.kernelPatches = [
      {
        name = "fix-audio-1";
        patch = builtins.fetchurl {
          url = "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/sound/soc/soc-topology.c?id=e0e7bc2cbee93778c4ad7d9a792d425ffb5af6f7";
          sha256 = "sha256:1y5nv1vgk73aa9hkjjd94wyd4akf07jv2znhw8jw29rj25dbab0q";
        };
      }
      {
        name = "fix-audio-2";
        patch = builtins.fetchurl {
          url = "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/patch/sound/soc/soc-topology.c?id=0298f51652be47b79780833e0b63194e1231fa34";
          sha256 = "sha256:14xb6nmsyxap899mg9ck65zlbkvhyi8xkq7h8bfrv4052vi414yb";
        };
      }
    ];

Be sure to track the issue and remove the patches when it’s fixed upstream.

The patch is to be applied to kernel 6.6.43.