[alsa-devel] sending a sequencer event to a delayed queue

Henning Thielemann alsa at henning-thielemann.de
Wed Mar 14 21:01:12 CET 2012


On Mon, 12 Mar 2012, Clemens Ladisch wrote:

> Henning Thielemann wrote:
>> On Sun, 11 Mar 2012, Clemens Ladisch wrote:
>>> Yes; whether an event is delivered depends only on its scheduled time,
>>> not whether the queue is running.
>>
>> That is, if the queue time is zero and the event time is zero, then
>> the event is sent, independent of whether the queue is running or not.
>
> Yes.

Ok, I had an idea of how to solve my problem. I want to halt the queue and 
send all messages immediately that are still in the queue. To this end I 
think I could just increase the queue time.

Thus I did a test whether this will work. I did the following:

output note-on event with timestamp 1s
output note-off event with timestamp 2s
control_queue SND_SEQ_EVENT_SETPOS_TIME 3s
drain

Nothing happens.

I continue the queue after increasing the time:

output note-on event with timestamp 1s
output note-off event with timestamp 2s
control_queue SND_SEQ_EVENT_SETPOS_TIME 3s
control_queue SND_SEQ_EVENT_CONTINUE
drain

Now the note events are scheduled at 1s and 2s as if the SETPOS_TIME 
control was ignored.

Then I continued the queue before increasing the time:

output note-on event with timestamp 1s
output note-off event with timestamp 2s
control_queue SND_SEQ_EVENT_CONTINUE
control_queue SND_SEQ_EVENT_SETPOS_TIME 3s
drain

Now the events arrive instantly. This is the behavior I want to have.

It looks like SETPOS_TIME is ignored if the queue is halted. Is this 
correct?


More information about the Alsa-devel mailing list