Re: How to stop playback on alsa synth?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think I've done it, just don't know how correct my solution is

I've added snd_seq_drain_output() after snd_seq_event_output() in thread 
function so the events are processed more "real time" as I understand 
it. I've also moved queue creation to the beginning of thread function 
(because stop function deletes the queue).

Then the stop function calls:
sets a bool to break the thread loop.
snd_seq_free_queue()
snd_seq_drop_output()

This seems to work. Any comments?

One problem I got with it though is that sometimes when I stop one music 
and play another one some note(s) from the old one are played 
indefinitely during the new music. I suppose some 'clear' event should 
be sent to remove it. I've tried MIDI_CTL_ALL_SOUNDS_OFF control one (as 
pmidi does on exit) but no luck.

-- 
Regards    Havner                     {jid,mail}:havner(at)pld-linux.org
                    "Quis custodiet ipsos custodes?"
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux