No speaker audio on Dell Pro 13 Premium

I’ve installed Guix System on a Dell Pro 13 Premium PA13250 with an Intel Core Ultra 5 236V Lunar Lake CPU. And everything seems fine so far… except the laptop speaker audio and headphone jack audio don’t work.

At least after adding (service bluetooth-service-type) to my system config, I got bluetooth audio working! But I’d like my laptop speakers to work…

OK, so I added nonguix to my ~/.config/guix/channels.scm file.

And in my system configuration, I have this.

(use-modules (gnu)
             (nongnu packages linux))

(operating-system
  (kernel linux)
  (firmware (list linux-firmware sof-firmware))
  ;; ...

I didn’t have sof-firmware in my firmware list at first, but I noticed there were some error messages in dmesg about it missing. (Sorry, I should have saved the exact error.)

Anyway, after adding sof-firmware, dmesg seems happy.

$ sudo dmesg | grep -i -E 'sof-|codec|snd'
[    6.210070] snd_hda_intel 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver
[    7.512689] sof-audio-pci-intel-lnl 0000:00:1f.3: enabling device (0000 -> 0002)
[    7.512777] sof-audio-pci-intel-lnl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[    7.513032] sof-audio-pci-intel-lnl 0000:00:1f.3: bound 0000:00:02.0 (ops intel_audio_component_bind_ops [xe])
[    7.520110] sof-audio-pci-intel-lnl 0000:00:1f.3: use msi interrupt mode
[    7.542503] sof-audio-pci-intel-lnl 0000:00:1f.3: hda codecs found, mask 4
[    7.542507] sof-audio-pci-intel-lnl 0000:00:1f.3: NHLT device BT(0) detected, ssp_mask 0x4
[    7.542508] sof-audio-pci-intel-lnl 0000:00:1f.3: BT link detected in NHLT tables: 0x4
[    7.542510] sof-audio-pci-intel-lnl 0000:00:1f.3: DMICs detected in NHLT tables: 0
[    7.548173] sof-audio-pci-intel-lnl 0000:00:1f.3: Firmware paths/files for ipc type 1:
[    7.548181] sof-audio-pci-intel-lnl 0000:00:1f.3:  Firmware file:     intel/sof-ipc4/lnl/sof-lnl.ri
[    7.548182] sof-audio-pci-intel-lnl 0000:00:1f.3:  Firmware lib path: intel/sof-ipc4-lib/lnl
[    7.548182] sof-audio-pci-intel-lnl 0000:00:1f.3:  Topology file:     intel/sof-ipc4-tplg/sof-lnl-cs42l43-l0.tplg
[    7.548959] sof-audio-pci-intel-lnl 0000:00:1f.3: Loaded firmware library: ADSPFW, version: 2.13.0.1
[    7.795503] sof-audio-pci-intel-lnl 0000:00:1f.3: Booted firmware version: 2.13.0.1
[    8.485300] cs42l43-codec cs42l43-codec: supply vdd-amp not found, using dummy regulator
[    8.520007] sof-audio-pci-intel-lnl 0000:00:1f.3: Topology: ABI 3:29:1 Kernel ABI 3:23:1
[    8.522655] sof-audio-pci-intel-lnl 0000:00:1f.3: Loaded firmware library: ADSPFW, version: 2.13.0.1
[   15.581822] input: sof-soundwire Jack as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input20
[   15.582157] input: sof-soundwire HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input21
[   15.582237] input: sof-soundwire HDMI/DP,pcm=6 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input22
[   15.582312] input: sof-soundwire HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sof_sdw/sound/card0/input23

However, I still have no speaker audio. :frowning:

aplay seems to see my device…

$ guix shell alsa-utils -- aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sofsoundwire [sof-soundwire], device 0: Jack Out (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofsoundwire [sof-soundwire], device 2: Speaker (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofsoundwire [sof-soundwire], device 5: HDMI1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofsoundwire [sof-soundwire], device 6: HDMI2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofsoundwire [sof-soundwire], device 7: HDMI3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofsoundwire [sof-soundwire], device 31: Deepbuffer Jack Out (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I tried running speaker-test, but I couldn’t hear anything.

$ guix shell alsa-utils -- speaker-test -D hw:0,2 -c 2
speaker-test 1.2.11

Playback device is hw:0,2
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 192 to 1048576
Period size range from 48 to 524288
Periods = 4
was set period_size = 12000
was set buffer_size = 48000
 0 - Front Left
 1 - Front Right

I think speaker-test uses ALSA directly, so I think(?) I’m bypassing Pulse/Pipewire… which I’m guessing means the issue isn’t with Pulse or Pipewire…

More info:

$ sudo lspci | grep -i audio
00:1f.3 Audio device: Intel Corporation Lunar Lake-M HD Audio Controller (rev 10)
$ sudo dmesg | grep -i codec
[    7.542503] sof-audio-pci-intel-lnl 0000:00:1f.3: hda codecs found, mask 4
[    8.485300] cs42l43-codec cs42l43-codec: supply vdd-amp not found, using dummy regulator

This GitLab issue seems related: Kernel support for latest Lunar Lake platforms audio (#390) · Issues · Nonguix / nonguix · GitLab

But the change got reverted because it was breaking aarch64 builds. :cry:

I tried adding this patch to my system.scm file. (Takes a while to build…)

diff --git a/system.scm b/system.scm
index c76663e..eb9f8cc 100644
--- a/system.scm
+++ b/system.scm
@@ -12,13 +12,20 @@
              (btv tailscale)
              (gnu packages cups)
              (gnu packages fonts)
+             (gnu packages linux)
              (nongnu packages linux)
              (nongnu system linux-initrd))
 
+(define-public linux-custom
+  (customize-linux #:linux linux
+                   #:configs
+                   '("CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES=y"
+                     "CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH=m")))
+
 (use-service-modules cups desktop networking ssh xorg)
 
 (operating-system
-  (kernel linux)
+  (kernel linux-custom)
   (initrd microcode-initrd)
   (firmware (list linux-firmware sof-firmware))
   (locale "en_US.utf8")

I also checked the kernel build-time config using this command. It seems to show the configuration was applied.

$ zcat /proc/config.gz | grep -E 'USER_FRIENDLY_LONG_NAMES|SOUNDWIRE_SOF_MACH'
CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES=y
CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH=m

But still no speaker audio. :sob: