Repository navigation
Description
Describe the bug
HW - Lenovo X1 Yoga G4 (i7-8665U with Cannon Lake Audio), Fedora 31 beta.
I've built a 5.4/mainline kernel (commit da05b5e) with the 5.4 ALSA/sound fixes merged, and SOF from master (commit 913644b). I get the kernel log:
[ 35.470052] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[ 35.470057] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[ 35.470198] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[ 35.474226] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 35.483498] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[ 35.483499] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[ 35.520225] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[ 35.520227] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[ 38.596599] sof-audio-pci 0000:00:1f.3: error: load fw failed ret: -110
[ 38.596629] sof-audio-pci 0000:00:1f.3: error: status = 0x0000002c panic = 0x00000000
[ 38.596650] sof-audio-pci 0000:00:1f.3: error: failed to reset DSP
[ 38.596652] sof-audio-pci 0000:00:1f.3: error: failed to boot DSP firmware -110
[ 38.596653] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -110
I realise this may be an unsupported configuration, however the 5.3 SOF code and firmware provided by Lenovo (somewhat unofficially) at https://forums.lenovo.com/t5/Ubuntu/Guide-X1-Carbon-7th-Generation-Ubuntu-compatability/m-p/4503771#M2849 does work, although with very low volume from the rear speakers (Laptop has two woofers and two tweeters) which I am hoping will improve with newer firmware.
To Reproduce
Install mainline kernel and SOF firmware/topolgy from head. Attempt to boot kernel and use sound.
Reproduction Rate
100%
Expected behavior
Successful firmware load with working sound output.
Impact
Annoyance unless it's movie night, then showstopper.
Environment
- Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
- Name of the topology file
- Topology: Unknown but all built topology is in /lib/firmware/intel/sof-tplg
- Name of the platform(s) on which the bug is observed.
- Platform: CNL
Activity
plbossart commentedon Sep 27, 2019
@tokyovigilante did you mean that you compiled the firmware yourself with GCC and using the community key? If yes, I don't think this can work. You'd have to use the 1.3 firmware signed with the Intel production key.
tokyovigilante commentedon Sep 27, 2019
Thanks for the reply. That's correct, I just followed the build instructions. Is that signing process available to end users?
[EDIT] I should say also using the xtensa-cnl-elf-gcc compiler built as per https://thesofproject.github.io/latest/getting_started/build-guide/build-from-scratch.html#build-cross-compiler
plbossart commentedon Sep 27, 2019
Unfortunately no. The OEM decides which keys are used. You can only sign your own firmware on 'open' platforms such as Up2 boards or Chromebooks based on GeminiLake or newer.
Also the issue is unlikely to be due to the firmware. The firmware only provides stereo to the HDaudio codec, and I would guess the split between tweeter/woofer is handled in the amplifier stages - outside of the chipset and it may be a codec configuration issue.
One way to test this hypothesis would be to use the legacy driver - by blacklisting snd-sof-pci and testing with the snd-hda-intel driver if the sound levels are acceptable. Disclaimer: playing with your hardware and sound levels may result in damaged speakers, use at your own risk, etc. Also the legacy driver will not support the capture over DMIC, so this is only to check the codec behavior.
tokyovigilante commentedon Sep 28, 2019
Thanks for the clarification. That is a little disappointing, as it does detract from the open nature of the project if I'm unable to use it outside an OEM-provided build. Lenovo has provided one for the 5.3 kernel to be fair though.
However on rebooting to the current 5.3 release kernel provided by Fedora (Linux firebert 5.3.1-300.fc31.x86_64 #1 SMP Tue Sep 24 21:00:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux) without replacing my custom built firmware, the sound driver and firmware seem to be loaded fine and the sound does work as below:
I'll try your suggestions regarding the legacy HDA driver and possibly chase up the findings with lenovo.
tokyovigilante commentedon Oct 8, 2019
On further review it seems you are correct and only signed firmware is able to be loaded on my ThinkPad. I have reverted to the signed 1.3 firmware and topology, but this is not compatible with the current sof-dev kernel branch (with the recent 5.4 rc1 merge) as follows:
dmesg output:
Neither ALSA nor Pulseaudio detect the hardware. I assume this is due to incompatibilities with the SOF firmware v1.3 and the 5.4 kernel changes.
Going forward, would it be possible to host signed builds of RC versions (or better nightlies) of the firmware for the various desktop/laptop platforms?
plbossart commentedon Oct 8, 2019
yes we have plans to provide signed releases. I am not sure we can do signed nightly builds due to logistics, @lgirdwood would need to comment.
The problem you have is a bug on our side, we should be backwards compatible with the 1.3 firmware and topology even when updating the kernel. @ranj063 @kv2019i does the dmesg trace above ring a bell?
@xiulipan @wenqingfu as discussed we need to have a kernel CI test against 1.3 firmware and topology to catch problems with non-backwards compatible issues before they are reported by users.
tokyovigilante commentedon Oct 8, 2019
Thanks again for the reply, that's good to know releases will be ongoing.
I should mention the above dmesg trace is after symlinking from
sof-hda-generic.tplgtosof-cnl-nocodec.tplg. Lenovo provided only thesof-hda-generic.tplgand without the symlink (but with the 1.3 firmware and the 5.4 kernel i get:dmesg output:
plbossart commentedon Oct 8, 2019
I think you have a config issue for your kernel, most likely you didn't select HDAudio support.
please make sure you have this enabled.
CONFIG_SND_SOC_SOF_HDA_LINK=y
CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y
tokyovigilante commentedon Oct 9, 2019
I reviewed my config and those opions were indeed not present, however I could not find them even after running
make oldconfigwith the standard Fedora config copied over, nor withmake olddefconfig. However they seemed to build after merging the relevent fragments fromsof/kconfigHowever I am still unable to load the 1.3 firmware/topology:
dmesg:
plbossart commentedon Oct 9, 2019
did you remove the symlink? It seems you are still using the nocodec mode?
[ 33.537658] sof-audio-pci 0000:00:1f.3: loading topology:intel/sof-tplg/sof-cnl-nocodec.tplg
tokyovigilante commentedon Oct 9, 2019
That's with the symlink removed, the only 1.3 topology file Lenovo is currently providing is
sof-hda-generic.tplg, so I assume those messages relate to the nocodec topology being absent, ie it doesn't seem to try to load the hda-generic topology in that case, whereas I presume it was on my 5.3 kernel. I did try the nocodec topology from my 1.4 build also, but that didn't work either, and gave me the following (100x of times):I appreciate none of these are likely to be supported configurations, but it would be nice to be able to run a 5.4 or devel kernel with the existing 1.3 firmware/topology. Thanks again for the attention.
xiulipan commentedon Oct 10, 2019
@plbossart @mengdonglin
We will try to add a matrix of test for daily test for CI:
FW: release 1.3/1.4/master
Kernel: sof-dev/linux/audio for-next
Any other release version need to be tracked?
plbossart commentedon Oct 10, 2019
@xiulipan it'd be good if you can test integration/soundwire-latest with the SoundWire options enabled on older platforms w/o SoundWire, just to check if things work without any impact from the added SoundWire initializations/parsing.
Just today I found a case I didn't manage on Up2 w/ hda-generic-idisp so it'd be quite good before going upstream. We should use the latest firmware there. It's a different problem from this issue #1885 really.
PaulVanSchayck commentedon Oct 20, 2019
I'm hitting a similar looking problem on Ubuntu 19.10 (and also on a Lenovo X1 7th gen) using the Ubuntu kernel 5.3.0-18-generic. When checking its config it reports this:
I'm also getting this error where it loads the nocodec machine driver:
Would this be an issue with this particular kernel config, and we need to talk to the Ubuntu devs to enable the other options? Or is there something else going on?
Sorry for semi-hijacking this issue. But I thought them to be closely related to each other.
4 remaining items
tokyovigilante commentedon Oct 21, 2019
It turns out this was the issue for me too sorry, I had the HD audio codec enabled but also the nocodec option, disabling this allows the 1.3 firmware/topology to work with kernel 5.4 and my existing pulseaudio config/ALSA UCM. Sorry about that!
PaulVanSchayck commentedon Oct 21, 2019
Thanks for the help and double checks Pierre.
After searching the Ubuntu Kernel tracker, turned out this was already self-reported by the Ubuntu developers a couple of days a go in this bug report on launchpad.
ASoC: SOF: Kconfig: add EXPERT dependency for developer options, clar…
ASoC: SOF: Kconfig: add EXPERT dependency for developer options, clar…
ASoC: SOF: Kconfig: add EXPERT dependency for developer options, clar…
ASoC: SOF: Kconfig: add EXPERT dependency for developer options, clar…
lgirdwood commentedon Nov 4, 2019
@plbossart can we close this now with your latest commits being merged ?
tokyovigilante commentedon Nov 4, 2019
Firmware load working well for me now with the kernel configs mentioned in the thread.
plbossart commentedon Nov 4, 2019
Closing. Thanks @tokyovigilante and @PaulVanSchayck for your help, we appreciate feedback from the community.
ASoC: SOF: Kconfig: add EXPERT dependency for developer options, clar…
ASoC: SOF: Kconfig: add EXPERT dependency for developer options, clar…
ASoC: SOF: Kconfig: add EXPERT dependency for developer options, clar…
UPSTREAM: ASoC: SOF: Kconfig: add EXPERT dependency for developer opt…
ASoC: SOF: Kconfig: add EXPERT dependency for developer options, clar…