Skip to contentSkip to conversation

Why there is no SNDRV_PCM_RATE_24000 in pcm.h

DISCUSSION Wei Kai 2 participants 3 messages Aug 10, 2007

lore
Share & tools
lore

Wei Kai

author
#0 lore raw

hi, guys
I checked the include/sound/pcm.h in kernel and find this problem, it seemed strange, so many codecs support the 24000 sample rate, why there is no such definition. Any special concern?

#1 lore raw
Quoted 3 lines · Wei Kai

I checked the include/sound/pcm.h in kernel and find this problem, it seemed strange, so many codecs support the 24000 sample rate, why there is no such definition.

When the header file was created many years ago, 24000 Hz wasn't a common sample rate.

To support a sample rate that is not in that list of predefined rates, your driver should set the RATE_KNOT bit and call the snd_pcm_hw_constraint_list() function; see the section "Constraints" in the "Writing an ALSA Driver" document.

HTH
Clemens

author
#2 lore raw

Thank you, Clemens.

2007/8/10, Clemens Ladisch <[email protected]>:

Quoted 17 lines
Quoted 3 lines · Wei Kai

I checked the include/sound/pcm.h in kernel and find this problem, it seemed strange, so many codecs support the 24000 sample rate, why there is no such definition.

When the header file was created many years ago, 24000 Hz wasn't a common sample rate.

To support a sample rate that is not in that list of predefined rates, your driver should set the RATE_KNOT bit and call the snd_pcm_hw_constraint_list() function; see the section "Constraints" in the "Writing an ALSA Driver" document.

HTH
Clemens