[alsa-devel] How do I tell ALSA that my driver supports every possible sample rate?

Timur Tabi timur at freescale.com
Wed Jul 25 16:37:34 CEST 2007

Takashi Iwai wrote:

>> So can I do this?
>> static const struct snd_pcm_hardware mpc86xx_pcm_hardware = {
>> 	.rate_min		= 1,
>> 	.rate_max		= (unsigned int) -1,
> In theory, yes, but these rate_min and rate_max are nothing but
> confusing in practice.  Your hardware won't support definitely such
> rates, but the application can't know.  Set some reasonable values
> there.

This is an ASOC driver.  My understanding is that ASOC will take all the values from the machine, PCM, I2S, and codec drivers and create the subset that matches all drivers.  That's the point I was trying to make: my PCM driver does *not* decide what the capabilities of the system are, because my DMA controller can handle all speeds.  So I don't want to put some arbitrary limits in the PCM driver, and then perhaps one day it gets attached to a codec driver that can handle 4000Hz, but ASOC won't allow it because I used SNDRV_PCM_RATE_8000_192000 | SNDRV_PCM_RATES_5512 in my PCM driver.  ASOC would incorrectly believe that the PCM driver can't handle 4000Hz.

More information about the Alsa-devel mailing list