sof
sof copied to clipboard
topology2: Add rt5682+max98357a support
make topology2_sof-mtl-max98357a-rt5682
localhost ~ # aplay -l **** List of PLAYBACK Hardware Devices **** card 0: sofrt5682 [sof-rt5682], device 0: Headset () [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: sofrt5682 [sof-rt5682], device 1: dummy-spk () [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: sofrt5682 [sof-rt5682], device 5: HDMI1 () [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: sofrt5682 [sof-rt5682], device 6: HDMI2 () [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: sofrt5682 [sof-rt5682], device 7: HDMI3 () [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: sofrt5682 [sof-rt5682], device 8: HDMI4 () [] Subdevices: 1/1 Subdevice #0: subdevice #0 localhost ~ # arecord -l **** List of CAPTURE Hardware Devices **** card 0: sofrt5682 [sof-rt5682], device 0: Headset (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0
Signed-off-by: Yong Zhi [email protected]
@yongzhi1 any update ?
V2:
- updated PCM.1 name from "dummy-spk" to "Speakers"
- updated NHLT_BIN name to nhlt-ace-mtl-rt5682.bin
- removed quote around pipeline_id "N"
- added DMIC pipelines
- *change SSP1's direction to duplex instead of playback
For the last change, not sure if this is a bug, without the change, capture on SSP0 will fail for:
[ 255.224147] sof-audio-pci-intel-mtl 0000:00:1f.3: no matching blob for sample rate: 48000 sample width: 32 channels: 2 [ 255.236138] sof-audio-pci-intel-mtl 0000:00:1f.3: failed to prepare widget copier.SSP.8.1 [ 255.245289] sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to prepare connected widgets [ 255.254045] sof-audio-pci-intel-mtl 0000:00:1f.3: error: failed widget list set up for pcm 0 dir 1 [ 255.264093] sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -22 [ 255.276045] Headset: ASoC: __soc_pcm_hw_params() failed (-22) [ 255.282591] Headset: ASoC: dpcm_fe_dai_hw_params failed (-22)
- *change SSP1's direction to duplex instead of playback
For the last change, not sure if this is a bug, without the change, capture on SSP0 will fail for:
[ 255.224147] sof-audio-pci-intel-mtl 0000:00:1f.3: no matching blob for sample rate: 48000 sample width: 32 channels: 2 [ 255.236138] sof-audio-pci-intel-mtl 0000:00:1f.3: failed to prepare widget copier.SSP.8.1 [ 255.245289] sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to prepare connected widgets [ 255.254045] sof-audio-pci-intel-mtl 0000:00:1f.3: error: failed widget list set up for pcm 0 dir 1 [ 255.264093] sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -22 [ 255.276045] Headset: ASoC: __soc_pcm_hw_params() failed (-22) [ 255.282591] Headset: ASoC: dpcm_fe_dai_hw_params failed (-22)
@juimonen Could you take a look? It seems that NHLT will be generated according to the last SSP definition.
V3
- changed SSP1 direction back from "duplex" to "playback" (tplg build and tested with https://github.com/juimonen/alsa-utils/tree/dai_index_fix)
@yongzhi1 does this pend on any recent unmerged fixes from @juimonen ?
@yongzhi1 does this pend on any recent unmerged fixes from @juimonen ?
Yes, that's correct - it depends on the dai_index fix to generate the working tplg for headset recording, but the conf itself should be OK :)
Can one of the admins verify this patch?
V4 update:
- Rename NHLT bin file.
- Use volume/mixer for SSP playback.
Just try to bring the code closer to its final form even thought the maturity of mixer is not ready.
@plbossart @juimonen @bardliao any comments on the updates ?
V5:
Cosmetic updates.
@yongzhi1 can you confirm the version of alsatplg you are using. It looks like the CI could be using an older version ?
[2/709] Generating sof-mtl-max98357a-rt5682.tplg
find_modes(): fs not set
alsatplg: malloc.c:2379: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted (core dumped)
@yongzhi1 can you confirm the version of alsatplg you are using. It looks like the CI could be using an older version ?
[2/709] Generating sof-mtl-max98357a-rt5682.tplg find_modes(): fs not set alsatplg: malloc.c:2379: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. Aborted (core dumped)
Hi, @lgirdwood , thank you for noticing, how to get https://github.com/alsa-project/alsa-utils/pull/162 merged?
@yongzhi1 can you confirm the version of alsatplg you are using. It looks like the CI could be using an older version ?
[2/709] Generating sof-mtl-max98357a-rt5682.tplg find_modes(): fs not set alsatplg: malloc.c:2379: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. Aborted (core dumped)
Hi, @lgirdwood , thank you for noticing, how to get alsa-project/alsa-utils#162 merged?
@ranj063 @juimonen should we send this patch to the mailing list instead ?
@ranj063 @juimonen should we send this patch to the mailing list instead ?
@lgirdwood alsaproject PR's always generate an email to the mailing list as well. In the past we've always pinged @perexg on the PR's to get his attention and looks like Yong has already done it.
The more important thing though would be to update our CI docker with the change in alsautils
Thank you @ranj063 for the hint, the alsa-utils patch got merged :)
Thank you @ranj063 for the hint, the alsa-utils patch got merged :)
@marc-hb can you update the container with latest alsa-utils git when convenient. Thanks !
v6:
Added default value for USE_CHAIN_DMA to fix build err.
v7:
Rebase due to topology dir structure changes.