From: Clemens Ladisch <clemens@ladisch.de>
To: Henning Thielemann <schlepptop@henning-thielemann.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: sending a sequencer event to a delayed queue
Date: Sun, 11 Mar 2012 21:40:37 +0100 [thread overview]
Message-ID: <4F5D0DC5.7090908@ladisch.de> (raw)
In-Reply-To: <4F5CC7AB.3030300@henning-thielemann.de>
Henning Thielemann wrote:
> Clemens Ladisch schrieb:
>> Henning Thielemann wrote:
>>> Unfortunately the ALSA doc does not say, what happens if I send an event
>>> to a queue that is not running.
>>
>> Exactly the same as with a running queue: the event stays in the client's
>> output buffer if its scheduled time has not yet been reached.
>
> I have attached a C program that demonstrates the effect: I start the
> "player" queue with one second delay and immediately send a message with
> a timestamp 0 that is meant to be the local time of the "player" queue.
> I expected that this event is delivered when the player queue starts,
> that is, one second after program start. But actually it is played
> immediately.
Yes; whether an event is delivered depends only on its scheduled time,
not whether the queue is running.
> If I choose a time larger than 0, say 1ns or 1s, then the
> event is not delivered at all.
Starting a queue also clears it. (This is done explicitly in the code,
so I guess this is a feature.)
I'd suggest to use one queue for both kinds of events, and to add the
delay to the scheduled time. To remove certain events, use
snd_seq_remove_events().
Regards,
Clemens
next prev parent reply other threads:[~2012-03-11 20:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-10 18:20 sending a sequencer event to a delayed queue Henning Thielemann
2012-03-10 20:51 ` Clemens Ladisch
2012-03-11 15:41 ` Henning Thielemann
2012-03-11 20:40 ` Clemens Ladisch [this message]
2012-03-11 21:08 ` Henning Thielemann
2012-03-11 22:14 ` Henning Thielemann
2012-03-12 8:21 ` Clemens Ladisch
2012-03-14 20:01 ` Henning Thielemann
2012-03-14 20:22 ` Henning Thielemann
2012-03-14 21:36 ` Clemens Ladisch
2012-03-13 22:33 ` Henning Thielemann
2012-03-14 8:22 ` Clemens Ladisch
2012-03-14 17:37 ` Henning Thielemann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F5D0DC5.7090908@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=schlepptop@henning-thielemann.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.