pcm: Add MSBITS subformat options

Improve granularity of format selection for S32/U32 formats by adding
masks representing 20, 24 and 32 most significant bits.

Closes: https://github.com/alsa-project/alsa-lib/pull/342
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Cezary Rojewski 2023-08-04 10:13:40 +02:00 committed by Jaroslav Kysela
parent f33284e85e
commit d8000f57fc
4 changed files with 21 additions and 3 deletions

View file

@ -2070,10 +2070,16 @@ static const char *const snd_pcm_type_names[] = {
static const char *const snd_pcm_subformat_names[] = {
SUBFORMAT(STD),
SUBFORMAT(MSBITS_MAX),
SUBFORMAT(MSBITS_20),
SUBFORMAT(MSBITS_24),
};
static const char *const snd_pcm_subformat_descriptions[] = {
SUBFORMATD(STD, "Standard"),
SUBFORMATD(MSBITS_MAX, "Maximum based on PCM format"),
SUBFORMATD(MSBITS_20, "20 most significant bits"),
SUBFORMATD(MSBITS_24, "24 most significant bits"),
};
static const char *const snd_pcm_start_mode_names[] = {

View file

@ -2008,7 +2008,10 @@ static const snd_mask_t refine_masks[SND_PCM_HW_PARAM_LAST_MASK - SND_PCM_HW_PAR
},
[SND_PCM_HW_PARAM_SUBFORMAT - SND_PCM_HW_PARAM_FIRST_MASK] = {
.bits = {
PCM_BIT(SNDRV_PCM_SUBFORMAT_STD)
PCM_BIT(SNDRV_PCM_SUBFORMAT_STD) |
PCM_BIT(SNDRV_PCM_SUBFORMAT_MSBITS_MAX) |
PCM_BIT(SNDRV_PCM_SUBFORMAT_MSBITS_20) |
PCM_BIT(SNDRV_PCM_SUBFORMAT_MSBITS_24),
},
},
};