Skip to content

IPC4: Add trigger reference counting in FE DAI trigger - #3957

Merged
plbossart merged 3 commits into
thesofproject:topic/sof-devfrom
ranj063:fix/trigger_refcount
Nov 1, 2022
Merged

plbossart merged 3 commits into
thesofproject:topic/sof-devfrom
ranj063:fix/trigger_refcount

Conversation

@ranj063

@ranj063 ranj063 commented Oct 25, 2022 •

Copy link
Copy Markdown
Collaborator

When there are shared pipelines between multiple PCMs, the triggering of pipeline states needs to be synchronized with the number of active PCMs that are using it. So we introduce a struct snd_sof_pipeline that can hold the information about how many PCMs are using the PCMs at any given time (started_count) and how many are paused (paused_count).

The started_count keeps track of the count of PCMs that are using a pipelines (including the ones that are paused). The paused_count keeps track of the PCM's that are using the pipeline but are paused. So there are 3 simple rules:

  1. A pipeline should be paused when all PCMs using it are paused.
  2. A pipeline should be set to RUNNING if it was never started or if all PCMs using it were previously paused
  3. A pipeline should be set to RESET if no PCM is using the pipeline ie when the started_count and paused_count are both 0

Loading
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.

6 participants