alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set
@ 2019-09-06  5:55 Peter Ujfalusi
  2019-09-09 10:07 ` [alsa-devel] Applied "ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set" to the asoc tree Mark Brown
  2019-09-10 12:07 ` [alsa-devel] [PATCH] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Takashi Iwai
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2019-09-06  5:55 UTC (permalink / raw)
  To: broonie, lgirdwood; +Cc: tiwai, alsa-devel, arthur.she

Some tools use the snd_pcm_info_get_name() to try to identify PCMs or for
other purposes.

Currently it is left empty with the dmaengine-pcm, in this case copy the
pcm->id string as pcm->name.

For example IGT is using this to find the HDMI PCM for testing audio on it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reported-by: Arthur She <arthur.she@linaro.org>
---
Hi,

this was actually reported for 4.14 kernel with omap-pcm (replaced by sdma-pcm
in v4.18), since then we only use the generic dmaengine PCM but the same issue
applies today.

Regards,
Peter

 sound/soc/soc-generic-dmaengine-pcm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 748f5f641002..d93db2c2b527 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -306,6 +306,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
 
 		if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i]))
 			pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE;
+
+		if (rtd->pcm->streams[i].pcm->name[0] == '\0') {
+			strncpy(rtd->pcm->streams[i].pcm->name,
+				rtd->pcm->streams[i].pcm->id,
+				sizeof(rtd->pcm->streams[i].pcm->name));
+		}
 	}
 
 	return 0;
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-09-11  7:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06  5:55 [alsa-devel] [PATCH] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Peter Ujfalusi
2019-09-09 10:07 ` [alsa-devel] Applied "ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set" to the asoc tree Mark Brown
2019-09-10 12:07 ` [alsa-devel] [PATCH] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Takashi Iwai
2019-09-10 14:23   ` Peter Ujfalusi
2019-09-10 14:46     ` Takashi Iwai
2019-09-10 14:50       ` Takashi Iwai
2019-09-11  7:22   ` Peter Ujfalusi
2019-09-11  7:46     ` Takashi Iwai

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