Re: Can ALSA MIDI use timestamps for precise timing?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roger Dannenberg wrote:
>     PortMIDI wants to send MIDI messages at precise times according to
> arbitrary clocks. In Audacity, the important clock to synchronize to is
> the audio sample clock.

What is the API that PortMIDI wants to offer?  And does any OS actually
offer this?

The ALSA sequencer relies on interrupts for the clock.  It would be
possible to use a PCM device as interrupt source, but there is only one
interrupt after each period, so this would have horrible jitter.

> There's absolute timing, but the docs say that's relative to when you
> start the queue, but when exactly is that?

When you start the queue, i.e., when you send the SND_SEQ_EVENT_START
message or call snd_seq_start_queue().

> if you send with relative time and you get unscheduled just as you are
> executing the write call, you'll be late.

That could also happen with any other call.

> The problem becomes precise timing of queue creation doesn't it?

You could measure the offset between the queue's clock and the actual
clock.

> And there's no timestamp provided for when to start.

You could schedule the start event, but that would require another
queue ...  ;-)


Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux