[oss-devel] Some questions about SNDCTL_DSP_SYNCSTART
Zakhar Levchenko
zlevchenko at gmail.com
Sun Jun 8 22:47:45 EEST 2008
I can't fully agree with this. Let's look again at my example with 3
subdevises (when two instances of handle_syncstart are executed in
parallel):
SYNC_PREPARE for sub-device 1 (1st process)
SYNC_PREPARE for sub-device 2 (1st process)
SYNC_PREPARE for sub-device 3 (2nd process)
...
The device driver gets three subsequent SYNC_PREPARE calls, how should it
guess for example that it should start simulateneoulsy subdevices 1 and 2
and then device 3, but not all 3 subdevices at the same time? Yes, audio
core invokes sync_control for correct devices, but this operation is not
atomic, handle_syncstart executed in parallel may mess up things totally,
the order in which device driver receives these commands may be kind of
random. Driver just can't distinguish commands from different processes. It
expects something like:
SYNC_PREPARE for sub-device 1 (1st process)
SYNC_PREPARE for sub-device 2 (1st process)
SYNC_TRIGGER for sub-device 1 (1st process)
SYNC_TRIGGER for sub-device 2 (1st process)
SYNC_PREPARE for sub-device 3 (2nd process)
SYNC_TRIGGER for sub-device 3 (2nd process)
but probably not
SYNC_PREPARE for sub-device 1 (1st process)
SYNC_PREPARE for sub-device 2 (1st process)
SYNC_PREPARE for sub-device 3 (2nd process)
SYNC_TRIGGER for sub-device 1 (1st process)
SYNC_TRIGGER for sub-device 3 (2nd process)
SYNC_TRIGGER for sub-device 2 (1st process)
Regards,
Zakhar Levcehnko
On 6/8/08, Hannu Savolainen <hannu at opensound.com> wrote:
>
> Zakhar Levchenko kirjoitti:
>
> > So device driver implementation of sync_control is supposed to check
> > group id or something like that? Otherwise I can't see any way to
> > separate devices from different groups.
>
> Drivers don't need to check it. The audio core takes care of invoking
> just the correct devices.
>
>
> Best regards,
>
> Hannu
> _______________________________________________
> oss-devel mailing list
> oss-devel at mailman.opensound.com
> http://mailman.opensound.com/mailman/listinfo/oss-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.opensound.com/pipermail/oss-devel/attachments/20080608/3a11123a/attachment.htm
More information about the oss-devel
mailing list