About Cleanup ASoC

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue May 24 06:40:24 CEST 2022


Hi ASoC
Cc Mark, Pierre-Louis, Cezary

I have very interesting to clean up ASoC.
I think it is still very complex, thus, non flexible.
I'm thinking that we want to cleanup...

	- Component with multi Card connection
	- fixed playback vs capture
	- fixed CPU vs Codec
	- DPCM connection vs normal connection

About first topic,
I guess the biggest reason why we have limitation is
its connections. Text based image is a little bit difficult,
but if my understanding was correct, current connections are...


	card <-> rtd <-> rtd <-> rtd <-> ...
	 |        |
	 +--------|-----+---------------+-----------+ (A)
	          |     |               |           |
	          +-> component ->  component -> component -> ...
		  |    (CPU)         (Codec)     (Platform)
		  |    |      |      |      |
	          +-> dai -> dai -> dai -> dai -> ...

Card has "component list", and Component has pointer to Card (A).
This makes the limitation which blocking multiple Card connections, I think.

One note here is that "Platform" doesn't have "DAI".

So if rtd have something other connector list, let's say "ep" list here for now,
instead of "dai", and remove Card <-> Component connection,
I think the connection can be simple, and the issue can be gone,
but what do you think ?

	card <-> rtd <-> rtd <-> rtd <-> ...
	          |
		  |   dai    dai    dai    dai
		  |    |      |      |      |
	          +--> ep --> ep --> ep -> ep -> ep -> ...
	               |      |      |      |     |
	              component     component   component
		       (CPU)         (Codec)    (Platform)

Here, ep is like this

	struct rtd_entry_point {
		struct list_head list;  // list for rtd
		struct struct snd_soc_pcm_runtime *rtd;
		struct snd_soc_component *component;
		struct snd_soc_dai *dai;
	};

Current for_each_xxx() can be like this

	for_each_rtd_components()  = for_each_rtd_ep() + ep_to_component()
	for_each_rtd_dais()        = for_each_rtd_ep() + ep_to_dai()
	for_each_card_components() = for_each_card_rtds() + for_each_rtd_components()

I guess Component can have multiple Card connection on this idea,
but what do you think ?

Maybe I'm misunderstanding and/or missing something, because ASoC
is complex enough :)
Please let me know if I was misunderstanding or missing.

Thank you for your help !!

Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list