From: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
alsa-devel@alsa-project.org
Cc: cezary.rojewski@intel.com, amadeuszx.slawinski@intel.com
Subject: Re: [PATCH v3 07/10] topology: decode: Fix decoding PCM formats and rates
Date: Wed, 15 Jul 2020 11:37:53 +0200 [thread overview]
Message-ID: <37b724ff-e485-8b7a-f16d-8cf8f8ac7c9b@linux.intel.com> (raw)
In-Reply-To: <bca4e102-f734-df31-17aa-686bc1463819@linux.intel.com>
On 2020-07-14 17:40, Pierre-Louis Bossart wrote:
>
>
> On 7/14/20 6:25 AM, Piotr Maziarz wrote:
>> Not checking _LAST format and rate, which are valid indexes in arrays,
>> makes data loss while converting binary to standard ALSA configuration
>> file.
>
> I must be really thick on this one.
>
> alsatplg converts from alsa-conf format to binary topology file.
> The binary topology file is used by drivers.
>
> In which cases would you convert from binary to alsa-conf files? And
> what tool would you use?
>
./alsatplg --decode topology.bin --output decoded_topology.conf,
This feature was added around the end of 2019. And why to use it? For
binary topologies to which conf files are lost for example. It's easier
to analyze and edit it in conf than directly in binary.
>
>> Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
>> ---
>> src/topology/pcm.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/topology/pcm.c b/src/topology/pcm.c
>> index b15b950..db40114 100644
>> --- a/src/topology/pcm.c
>> +++ b/src/topology/pcm.c
>> @@ -549,7 +549,7 @@ int tplg_save_stream_caps(snd_tplg_t *tplg
>> ATTRIBUTE_UNUSED,
>> if (err >= 0 && sc->formats) {
>> err = tplg_save_printf(dst, pfx, "\tformats '");
>> first = 1;
>> - for (i = 0; err >= 0 && i < SND_PCM_FORMAT_LAST; i++) {
>> + for (i = 0; err >= 0 && i <= SND_PCM_FORMAT_LAST; i++) {
>> if (sc->formats & (1ULL << i)) {
>> s = snd_pcm_format_name(i);
>> err = tplg_save_printf(dst, NULL, "%s%s",
>> @@ -563,7 +563,7 @@ int tplg_save_stream_caps(snd_tplg_t *tplg
>> ATTRIBUTE_UNUSED,
>> if (err >= 0 && sc->rates) {
>> err = tplg_save_printf(dst, pfx, "\trates '");
>> first = 1;
>> - for (i = 0; err >= 0 && i < SND_PCM_RATE_LAST; i++) {
>> + for (i = 0; err >= 0 && i <= SND_PCM_RATE_LAST; i++) {
>> if (sc->rates & (1ULL << i)) {
>> s = get_rate_name(i);
>> err = tplg_save_printf(dst, NULL, "%s%s",
>>
next prev parent reply other threads:[~2020-07-15 9:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-14 11:25 [PATCH v3 00/10] topology: decode: Various fixes Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 01/10] topology: decode: Fix channel map memory allocation Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 02/10] topology: decode: Fix infinite loop in decoding enum control Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 03/10] topology: decode: Remove decoding values for " Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 04/10] topology: decode: Add enum control texts as separate element Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 05/10] topology: decode: Fix printing texts section Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 06/10] topology: decode: Change declaration of enum decoding function Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 07/10] topology: decode: Fix decoding PCM formats and rates Piotr Maziarz
2020-07-14 15:40 ` Pierre-Louis Bossart
2020-07-15 9:37 ` Piotr Maziarz [this message]
2020-07-15 14:37 ` Pierre-Louis Bossart
2020-07-15 16:18 ` Cezary Rojewski
2020-07-14 11:25 ` [PATCH v3 08/10] topology: decode: Print sig_bits field in PCM capabilities section Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 09/10] topology: decode: Add DAI name printing Piotr Maziarz
2020-07-14 11:25 ` [PATCH v3 10/10] topology: Make buffer for saving dynamic size Piotr Maziarz
2020-07-15 14:47 ` [PATCH v3 00/10] topology: decode: Various fixes Pierre-Louis Bossart
2020-07-15 16:20 ` Cezary Rojewski
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=37b724ff-e485-8b7a-f16d-8cf8f8ac7c9b@linux.intel.com \
--to=piotrx.maziarz@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=amadeuszx.slawinski@intel.com \
--cc=cezary.rojewski@intel.com \
--cc=pierre-louis.bossart@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;
as well as URLs for NNTP newsgroup(s).