[alsa-devel] Recording problem with ALSA: trying to set up some constraints

Sedji Gaouaou sedji.gaouaou at atmel.com
Thu May 22 11:33:34 CEST 2008


I have a problem with my recording driver.
I have set up a pcm_hardware structure in which I define the format 
supported by my hardware:

static struct snd_pcm_hardware snd_at91_ac97_capture_hw = {
    .info            = (SNDRV_PCM_INFO_INTERLEAVED
                   | SNDRV_PCM_INFO_MMAP
                   | SNDRV_PCM_INFO_MMAP_VALID
                                   | SNDRV_PCM_INFO_BLOCK_TRANSFER),
    .formats        = (SNDRV_PCM_FMTBIT_S16_LE
                   | SNDRV_PCM_FMTBIT_S16_BE
                   | SNDRV_PCM_FMTBIT_S20_3LE
                   | SNDRV_PCM_FMTBIT_U20_3LE
                   | SNDRV_PCM_FMTBIT_S20_3BE
                   | SNDRV_PCM_FMTBIT_U20_3BE
                   | SNDRV_PCM_FMTBIT_S18_3LE
                   | SNDRV_PCM_FMTBIT_U18_3LE
                   | SNDRV_PCM_FMTBIT_S18_3BE
                   | SNDRV_PCM_FMTBIT_U18_3BE),
    .rates            = SNDRV_PCM_RATE_CONTINUOUS,
    .rate_min        = 8000,
    .rate_max        = 48000,
    .channels_min        = 1,
    .channels_max        = 2,
    .buffer_bytes_max    = 256*1024,
    .period_bytes_min    = 1024,
    .period_bytes_max    = 4*1024,
    .periods_min        = 1,
    .periods_max        = 64,

Then in my open function I pass it to the runtime struct.

Nevertheless if  I try to run arecord with this option: arecord -d 1 
test.wav, I will have a kernel oops.
The default format is U8, but it is not supported by my Hardware, abd it 
is not defined in my structure, so I though that it should exit arecord 
but not crash.

Do I miss something when defining my pcm_hardware strucutre, or do I 
forgot to use a specific function which should return me an error?

I have try to set up some constraints as well(for the rate and the 
format), but still I have the same crash.


More information about the Alsa-devel mailing list