Skip to content

ASoC: improve codec to codec link support

Jerome Brunet alsa-devel linux-amlogic linux-devicetree lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 6 repliesIn review
  2. v16 patches 4 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6ASoC: codec2codec: run callbacks in ordersound/soc/soc-dapm.c+27 -91 reply
2/6ASoC: codec2codec: name link using stream directionsound/soc/soc-dapm.c+4 -81 reply
3/6ASoC: codec2codec: deal with params when necessarysound/soc/soc-dapm.c+92 -671 reply
4/6ASoC: create pcm for codec2codec links as wellsound/soc/soc-core.c sound/soc/soc-pcm.c+44 -331 reply
5/6ASoC: codec2codec: remove ephemeral variablessound/soc/soc-dapm.c+42 -301 reply
6/6ASoC: codec2codec: fill some of the runtime stream parameterssound/soc/soc-dapm.c+5 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] ASoC: improve codec to codec link support

As explained in this previous series [0], on Amlogic, we are using codec to codec links to deal with the glue which is between the i2s backends and the synopsys hdmi controller.

This worked well until I tried to .get_eld() support in the dw-hdmi-i2s driver. Doing so adds channel mapping controls to the codec. This shown several problem

1) .pcm_new() is not called on codec to codec links. struct snd_soc_pcm_runtime do not even have a valid .pcm
2) struct snd_pcm_substream and struct snd_pcm_runtime are ephemeral This is a problem if a control needs to access them

The goal of this patchset is to resolve the above issues and improve the codec to codec link support enough to correctly handle the hdmi-codec

The support of these codec to codec links could probably be improved in the future to behave like any other link and use soc_pcm_open(), soc_pcm_hw_params(), etc...

The challenge lies in the dapm mutex. The soc_pcm call dapm function locking this mutex but the dapm mutex is already held in snd_soc_dai_link_event()

Changes since v1 [1]:
* Fix rebase on Murimoto-san's patches
* Allocate params dynamically again and refactor the pre_pmu code to simplify the error handling and rollback a bit

[0]: https://lkml.kernel.org/r/[email protected]
[1]: https://lkml.kernel.org/r/[email protected]

Jerome Brunet (6):
ASoC: codec2codec: run callbacks in order
ASoC: codec2codec: name link using stream direction
ASoC: codec2codec: deal with params when necessary
ASoC: create pcm for codec2codec links as well
ASoC: codec2codec: remove ephemeral variables
ASoC: codec2codec: fill some of the runtime stream parameters

 sound/soc/soc-core.c |  42 +++------
 sound/soc/soc-dapm.c | 220 +++++++++++++++++++++++++++----------------
 sound/soc/soc-pcm.c  |  35 ++++++-
 3 files changed, 182 insertions(+), 115 deletions(-)
Signature · 1 line
2.21.0