Can ALSA MIDI use timestamps for precise timing?

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

 



Hi,

    I wrote PortMIDI long ago and now that it's going into Audacity and
we're having timing problems in Linux, I'm revisiting the code and
wondering if ALSA has a fundamental design problem. I'm hoping I'm
missing something, but here's the problem:

    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. To synchronize MIDI, one can in principle use
timestamps and let the device driver, which presumably runs with very
low latency, dispatch MIDI from a queue to the device or destination.
The question is then what timestamp to use. ALSA has some options.
There's relative timing, but if you send with relative time and you get
unscheduled just as you are executing the write call, you'll be late.
There's absolute timing, but the docs say that's relative to when you
start the queue, but when exactly is that? The problem becomes precise
timing of queue creation doesn't it? And there's no timestamp provided
for when to start. If "absolute" mean exactly the system time, that
would be great, but I think that's not the case.

    Is this a fundamental design error, or am I missing something?

    Thanks. -Roger Dannenberg



_______________________________________________
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