Re: [PATCH RFC v2 4/4] ASoC: add warning if the function is not support multi cpu yet.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@xxxxxxxxxxxxxxx]
> Sent: Thursday, January 16, 2020 9:50 AM
> To: Bard liao <yung-chuan.liao@xxxxxxxxxxxxxxx>; broonie@xxxxxxxxxx;
> tiwai@xxxxxxx
> Cc: liam.r.girdwood@xxxxxxxxxxxxxxx; alsa-devel@xxxxxxxxxxxxxxxx; Liao, Bard
> <bard.liao@xxxxxxxxx>; kuninori.morimoto.gx@xxxxxxxxxxx
> Subject: Re:  [PATCH RFC v2 4/4] ASoC: add warning if the function is
> not support multi cpu yet.
> 
> 
> 
> On 1/14/20 11:51 AM, Bard liao wrote:
> > Multi cpu is not supported by all functions yet. Add a warning message
> > to warn it.
> 
> Shouldn't we be consistent and return an error when we have an unexpected
> number of cpu dais? see below
> 
> >
> > Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
> > Signed-off-by: Bard liao <yung-chuan.liao@xxxxxxxxxxxxxxx>
> > ---
> >   sound/soc/soc-compress.c              |  7 ++++---
> >   sound/soc/soc-generic-dmaengine-pcm.c | 12 ++++++++++++
> >   sound/soc/soc-pcm.c                   | 12 ++++++++++++
> >   3 files changed, 28 insertions(+), 3 deletions(-)
> >
> > diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index
> > 223cd045719e..bf9d6a21bcd9 100644
> > --- a/sound/soc/soc-compress.c
> > +++ b/sound/soc/soc-compress.c
> > @@ -810,10 +810,11 @@ int snd_soc_new_compress(struct
> snd_soc_pcm_runtime *rtd, int num)
> >   	int playback = 0, capture = 0;
> >   	int i;
> >
> > -	if (rtd->num_codecs > 1) {
> > +	if (rtd->num_cpus > 1 ||
> > +	    rtd->num_codecs) {
> >   		dev_err(rtd->card->dev,
> > -			"Compress ASoC: Multicodec not supported\n");
> > -		return -EINVAL;
> > +			"Compress ASoC: Multi CPU/Codec not supported\n");
> > +		return -ENOTSUPP;
> 
> so this is an error...

Changing to -ENOTSUPP will prevent below to return error in
soc_init_pcm_runtime().

/* create compress_device if possible */
ret = snd_soc_dai_compress_new(cpu_dai, rtd, num);
if (ret != -ENOTSUPP) {
	if (ret < 0)
		dev_err(card->dev, "ASoC: can't create compress %s\n",
			dai_link->stream_name);
	return ret;
}

So it is to prevent an error actually. But I agree it is better to return
an error when we have an unexpected number of cpu dais. What do you
think? @Morimoto-san

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



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux