All of lore.kernel.org
 help / color / mirror / Atom feed
* How to stop playback on alsa synth?
@ 2008-03-16 16:53 Lukasz Pawelczyk
  2008-03-16 21:48 ` Lukasz Pawelczyk
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Pawelczyk @ 2008-03-16 16:53 UTC (permalink / raw)
  To: alsa-devel

Hello.

I'd like to ask how to completely stop playback using alsa synth.

Basically my program initialized output in the following way:

snd_seq_open()
snd_seq_set_client_name()
snd_seq_client_id()
snd_seq_parse_address()
snd_seq_create_simple_port()
snd_seq_connect_to()
snd_seq_alloc_named_queue()

Then I create a new thread that processes events.
It sets tempo and in infinite loop it does:
snd_seq_ev_set_fixed()
snd_seq_event_output()

This all is based on aplaymidi code.

How can I asynchronously immediately stop all the playback? Basicaly it 
requires breaking snd_seq_event_output() thats locked on my thread.
I tried everything I could come up with. I know very little about alsa 
synth programming and basically thats the only thing i need to do now.

Tried:
snd_seq_ev_set_queue_stop()
snd_seq_stop_queue()
snd_seq_remove_events()

or even closing the seq completely to reopen it on another file playback 
with:
snd_seq_stop_queue()
snd_seq_disconnect_to()
snd_seq_delete_simple_port()
snd_seq_close()

All failed, results were very various. I simply run out of ideas. It 
doesn't matter if the method would require to close seq or not. I just 
need to stop the playback so i can gracefully stop the thread and play 
another file (with eventual reopening ports/seq).

Would appreciate any help.

-- 
Regards    Havner                     {jid,mail}:havner(at)pld-linux.org
                    "Quis custodiet ipsos custodes?"

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

end of thread, other threads:[~2008-03-16 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-16 16:53 How to stop playback on alsa synth? Lukasz Pawelczyk
2008-03-16 21:48 ` Lukasz Pawelczyk

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.