Skip to content

Adding support for two Lenovo Laptops (P1 & P16) #10087

Closed

Description

@simontrimmer

(Moving from thesofproject/linux#5480)

@bardliao looped us into a conversation - there are a few Lenovo products coming that require quirking in sof_sdw.c and some new topology files.

An issue was the ordering of the arl match table ( https://patch.msgid.link/20250626141841.77780-1-ckeepax@opensource.cirrus.com ), I've just sent a patch to Mark to add a few entries to the sof_sdw_ssid_quirk_table[] to activate the SOC_SDW_CODEC_MIC on these SSIDs ( https://lore.kernel.org/linux-sound/20250702112235.377479-1-simont@opensource.cirrus.com/ )

That done these products then look to load topologies that are new, here are the gathered IDs:

sof-arl-cs42l43-l0-cs35l56-l2-2ch.tplg
[ 9.719802] sof_sdw sof_sdw: create dai link SDW0-Playback-SimpleJack, id 0
[ 9.719805] sof_sdw sof_sdw: create dai link SDW0-Capture-SimpleJack, id 1
[ 9.719807] sof_sdw sof_sdw: create dai link SDW2-Playback-SmartAmp, id 2
[ 9.719808] sof_sdw sof_sdw: create dai link dmic01, id 3
[ 9.719809] sof_sdw sof_sdw: create dai link dmic16k, id 4
[ 9.719810] sof_sdw sof_sdw: create dai link iDisp1, id 5
[ 9.719811] sof_sdw sof_sdw: create dai link iDisp2, id 6
[ 9.719812] sof_sdw sof_sdw: create dai link iDisp3, id 7

sof-arl-cs42l43-l2-cs35l56-l3-2ch.tplg
[ 5.534309] sof_sdw sof_sdw: create dai link SDW2-Playback-SimpleJack, id 0
[ 5.534311] sof_sdw sof_sdw: create dai link SDW2-Capture-SimpleJack, id 1
[ 5.534313] sof_sdw sof_sdw: create dai link SDW3-Playback-SmartAmp, id 2
[ 5.534314] sof_sdw sof_sdw: create dai link dmic01, id 3
[ 5.534314] sof_sdw sof_sdw: create dai link dmic16k, id 4
[ 5.534315] sof_sdw sof_sdw: create dai link iDisp1, id 5
[ 5.534316] sof_sdw sof_sdw: create dai link iDisp2, id 6
[ 5.534317] sof_sdw sof_sdw: create dai link iDisp3, id 7

I made a patch to build them - but testing feedback is that the recording level of the dmic is low. I'm wondering if that is related to building the topology from an old branch (v2.11.1) or whether more cmake magic is required, I know @singalsu was doing some cmake magic recently so wonder if he had any suggestions?

I'll make a PR with the code in it, but the entries I added to tools/topology/topology2/production/tplg-targets-ace1.cmake are (and attached):

"cavs-sdw;sof-arl-cs42l43-l0-cs35l56-l2-2ch;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,
NUM_DMICS=2,PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,DMIC0_ID=3,DMIC1_ID=4,
HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7"

"cavs-sdw;sof-arl-cs42l43-l2-cs35l56-l3-2ch;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,
NUM_DMICS=2,PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,DMIC0_ID=3,DMIC1_ID=4,
HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7"

0001-topology2-Add-sof-arl-cs42l43-l2-cs35l56-l3-2ch-supp.patch
0002-topology2-Add-sof-arl-cs42l43-l0-cs35l56-l2-2ch-supp.patch

Activity

  1. simontrimmer commented on Jul 10, 2025

    @simontrimmer
    ContributorAuthor

    @bardliao & @singalsu , if we can't see anything wrong with the patches I've proffered shall we merge and work out why the DMICs are quiet from there?

  2. bardliao commented on Jul 11, 2025

    @bardliao
    Collaborator

    @simontrimmer The patches are included in thesofproject/linux#5485. I will merge it if the CI test looks good. @singalsu is currently on vacation. I am not sure if it is the right solution, but can you add
    DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,EFX_DMIC0_DRC_PARAMS=dmic_default
    to your tplg-targets-ace1.cmake and see if it helps?
    Like

    "cavs-sdw;sof-arl-cs42l43-l0-cs35l56-l2-2ch;PLATFORM=mtl,NUM_SDW_AMP_LINKS=1,
    SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,
    SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,
    NUM_DMICS=2,PDM1_MIC_A_ENABLE=0,PDM1_MIC_B_ENABLE=0,DMIC0_ID=3,DMIC1_ID=4,
    HDMI1_ID=5,HDMI2_ID=6,HDMI3_ID=7, DMIC0_ENHANCED_CAPTURE=true,
    EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,EFX_DMIC0_DRC_PARAMS=dmic_default"

    And, not related to this issue, but we need to create nhlt bin for debug purpose.
    Like PREPROCESS_PLUGINS=nhlt,NHLT_BIN=sof-arl-cs42l43-l0-cs35l56-l2-2ch.bin

  3. simontrimmer commented on Jul 15, 2025

    @simontrimmer
    ContributorAuthor

    I've got some unrelated technical problems I'm working through, but I just looked back at this and had a thought - the platform in question is an ARL so should these entries be in the ace1 cmake and should the PLATFORM be something other than mtl?

  4. bardliao commented on Jul 16, 2025

    @bardliao
    Collaborator

    I've got some unrelated technical problems I'm working through, but I just looked back at this and had a thought - the platform in question is an ARL so should these entries be in the ace1 cmake and should the PLATFORM be something other than mtl?

    There is no difference between ARL and MTL on the topology part. So, it is correct that add the arl topologies in the ace1 cmake and set PLATFORM=mtl.

  5. simontrimmer commented on Jul 16, 2025

    @simontrimmer
    ContributorAuthor

    Good!

    FYI - I sent a top-of-tree build of these topology files with these suggested changes for testing on target yesterday

  6. simontrimmer commented on Jul 17, 2025

    @simontrimmer
    ContributorAuthor

    Feedback was good - updated the PR !

  7. bardliao commented on Jul 18, 2025

    @bardliao
    Collaborator

    Feedback was good - updated the PR !

    @simontrimmer Sorry but which PR are you referring to?

  8. simontrimmer commented on Jul 18, 2025

    @simontrimmer
    ContributorAuthor

    @bardliao the branch at least! PR created #10123

  9. singalsu commented on Jul 21, 2025

    @singalsu
    Collaborator

    Thanks @bardliao @simontrimmer ! Yep, the patch add to enable DRC and beamformer looks good. It enables the capture pre-preprocessing with a generic setup for the algorithms.

    @simontrimmer It's also possible to use bespoke tuning for capture and render processing (SOF equalizers, DRC, beamformer) via UCM2 DMI ID based scripts, see https://github.com/alsa-project/alsa-ucm-conf/tree/master/ucm2/blobs/sof and https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/Intel/sof-hda-dsp/dsp.conf . Though the example is only for a very simple UP2 board. The UCM variables to set names vary a bit for HDA and SDW topologies with/without DMIC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions