From: Piotr Maziarz Date: Mon, 31 Aug 2020 09:09:02 +0000 (+0200) Subject: topology: decode: Add DAI name printing X-Git-Tag: v1.2.4~26 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=6b0fb2bc7e0cfac8e1aedfcad183ab247c85173d;p=alsa-lib.git topology: decode: Add DAI name printing DAI name is a part of topology binary. Not printing makes data loss while converting from binary to standard ALSA configuration file. Signed-off-by: Piotr Maziarz Reviewed-by: Cezary Rojewski Reviewed-by: Amadeusz Sławiński Reviewed-by: Pierre-Louis Bossart Signed-off-by: Jaroslav Kysela --- diff --git a/src/topology/pcm.c b/src/topology/pcm.c index 49c5eaba..5a54e153 100644 --- a/src/topology/pcm.c +++ b/src/topology/pcm.c @@ -781,7 +781,9 @@ int tplg_save_fe_dai(snd_tplg_t *tplg ATTRIBUTE_UNUSED, struct snd_soc_tplg_pcm *pcm = elem->pcm; int err = 0; - if (pcm->dai_id > 0) + if (strlen(pcm->dai_name)) + err = tplg_save_printf(dst, pfx, "dai.'%s'.id %u\n", pcm->dai_name, pcm->dai_id); + else if (pcm->dai_id > 0) err = tplg_save_printf(dst, pfx, "dai.0.id %u\n", pcm->dai_id); return err; }