From: Takashi Iwai <tiwai@suse.de>
To: bownie@bownie.com
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: timestamps on recorded events
Date: Thu, 11 Apr 2002 12:31:27 +0200 [thread overview]
Message-ID: <s5h8z7ule68.wl@alsa2.suse.de> (raw)
In-Reply-To: <200204110944.AFK42109@msgdirector2.onetel.net.uk>
Hi,
At Thu, 11 Apr 2002 10:42:05 +0100,
Richard Bown wrote:
>
> Hi. Another simple one but another one I'm afraid I can't find an example for.
>
> I'm writing and reading events from the same ALSA 0.9.0 port (on the same
> duplex handle) - I receive the events correctly through snd_seq_event_input
> but the timestamps are coming back as zero even when I've started a queue
> against that handle. I presume I don't have to extract the timestamps from
> the queue itself?
you can let the sequencer-core update the timestamp of the event
automatically.
at the subscription, call snd_seq_port_subscribe_set_time_update().
a typical code would be like this:
snd_seq_addr_t sender, dest;
snd_seq_port_subscribe_t *subs;
snd_seq_port_subscribe_alloca(&subs);
// receive events from a specified port
sender.client = source_client_id;
sender.port = source_port_id;
dest.client = my_client_id;
dest.port = my_port_id;
// set up subscribe info
snd_seq_port_subscribe_set_sender(subs, &sender_addr);
snd_seq_port_subscribe_set_dest(subs, &dest_addr);
// set the queue to be used for updating time-stamps
snd_seq_port_subscribe_set_queue(subs, queue_used);
// enable time-stamp-update mode
snd_seq_port_subscribe_set_time_update(subs, 1);
// if you want to get real-time (not tick), call the
// following, too
// snd_seq_port_subscribe_set_time_real(subs, 1);
err = snd_seq_port_subscribe(handle, subs);
...
if you are using snd_seq_connect_to/from, then you need to replace
it like above.
Takashi
next prev parent reply other threads:[~2002-04-11 10:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.33.0204091221050.7128-100000@wotan.suse.de>
2002-04-11 9:42 ` timestamps on recorded events Richard Bown
2002-04-11 10:31 ` Takashi Iwai [this message]
2002-04-12 10:52 ` Bob Ham
2002-04-12 11:01 ` Takashi Iwai
2002-04-12 13:32 ` Richard Bown
2002-04-12 14:06 ` Takashi Iwai
2002-04-12 13:46 Joachim Backhaus
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=s5h8z7ule68.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=bownie@bownie.com \
/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.