Skip to content

Commit 8c5db3a

Browse files
ALSA: pcm.h: Add rate defines for 352k8 and 384k
Add SNDRV_PCM_RATE_352800 and SNDRV_PCM_RATE_384000 defines to pcm.h, for 352k8 and 384k sample rates. Add SNDRV_PCM_RATE_8000_384000 define. Update rates list. Yes, we can use CONTINUOUS/KNOT and constraints, to support the x8 sample rates, but having the defines requires less code in drivers. Many more DAC chips are now supporting the x8 44k1/48k multiples. From a high-res viewpoint, the DXD standard is 352k8, 24 bit. That alone should justify the addition of a define for it. ;) Signed-off-by: DigitalDreamtime <[email protected]>
1 parent b3e2e28 commit 8c5db3a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

include/sound/pcm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ struct snd_pcm_ops {
129129
#define SNDRV_PCM_RATE_96000 (1<<10) /* 96000Hz */
130130
#define SNDRV_PCM_RATE_176400 (1<<11) /* 176400Hz */
131131
#define SNDRV_PCM_RATE_192000 (1<<12) /* 192000Hz */
132+
#define SNDRV_PCM_RATE_352800 (1<<13) /* 352800Hz */
133+
#define SNDRV_PCM_RATE_384000 (1<<14) /* 384000Hz */
132134

133135
#define SNDRV_PCM_RATE_CONTINUOUS (1<<30) /* continuous range */
134136
#define SNDRV_PCM_RATE_KNOT (1<<31) /* supports more non-continuos rates */
@@ -141,6 +143,8 @@ struct snd_pcm_ops {
141143
SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000)
142144
#define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\
143145
SNDRV_PCM_RATE_192000)
146+
#define SNDRV_PCM_RATE_8000_384000 (SNDRV_PCM_RATE_8000_192000|SNDRV_PCM_RATE_352800|\
147+
SNDRV_PCM_RATE_384000)
144148
#define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt)
145149
#define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8)
146150
#define SNDRV_PCM_FMTBIT_U8 _SNDRV_PCM_FMTBIT(U8)

sound/core/pcm_native.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,12 +1981,13 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
19811981
return snd_interval_refine(hw_param_interval(params, rule->var), &t);
19821982
}
19831983

1984-
#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_192000 != 1 << 12
1984+
#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_384000 != 1 << 14
19851985
#error "Change this table"
19861986
#endif
19871987

19881988
static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
1989-
48000, 64000, 88200, 96000, 176400, 192000 };
1989+
48000, 64000, 88200, 96000, 176400, 192000,
1990+
352800, 384000 };
19901991

19911992
const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {
19921993
.count = ARRAY_SIZE(rates),

0 commit comments

Comments
 (0)