[alsa-devel] [PATCH 2/2] add API to allow disabling period interrupt

pl bossart bossart.nospam at gmail.com
Tue Nov 2 14:12:26 CET 2010


>>>>> +int snd_pcm_hw_params_can_disable_period_irq(const snd_pcm_hw_params_t
>>>>> *params)
>>>>
>>>> This function is useless because it cannot be called before
>>>> snd_pcm_hw_params_set_period_irq().
>>>
>>> I don't think so. The info bits from the driver are used in this check
>>> which are read-only.
>>
>> All the snd_pcm_hw_params_can_* functions that read the info bits
>> are documented to require a completed configuration.  So they actually
>> don't, and there will never be a flag that depends on the configuration?
>
> You're right. The *_can_* check should be removed.

If I remove the *_can_* check and add a flag for snd_pcm_open,
actually the other set/get routines need to go as well. Everything
would happen at the opening stages instead of when the hardware params
are set, you would try to disable the interrupts and if the open fails
you would fall back to 'normal' mode.
The alternative would be to remove the _*can* but keep the set/get
routines. In that case the hw_params configuration would be rejected
if the hardware doesn't support this feature.
Which solution do you guys prefer?

Either way, it makes sense to check that the app uses the non-blocking
mode as well, otherwise everything would be broken as noted in the
remarks.

-Pierre


More information about the Alsa-devel mailing list