From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: timestamps on recorded events Date: Thu, 11 Apr 2002 12:31:27 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <200204110944.AFK42109@msgdirector2.onetel.net.uk> Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <200204110944.AFK42109@msgdirector2.onetel.net.uk> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: bownie@bownie.com Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org 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