Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] no sof-lnl-cs42l43-l0-2ch.tplg found #5329

Open
pma1 opened this issue Nov 26, 2024 · 44 comments
Open

[BUG] no sof-lnl-cs42l43-l0-2ch.tplg found #5329

pma1 opened this issue Nov 26, 2024 · 44 comments
Assignees
Labels
bug Something isn't working SDW Applies to SoundWire bus for codec connection topology Issues caused by topology

Comments

@pma1
Copy link

pma1 commented Nov 26, 2024

Describe the bug
No sound cards are initialized.

Reproduction Rate
1/1

Expected behavior
The right tplg is loaded.

Impact
no audio

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: 6.12+ 9f16d5e Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
    • SOF: db771bf v2.11.x: add new 2.11.2 topology2 production binaries
  2. Name of the topology file
    • Topology: intel/sof-ipc4-tplg/sof-lnl-cs42l43-l0-2ch.tplg
  3. Name of the platform(s) on which the bug is observed.
    • Platform: CPU0: Intel(R) Core(TM) Ultra 7 258V

Screenshots or console output
aladdin-1-6.12-dmesg-nosoundcards.txt

@pma1 pma1 added the bug Something isn't working label Nov 26, 2024
@lgirdwood
Copy link
Member

@charleskeepax I guess this topology is now upstream but not in the current release ?

@charleskeepax
Copy link

Alas a bunch of these SKUs ended up looking slightly different to what we expected. This needs some updates, we have a 4-channel topology, but not a 2-channel one. This will also need some quirk updates for the kernel side.

@rfvirgil
Copy link

rfvirgil commented Nov 27, 2024

Can you try it with these two patches?

Kernel: f6f710b
Topology: CirrusLogic/sof@bfd4c7b

@rfvirgil rfvirgil self-assigned this Nov 27, 2024
@pma1
Copy link
Author

pma1 commented Nov 28, 2024

@rfvirgil ,
Thanks for the quick change.

Would you mind share a sof-bin? Sorry I am not familiar with sof building.

@rfvirgil
Copy link

rfvirgil commented Nov 28, 2024

tplg file attached
sof-lnl-cs42l43-l0-2ch.tplg.gz

ungzip it and copy the .tplg to /lib/firmware/intel/sof-ipc4-tplg/

@pma1
Copy link
Author

pma1 commented Nov 28, 2024

@rfvirgil ,

Thanks.

After copied the tplg, sof show error:
error: can't connect DAI alh-copier.Playback-SmartAmp.0

Full dmesg:
Aladdin-sof-load-fail-dmesg.txt

@lgirdwood
Copy link
Member

@ujfalusi @bardliao pls see above copier error and dmesg. Missing kernel patch or topology ?

@rfvirgil
Copy link

@pma1 Did you apply the kernel patch? f6f710b

@pma1
Copy link
Author

pma1 commented Nov 29, 2024

@rfvirgil

Sorry for my mistake.

After applied patch, with new tplg, still show:
sof-audio-pci-intel-lnl 0000:00:1f.3: no hda codecs found!

Aladdin-sof-tplg-kernel-6.12-patch-load-fail-dmesg.txt

@bardliao
Copy link
Collaborator

The main issue is:

[    4.014846] sof_sdw sof_sdw: ASoC: physical link dmic01 (id 4) not exist
[    4.015984] sof_sdw sof_sdw: ASoC: topology: could not load header: -22
[    4.017044] sof-audio-pci-intel-lnl 0000:00:1f.3: error: tplg component load failed -22
[    4.017758] sof-audio-pci-intel-lnl 0000:00:1f.3: error: failed to load DSP topology -22
[    4.018707] sof-audio-pci-intel-lnl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
[    4.019675] sof_sdw sof_sdw: ASoC: failed to instantiate card -22

Please rename sof-dyndbg.conf.txt to sof-dyndbg.conf and put it in the /etc/modprobe.d/ folder and share the dmesg again. Thanks.

@pma1
Copy link
Author

pma1 commented Nov 29, 2024

@bardliao
Copy link
Collaborator

	Line 3681: [    3.675201] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link SDW0-Playback-SimpleJack, id 0
	Line 3682: [    3.675862] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link SDW0-Capture-SimpleJack, id 1
	Line 3683: [    3.676936] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link SDW0-Playback-SmartAmp, id 2
	Line 3684: [    3.677793] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link dmic01, id 3
	Line 3685: [    3.678640] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link dmic16k, id 4
	Line 3686: [    3.679337] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link iDisp1, id 5
	Line 3687: [    3.679976] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link iDisp2, id 6
	Line 3688: [    3.680805] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link iDisp3, id 7

The dmic01 id is 3.
@pma1 Can you try sof-lnl-cs42l43-l0-2ch.zip?

@pma1
Copy link
Author

pma1 commented Nov 29, 2024

Aladdin-sof-tplg-kernel-6.12-patch-audio-show-no-input-nomic-dmesg.txt

With the new tplg, the audio is shown:
$ cat /proc/asound/cards
0 [sofsoundwire ]: sof-soundwire - sof-soundwire
LENOVO-21Q6SIT019-ThinkPadAladdin

But still no sound output, no mic.

@bardliao
Copy link
Collaborator

[    3.065555] calling  xe_init+0x0/0x100 [xe] @ 275
[    3.065616] initcall xe_init+0x0/0x100 [xe] returned -19 after 0 usecs

Also some

sof-audio-pci-intel-lnl 0000:00:1f.3: ASoC: error at snd_soc_dai_hw_params on iDisp1 Pin: -22

are shown.
@kv2019i Do you know if display audio work on 6.12.0+?

@pma1 Can you test with aplay/arecord first?

@pma1
Copy link
Author

pma1 commented Nov 29, 2024

There is no sound from aplay or arecord.

xe is disabled because of some issues.

After enabled xe, the sound can not output or input too.
Aladdin-sof-tplg-kernel-6.12-patch-xe-audio-show-no-input-nomic-dmesg.txt

@kv2019i
Copy link
Collaborator

kv2019i commented Nov 29, 2024

@pma1 wrote:

After enabled xe, the sound can not output or input too. Aladdin-sof-tplg-kernel-6.12-patch-xe-audio-show-no-input-nomic-dmesg.txt

ACk to @bardliao , display audio should work and this log at least looks good for driver probes. Xe driver for display is up, SOF and codec drivers are probed without errors. I wonder if some alsamixer settings are wrong now. Output from "alsa-info.sh" would be useful (when playing back to one device with aplay). It will show the state of all codec settings.

@rfvirgil
Copy link

Speakers will not work because you don't have firmware for the CS35L56. We would need permission from Lenovo to publish the firmware.

Did you buy this laptop from a shop, or is this a pre-production device?

@pma1
Copy link
Author

pma1 commented Nov 29, 2024

alsa-info:
aladdin-alsa-info.txt

This is a pre-production device.

Does it need a kernel patch to match the CS35L56?

@rfvirgil
Copy link

rfvirgil commented Dec 2, 2024

Does it need a kernel patch to match the CS35L56?

The patch I linked that changes the DMI matches should be the only kernel patch you need.

@rfvirgil
Copy link

rfvirgil commented Dec 5, 2024

@bardliao what was the source change you made to create your fixed tplg?

@bardliao
Copy link
Collaborator

bardliao commented Dec 6, 2024

@rfvirgil

"cavs-sdw\;sof-lnl-cs42l43-l0-2ch\;PLATFORM=lnl,NUM_SDW_AMP_LINKS=1,NUM_DMICS=2,\
PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,DMIC0_ID=3,DMIC1_ID=4,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-cs42l43-l0-2ch.bin,\
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,\
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7,DMIC0_ENHANCED_CAPTURE=true,\
EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default"

The point is DMIC0_ID=3,DMIC1_ID=4. They are 4 and 5 by default. But from

	Line 3684: [    3.677793] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link dmic01, id 3
	Line 3685: [    3.678640] snd_soc_sdw_utils:asoc_sdw_init_dai_link: sof_sdw sof_sdw: create dai link dmic16k, id 4

They should be 3 and 4.

@RyanJiao
Copy link

RyanJiao commented Dec 8, 2024

fig
Hi, I'm using kernel 6.12 on my Intel Ultra 258V and the sof driver was not initialized properly resulting in no audio.

But I can't even find a sof-lnl.** file in this repo's release zip. How can I load my audio card driver properly? It would be so grateful if anyone can give any instruction.

@bardliao
Copy link
Collaborator

bardliao commented Dec 9, 2024

@RyanJiao You could find the sof-lnl.ri from https://github.com/thesofproject/sof-bin/tree/main/v2.11.x/sof-ipc4-v2.11.1/lnl/intel-signed

@RyanJiao
Copy link

RyanJiao commented Dec 9, 2024

Thank you!

@rfvirgil
Copy link

The tplg file (with Bard's change) is merged into the sof repository here:
thesofproject/sof@f4cd55c

The firmware files for the CS35L56 for Aladdin are now available here:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=9c46d10f8ea7a72d910ba5f5ebed7fcd2de31c71

Do not copy the firmware files manually. It must be installed correctly
First make a backup of your existing /lib/firmware content so you can restore it if this all goes wrong!

sudo apt-get install rdfind
git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
cd linux-firmware
sudo make install
sudo make dedup

@pma1
Copy link
Author

pma1 commented Feb 11, 2025

@rfvirgil and @bardliao
After I copied the sof-lnl-cs42l43-l0-2ch.tplg in the latest sof-bin, and with 6.14-rc2.

There is no sound.

Errors are shown:
kernel: soundwire_intel soundwire_intel.link.0: IO transfer timed out, cmd 2 device 0 addr 50 len 6
kernel: soundwire sdw-master-0-0: trf on Slave 0 failed:-110 read addr 50 count 0
kernel: soundwire sdw-master-0-0: DEVID read fail:-110

Aladdin-1-6.14-rc2-alsa-info.txt

@bardliao
Copy link
Collaborator

Simple mixer control 'cs42l43 Speaker L Input 1',0
  Capabilities: volume volume-joined enum
  Items: 'None' 'Tone Generator 1' 'Tone Generator 2' 'Decimator 1' 'Decimator 2' 'Decimator 3' 'Decimator 4' 'ASPRX1' 'ASPRX2' 'ASPRX3' 'ASPRX4' 'ASPRX5' 'ASPRX6' 'DP5RX1' 'DP5RX2' 'DP6RX1' 'DP6RX2' 'DP7RX1' 'DP7RX2' 'ASRC INT1' 'ASRC INT2' 'ASRC INT3' 'ASRC INT4' 'ASRC DEC1' 'ASRC DEC2' 'ASRC DEC3' 'ASRC DEC4' 'ISRC1 INT1' 'ISRC1 INT2' 'ISRC1 DEC1' 'ISRC1 DEC2' 'ISRC2 INT1' 'ISRC2 INT2' 'ISRC2 DEC1' 'ISRC2 DEC2' 'EQ1' 'EQ2'
  Item0: 'None'
Simple mixer control 'cs42l43 Speaker R Input 1',0
  Capabilities: volume volume-joined enum
  Items: 'None' 'Tone Generator 1' 'Tone Generator 2' 'Decimator 1' 'Decimator 2' 'Decimator 3' 'Decimator 4' 'ASPRX1' 'ASPRX2' 'ASPRX3' 'ASPRX4' 'ASPRX5' 'ASPRX6' 'DP5RX1' 'DP5RX2' 'DP6RX1' 'DP6RX2' 'DP7RX1' 'DP7RX2' 'ASRC INT1' 'ASRC INT2' 'ASRC INT3' 'ASRC INT4' 'ASRC DEC1' 'ASRC DEC2' 'ASRC DEC3' 'ASRC DEC4' 'ISRC1 INT1' 'ISRC1 INT2' 'ISRC1 DEC1' 'ISRC1 DEC2' 'ISRC2 INT1' 'ISRC2 INT2' 'ISRC2 DEC1' 'ISRC2 DEC2' 'EQ1' 'EQ2'
  Item0: 'None'
Simple mixer control 'cs42l43 Headphone L Input 1',0
  Capabilities: volume volume-joined enum
  Items: 'None' 'Tone Generator 1' 'Tone Generator 2' 'Decimator 1' 'Decimator 2' 'Decimator 3' 'Decimator 4' 'ASPRX1' 'ASPRX2' 'ASPRX3' 'ASPRX4' 'ASPRX5' 'ASPRX6' 'DP5RX1' 'DP5RX2' 'DP6RX1' 'DP6RX2' 'DP7RX1' 'DP7RX2' 'ASRC INT1' 'ASRC INT2' 'ASRC INT3' 'ASRC INT4' 'ASRC DEC1' 'ASRC DEC2' 'ASRC DEC3' 'ASRC DEC4' 'ISRC1 INT1' 'ISRC1 INT2' 'ISRC1 DEC1' 'ISRC1 DEC2' 'ISRC2 INT1' 'ISRC2 INT2' 'ISRC2 DEC1' 'ISRC2 DEC2' 'EQ1' 'EQ2'
  Item0: 'None'
Simple mixer control 'cs42l43 Headphone R Input 1',0
  Capabilities: volume volume-joined enum
  Items: 'None' 'Tone Generator 1' 'Tone Generator 2' 'Decimator 1' 'Decimator 2' 'Decimator 3' 'Decimator 4' 'ASPRX1' 'ASPRX2' 'ASPRX3' 'ASPRX4' 'ASPRX5' 'ASPRX6' 'DP5RX1' 'DP5RX2' 'DP6RX1' 'DP6RX2' 'DP7RX1' 'DP7RX2' 'ASRC INT1' 'ASRC INT2' 'ASRC INT3' 'ASRC INT4' 'ASRC DEC1' 'ASRC DEC2' 'ASRC DEC3' 'ASRC DEC4' 'ISRC1 INT1' 'ISRC1 INT2' 'ISRC1 DEC1' 'ISRC1 DEC2' 'ISRC2 INT1' 'ISRC2 INT2' 'ISRC2 DEC1' 'ISRC2 DEC2' 'EQ1' 'EQ2'
  Item0: 'None'

@pma1 Looks like the mixer settings are incorrect. Can you update your ucm files and test again?
You can get the latest ucm from https://github.com/alsa-project/alsa-ucm-conf/

@pma1
Copy link
Author

pma1 commented Feb 12, 2025

@bardliao copied the latest alsa-ucm-conf, the speaker sof-firmware is in the sound ouput list, but no sound output, no mic input at all.

alsa-info

aladdin-1-ucm250212-6.14-rc2-alsa-info.txt

@bardliao
Copy link
Collaborator

@pma1 Can you run "sudo alsaucm reload" and check is there any error?

@pma1
Copy link
Author

pma1 commented Feb 13, 2025

@bardliao Thanks for the reminder, after update alsa-utils to 1.2.13.

with the lastest alsa-ucm-conf, the audio input and output works fine.

Could you please share the specific commits of ucm those works with this tplg?
I have to backport these commits to the old release of Ubuntu.

Thank you very much.

@bardliao
Copy link
Collaborator

@pma1 I think @rfvirgil and @charleskeepax may be better people to answer the question. :)

@pma1
Copy link
Author

pma1 commented Feb 14, 2025

@bardliao
Neither the Speaker mute LED or the mic mute LED can work.
There is no codec list in card sofsoundwire:
$ cat /proc/asound/cards
0 [sofsoundwire ]: sof-soundwire - sof-soundwire
LENOVO-21Q6SIT019-ThinkPadAladdin
29 [ThinkPadEC ]: ThinkPad EC - ThinkPad Console Audio Control
ThinkPad Console Audio Control at EC reg 0x30, fw N4CHT24W

Only 1 codec: /proc/asound/card0/codec#2
Codec: Intel Lunar Lake HDMI
Address: 2
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x80862820
Subsystem Id: 0x80860101
Revision Id: 0x100000

@bardliao bardliao transferred this issue from thesofproject/sof Feb 14, 2025
@bardliao
Copy link
Collaborator

@pma1 Can you share the output of "sudo cat /sys/class/sound/ctl-led/mic/card0/list" and "sudo cat /sys/class/sound/ctl-led/speaker/card0/list"?

@bardliao
Copy link
Collaborator

@charleskeepax @rfvirgil Do we need to add "ctl-led/speaker/" in the UCM for speaker mute LED control?

@pma1
Copy link
Author

pma1 commented Feb 17, 2025

aladdin-1-6.14-rc2-amixer-controls.txt

@bardliao the speaker list is NULL, the result is attached.

Thanks.

@bardliao
Copy link
Collaborator

@pma1 Regarding the mic mute led,

$ sudo cat /sys/class/sound/ctl-led/mic/card0/list
30 28 24 202

The corresponding controls are

numid=30,iface=MIXER,name='cs42l43 Decimator 1 Switch'
numid=28,iface=MIXER,name='cs42l43 Decimator 4 HPF Corner Frequency'
numid=24,iface=MIXER,name='cs42l43 Decimator 4 HPF Switch'
numid=202,iface=MIXER,name='Dmic0 Capture TDFB beam switch'

But I believe they should be

numid=30,iface=MIXER,name='cs42l43 Decimator 1 Switch'
numid=34,iface=MIXER,name='cs42l43 Decimator 3 Switch'
numid=36,iface=MIXER,name='cs42l43 Decimator 4 Switch'
numid=208,iface=MIXER,name='Dmic0 Capture Switch'

@charleskeepax @rfvirgil Any idea what might be the issue?

Regarding the speaker mute led,
Can you try

diff --git a/ucm2/codecs/cs42l43/init.conf b/ucm2/codecs/cs42l43/init.conf
index 0fbb517bd17b..0c48349276a5 100644
--- a/ucm2/codecs/cs42l43/init.conf
+++ b/ucm2/codecs/cs42l43/init.conf
@@ -24,4 +24,6 @@ FixedBootSequence [
        sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 1 Switch"
        sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 3 Switch"
        sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:cs42l43 Decimator 4 Switch"
+       sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:cs42l43 Speaker L Input 1"
+       sysw "-/class/sound/ctl-led/speaker/card${CardNumber}/attach:cs42l43 Speaker R Input 1"
 ]

This may not be the right place and may not be the right controls for speaker mute led. Needs @charleskeepax @rfvirgil 's comment.

@charleskeepax
Copy link

Certainly you are correct the right controls should be Decimator 1,3,4 Switch, not the HPF controls, as to how those incorrect controls are getting in there I am less certain. I wonder perhaps if numeric IDs could be getting retained whilst the controls are regenerated say if the sound card was reloaded. @pma1 could I confirm that you see those controls linked for the mic switch after a cold boot with no additional debug steps being followed?

21Q6 uses cs35l56 bridge speakers so I believe the correct speaker LED controls should be "AMPL Speaker Switch" and "AMPR Speaker Switch" rather than the cs42l43 ones. Someone is planning to have a look at this from our side as I don't think we can just blanket add those controls; they need to be conditional on the right system architecture being present. But for now adding those locally should get the LED working.

@pma1
Copy link
Author

pma1 commented Feb 18, 2025

@charleskeepax
Confirmed the controls and list output are the same after cold boot without any debug steps.

@bardliao
Copy link
Collaborator

@pma1 Can you list the control values before and after the mic mute led button is pressed?

numid=30,iface=MIXER,name='cs42l43 Decimator 1 Switch'
numid=34,iface=MIXER,name='cs42l43 Decimator 3 Switch'
numid=36,iface=MIXER,name='cs42l43 Decimator 4 Switch'
numid=208,iface=MIXER,name='Dmic0 Capture Switch'

@pma1
Copy link
Author

pma1 commented Feb 18, 2025

@bardliao

What value are you looking for?

The ctl-led/list always stays the same.

@bardliao
Copy link
Collaborator

@pma1 I meant the output of amixer cget name='cs42l43 Decimator 1 Switch' before and after the mic mute led button is pressed. And same as other related controls.

@pma1
Copy link
Author

pma1 commented Feb 18, 2025

@bardliao The laptop is out of reach now, I will get it to you asap.

@charleskeepax
Copy link

Ok I think the confusion here is in how one accesses the controls. I suspect if you do "amixer -D hw controls" the numbers will match those in the ctl-led list. Otherwise it turns out alsa will show the additional combined controls created by the UCM. Once that is confirmed, I agree with Bard the next step in debug will be to get the value of each of the controls with the system muted and unmuted. The LED will only light if all the controls are muted, so we need to see which control is not getting muted. The system should be host dmics, so it should be the "Dmic0 Capture Switch" that changes and all the cs42l43 controls should just sit at their default of muted. Although I guess if you have done past testing on this laptop it is possible alsa control restore is overwriting the defaults with an unmuted value.

@ujfalusi
Copy link
Collaborator

What is the conclusion on this? Is this a kernel issue at all or topology or UCM?

@ujfalusi ujfalusi added SDW Applies to SoundWire bus for codec connection topology Issues caused by topology labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SDW Applies to SoundWire bus for codec connection topology Issues caused by topology
Projects
None yet
Development

No branches or pull requests

8 participants