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

Sedji Gaouaou sedji.gaouaou at atmel.com
Fri May 23 16:27:19 CEST 2008

Clemens Ladisch a écrit :
> Sedji Gaouaou wrote:
>> 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:
>> ...
>>     .formats        = (SNDRV_PCM_FMTBIT_S16_LE
>>                    | SNDRV_PCM_FMTBIT_S16_BE
>>                    | SNDRV_PCM_FMTBIT_S20_3LE
>>                    ...
>> 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.
> The default device will do automatic sample format conversion, i.e.,
> your driver will see a request for S16_LE.
> This looks like a bug somewhere else in your driver.
> Regards,
> Clemens
That means that if the format is no supported, it should not return an 
error, but just use another format which is supported?

More information about the Alsa-devel mailing list