Substream value is currently hardcoded to SNDRV_PCM_SUBFORMAT_STD. Update the constraint procedure so that subformat selection is not ignored.
Signed-off-by: Cezary Rojewski cezary.rojewski@intel.com --- sound/core/pcm_native.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 39a65d1415ab..cb2745f80af3 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -2618,6 +2618,8 @@ static int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream) int err; unsigned int mask = 0;
+ /* All PCMs support at least the default STD subformat. */ + hw->subformats |= PARAM_MASK_BIT(SNDRV_PCM_SUBFORMAT_STD); if (hw->info & SNDRV_PCM_INFO_INTERLEAVED) mask |= PARAM_MASK_BIT(SNDRV_PCM_ACCESS_RW_INTERLEAVED); if (hw->info & SNDRV_PCM_INFO_NONINTERLEAVED) @@ -2638,8 +2640,7 @@ static int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream) if (err < 0) return err;
- err = snd_pcm_hw_constraint_mask(runtime, SNDRV_PCM_HW_PARAM_SUBFORMAT, - PARAM_MASK_BIT(SNDRV_PCM_SUBFORMAT_STD)); + err = snd_pcm_hw_constraint_mask(runtime, SNDRV_PCM_HW_PARAM_SUBFORMAT, hw->subformats); if (err < 0) return err;