Skip to contentSkip to conversation

Simple alsa sequencer question

DISCUSSION Ryan Pavlik 3 participants 6 messages Oct 25, 2003 – Oct 28, 2003

lore
Share & tools
lore
#0 lore raw

Minor question... I probably just overlooked something... but when I subscribe to a port, and I've done this:

        :
    snd_seq_port_subscribe_set_queue(subs, 1);
    snd_seq_port_subscribe_set_time_update(subs, 1);
    snd_seq_port_subscribe_set_time_real(subs, 1);
        :

Shouldn't I get numbers in ev->time.time.tv_*? I'm just getting zeros... what did I miss? ;)

Signature · 10 lines
Ryan Pavlik <[email protected]>

"I was promised claws and an impossible biology!" - 8BT


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
#1 lore raw

At Sat, 25 Oct 2003 02:41:06 -0700,

Quoted 4 lines · Ryan Pavlik

Minor question... I probably just overlooked something... but when I subscribe to a port, and I've done this:

Quoted 8 lines
        :
    snd_seq_port_subscribe_set_queue(subs, 1);
    snd_seq_port_subscribe_set_time_update(subs, 1);
    snd_seq_port_subscribe_set_time_real(subs, 1);
        :

Shouldn't I get numbers in ev->time.time.tv_*? I'm just getting zeros... what did I miss? ;)

no, it should be, as long as the event is delivered to these subscribers (i.e. setting the destination as SND_SEQ_ADDR_SUBSCRIBERS).

btw, to update the timestamp of every event to a certain port, you can set the timestamp attribute on the port_info, too.

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/

#2 lore raw
Quoted 2 lines · On Mon, 27 Oct 2003 11:54:21 +0100 Takashi Iwai <[email protected]> wrote:

At Sat, 25 Oct 2003 02:41:06 -0700,
Ryan Pavlik wrote:

<snip>

Quoted 8 lines
Quoted 2 lines

Shouldn't I get numbers in ev->time.time.tv_*? I'm just getting zeros... what did I miss? ;)

no, it should be, as long as the event is delivered to these subscribers (i.e. setting the destination as SND_SEQ_ADDR_SUBSCRIBERS).

btw, to update the timestamp of every event to a certain port, you can set the timestamp attribute on the port_info, too.

OK, I've attached some code to show what I'm doing exactly.

I'm trying to receive input from an external sequencer that's tagged with the event arrival time. The docs indicate this should be no problem, and I believe I've done what they say, but I'm obviously not doing something right. :-)

I prefer time in realtime, not midi time, for accuracy and time calculation reasons, but neither seems to work.

Also, I seem to be getting a lot of type 42 messages (active sense). Now, only one piece of gear (Roland, go figure ;) generates these, and the MTP/AV i'm using blocks them (thankfully). The Roland gear is off, and the MTP/AV shows no input traffic. Why am I still getting these messages...? (For my ruby lib, i'm filtering them at the moment since they're the useless, but saving a little CPU would be nice, too.)

Thanks,

Signature · 3 lines
Ryan Pavlik <[email protected]>

"I believe in exploiting debts, not having them." - 8BT
#3 lore raw
Quoted 9 lines · Ryan Pavlik
Quoted 5 lines · Takashi Iwai
Quoted 2 lines · Ryan Pavlik

Shouldn't I get numbers in ev->time.time.tv_*? I'm just getting zeros... what did I miss? ;)

(snip)

OK, I've attached some code to show what I'm doing exactly.

The event timestamps are set yo the current time of the queue. Your queue isn't running, so its current time is zero.

Call snd_seq_start_queue(seq, queue, NULL) (and snd_seq_drain_output).

HTH
Clemens

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/

#4 lore raw
Quoted 7 lines · On Tue, 28 Oct 2003 10:23:40 +0100 (MET) Clemens Ladisch <[email protected]>…
Quoted 6 lines · Ryan Pavlik
Quoted 4 lines · Takashi Iwai
Quoted 2 lines · Ryan Pavlik

Shouldn't I get numbers in ev->time.time.tv_*? I'm just getting zeros... what did I miss? ;)

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

(snip)

OK, I've attached some code to show what I'm doing exactly.

The event timestamps are set yo the current time of the queue. Your queue isn't running, so its current time is zero.

Call snd_seq_start_queue(seq, queue, NULL) (and snd_seq_drain_output).

Hmm, nope... I've tried this in various combinations along with tempo-setting and position-setting events sent to the queue, with no avail. I'm still getting 0 0.

I've attached the new code.

thanks,

Signature · 3 lines
Ryan Pavlik <[email protected]>

"Maybe it's the unfocused, blind, murderous rage." - 8BT
#5 lore raw
In reply to Ryan Pavlik
Quoted 8 lines · Ryan Pavlik

but when I subscribe to a port, and I've done this:

        :
    snd_seq_port_subscribe_set_queue(subs, 1);
    snd_seq_port_subscribe_set_time_update(subs, 1);
    snd_seq_port_subscribe_set_time_real(subs, 1);
        :

Shouldn't I get numbers in ev->time.time.tv_*? I'm just getting zeros... what did I miss? ;)

The second parameter of ..._set_queue is the id of the queue to get the time from. Probably queue #1 doesn't exist, or isn't running when the events get delivered.

HTH
Clemens

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/