[alsa-devel] hdmi-codec: modifying params in hw_params() callback

Clemens Ladisch clemens at ladisch.de
Thu Feb 28 14:39:18 CET 2019


Russell King - ARM Linux admin wrote:
> While looking at hdmi-codec issues, I spotted this code:
>
> static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
>                                 struct snd_pcm_hw_params *params,
>                                 struct snd_soc_dai *dai)
> {
> ...
>         if (params_width(params) > 24)
>                 params->msbits = 24;
>
> [...]
> What's more is that the msbits is a parameter that is refined with
> userspace, so surely the above should be a declared constraint?

Yes, there should be a call to "snd_pcm_hw_constraint_msbits"
somewhere.

> So, all in all, it seems that the above code limiting msbits is
> redundant - nothing will read this modified value.  Can we kill it?

Yes.


Regards,
Clemens


More information about the Alsa-devel mailing list