mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-28 05:40:23 -04:00
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:
parent
f33284e85e
commit
d8000f57fc
4 changed files with 21 additions and 3 deletions
|
|
@ -286,7 +286,13 @@ typedef enum _snd_pcm_subformat {
|
|||
SND_PCM_SUBFORMAT_UNKNOWN = -1,
|
||||
/** Standard */
|
||||
SND_PCM_SUBFORMAT_STD = 0,
|
||||
SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
|
||||
/** Maximum bits based on PCM format */
|
||||
SND_PCM_SUBFORMAT_MSBITS_MAX = 1,
|
||||
/** 20 most significant bits */
|
||||
SND_PCM_SUBFORMAT_MSBITS_20 = 2,
|
||||
/** 24 most significant bits */
|
||||
SND_PCM_SUBFORMAT_MSBITS_24 = 3,
|
||||
SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_MSBITS_24
|
||||
} snd_pcm_subformat_t;
|
||||
|
||||
/** PCM state */
|
||||
|
|
|
|||
|
|
@ -274,7 +274,10 @@ typedef int __bitwise snd_pcm_format_t;
|
|||
|
||||
typedef int __bitwise snd_pcm_subformat_t;
|
||||
#define SNDRV_PCM_SUBFORMAT_STD ((snd_pcm_subformat_t) 0)
|
||||
#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
|
||||
#define SNDRV_PCM_SUBFORMAT_MSBITS_MAX ((snd_pcm_subformat_t) 1)
|
||||
#define SNDRV_PCM_SUBFORMAT_MSBITS_20 ((snd_pcm_subformat_t) 2)
|
||||
#define SNDRV_PCM_SUBFORMAT_MSBITS_24 ((snd_pcm_subformat_t) 3)
|
||||
#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_MSBITS_24
|
||||
|
||||
#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
|
||||
#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
|
||||
|
|
|
|||
|
|
@ -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[] = {
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue