All of lore.kernel.org
 help / color / mirror / Atom feed
* snd_seq_sync_output_queue does not work
@ 2004-12-02 11:58 Bengt Mÿffffe5nsson
  2004-12-02 15:41 ` Clemens Ladisch
  0 siblings, 1 reply; 3+ messages in thread
From: Bengt Mÿffffe5nsson @ 2004-12-02 11:58 UTC (permalink / raw)
  To: alsa-devel

I'm trying to make an app where I need to exchange an
18k sysex. I use Rh9.
I think I've worked out the receiving part, but
sending will not work.
I chop the big sysex into 256 byte blocks and send in
a sequence. This seems to work fine when I run it
stepwise in the debugger, but crash when I run it at
full speed.
I think I've traced the problem down to the call to
snd_seq_sync_output_queue. I expect that call to hang
until the output is drained, and return a 0.
What happens is that the call seems to return
immediately with a 1.
Tried to use snd_seq_nonblock(0) but that didn't
change anything.
Does anyone have any hint?
/Bengt



		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

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

* Re: snd_seq_sync_output_queue does not work
  2004-12-02 11:58 snd_seq_sync_output_queue does not work Bengt Mÿffffe5nsson
@ 2004-12-02 15:41 ` Clemens Ladisch
  2004-12-02 21:01   ` Bengt Mÿffffe5nsson
  0 siblings, 1 reply; 3+ messages in thread
From: Clemens Ladisch @ 2004-12-02 15:41 UTC (permalink / raw)
  To: Bengt Månsson; +Cc: alsa-devel

Bengt Månsson wrote:
> I'm trying to make an app where I need to exchange an
> 18k sysex. I use Rh9.
> I think I've worked out the receiving part, but
> sending will not work.
> I chop the big sysex into 256 byte blocks and send in
> a sequence. This seems to work fine when I run it
> stepwise in the debugger, but crash when I run it at
> full speed.

The sequencer isn't designed to handle big sysexs.  Due to the
message-based architecture it's difficult to signal back to the
sending application that the output buffer is full.

I'd guess some message couldn't be delivered and was thrown away.

Try to limit the rate of messages so that you don't exceed the MIDI
data rate.

> I think I've traced the problem down to the call to
> snd_seq_sync_output_queue. I expect that call to hang
> until the output is drained, and return a 0.
> What happens is that the call seems to return
> immediately with a 1.

The documentation is wrong, any nonnegative return value indicates
success (the current implementation always returns 1).

snd_seq_sync_output_queue waits until all events have been sent.  At
this point, it's too late to detect events than cannot be delivered at
the destination.


The documentation, if it actually existed, would tell you to use the
rawmidi API for big chunks of sysex data.  See the amidi program for
an example.


HTH
Clemens



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

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

* Re: snd_seq_sync_output_queue does not work
  2004-12-02 15:41 ` Clemens Ladisch
@ 2004-12-02 21:01   ` Bengt Mÿffffe5nsson
  0 siblings, 0 replies; 3+ messages in thread
From: Bengt Mÿffffe5nsson @ 2004-12-02 21:01 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 2248 bytes --]

Thank you for your quick reply.
I've looked at amidi and maybe that is a solution.
It's a little bit annoying though, since receiving
works so fine. I would prefer a symetrical solution
that is easy to map to tha java api.
Maybe a sleep is easiest, but I'll consider that when
I've had some myself.
/Bengt

--- Clemens Ladisch <clemens@ladisch.de> wrote:

> Bengt Månsson wrote:
> > I'm trying to make an app where I need to exchange
> an
> > 18k sysex. I use Rh9.
> > I think I've worked out the receiving part, but
> > sending will not work.
> > I chop the big sysex into 256 byte blocks and send
> in
> > a sequence. This seems to work fine when I run it
> > stepwise in the debugger, but crash when I run it
> at
> > full speed.
> 
> The sequencer isn't designed to handle big sysexs. 
> Due to the
> message-based architecture it's difficult to signal
> back to the
> sending application that the output buffer is full.
> 
> I'd guess some message couldn't be delivered and was
> thrown away.
> 
> Try to limit the rate of messages so that you don't
> exceed the MIDI
> data rate.
> 
> > I think I've traced the problem down to the call
> to
> > snd_seq_sync_output_queue. I expect that call to
> hang
> > until the output is drained, and return a 0.
> > What happens is that the call seems to return
> > immediately with a 1.
> 
> The documentation is wrong, any nonnegative return
> value indicates
> success (the current implementation always returns
> 1).
> 
> snd_seq_sync_output_queue waits until all events
> have been sent.  At
> this point, it's too late to detect events than
> cannot be delivered at
> the destination.
> 
> 
> The documentation, if it actually existed, would
> tell you to use the
> rawmidi API for big chunks of sysex data.  See the
> amidi program for
> an example.
> 
> 
> HTH
> Clemens
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

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

end of thread, other threads:[~2004-12-02 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-02 11:58 snd_seq_sync_output_queue does not work Bengt Mÿffffe5nsson
2004-12-02 15:41 ` Clemens Ladisch
2004-12-02 21:01   ` Bengt Mÿffffe5nsson

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.