FrancescoCeruti / linux-show-player

Linux Show Player - Cue player designed for stage productions
https://linux-show-player.org
GNU General Public License v3.0
212 stars 49 forks source link

Action cue or another way to close LiSP #129

Open tizo78 opened 6 years ago

tizo78 commented 6 years ago

It would be good to have a way to clean close LiSP from a midi event. I am thinking of using it for live music performance,in conjunction with other software, over jackd. Each LiSP session represents a song for me, and when I finish one, I close LiSP externally (with a terminate from a pyhton script), and that generates some xruns in jackd. If I close it manually (stopping all audios being reproduced and closing it from the GUI), it generates no xruns.

Thanks!

FrancescoCeruti commented 6 years ago

It would be good to have a way to clean close LiSP from a midi event

Looks a bit extreme, but I'll see what can be done.

I close LiSP externally (with a terminate from a pyhton script) , and that generates some xruns in jackd.

Are you running the AppImage? If you can post the script I can try to figure out a way to avoid the problem :-)

tizo78 commented 6 years ago

I am not using AppImage; I have just installed the package from the apt repositories.

I will post the relevant parts of the python script later.

tizo78 commented 6 years ago

Here they are:

How I open LiSP:

lspprocess = subprocess.Popen(["linux-show-player", "-f", lspsessionfile]);

How I close it:

lspprocess.terminate(); lspprocess.wait();

FrancescoCeruti commented 6 years ago

Okay, the problem here is that LiSP handle only close signals from the UI and therefore the JACK clients are not closed correctly, and due to some errors with the server you get the xruns.

To solve it you can automate a "close-event" on the window using wmctrl (you may need to install it), with the following shell command you should be able to close LiSP without xruns:

wmctrl -c "Linux Show Player"

or with python:

subprocess.run(['wmctrl', '-c', 'Linux Show Player'])

tizo78 commented 6 years ago

Thanks!. I will try it later.

tizo78 commented 6 years ago

Thanks Francesco!. It works right now. The only problem is when I close LiSP on that way, but there are some audios cues playing; some xruns are generated on that case. Anyway, it's not a big deal, because that will occur only on abnormal situations.