sof icon indicating copy to clipboard operation
sof copied to clipboard

Tools: Topology: Add echo reference for SDW speaker and jack

Open singalsu opened this issue 1 month ago • 6 comments

This patch adds an echo reference capture PCM for speaker and jack playback. The additions are normally disabled but can be enabled with build options SDW_JACK_ECHO_REF=true and/or SDW_SPK_ECHO_REF=true.

This depends on merge of https://github.com/thesofproject/sof/pull/10329

singalsu avatar Nov 21 '25 16:11 singalsu

This PR depends on https://github.com/thesofproject/sof/pull/10329 and kernel patch by @ranj063 .

singalsu avatar Nov 21 '25 16:11 singalsu

Build variants with echo reference, for both speaker and jack, just speaker, just jack, echoref but without speaker post-processing.

Echo reference for jack: sof-arl-cs42l43-l0-cs35l56-l23-echoref_jack

Echo reference for jack and speaker, no EQ and DRC. sof-arl-cs42l43-l0-cs35l56-l23-echoref_noenh

Echo reference for speaker: sof-arl-cs42l43-l0-cs35l56-l23-echoref_spk

Echo Reference for speaker and jack, with EQ and DRC for speaker: sof-arl-cs42l43-l0-cs35l56-l23-echoref

singalsu avatar Nov 21 '25 16:11 singalsu

Can echo ref be always available in the topology and switch on/off by opening the PCM ?

Yep, the PCMs can be used or ignored. If there is no playback and ref capture is done, it produces silence.

singalsu avatar Nov 24 '25 16:11 singalsu

Can echo ref be always available in the topology and switch on/off by opening the PCM ?

Yep, the PCMs can be used or ignored. If there is no playback and ref capture is done, it produces silence.

Perfect, lets do this so its available for general usage. This would need a new PCM ID. I assume this would capture playback if the playback PCM was in use ?

lgirdwood avatar Nov 25 '25 12:11 lgirdwood

I updated the virtual DAI name to LoopbackCapture_virtual_DAI, and added build for sof-ptl-rt721-echoref.tplg.

singalsu avatar Dec 10 '25 12:12 singalsu

The virtual DAI name is shortened to "Loopback_Virtual". The previous name was too long for kernel name limit. This matches the updated https://github.com/thesofproject/linux/pull/5609 .

singalsu avatar Dec 10 '25 17:12 singalsu

Updates: I removed the $JACK_RATE from speaker pipelines. Also I moved the basic host-copier output formats to class definition, so they don't need to be repeated for speaker. Same also for formats for siggen.

Also I tried to remove some formats definition stuff from virtual DAI to reduce tplg code amount but seems it's needed. Kernel parsed it but the formats appeared as 0 Hz and 0 bit, so I felt it wasn't safe to do.

singalsu avatar Dec 19 '25 10:12 singalsu