[alsa-devel] [PATCH] ASoC: have unique stream_names in codecs

Péter Ujfalusi peter.ujfalusi at ti.com
Fri Oct 5 16:47:43 CEST 2012


Hi,

On 10/05/2012 05:17 PM, Peter Meerwald wrote:
> From: Peter Meerwald <p.meerwald at bct-electronic.com>
> 
> for example, there are two 'Capture' stream_names in twl4030, resulting in
> 
> twl4030-codec twl4030-codec: ASoC: Failed to create Capture debugfs file
> 
> with debug enabled (fails to create two sysfs entries named 'Capture' under
> /sys/kernel/debug/asoc/omap3beagle/twl4030-codec/dapm

I have already sent patches for twl4040 and twl6040 and they should have been
applied:
twl4030:
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-September/055683.html

twl6040:
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-September/055684.html
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-October/055959.html

Also: if you just change the stream name you might end up with non working
audio since the stream name matching will no longer work.

-- 
Péter

> 
> this patch tries to avoid duplicate stream_names
> 
> Signed-off-by: Peter Meerwald <p.meerwald at bct-electronic.com>
> ---
>  sound/soc/codecs/stac9766.c |    4 ++--
>  sound/soc/codecs/twl4030.c  |    4 ++--
>  sound/soc/codecs/twl6040.c  |    2 +-
>  sound/soc/codecs/uda1380.c  |    4 ++--
>  sound/soc/codecs/wm8753.c   |    4 ++--
>  5 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c
> index 33c0f3d..3379119 100644
> --- a/sound/soc/codecs/stac9766.c
> +++ b/sound/soc/codecs/stac9766.c
> @@ -300,14 +300,14 @@ static struct snd_soc_dai_driver stac9766_dai[] = {
>  
>  	/* stream cababilities */
>  	.playback = {
> -		.stream_name = "stac9766 analog",
> +		.stream_name = "stac9766 playback",
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = SNDRV_PCM_RATE_8000_48000,
>  		.formats = SND_SOC_STD_AC97_FMTS,
>  	},
>  	.capture = {
> -		.stream_name = "stac9766 analog",
> +		.stream_name = "stac9766 capture",
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = SNDRV_PCM_RATE_8000_48000,
> diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
> index 391fcfc..55582db 100644
> --- a/sound/soc/codecs/twl4030.c
> +++ b/sound/soc/codecs/twl4030.c
> @@ -2172,7 +2172,7 @@ static struct snd_soc_dai_driver twl4030_dai[] = {
>  		.formats = TWL4030_FORMATS,
>  		.sig_bits = 24,},
>  	.capture = {
> -		.stream_name = "Capture",
> +		.stream_name = "HiFi Capture",
>  		.channels_min = 2,
>  		.channels_max = 4,
>  		.rates = TWL4030_RATES,
> @@ -2189,7 +2189,7 @@ static struct snd_soc_dai_driver twl4030_dai[] = {
>  		.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
>  		.formats = SNDRV_PCM_FMTBIT_S16_LE,},
>  	.capture = {
> -		.stream_name = "Capture",
> +		.stream_name = "Voice Capture",
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
> diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
> index c084c54..6f3a9cf 100644
> --- a/sound/soc/codecs/twl6040.c
> +++ b/sound/soc/codecs/twl6040.c
> @@ -1046,7 +1046,7 @@ static struct snd_soc_dai_driver twl6040_dai[] = {
>  {
>  	.name = "twl6040-ul",
>  	.capture = {
> -		.stream_name = "Capture",
> +		.stream_name = "Capture UL",
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = TWL6040_RATES,
> diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
> index 2502214..d780fe7 100644
> --- a/sound/soc/codecs/uda1380.c
> +++ b/sound/soc/codecs/uda1380.c
> @@ -671,7 +671,7 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
>  { /* playback only - dual interface */
>  	.name = "uda1380-hifi-playback",
>  	.playback = {
> -		.stream_name = "Playback",
> +		.stream_name = "Playback Only",
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = UDA1380_RATES,
> @@ -682,7 +682,7 @@ static struct snd_soc_dai_driver uda1380_dai[] = {
>  { /* capture only - dual interface*/
>  	.name = "uda1380-hifi-capture",
>  	.capture = {
> -		.stream_name = "Capture",
> +		.stream_name = "Capture Only",
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = UDA1380_RATES,
> diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
> index 13bff87..783ac20 100644
> --- a/sound/soc/codecs/wm8753.c
> +++ b/sound/soc/codecs/wm8753.c
> @@ -1400,7 +1400,7 @@ static struct snd_soc_dai_driver wm8753_dai[] = {
>  		.formats = WM8753_FORMATS
>  	},
>  	.capture = { /* dummy for fast DAI switching */
> -		.stream_name = "Capture",
> +		.stream_name = "HiFi Capture",
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = WM8753_RATES,
> @@ -1418,7 +1418,7 @@ static struct snd_soc_dai_driver wm8753_dai[] = {
>  		.formats = WM8753_FORMATS,
>  	},
>  	.capture = {
> -		.stream_name = "Capture",
> +		.stream_name = "Voice Capture",
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = WM8753_RATES,
> 




More information about the Alsa-devel mailing list