WeirdTreeThing / chromebook-linux-audio

Script to enable audio support on many Chrome devices
BSD 3-Clause "New" or "Revised" License
267 stars 49 forks source link

Alderlake-N PUJJO on 6.5.0 kernel requires dsp_driver option only given in debug mode #100

Open robcast opened 9 months ago

robcast commented 9 months ago

Describe the bug I ran setup-audio on my IdeaPad 3 Flex Alderlake-N Chromebook and speaker or headphone did not work, aplay -l showed only HDMI outputs and KDE desktop config only used null driver.

But when I ran setup-audio --enable-debug speaker and headphone started working, aplay -l showed 7 "sof-rt5682" outputs and KDE desktop config started using speaker and headphone.

I reduced the snd-sof-dbg.conf in /etc/modprobe.d and it seems that at least

options snd-intel-dspcfg dsp_driver=3

is required for the driver to properly initialize.

Boardname Pujjo (Pujjoflex, Nissa, AlderLake-N)

Log dmesg without module config, sound not working

[    6.514825] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    6.514839] snd_hda_intel 0000:00:1f.3: NHLT table not found
[    6.515181] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
...
[    6.544791] rt5682 i2c-10EC5682:00: Using default DAI clk names: rt5682-dai-wclk, rt5682-dai-bclk
[    6.544887] rt5682 i2c-10EC5682:00: supply AVDD not found, using dummy regulator
[    6.544920] rt5682 i2c-10EC5682:00: supply MICVDD not found, using dummy regulator
[    6.544932] rt5682 i2c-10EC5682:00: supply VBAT not found, using dummy regulator
[    6.544940] rt5682 i2c-10EC5682:00: supply DBVDD not found, using dummy regulator
[    6.544949] rt5682 i2c-10EC5682:00: supply LDO1-IN not found, using dummy regulator
...
[    7.195800] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input5
[    7.196002] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input6
[    7.198666] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input7
[    7.199665] input: HDA Intel PCH HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input8

dmesg with dsp_driver=3, sound working


[   17.868661] rt5682 i2c-10EC5682:00: Using default DAI clk names: rt5682-dai-wclk, rt5682-dai-bclk
[   17.868726] rt5682 i2c-10EC5682:00: supply AVDD not found, using dummy regulator
[   17.868765] rt5682 i2c-10EC5682:00: supply MICVDD not found, using dummy regulator
[   17.868772] rt5682 i2c-10EC5682:00: supply VBAT not found, using dummy regulator
[   17.868781] rt5682 i2c-10EC5682:00: supply DBVDD not found, using dummy regulator
[   17.868787] rt5682 i2c-10EC5682:00: supply LDO1-IN not found, using dummy regulator
...
[   18.626430] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[   18.626533] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   18.633313] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[   18.649167] sof-audio-pci-intel-tgl 0000:00:1f.3: NHLT table not found
[   18.649209] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 4
[   18.661979] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[   18.661983] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[   18.661988] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
...
[   18.773422] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 2:2:0-57864
[   18.773428] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:22:1 Kernel ABI 3:23:0
[   18.789078] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:22:1 Kernel ABI 3:23:0
[   18.789370] sof_rt5682 adl_mx98360_rt5682: ASoC: Parent card not yet available, widget card binding deferred
[   18.850928] snd_hda_codec_hdmi ehdaudio0D2: ASoC: sink widget AIF1TX overwritten
[   18.850938] snd_hda_codec_hdmi ehdaudio0D2: ASoC: source widget AIF1RX overwritten
[   18.875616] input: sof-rt5682 Headset Jack as /devices/pci0000:00/0000:00:1f.3/adl_mx98360_rt5682/sound/card0/input5
[   18.875680] input: sof-rt5682 HDMI/DP,pcm=2 as /devices/pci0000:00/0000:00:1f.3/adl_mx98360_rt5682/sound/card0/input6
[   18.875766] input: sof-rt5682 HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/adl_mx98360_rt5682/sound/card0/input7
[   18.875815] input: sof-rt5682 HDMI/DP,pcm=4 as /devices/pci0000:00/0000:00:1f.3/adl_mx98360_rt5682/sound/card0/input8
[   18.875854] input: sof-rt5682 HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/adl_mx98360_rt5682/sound/card0/input9
...
[   21.963645] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx error for 0x60010000 (msg/reply size: 108/20): -22
[   21.963669] sof-audio-pci-intel-tgl 0000:00:1f.3: HW params ipc failed for stream 1
[   21.963676] sof-audio-pci-intel-tgl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -22
(repeating ~100 times)
WeirdTreeThing commented 9 months ago

Which kernel version?

robcast commented 9 months ago

I am on Kubuntu 23.10 with kernel 6.5.0-17-generic.

WeirdTreeThing commented 9 months ago

I sent a patch to automatically select the sof driver on ADL and ADL-N, but that patch is only in 6.6 and newer.

robcast commented 9 months ago

I tried the non-standard Ubuntu mainline kernels (6.7.5 and 6.6.17) on Kubuntu and the Alsa setup worked without extra module options but there were issues with desktop integration (UCF?) and KDE showed no sound devices. I am back to Ubuntu's 6.5.0 and dsp_driver=3 for now.

osousa commented 9 months ago

I sent a patch to automatically select the sof driver on ADL and ADL-N, but that patch is only in 6.6 and newer.

Ubuntu 23.10 6.5.0.21 initially here.

Neither the script or defining the modproble as OP specified were enough. Updating the kernel to 6.6.0 did it for me. Can you point me to the patch? Just out of curiosity.

Thank you very much for your work.

WeirdTreeThing commented 9 months ago

https://lore.kernel.org/all/ZNuDLk5hgmfKrZg6@arch/