At Mon, 24 Nov 2003 13:10:55 +0100 (MET),
Clemens Ladisch wrote:
> 
> Takashi Iwai wrote:
> 
> > Clemens Ladisch wrote:
> > >
> > > - initialize active_mask and unlink_mask each time before URBs are
> > >   started
> >
> > we still need to check here whether the urbs are really free, since
> > a path like trigger stop -> prepare -> trigger_start is possible.
> > in this case, the operation can be done quickly enough before urbs are
> > really unlinked.
> >
> > the question is then where we can do a long wait.  perpare would be a
> > better place than trigger, but unfortunately, prepare callback is also
> > regarded as atomic because of linked streams.
> 
> If we cannot sleep until the URBs are completely unlinked, we have to
> 1) busy-wait until the URBs are inactive (*ouch!*), or
> 2) let trigger_start fail with "device not yet ready", or
> 3) allocate a new set of URBs, and put the old ones in some list to be
>    freed later.
> 
> (1) would be really evil; (2) a quick hack; (3) would be most useful,
> but it's anything but elegant.

(1) is difficult because the callback is performed with irq disabled.
thus complete callback will be never called inside the prepare or
trigger callback.

(2) will bring many complains, i guess :)

(3) looks like a good idea as a workaround.


meanwhile, i'm trying to implement:

(4) allow prepare callback to sleep with a special flag.

this will be useful for other drivers, too, such as vx and korg1212
drivers which require the handshaking.
but what i'm doing is still a hack, and will be a fundamental rewrite
later.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to