No Sound on Speakers (Huawei Matebook D14)

Nix was using pipewire by default. got no sound working. Tried switching to pulseaudio and still no sound.

# dmesg | grep -i audio

[    3.073316] sof-audio-pci-intel-tgl 0000:00:1f.3: enabling device (0000 -> 0002)
[    3.073468] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    3.136051] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    3.142597] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[    3.155637] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 4
[    3.155640] sof-audio-pci-intel-tgl 0000:00:1f.3: NHLT device BT(0) detected, ssp_mask 0x4
[    3.155642] sof-audio-pci-intel-tgl 0000:00:1f.3: BT link detected in NHLT tables: 0x4
[    3.155643] sof-audio-pci-intel-tgl 0000:00:1f.3: DMICs detected in NHLT tables: 2
[    3.155645] sof-audio-pci-intel-tgl 0000:00:1f.3: NHLT device I2S(4) detected, ssp_mask 0x1
[    3.155646] sof-audio-pci-intel-tgl 0000:00:1f.3: Overriding topology with MCLK mask 0x1 from NHLT
[    3.159820] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware paths/files for ipc type 0:
[    3.159822] sof-audio-pci-intel-tgl 0000:00:1f.3:  Firmware file:     intel/sof/sof-tgl.ri
[    3.159823] sof-audio-pci-intel-tgl 0000:00:1f.3:  Topology file:     intel/sof-tplg/sof-tgl-es8336-dmic2ch-ssp0.tplg
[    3.160761] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    3.160763] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:1
[    3.268857] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[    3.268861] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:1
[    3.395580] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:22:1 Kernel ABI 3:23:1

Here’s what i put on my nix config when i tried switching to pulseaudio:

  # Audio
  boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest;
  hardware.pulseaudio.enable = true;
  hardware.pulseaudio.package = pkgs.pulseaudioFull;
  services.pipewire.enable = false;

hello can you try following without pulseaudio.package:

boot.kernelPackages = pkgs.linuxPackages_latest;
# Enable sound with Pulseaudio.
  hardware.pulseaudio.enable = true;
  security.rtkit.enable = true;

Hi, yes and it still does not work

  boot.kernelPackages = pkgs.linuxPackages_latest;
  hardware.pulseaudio.enable = true;
  security.rtkit.enable = true;
  services.pulseaudio.enable = true;
  services.pipewire.enable = false;

So apparently Huawei linux driver support is not the best.
https://www.reddit.com/r/linuxhardware/comments/wp884i/huawei_matebook_14_sound_card/

But could you try this:

hardware.pulseaudio.extraConfig = "options snd-intel-dspcfg dsp_driver=1";

https://bbs.archlinux.org/viewtopic.php?id=290124

that post is old. i got it working on a lot of distros, the last one being gentoo using pipewire

And what did you do to make it work on the other distros?

aside from installing sof-firmware,
I just followed the setup from the gentoo wiki
(Configuration and Sound Configuration section):

https://wiki.gentoo.org/wiki/PipeWire#Configuration

one thing I also always do when setting up a new distro is installing intel-microcode, but I don’t know how to do it in NixOs yet nor I know whther it is already installed or not

should be installed via the hardware config.

But how have you installed sof-firmware, and what was your config for pipewire?
Then some steps to try:

  1. First try Pipewire again with this:
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    wireplumber.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;
  };
  1. Try running these commands systemctl --user restart pipewire.service and then systemctl --user restart pipewire-pulse.service
  2. cleare this /run/user/1000/pulse after backing it up

still did not work :face_exhaling:

just found this one Sound works in live CD but not on installation for Huawei MateBook D 14 Intel Tiger Lake-LP Audio Controller
how can i downgrade my kernel to 6.9.9?

You cannot use that kernel version, it is EOL. You could use:

boot.kernelPackages = linuxKernel.packages.linux_6_6;

To downgrade to an older LTS release. This will also become EOL in time, so it’s only a temporary solution; I suppose it will at least let you confirm if this is indeed a kernel issue, though it’s indeed not unlikely.

sof-firmware sounds like a more sustainable solution, you can explicitly install it with:

hardware.firmware = [ pkgs.sof-firmware ];

Although it is included in hardware.enableRedistributableFirmware, which is added to the default hardware config, and your dsp is found according to your logs, so that’s likely not it either

Can you try following:

  1. Set the Appropriate DSP Driver Mode: Some Intel audio devices require specifying the Digital Signal Processor (DSP) driver mode. Adding the following to your configuration.nix can help:
boot.extraModprobeConfig = ''
  options snd-intel-dspcfg dsp_driver=1
'';

  1. Install alsamixer. Ensure that the correct sound card is selected and that no channels (like Master, PCM, Speaker) are muted (look for “MM” versus “OO”) or set to low volumes.
  2. Verify Audio Devices:
    Run aplay -l to see if the sound card is correctly listed. You can also check your audio server’s sinks (for PulseAudio or PipeWire) using: pactl list sinks

do i still need to use this:

security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    wireplumber.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;
  };

No there you need to use pulseaudio.

1 Like

❯  aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
❯  pactl list sinks
Sink #0
	State: SUSPENDED
	Name: auto_null
	Description: Dummy Output
	Driver: module-null-sink.c
	Sample Specification: s16le 2ch 48000Hz
	Channel Map: front-left,front-right
	Owner Module: 14
	Mute: no
	Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	       balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: auto_null.monitor
	Latency: 0 usec, configured 0 usec
	Flags: DECIBEL_VOLUME LATENCY SET_FORMATS 
	Properties:
		device.description = "Dummy Output"
		device.class = "abstract"
		device.icon_name = "audio-card"
	Formats:
		pcm

Ok so the channels are not muted.
Have you tried this?

yeah already pasted it

and did it work after a restart?
If not can you try it with:

boot.extraModprobeConfig = ''
  # Force legacy (HDA) mode instead of SOF
  options snd-intel-dspcfg dsp_driver=1
  # Probe only the first codec (likely your analog output)
  options snd_hda_intel probe_mask=1
'';

it got worse. now “aplay -l” says no soundcards found

That is strang.
Can you try it with this:

boot.extraModprobeConfig = ''
  options snd-intel-dspcfg dsp_driver=1
  options snd_hda_intel dmic_detect=0
'';

if this does not help try it just with the dimc_decetion:

boot.extraModprobeConfig = ''
  options snd_hda_intel dmic_detect=0
'';

Also just to be safe add this too:

hardware.firmware = [ pkgs.sof-firmware ];