MS3FGX / SomaFM

A simple Python 3.x terminal interface for streaming SomaFM
GNU General Public License v3.0
52 stars 10 forks source link

Vanilla Debian Script Issues #4

Open TodWulff opened 1 year ago

TodWulff commented 1 year ago

(new to linux & new to python <-- just to set a context)

Considering a fresh install of Debian 11 on an amd64 box (non-gui), installing somafm via pip works - opening the app works and it makes music (mplayer and mpv are installed from previous endeavors). :)

I am having one issue and one possible feature request:

1) on a ctl-c, to quit the script, it errors as depicted here: https://i.imgur.com/kK40B2S.png BTW, SSH client (putty) requires a 'reset' as chars are making it to the server but not echoed in the terminal after the error. Also, the error orphans /tmp/soma.pid, requiring a manual rm of same before script runs again. https://i.imgur.com/XszcEGv.png

2) [FR?} Is it possible to have the script continue to run when it is forced to the background? If I ctl-z to do other things in the ssh session, the player ceases to make music until I foreground it again. If I try to force it background/subshell on launch with the & control operator, it keeps quiet, sadly.

If these are easily resolved, please advise salient details. Thanks, in advance.

~MHz

TodWulff commented 1 year ago

2 is resolved thanks to nohup ( nohup somafm > /dev/null 2>&1 & ).

MS3FGX commented 1 year ago

Well that's surprising. It appears that Debian doesn't ship the "killall" command by default, which is why Ctrl-C isn't exiting cleanly.

For reference, the result of Ctrl-C should look like the following, with a "Forced Close" message and the temporary files cleaned up properly:

image

Long term, I should perhaps rethink the way force closing the script is handled if it's not going to work as expected on some distros. But in the meantime, it looks like you just need to install the psmisc package which will get you the "killall" command (as well as a few others):

https://debian.pkgs.org/11/debian-main-amd64/psmisc_23.4-2_amd64.deb.html

Alternately, if you're using mplayer as the backend (it looks like it, from the picture), you should be able to stop playback by simply pressing Q. This will make mplayer exit normally, and doesn't require the killall command.