All of lore.kernel.org
 help / color / mirror / Atom feed
* timestamps on recorded events
       [not found] <Pine.LNX.4.33.0204091221050.7128-100000@wotan.suse.de>
@ 2002-04-11  9:42 ` Richard Bown
  2002-04-11 10:31   ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Bown @ 2002-04-11  9:42 UTC (permalink / raw)
  To: alsa-devel

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?

Thanks,
Richard
-- 
http://www.all-day-breakfast.com/rosegarden
http://www.bownie.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: timestamps on recorded events
  2002-04-11  9:42 ` timestamps on recorded events Richard Bown
@ 2002-04-11 10:31   ` Takashi Iwai
  2002-04-12 10:52     ` Bob Ham
  2002-04-12 13:32     ` Richard Bown
  0 siblings, 2 replies; 7+ messages in thread
From: Takashi Iwai @ 2002-04-11 10:31 UTC (permalink / raw)
  To: bownie; +Cc: alsa-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: timestamps on recorded events
  2002-04-11 10:31   ` Takashi Iwai
@ 2002-04-12 10:52     ` Bob Ham
  2002-04-12 11:01       ` Takashi Iwai
  2002-04-12 13:32     ` Richard Bown
  1 sibling, 1 reply; 7+ messages in thread
From: Bob Ham @ 2002-04-12 10:52 UTC (permalink / raw)
  To: ALSA Development Mailing List; +Cc: Takashi Iwai

On Thu, 2002-04-11 at 11:31, Takashi Iwai wrote:

> 	// 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);

Does the value of the integer that's passed to either of these functions
make any difference, or is it just their non-zeroness?

Bob

-- 
Bob Ham: bob@ham.org  http://pkl.net/~node/

My music: http://mp3.com/obelisk_uk
GNU Hurd: http://hurd.gnu.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: timestamps on recorded events
  2002-04-12 10:52     ` Bob Ham
@ 2002-04-12 11:01       ` Takashi Iwai
  0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2002-04-12 11:01 UTC (permalink / raw)
  To: Bob Ham; +Cc: ALSA Development Mailing List

At 12 Apr 2002 11:52:25 +0100,
Bob Ham wrote:
> 
> On Thu, 2002-04-11 at 11:31, Takashi Iwai wrote:
> 
> > 	// 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);
> 
> Does the value of the integer that's passed to either of these functions
> make any difference, or is it just their non-zeroness?

the latter - it's non-zero boolean.


Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: timestamps on recorded events
  2002-04-11 10:31   ` Takashi Iwai
  2002-04-12 10:52     ` Bob Ham
@ 2002-04-12 13:32     ` Richard Bown
  2002-04-12 14:06       ` Takashi Iwai
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Bown @ 2002-04-12 13:32 UTC (permalink / raw)
  To: alsa-devel

Takashi Iwai wrote:

[turning on timestamps]

> 	err = snd_seq_port_subscribe(handle, subs);
> 	...
> 
> if you are using snd_seq_connect_to/from, then you need to replace
> it like above.

Excellent, yeah thanks that does the trick.  With the minor typo correction that
the last line is supposed to be "err = snd_seq_subscribe_port(handle, subs);"

BTW is this list the best place for these app developer questions?  I know
it's certainly the best place to get answers (and quickly) but I can't help
feeling that we're treading on toes..

and I'm probably just shooting myself in the foot by even asking this..

R

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: timestamps on recorded events
@ 2002-04-12 13:46 Joachim Backhaus
  0 siblings, 0 replies; 7+ messages in thread
From: Joachim Backhaus @ 2002-04-12 13:46 UTC (permalink / raw)
  To: 'bownie@bownie.com', alsa-devel



> -----Original Message-----
> From: Richard Bown [mailto:bownie@bownie.com]
> Sent: Freitag, 12. April 2002 15:33
> To: alsa-devel@lists.sourceforge.net
> Subject: Re: [Alsa-devel] timestamps on recorded events
> 
> BTW is this list the best place for these app developer 
> questions?

For general linux audio app developing questions I think
the LAD (linux audio developer) list is better.

regards,
J.Backhaus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: timestamps on recorded events
  2002-04-12 13:32     ` Richard Bown
@ 2002-04-12 14:06       ` Takashi Iwai
  0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2002-04-12 14:06 UTC (permalink / raw)
  To: bownie; +Cc: alsa-devel

At Fri, 12 Apr 2002 14:32:52 +0100,
Richard Bown wrote:
> 
> Takashi Iwai wrote:
> 
> [turning on timestamps]
> 
> > 	err = snd_seq_port_subscribe(handle, subs);
> > 	...
> > 
> > if you are using snd_seq_connect_to/from, then you need to replace
> > it like above.
> 
> Excellent, yeah thanks that does the trick.  With the minor typo correction that
> the last line is supposed to be "err = snd_seq_subscribe_port(handle, subs);"
 
oh yeah :)

> BTW is this list the best place for these app developer questions?  I know
> it's certainly the best place to get answers (and quickly) but I can't help
> feeling that we're treading on toes..

as long as the question is related with ALSA specific issues, then i
believe here is the right place.  such q&a's are also helpful for
documentation later, too.


Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-04-12 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
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

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.