public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: "Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
	"Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>,
	"Mark Brown" <broonie@kernel.org>
Cc: "ALSA Development Mailing List" <alsa-devel@alsa-project.org>,
	"Kuninori Morimoto" <kuninori.morimoto.gx@renesas.com>,
	"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
	"Curtis Malainey" <cujomalainey@google.com>,
	"Bard Liao" <yung-chuan.liao@linux.intel.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Liam Girdwood" <liam.r.girdwood@linux.intel.com>,
	"Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
Subject: Re: ASoC component/card relationship
Date: Wed, 4 May 2022 18:00:27 +0200	[thread overview]
Message-ID: <e34d453b-1fbe-6e53-dc90-00580c9df9dd@intel.com> (raw)
In-Reply-To: <2c2c1af4-9c40-841d-fc9e-486c3db482bd@linux.intel.com>

On 2022-05-04 5:26 PM, Pierre-Louis Bossart wrote:

>>> b) the hardware/board level parts. That is a weak part of the topology
>>> today, it should come from a hardware description instead of being
>>> hard-coded in each topology. We must have dozens of identical topology
>>> files that differ only because of the SSP index or SoundWire link ID
>>> used on specific board. There should be a way to 'remap' BEs for
>>> specific boards.
>>>
>>> It doesn't mean we should toss the topology and redo everything, the
>>> latter part can be addressed by providing the 'real' hardware
>>> information to the topology and dynamically modify defaults.
>>>
>>
>> I already showed how we tried to solve this for i2s use cases in links
>> above.
> 
> You still have N identical topologies, completely identical with the
> exception of 1 SSP index to maintain.
> 
> Just to make this point stronger, with the recent support of the ES8336
> codecs, we had to generate the following topologies to account for all
> permutations:
> 
> sof-apl-es8336-ssp0.tplg
> sof-apl-es8336-ssp2.tplg
> sof-cml-es8336-dmic2ch-ssp0.tplg
> sof-cml-es8336-dmic2ch-ssp2.tplg
> sof-cml-es8336-dmic4ch-ssp0.tplg
> sof-cml-es8336-dmic4ch-ssp2.tplg
> sof-cml-es8336-ssp0.tplg
> sof-cml-es8336-ssp2.tplg
> sof-glk-es8336-ssp0.tplg
> sof-glk-es8336-ssp2.tplg
> sof-jsl-es8336-dmic2ch-ssp0.tplg
> sof-jsl-es8336-dmic2ch-ssp2.tplg
> sof-jsl-es8336-dmic4ch-ssp0.tplg
> sof-jsl-es8336-dmic4ch-ssp2.tplg
> sof-jsl-es8336-ssp0.tplg
> sof-jsl-es8336-ssp2.tplg
> sof-tgl-es8336-dmic2ch-ssp0.tplg
> sof-tgl-es8336-dmic2ch-ssp2.tplg
> sof-tgl-es8336-dmic4ch-ssp0.tplg
> sof-tgl-es8336-dmic4ch-ssp2.tplg
> sof-tgl-es8336-ssp0.tplg
> sof-tgl-es8336-ssp2.tplg
> 
> All these topologies come from the same file, and generated using
> macros. That makes no sense to me, this should be the same topology that
> is remapped at run-time.


What Amadeo is explaining here is that AVS driver already addresses this 
too - at least in our opinion - see parse_link_formatted_string() in 
sound/soc/intel/avs/topology.c.

User is allowed to specify widget name as: ssp%d within the topology 
file, leaving kernel with responsibility to fill the missing index. And 
this is something I (perhaps we all) would like to see within the 
framework in the future.

In consequence, avs-driver user does NOT need to define N identical 
topologies. For example, SSP-test board [1] and its definition in 
board_selection.c [2] clearly show that all 6 SSP boards look at the 
exact same file. The same approach is used when speaking of other, 
simple i2s codecs, e.g.: rt274, rt286, rt298. Difference between rt298 
on APL and GML comes down to SSP port number. Here, board_selection.c 
shows different prefixes (apl- vs gml-) but the reality is that both 
files are symlinks looking at the exact same actual topology file with 
ssp%d specified as widget names.

At the same time, compound machine boards are still permitted and made 
use of, example being TDF8532/Dirana board for Automotive (not yet 
present on the list).

Really, flexibility is key here. As long as devices found on given 
platform are not connected or dependent on each other, there are no 
major objections preventing card split. Such code scales better and has 
good reuseability.


Regards,
Czarek


[1]: 
https://lore.kernel.org/alsa-devel/20220427081902.3525183-6-cezary.rojewski@intel.com/
[2]: 
https://lore.kernel.org/alsa-devel/20220426172346.3508411-11-cezary.rojewski@intel.com/

  parent reply	other threads:[~2022-05-04 16:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 21:55 ASoC component/card relationship Pierre-Louis Bossart
2022-04-29 22:32 ` Curtis Malainey
2022-05-02 15:06   ` Pierre-Louis Bossart
2022-05-02 20:06     ` Curtis Malainey
2022-05-03 18:10 ` Mark Brown
2022-05-03 18:59   ` Pierre-Louis Bossart
2022-05-03 20:31     ` Mark Brown
2022-05-03 21:42       ` Pierre-Louis Bossart
2022-05-04  9:21         ` Amadeusz Sławiński
2022-05-04 15:26           ` Pierre-Louis Bossart
2022-05-04 15:38             ` Jaroslav Kysela
2022-05-04 16:00             ` Cezary Rojewski [this message]
2022-05-04 16:27               ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e34d453b-1fbe-6e53-dc90-00580c9df9dd@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@google.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox