Skip to content

Commit

Permalink
google_rtc_audio_processing.c: Ignore cross-pipeline triggers
Browse files Browse the repository at this point in the history
The pipeline code is complicated, and some trigger events (for example
reset of a playback pipeline that was started before capture) cross
pipelines from the playback/reference stream into the AEC component
unexpectedly.  Ignore/halt triggers we get from the reference
pipeline.

Also work around a bug with some stale code in IPC3 builds that
detects the lack of an active reference source as an "error"
incorrectly.

Signed-off-by: Andy Ross <[email protected]>
  • Loading branch information
andyross committed Jan 11, 2024
1 parent 1cc7a4c commit 5b2f6d7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/audio/google/google_rtc_audio_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,26 @@ static int google_rtc_audio_processing_prepare(struct processing_module *mod,
return 0;
}

static int trigger_handler(struct processing_module *mod, int cmd)
{
struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod);

/* Ignore and halt propagation if we get a trigger from the
* playback pipeline: not for us.
*/
if (cd->ref_comp_buffer->walking)
return PPL_STATUS_PATH_STOP;

/* Note: not module_adapter_set_state(). With IPC4 those are
* identical, but IPC3 has some odd-looking logic that
* validates that no sources are active when receiving a
* PRE_START command, which obviously breaks for our reference
* stream if playback was already running when our pipeline
* started
*/
return comp_set_state(mod->dev, cmd);
}

static int google_rtc_audio_processing_reset(struct processing_module *mod)
{
comp_dbg(mod->dev, "google_rtc_audio_processing_reset()");
Expand Down Expand Up @@ -757,6 +777,7 @@ static struct module_interface google_rtc_audio_processing_interface = {
.prepare = google_rtc_audio_processing_prepare,
.set_configuration = google_rtc_audio_processing_set_config,
.get_configuration = google_rtc_audio_processing_get_config,
.trigger = trigger_handler,
.reset = google_rtc_audio_processing_reset,
};

Expand Down

0 comments on commit 5b2f6d7

Please sign in to comment.