Skip to content

Conversation

@ujfalusi
Copy link
Collaborator

It is allowed to mix Link and Host DMA channels in a way that their index is different. In this case we would read the LLP from a channel which is not used or used for other operation.

Such case can be reproduced on cAVS2.5 or ACE1 platforms with soundwire configuration:
playback to SDW would take Host channel 0 (stream_tag 1) and no Link DMA used
Second playback to HDMI (HDA) would use Host channel 1 (stream_tag 2) and Link channel 0 (stream_tag 1).

In this case reading the LLP from channel 2 is incorrect as that is not the Link channel used fro the HDMI playback.

To correct this, we should look up the BE and get the channel used on the Link side.

Fixes: 67b182b ("ASoC: SOF: Intel: hda: Implement get_stream_position (Linear Link Position)")

{
struct hdac_stream *hstream = substream->runtime->private_data;
struct hdac_ext_stream *hext_stream = stream_to_hdac_ext_stream(hstream);
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ujfalusi this makes perfect sense. You just have a minor typo in the commit message, otherwise good to go: "fro"

@ujfalusi ujfalusi force-pushed the peter/sof/pr/llp-for-mixed-systems branch from 0780c39 to 0fa8568 Compare September 19, 2025 10:34
It is allowed to mix Link and Host DMA channels in a way that their index
is different. In this case we would read the LLP from a channel which is
not used or used for other operation.

Such case can be reproduced on cAVS2.5 or ACE1 platforms with soundwire
configuration:
playback to SDW would take Host channel 0 (stream_tag 1) and no Link DMA
used
Second playback to HDMI (HDA) would use Host channel 1 (stream_tag 2) and
Link channel 0 (stream_tag 1).

In this case reading the LLP from channel 2 is incorrect as that is not the
Link channel used for the HDMI playback.

To correct this, we should look up the BE and get the channel used on the
Link side.

Fixes: 67b182b ("ASoC: SOF: Intel: hda: Implement get_stream_position (Linear Link Position)")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
@ujfalusi
Copy link
Collaborator Author

Changes since v1:

  • typo in commit message fixed (fro -> for)

@bardliao bardliao merged commit e1e5f5d into thesofproject:topic/sof-dev Sep 22, 2025
10 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants