[alsa-devel] incoming sequencer event timestamping (via a running queue): how?
r10kindsofpeople at gmail.com
Mon Apr 11 22:10:34 CEST 2011
On Mon, Apr 11, 2011 at 2:01 PM, R. Dresens <chromisx at nedlinux.nl> wrote:
> I'm attempting to write a program that lets me record (and play)
> MIDI sequences,
> I have created a sequencer queue (with `snd_seq_alloc_queue`), and
> when I set it up and let it run I can observe that the tick value
> properly increases (with `snd_seq_queue_status_get_tick_time`);
> everything runs fine. Queing events to an output work as well.
> But is it somehow possible to bind "incoming events" to this queue as
> well? (...in such a way that the `event->time.tick` value of these
> incoming events is used to automatically store the queue timer value
> at reception? ...)
> At this moment, I just sample the tick value manually when I get an
> event. That kinda works, but chances are high that the kernel
> sequencer system can do that for me with more accuracy?
> I wrote a function that essentially reconnects the inputs of the port
> used for reception just before the queue is started. This allows me
> to set the queue explicitly. I also enable
> `snd_seq_port_subscribe_set_time_update`. It doesnt't work (yet).
> Should this work? Am I on the right track? Or am I missing something?
> Can anyone give me a hint?
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
In your function that does the connection to the reception port...
snd_seq_port_subscribe_set_queue(subs, queue_id); //<< queue_id being
the one you allocated
...with the caution that this may be the completely wrong way to go
about this, but it may help until someone more knowledgeable comes
More information about the Alsa-devel