Hi,

This is good approach, however it may fail if syncstart operation is
interrupted before SYNC_TRIGGER stage. I don't know if this is really
possible in practice, however code of handle_syncstart permits this. On
lines 2744 and 2745 result of prepare_output is checked and if
prepare_output fails handle_syncstart just returns with error code. If such
situation happens driver may remember some non-zero mask that will be used
next time syncstart is invoked. Theoretically it may start some additional
devices. I don't know though if it is really a problem. My approach easily
overcomes this problem, that's why I decided to link devices on SYNC_START
stage (now I see however that instead of linking devices into a list it is
possible to calculate common device mask, it is really nice idea). However I
see an alternative: it is possible to add one more event something like
SYNC_CLEANUP that should inform drivers that it should clean up all data
created on SYNC_PREPARE stage. I'm not sure if it is really necessary.
Another alternative is not to check result of prepare_output at all. What do
you think about that?

Regards,
          Zakhar Levchenko


On 6/10/08, Hannu Savolainen <[EMAIL PROTECTED]> wrote:
>
> Zakhar Levchenko kirjoitti:
>
> > Hi,
> >
> > I've attached a patch that implements sync_control for envy24ht devices.
>
> I would recommend you do it in slightly different way:
>
> Add a syncstart_mask field to devc.
>
> During SYNC_PREPARE:
>
>     devc->syncstart_mask |= portc->mask; /* Add this sub-device to the
> mask */
>
> During SYNC_TRIGER:
>
>   if (devc->syncstart_mask != 0)
>   {
>        enable=INB();
>        intrmask = INB();
>
>        enable |= devc->syncstart_mask;
>        intrmask &= ~devc->syncstart_mask;
>
>        OUTB(enable);
>        OUTB(intrmask);
>
>        devc->syncstart_mask = 0;   /* MArk all devices as started.
>   }
>
> The above is the way how the sync start feature was originally designed
> to work. During the PREPARE step(s) the driver should construct a
> register value to be written later to some "global" start register.
> During the first TRIGGER call write this value to the start register.
> Ignore all subsequent TRIGER calls (until PREPARE has been called again).
>
> This approach didn't work with envy24 (because of the additional
> buffering) but it works with envy24ht.
>
> Best regards,
>
> Hannu
> _______________________________________________
> oss-devel mailing list
> oss-devel@mailman.opensound.com
> http://mailman.opensound.com/mailman/listinfo/oss-devel
>
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to