All of lore.kernel.org
 help / color / mirror / Atom feed
* stopping sequencer output queue gracefully
@ 2006-12-14 14:12 r10 kindsofpeople
  2006-12-14 16:48 ` Steve deRosier
  2006-12-15  7:30 ` Clemens Ladisch
  0 siblings, 2 replies; 3+ messages in thread
From: r10 kindsofpeople @ 2006-12-14 14:12 UTC (permalink / raw)
  To: alsa-devel

Is there example code around that shows how to stop MIDI playback 
gracefully?

At present, I'm doing a snd_seq_drop_output() and a snd_seq_stop_queue(), 
and getting some interesting behavior when I try to restart.

I'm also wondering if Alsa does anything to track or handle the stuck notes 
that result, or if my client needs to be responsible for tracking these and 
turning them off before stopping the queue.

John

_________________________________________________________________
Talk now to your Hotmail contacts with Windows Live Messenger. 
http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://get.live.com/messenger/overview


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: stopping sequencer output queue gracefully
  2006-12-14 14:12 stopping sequencer output queue gracefully r10 kindsofpeople
@ 2006-12-14 16:48 ` Steve deRosier
  2006-12-15  7:30 ` Clemens Ladisch
  1 sibling, 0 replies; 3+ messages in thread
From: Steve deRosier @ 2006-12-14 16:48 UTC (permalink / raw)
  To: r10 kindsofpeople; +Cc: alsa-devel

John,

Not sure of an answer to the first part of your question but for what I 
usually do is a snd_seq_free_queue() and a snd_seq_close().

But the answer to the second part: you need to keep track of what notes 
are on yourself... or take the easy way out and just run an all notes 
off message for every channel, or actually do a note off message for 
every note; that way no matter what you know you'll never stick a note. 
  Don't forget to turn the pedal controllers off also.

- Steve


r10 kindsofpeople wrote:
> Is there example code around that shows how to stop MIDI playback 
> gracefully?
> 
> At present, I'm doing a snd_seq_drop_output() and a snd_seq_stop_queue(), 
> and getting some interesting behavior when I try to restart.
> 
> I'm also wondering if Alsa does anything to track or handle the stuck notes 
> that result, or if my client needs to be responsible for tracking these and 
> turning them off before stopping the queue.
> 
> John
> 
> _________________________________________________________________
> Talk now to your Hotmail contacts with Windows Live Messenger. 
> http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://get.live.com/messenger/overview
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: stopping sequencer output queue gracefully
  2006-12-14 14:12 stopping sequencer output queue gracefully r10 kindsofpeople
  2006-12-14 16:48 ` Steve deRosier
@ 2006-12-15  7:30 ` Clemens Ladisch
  1 sibling, 0 replies; 3+ messages in thread
From: Clemens Ladisch @ 2006-12-15  7:30 UTC (permalink / raw)
  To: r10 kindsofpeople, alsa-devel

r10 kindsofpeople wrote:
> Is there example code around that shows how to stop MIDI playback 
> gracefully?
> 
> At present, I'm doing a snd_seq_drop_output() and a snd_seq_stop_queue(), 
> and getting some interesting behavior when I try to restart.

What do you mean with "interesting"?

After snd_seq_stop_queue(), you have to call snd_seq_drain_output() to
actually send the stop event.

> I'm also wondering if Alsa does anything to track or handle the stuck notes 
> that result, or if my client needs to be responsible for tracking these and 
> turning them off before stopping the queue.

A queue is just a tool for delivering events; ALSA doesn't try to
interpret the events sent through it.  Besides, different devices may
have different rules about sending of note-on/note-off events.

I'd just send an All Notes Off message.


HTH
Clemens

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

end of thread, other threads:[~2006-12-15  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14 14:12 stopping sequencer output queue gracefully r10 kindsofpeople
2006-12-14 16:48 ` Steve deRosier
2006-12-15  7:30 ` Clemens Ladisch

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.