mbox series

[RFC,v2,0/4] Add support for detection

Message ID 20241112114006.2812697-1-amadeuszx.slawinski@linux.intel.com (mailing list archive)
Headers show
Series Add support for detection | expand

Message

Amadeusz Sławiński Nov. 12, 2024, 11:40 a.m. UTC
Hi,

continuing discussion from [1] I've redone detection code to use
snd_pcm_prepare() to configure FW. However I have some concerns and
would like to clear up if we should keep working on this solution or
perhaps after all this is not the best way to do this?

My main concern is that if we decide to go this way we should really
implement something more advanced than what is currently done in patch 4.

FW pipelines need to follow specific state transition order:
CREATE -> RESET -> PAUSE -> RUNNING -> PAUSE -> RESET -> DELETE
so if we put pipeline into running state in prepare callback, and we
want to call prepare again (which as far as I know is allowed by ALSA
API), we need to pause pipeline first before resetting, pausing and
running it again to enable detection.

Additionally our FW uses pipelines and we group them on kernel side
under "paths" - assigned to FE and BE widgets. In reality we want to
have part of path (some pipelines) active, so we shouldn't represent
whole state of underlying pipelines by only setting path state.

Patch 1 is cleanup, which I will send separately when I have
confirmation from validation team that it doesn't break anything.
Patch 2-4 add support for starting detection using snd_pcm_prepare().

[1] https://lore.kernel.org/linux-sound/0c620aa7-ddad-42ae-b82f-91c4aaf80c83@linux.intel.com/T/#t

Amadeusz Sławiński (4):
  ASoC: Intel: avs: Simplify pipeline management
  ASoC: Intel: avs: Separate path state from pipeline state
  ASoC: Intel: avs: Run detecting paths during prepare
  ASoC: Intel: avs: Pause detecting pipeline before reset

 sound/soc/intel/avs/path.c     | 29 +++++++++++------
 sound/soc/intel/avs/path.h     |  9 ++++++
 sound/soc/intel/avs/pcm.c      | 57 ++++++++++++++++------------------
 sound/soc/intel/avs/topology.h |  1 +
 4 files changed, 55 insertions(+), 41 deletions(-)