mbox series

[v4,00/16] ASoC: Add Audio Graph Card2 support

Message ID 87a6jn56x0.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
Headers show
Series ASoC: Add Audio Graph Card2 support | expand

Message

Kuninori Morimoto Oct. 6, 2021, 12:32 a.m. UTC
Hi Mark

We already have Audio-Graph-Card which is Of-Graph base general sound
card driver. Basically it supports basic CPU-Codec connection, and is
also supporting DPCM connection. Because it was forcibly expanded to
DPCM, DT parsing is very limited and very difficult to add new features
on it, for example Multi-CPU/Codec support, Codec2Codec support, etc.

This patch adds more flexible new Audio-Graph-Card2 driver for it.
Audio-Graph-Card and Audio-Graph-Card2 are similar, but don't have
full compatibility.
The reason why I need Audio-Graph-Card2 instead of updating Audio-Graph-Card
is that it is very difficult to keep compatibility.

Audio-Graph-Card2 supports Normal/DPCM/Codec2Codec Connection wich
Single/Multi DAIs. And it is possible to Customizing.

This patch-set adds Audio-Graph-Card2 driver and its custom driver
sample, and DT settings sample which can be used for testing.

To enable testing/debuging, this patch-set also adds Test-Component
driver. We already have Dummy Component and/or Dummy DAI on soc-utils,
but 1) we can't use it from DT, 2) it do nothing.
Added new Test-Component can be used from DT, and it can indicate called
function name. We can use it to trace callback order, understanding
ALSA SoC behavior, etc, etc...
Sample DT settings of Audio Graph Card2 is using Test-Component as CPU/Codec DAI.

You can easily try to use/test it if you added below line to your DT file.
Your .config needs to have below CONFIGs to use/test it.
It will probe sample Sound Card which has Normal/DPCM/Multi/Codec2Codec
connections.

	#include "../../../../../sound/soc/generic/audio-graph-card2-custom-sample.dtsi"

	CONFIG_SND_AUDIO_GRAPH_CARD2
	CONFIG_SND_AUDIO_GRAPH_CARD2_CUSTOM_SAMPLE
	CONFIG_SND_TEST_COMPONENT

Because Audio Graph Card2 is still under experimental stage, it will
indicate such warning when probing, and the DT might be updated/exchanged.

It can use Codec2Codec, but it will start automatically when probed,
and can't stop it so far. It should be updated.

Link: https://lore.kernel.org/r/87k0xszlep.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/871r8u4s6q.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87a6mhwyqn.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87tuitusy4.wl-kuninori.morimoto.gx@renesas.com

v1 -> v2
	- don't use "port" base for_each loop

v2 -> v3
	- Rename audio-graph-card2 to rich-graph-card
	- Rename DSP to DPCM not to confuse
	- Normal/DPCM/Codec2Codec can use Single/Multi DAIs.
	- use dpcm/multi/codec2codec node instead of using extra compatible
	- Sample DTSI patch is separated to Single/Multi.

v3 -> v4
	- Rename rich-graph-card to audio-graph-card2
	- fixup custom sample driver's connection bug
	- test-component compatible uses "verbose" instead of "vv"

Kuninori Morimoto (16):
  ASoC: test-component: add Test Component YAML bindings
  ASoC: test-component: add Test Component for Sound debug/test
  ASoC: simple-card-utils: add asoc_graph_is_ports0()
  ASoC: simple-card-utils: add codec2codec support
  ASoC: add Audio Graph Card2 driver
  ASoC: audio-graph-card2: add Multi CPU/Codec support
  ASoC: audio-graph-card2: add DPCM support
  ASoC: audio-graph-card2: add Codec2Codec support
  ASoC: add Audio Graph Card2 Yaml Document
  ASoC: add Audio Graph Card2 Custom Sample
  ASoC: audio-graph-card2-custom-sample.dtsi: add Sample DT for Normal (Single)
  ASoC: audio-graph-card2-custom-sample.dtsi: add Sample DT for Normal (Nulti)
  ASoC: audio-graph-card2-custom-sample.dtsi: add DPCM sample (Single)
  ASoC: audio-graph-card2-custom-sample.dtsi: add DPCM sample (Multi)
  ASoC: audio-graph-card2-custom-sample.dtsi: add Codec2Codec sample (Single)
  ASoC: audio-graph-card2-custom-sample.dtsi: add Codec2Codec sample (Multi)

 .../bindings/sound/audio-graph-card2.yaml     |   57 +
 .../bindings/sound/test-component.yaml        |   33 +
 include/sound/graph_card.h                    |   21 +
 include/sound/simple_card_utils.h             |    4 +
 sound/soc/generic/Kconfig                     |   20 +
 sound/soc/generic/Makefile                    |    6 +
 .../generic/audio-graph-card2-custom-sample.c |  174 +++
 .../audio-graph-card2-custom-sample.dtsi      |  227 +++
 sound/soc/generic/audio-graph-card2.c         | 1281 +++++++++++++++++
 sound/soc/generic/simple-card-utils.c         |   46 +-
 sound/soc/generic/test-component.c            |  659 +++++++++
 11 files changed, 2527 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card2.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/test-component.yaml
 create mode 100644 sound/soc/generic/audio-graph-card2-custom-sample.c
 create mode 100644 sound/soc/generic/audio-graph-card2-custom-sample.dtsi
 create mode 100644 sound/soc/generic/audio-graph-card2.c
 create mode 100644 sound/soc/generic/test-component.c

Comments

Kuninori Morimoto Oct. 11, 2021, 5:52 a.m. UTC | #1
Hi Mark

> v1 -> v2
> 	- don't use "port" base for_each loop
> 
> v2 -> v3
> 	- Rename audio-graph-card2 to rich-graph-card
> 	- Rename DSP to DPCM not to confuse
> 	- Normal/DPCM/Codec2Codec can use Single/Multi DAIs.
> 	- use dpcm/multi/codec2codec node instead of using extra compatible
> 	- Sample DTSI patch is separated to Single/Multi.
> 
> v3 -> v4
> 	- Rename rich-graph-card to audio-graph-card2
> 	- fixup custom sample driver's connection bug
> 	- test-component compatible uses "verbose" instead of "vv"

I'm looking forward to get your review.
Now, I noticed that v4 has some miss/unclear at comment area.
So, I want to post v5.

I will wait your review if you have something, then merge fixup into v5.
Please let me know if no review/comment, I will post v5 soon.

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Mark Brown Oct. 11, 2021, 11:08 a.m. UTC | #2
On Mon, Oct 11, 2021 at 02:52:49PM +0900, Kuninori Morimoto wrote:

> I will wait your review if you have something, then merge fixup into v5.
> Please let me know if no review/comment, I will post v5 soon.

I don't really have anything - I was actually just leaving it a little
bit in case anyone else had any comments.  Please just go ahead and
post.
Kuninori Morimoto Oct. 12, 2021, 4:19 a.m. UTC | #3
Hi Mark

> > I will wait your review if you have something, then merge fixup into v5.
> > Please let me know if no review/comment, I will post v5 soon.
> 
> I don't really have anything - I was actually just leaving it a little
> bit in case anyone else had any comments.  Please just go ahead and
> post.

OK, thanks.
Nice to know

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Mark Brown Oct. 15, 2021, 7:42 p.m. UTC | #4
On 06 Oct 2021 09:32:59 +0900, Kuninori Morimoto wrote:
> We already have Audio-Graph-Card which is Of-Graph base general sound
> card driver. Basically it supports basic CPU-Codec connection, and is
> also supporting DPCM connection. Because it was forcibly expanded to
> DPCM, DT parsing is very limited and very difficult to add new features
> on it, for example Multi-CPU/Codec support, Codec2Codec support, etc.
> 
> This patch adds more flexible new Audio-Graph-Card2 driver for it.
> Audio-Graph-Card and Audio-Graph-Card2 are similar, but don't have
> full compatibility.
> The reason why I need Audio-Graph-Card2 instead of updating Audio-Graph-Card
> is that it is very difficult to keep compatibility.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/16] ASoC: test-component: add Test Component YAML bindings
        commit: 5dd7e163e71f4b9a82c35f0bc2af3d7c5b1fb7f5
[02/16] ASoC: test-component: add Test Component for Sound debug/test
        commit: d293abc0c8fbb7b1610b9f7497323028b06cd5f8
[03/16] ASoC: simple-card-utils: add asoc_graph_is_ports0()
        commit: 92939252458fa279d0013e5dc545a98a4ca4064a
[04/16] ASoC: simple-card-utils: add codec2codec support
        commit: 52a18c291470e66a27f415b8c99136f25f55092e
[05/16] ASoC: add Audio Graph Card2 driver
        commit: 6e5f68fe3f2d35046856572fa037a5149d55a070
[06/16] ASoC: audio-graph-card2: add Multi CPU/Codec support
        commit: c8c74939f791ccbbfff988aec5f929374dbef2a6
[07/16] ASoC: audio-graph-card2: add DPCM support
        commit: f03beb55a831bc7575b3c8882bf8fa6c81198eca
[08/16] ASoC: audio-graph-card2: add Codec2Codec support
        commit: c3a15c92a67b701751c2680fa894d832570f7e7b
[09/16] ASoC: add Audio Graph Card2 Yaml Document
        commit: 466ac332bc5762de441d05f1314b8e7ef2c6dccb
[10/16] ASoC: add Audio Graph Card2 Custom Sample
        commit: 95373f36b9b810aa5461e3a864d7a3ad05b30b91
[11/16] ASoC: audio-graph-card2-custom-sample.dtsi: add Sample DT for Normal (Single)
        commit: c601fdf5c845b5bc416a1215cd22a7a786fcf268
[12/16] ASoC: audio-graph-card2-custom-sample.dtsi: add Sample DT for Normal (Nulti)
        commit: 5279bd8a842b88b24724dc6364b9850eacb5f490
[13/16] ASoC: audio-graph-card2-custom-sample.dtsi: add DPCM sample (Single)
        commit: e781759ab87b5b7bc4282faf08352e564c3eaf81
[14/16] ASoC: audio-graph-card2-custom-sample.dtsi: add DPCM sample (Multi)
        commit: cb2d94aa4d51e49f68ea02fe49225948467427bd
[15/16] ASoC: audio-graph-card2-custom-sample.dtsi: add Codec2Codec sample (Single)
        commit: 349b15ef9d535116ded20fd2ac945afce98b227e
[16/16] ASoC: audio-graph-card2-custom-sample.dtsi: add Codec2Codec sample (Multi)
        commit: baa274db99effe4fd85cf7bee70fecc8159be0cb

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark