Dell XPS 17 9700 Audio Issues - SOF / SoundWire

hello,

I'm having some problems on kernel 5.7 with the new Dell XPS 17 (model 9700) - Audio is not working and pulseaudio is just adding some "Dummy Output", alsamixer is just showing HDMI ports only. FWIW, in Windows after the firmware has loaded there are 5 children of the Audio card in Device Manager, one of which is the HDMI port audio and the other 4 are SoundWire audio devices, specifically Realtek ALC711, ALC714, and 2x ALC1309D (025d:1308)

The specifics are as follows - out of the box the audio in lspci looks something like this:

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Device [8086:06c8]
	Subsystem: Dell Device [1028:098f]
	Flags: bus master, fast devsel, latency 64, IRQ 16
	Memory at 609b118000 (64-bit, non-prefetchable) [size=16K]
	Memory at 609b000000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: [50] Power Management version 3
	Capabilities: [80] Vendor Specific Information: Len=14 <?>
	Capabilities: [60] MSI: Enable- Count=1/1 Maskable- 64bit+
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl, snd_sof_pci

I noted online a patch relating to Intel DSP -> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=82d9d54a6c0ee8b12211fa4e59fd940a2da4e063

Specifically it illuminates me on the following: "All [three] drivers registers similar PCI IDs, so the first driver probed from the PCI stack can win. But... it is not guaranteed that the correct driver wins." It then goes on to look at the device ID in a switch and to prioritise using SST if the device is is 06c8. So the automatic sensing in this module is not quite working, but anyway. I therefore set the flag dsp_driver=2 in a modprobe conf file to help with this.

This results in the following dmesg output on boot:

Jul 01 00:15:26 applecross kernel: HDMI HDA Codec ehdaudio0D2: Max dais supported: 3
Jul 01 00:15:26 applecross kernel: snd_soc_skl 0000:00:1f.3: Direct firmware load for 6c8-DELL-DellInc-538378241-tplg.bin failed with error -2
Jul 01 00:15:26 applecross kernel: snd_soc_skl 0000:00:1f.3: tplg fw 6c8-DELL-DellInc-538378241-tplg.bin load failed with -2, falling back to dfw_sst.bin
Jul 01 00:15:26 applecross kernel: snd_soc_skl 0000:00:1f.3: Direct firmware load for dfw_sst.bin failed with error -2
Jul 01 00:15:26 applecross kernel: snd_soc_skl 0000:00:1f.3: Fallback tplg fw dfw_sst.bin load failed with -2
Jul 01 00:15:26 applecross kernel: snd_soc_skl 0000:00:1f.3: Failed to init topology!
Jul 01 00:15:26 applecross kernel: snd_soc_skl 0000:00:1f.3: ASoC: failed to probe component -2
Jul 01 00:15:26 applecross kernel: skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: failed to instantiate card -2
Jul 01 00:15:26 applecross kernel: skl_hda_dsp_generic: probe of skl_hda_dsp_generic failed with error -2

Technically things get worse because there is now no HDMI audio but I feel like it is closer as there is no possibility of soundwire working without that DSP loading anyway.

I see the Subsystem dell device ID here:
https://github.com/torvalds/linux/blob/9fb4c5250f10dc4d8257cd766991be690eb25c5b/sound/soc/intel/boards sof_cdw.c line 151 (can't direct link due to new users link limit sorry) and the Realtek devices I mentioned earlier have files in that same directory, sof_sdw_rt1308.c and sof_sdw_rt711.c.

But I'm at (infact, beyond) the end of my knowledge at this point, so does anyone have an idea of next steps to try and get things working? How does the existence of those quirks files relate to the missing firmware file? Where would I find a firmware file like that - would one even exist? Could it be pulled from the Windows drivers, which are available on the Dell website? Or does SOF use its own firmware format?

Thanks to anyone who can shed a little light here. I'm stil dual booting with Windows until this is fixed so I can get any info from running hardware, and happy to try most suggestions.

Cheers!

edit: For the sake of completeness, dmesg output when using SOF not SST (since i just noticed the .c files I linked are named _sof)

[    2.456758] sof-audio-pci 0000:00:1f.3: enabling device (0000 -> 0002)
[    2.456910] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    2.456996] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    2.463482] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[    2.500435] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 4
[    2.500438] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    2.620438] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:4:2-66a5a
[    2.620441] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:11:0 Kernel ABI 3:13:0
[    2.639114] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link iDisp1
[    2.639117] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link iDisp2
[    2.639117] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link iDisp3
[    2.639118] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link dmic01
[    2.639119] skl_hda_dsp_generic skl_hda_dsp_generic: info: override BE DAI link dmic16k
[    2.639388] sof-audio-pci 0000:00:1f.3: Topology: ABI 3:11:0 Kernel ABI 3:13:0
[    2.639392] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp3 Tx not handled
[    2.639393] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp2 Tx not handled
[    2.640695] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp1_out not handled
[    2.640702] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp1 Tx not handled
[    2.642146] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp2_out not handled
[    2.643328] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp3_out not handled
[    2.645632] sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[    2.653296] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi1 <-> iDisp1 Pin mapping ok
[    2.653300] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi2 <-> iDisp2 Pin mapping ok
[    2.653303] skl_hda_dsp_generic skl_hda_dsp_generic: intel-hdmi-hifi3 <-> iDisp3 Pin mapping ok
[    2.653305] skl_hda_dsp_generic skl_hda_dsp_generic: dmic-hifi <-> DMIC01 Pin mapping ok
[    2.653308] skl_hda_dsp_generic skl_hda_dsp_generic: dmic-hifi <-> DMIC16k Pin mapping ok
[    2.653320] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> HDMI1 1 mapping ok
[    2.653328] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> HDMI2 2 mapping ok
[    2.653340] skl_hda_dsp_generic skl_hda_dsp_generic: snd-soc-dummy-dai <-> HDMI3 3 mapping ok
[    2.664521] input: sof-hda-dsp HDMI/DP,pcm=1 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input25
[    2.664627] input: sof-hda-dsp HDMI/DP,pcm=2 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input26
[    2.664694] input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input27

Matters are somewhat improved here as there are now mixers called PGA2.0 2 Master, PGA2.0 3 Master and PGA2.0 4 Master in alsamixer although based on the above these are the HDMI outputs that the legacy driver also showed!

please post response to - grep -n snd /etc/modprobe.d/*.conf
to show any options added

lspci data is showing the Legacy HDA driver is loaded

Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl, snd_sof_pci

the HDA driver does not support the onboard Intel SST DMIC
audio can be made to work with legacy driver by disabling dmic detection in modprobe

options snd-intel-dspcfg dsp_driver=1
internal microphone will not work with this option

link to kernel patch in OP mentions the code was 'Tested on Lenovo Carbon X1 7th gen'
suggestions on Arch wiki page for this laptop may work for this hardware too

wiki.archlinux.org - Lenovo ThinkPad X1 Carbon (Gen_7) - Audio

best option for a solution at this time appears to be to install pulseaudio-git
get the latest version of Pulseaudio (v13.99) which has fixes for SOF firmware included

or follow the other steps and add modprobe options to blacklist Legacy and SST drivers
blacklist snd_hda_intel
blacklist snd_soc_skl
should get the SOF driver sof-hda-dsp loaded in ALSA
and Pulseaudio will not need to create a Dummy Device

hey,

The only option added is the one I mentioned in the post: options snd-intel-dspcfg dsp_driver=3... afaik changing it to = 1 just makes hda_intel the driver and therefore the soundwire chip (which the speakers are connected to) does not work.

After adding dsp_driver = 3 the following lspci output:

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Device [8086:06c8]
	Subsystem: Dell Device [1028:098f]
	Flags: bus master, fast devsel, latency 64, IRQ 201
	Memory at 609b118000 (64-bit, non-prefetchable) [size=16K]
	Memory at 609b000000 (64-bit, non-prefetchable) [size=1M]
	Capabilities: [50] Power Management version 3
	Capabilities: [80] Vendor Specific Information: Len=14 <?>
	Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Kernel driver in use: sof-audio-pci
	Kernel modules: snd_hda_intel, snd_soc_skl, snd_sof_pci

Blacklisting did not achieve the same result because I think snd_hda_intel was required to load snd_intel_dspcfg or something. I just ended up with no driver loaded whatsoever when i done that.

I will try your suggestion of looking at the ThinkPad page, and upgrading Pulseaudio, that is a good connection!

Cheers,

Mark

Starting latest pulseaudio gives this:

E: [pulseaudio] alsa-ucm.c: Failed to get the verb HiFi
E: [pulseaudio] alsa-ucm.c: No UCM verb is valid for hw:0
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="pci-0000_00_1f.3-platform-skl_hda_dsp_generic" card_name="alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic" 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""): initialization failed.

skl_hda_dsp_generic is the thing here, where I think we should probably be loading sof_sdw_rt1308 and sof_sdw_rt711 instead or as well. As for how to fix the sensing of that - no idea?

modprobe option snd-intel-dspcfg dsp_driver=1 replaced a previous modprobe option snd_hda_intel.dmic_detect=0 on earlier kernels
some hardware still requires this option to disable the internal DMIC where it is not supported yet by SOF drivers (and some users do not need internal microphones). if internal microphone is ignored, snd_hda_intel works with the rest of the audio codec

i did a check for issues with 'rt711' at thesofproject and most of the bug reports appear to have been resolved in the last few months - https://github.com/thesofproject/sof/issues?q=is%3Aissue+rt711

but some issues were only resolved recently and may not have made it to Manjaro stable branch yet

sof-firmware v1.4.2-1 in stable should be updated to v1.5.1-1 soon
later version is available available in Testing and Unstable branches now

E: [pulseaudio] alsa-ucm.c: Failed to get the verb HiFi
E: [pulseaudio] alsa-ucm.c: No UCM verb is valid for hw:0
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.

Pulseaudio appears to be failing due to not finding the HiFi profile,
and may need a later version of package alsa-ucm-conf
stable branch has v1.2.2-1 and Testing and Unstable has v1.2.3-2

switching to testing branch may get audio working better with later package versions
but i expect the new packages will arrive in an update for stable branch soon

hey, thanks for the link to github, seems extremely relevant! https://github.com/thesofproject/sof/issues/2901 for example relates to a very similar laptop to this one.

1 Like

so, for anyone who is following along, the situation is:

dell have released an ubuntu version of this laptop with slightly different hardware called the dell precision 5750, i have been in touch with someone who has one of these and it has been very useful, basically dell have bundled a dkms build of thesofproject driver (circa kernel 5.1) with added device definitions.

the file kernel/sound/hda/intel-dsp-config.c is where the Dell 9700 definition is in the audio drivers. It is not in the 5.7 tree but it is in the 5.8 tree. For the vast majority of people the best option will be to wait for 5.8 release which is more than likely going to be within a month.

So I took the dkms module from launchpad (soundwire-dkms@1.2.1) and updated it with minor patches so it would compile against 5.7 kernel, and I downloaded ucm2 for the rt711etc from thesofproject/alsa-ucm-conf, and now everything works.

But since this driver version is old by some unknown amount I thought to try and build the latest driver from thesofproject/linux against kernel 5.7, but that went very badly, there was no audio at all and random crashes of the driver, system hanging when resuming from sleep etc, so I can not currently recommend this approach to anyone :slight_smile: but there were some big refactors so it might do better against kernel 5.8. Hopefully, otherwise it could be 3 months before this laptop "just works" :slight_smile:

Anyway, I wrote a quite terse blog on how to compile the dkms driver and put my patches for it on github -> https://blog.fts.scot/2020/07/04/dell-xps-2020-how-to-get-audio-working-on-linux/

2 Likes

Forum kindly sponsored by