Re: [PATCH] ASoC: qcom: q6apm-lpass-dais: pass max number of channels to Audioreach

From: Mark Brown
Date: Mon Oct 23 2023 - 11:18:23 EST


On Wed, Oct 18, 2023 at 10:14:03AM +0200, Krzysztof Kozlowski wrote:
> On 17/10/2023 18:14, Krzysztof Kozlowski wrote:

> > Using the params_channels() helper when setting hw_params, results in
> > passing to Audioreach minimum number of channels valid for given
> > hardware. This is not valid for any hardware which sets minimum
> > channels to two and maximum to something bigger, like four channels.
> >
> > Instead pass the maximum number of supported channels to allow playback
> > of multi-channel formats.

> I am not sure if this is correct fix. I think sound machine drivers
> should just not override channels like:

You *can* get cases where machine specific wiring or clocking limits
mean that even if both ends of a link are capable of some number of
channels the actual limit is lower.

> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/qcom/sm8250.c?h=v6.6-rc6#n44

That's:

| static int sm8250_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
| struct snd_pcm_hw_params *params)

...

| rate->min = rate->max = 48000;
| channels->min = channels->max = 2;

which is DPCM which is it's own special thing - in this case it's saying
that whatever the front end takes in the thing that comes out of the SoC
will have been reformatted to 48kHz stereo (so mono will be turned into
stereo for example) which is a perfectly reasonable thing for a DSP to
do. See previous discussions of how we should handle this better, DPCM
isn't ideal.

Attachment: signature.asc
Description: PGP signature