public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Cezary Rojewski" <cezary.rojewski@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>,
	"Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Liam Girdwood" <liam.r.girdwood@linux.intel.com>,
	"Bard Liao" <yung-chuan.liao@linux.intel.com>
Subject: Re: ASoC component/card relationship
Date: Wed, 4 May 2022 11:27:08 -0500	[thread overview]
Message-ID: <a34be989-c5a9-a7ce-cff4-6fd83c45c9bf@linux.intel.com> (raw)
In-Reply-To: <e34d453b-1fbe-6e53-dc90-00580c9df9dd@intel.com>


>> 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.

Wow. I don't think anyone saw that concept in the code or comments....

That's not a bad idea, but is this really what the definition of
SND_SOC_TPLG_TUPLE_TYPE_STRING meant?

That's a de-facto ABI or strong convention between kernel and topology,
we'd probably need framework extensions to be on the safe side and deal
with variability in more 'controlled' way.

In the AVS example, the 'i2s_link_mask' is used, but in practice there
are cases where the information is only known by checking a package in
the DSDT (baytrail), a DMI quirk, an NHLT information, etc. We should
really plan for extensions with a callback into the topology parser.

> 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.

ok, but why even consider symlinks? Why not using the same topology name?

We are making things too hard for package maintainers, e.g. for SOF we
released 198 topologies already, that's not sustainable.

> 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.

I don't disagree here but you combined two capabilities in one. The
major simplification comes from the remapping or 'dynamic naming' to
quote your code, the split is a refinement.

Thanks for all the comments so far, good discussion indeed.

      reply	other threads:[~2022-05-04 16:28 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
2022-05-04 16:27               ` Pierre-Louis Bossart [this message]

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=a34be989-c5a9-a7ce-cff4-6fd83c45c9bf@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --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=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