Re: [RFC PATCH 0/2] soundwire: multi-direction stream API
From: Pierre-Louis Bossart
Date: Wed Dec 02 2026 - 10:50:06 EST
On 12/2/26 12:36 AM, Srinivas Kandagatla wrote:
On 12/1/26 4:44 PM, Pierre-Louis Bossart wrote:There's yet another case that I just thought of, in the SDCA spec there are mentions of amplifiers providing speaker protection information to other amps, so that all amps adjust their volume. Amps could be on the same link or use low-latency loopback capabilities on the manager for the cross-link connections. Having this 'multi-stream' without any mention of direction could cover this case, what really matters is the prepare/activation done for all constituents.
On 11/30/26 11:40 PM, Srinivas Kandagatla wrote:
During Speaker Protection patches for Qualcomm SoCs, Pierre suggested
that we should add support to multi-direction in sdw_stream.
This patchset is to start that discussion on how these apis should look
like.
Thanks for starting this!
Some SoundWire codec-codec links drive more than one direction on the
same BE and the two directions are coupled on the bus: they share a
bring-up sequence and want to fail or succeed together. The first
in-tree case is WSA playback plus V/I-sense feedback on the same BE
(DSP speaker protection and thermal/excursion feedback).
Humm, maybe before we start looking further, can you clarify if the
feedback has the same format as the playback PCM? I vaguely recall that
some amplifiers use custom formats, e.g. 10bits, for IV sense. The
resolution doesn't need to be as precise as for PCM, does it?
For dai links with multi-direction flag there is a fixup callback where
we set the format constriants for VI in our speaker protection dai-link.
Not necessarly because the format for codec-to-codec like in this case
I initially thought that we could combine all ports for all
'constituents', but if they transport different data formats we do have
to stick with the rule 'one stream - one data format'.
is not necessarily same, VI module only supports fixed format.
The second question is whether the goal is to only deal with the
direction problem, or if we want a way to 'link' or 'bind' data streams
that need to be prepared together and later activated together. In that
case you could simplify the API to 'sdw_multi_stream' and forget about
the direction?
Its both. That is good idea.
That should not matter I guess, in that case codec-codec without any
The feedback in your example does flow in the opposite direction, but
for companion amps the data comes from the main amp. SDCA also has a
concept of a DSP-generated 'enhancement' stream that would flow in
parallel to the main playback stream.
multi-direction flag should work.
One important point is also that the concept of multiple streams iscorrect.
'hidden' below the ASoC dailink level, where I don't think we can work-
around the direction. This API would only be for low-level data that is
not exposed to userspace, ever.
IOW the Linux drivers would provide
configuration capability but no PCM devices/DMA support for thosetrue.
auxiliary streams.