[pulseaudio-discuss] [alsa-devel] [PATCH 1/3] add API to allow disabling period interrupts
Jaroslav Kysela
perex at perex.cz
Mon May 17 07:42:28 PDT 2010
On Mon, 17 May 2010, Jassi Brar wrote:
> On Mon, May 17, 2010 at 8:16 PM, Clemens Ladisch <clemens at ladisch.de> wrote:
>> Jassi Brar wrote:
>>> I am in favor of support variable hw_interrupt at lowest level, i.e, in
>>> ring buffer driver, instead of disabling hw_interrupt altogether.
>>
>> Removing the constant-sized periods restriction would certainly be
>> useful. However, it doesn't look as if anybody has the time to redesign
>> the ALSA API, the kernel framework and all the drivers.
> No need to redesign ALSA API and certainly no need to change _any_ driver,
> just like this interrupt disable call is optional so would period resize be.
>
> I only ask to make this newly added call as period-resize rather than
> a special case of period-disable.
This is very good point. But I have two comments:
1) Period-disable function is OK, but it should not have a name "no
period irq": SNDRV_PCM_INFO_PERIOD_DISABLE or DISABLE_PERIOD looks
better. This change does imply to set the period size automatically in
the driver - probably to highest value (applications cannot choose/set
the period size in this operation mode - it's useless anyway).
2) The avail_min parameter in sw_params was overlooked. The lowlevel
drivers can use this value to compute the wake-up point and set hw
appropriately, to do wake-up at requested time. We can add a support
functions like "return how many samples are expected to be transferred
for next wake-up point" to linux/sound/pcm.h. In case when this value
is high, no interrupts (wake ups) will be processed in the driver. If
hardware cannot do the precise transfers, we can program a system
timer as the wake-up source.
Jaroslav
-----
Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
More information about the pulseaudio-discuss
mailing list