Giocoso Version 3 - Usability Tips and Techniques

I thought it might be helpful to document how I use Giocoso on a regular basis. Some of this may be useful to you, too!

1.0 Remote Access

I do not run Giocoso on my main, desktop PC. Instead, I have a painfully feeble and slow fan-less PC sitting in an old TV cabinet to which I can connect via Ethernet network and I run Giocoso on that instead. However, I am sat at my desktop PC for long hours of the day: that's obviously the computer with which I want to control Giocoso. So how do I issue commands on my desktop PC and yet control Giocoso running in the TV cabinet?

SSH is the answer -and, more specifically, X over ssh.

The Giocoso PC (we'll call it 'sparky3', as that's its hostname) runs the OpenSSH server, installed on Debian and Ubuntu-flavoured distros with the command:

sudo apt install openssh-server

After installation, the commands:

sudo systemctl enable sshd
sudo systemctl start sshd

...should mean that the ssh server is now running and ready to accept connections over the home network, on the default port 22.

On the main desktop PC, I need to install the OpenSSH client package (Ubuntu's command would be sudo apt install openssh-client). Once that's installed, I can open a terminal on my desktop PC and issue the command:

ssh -Y hjr@sparky3

The "-Y" bit there permits me to remotely launch graphical applications on the music PC... and Giocoso, oddly enough perhaps, counts as such an app:

From the command prompt, you can see that I am now 'virtually sitting' at the music PC's keyboard: commands I type here, whilst sat at my desktop PC, will execute as if they had been typed directly on the music PC. You can actually see this when I submit that last command to run 'giocoso':

That looks like standard Giocoso. Indeed, it is standard Giocoso! But look at the window's title bar: "(hjr) sparky3 - Konsole". That tells you that Giocoso is running on a PC whose name is 'sparky3'... but you saw in the screenshot before this that I was originally typing things on a PC called 'britten', from which I merely connected, remotely, to sparky3. Perhaps this screenshot makes it even more obvious:

That's me on my desktop PC's main desktop, with two terminal sessions launched: one's clearly on a PC called 'britten', whilst the other's busy running Giocoso in a window belonging to a PC called 'sparky3'.

This all simply means that I can operate Giocoso from my desktop PC, but everything I do is actually running on the music PC. I have remote control of what Giocoso does... but the program display is entirely as if I were running it locally.

2.0 Uninterruptibility

I've run Giocoso remotely as described above for months on end... but almost every day, I accidentally close the terminal window on my local PC... which immediately causes Giocoso running on the music PC to abruptly stop playing. This is annoying at any time, but when you've played 1 hour 25 minutes of a 1 hour 30 minute requiem, it's infuriating: none of that 'play', which was substantially complete ever counts or gets recorded in the Giocoso play history.

So, how can I do things remotely as previously described, but add an 'uninterruptible' component to proceedings? If I shutdown on my desktop PC the terminal running remote Giocoso on the music playing PC, I don't want Giocoso to terminate. I simply want it to continue playing away, oblivious to what I'm doing on the PC it's not running on!

The answer is: tmux. It's a little utility, which you'll probably have to install, that allows terminals to be 'disconnected' whilst the programs they're running continue running in the background. So, first, I had to install tmux on my music PC:

sudo apt install tmux

Once that's done, I run the program:

tmux

That causes the terminal display to acquire a 'status bar' type of thing at its bottom edge:

It's just a reminder that your bash environment is not running 'native', but within the context of a tmux session. Accommodating that extra line of 'status information' means you probably want the desktop PC's terminal emulator to be configured to display 29 vertical lines, not the 28 you'd normally want to display Giocoso properly. You can edit your terminal's profiles to achieve that extra line of vertical space automatically -or just re-size the terminal manually if you prefer.

Once tmux has been launched, you can type commands to launch Giocoso as normal:

A fairly normal-looking Giocoso display, I think you'll agree! So now, start playing music (by taking Option 1 on the Play Music menu, for example). Once it's playing, let the tmux magic start. Type:

Ctrl + B (nothing appears to happen)
D ('detach' from the program)

...which results in:

...and, as you can see, I'm now back at a command prompt with, apparently, Giocoso not running! Except, as my ears can tell (but yours unfortunately cannot!), Giocoso is busy playing music just as well as it ever was. The point is that it's doing it in the background, so I can shut this terminal down completely ...and the music will still keep playing. Inadvertent shutdowns of terminals screwing with Giocoso's ability to complete a play is now a thing of the past.

If you want to get back control over the background-playing Giocoso session, you can simply start a new terminal session and type:

tmux a

...which returns you to your previously-detached Giocoso, running exactly as ever it was.

It's not perfect: the album art display does not work when Giocoso is run within tmux in this way, so you see this sort of thing:

The big, black space on the right of the screen is not supposed to be like that... but the loss of a display of album art in this way is a price I'm sometimes prepared to pay!

3.0 Mobile Alternatives

Sometimes, I'm sitting listening to music in a big, old comfy armchair, not sitting at my desktop PC at all. How do I remotely control my music PC from there, then? There are two options:

3.1 KDE Connect

KDE Connect is a utility which allows a mobile phone to control a PC, provided that both PC and phone have the KDE Connect app installed. On the phone front, there is definitely a KDE Connect app in the Android store; there is allegedly an equivalent for iPhone (but I know nothing about it!) Let's just assume you've installed it on your phone, anyway.

On the PC side of things, you install KDE Connect as you would any other package on Linux, from your distro's repositories. I should note that there's a version of KDE Connect available for Windows from the Windows Store, so it's not a Linux-only thing; nor do Gnome users have to miss out on its features, as they can not only install 'true' KDE Connect, but can also install a Gnome extension (called gsconnect) which provides the equivalent functionality.

Anyway, here's me doing the installation on my music PC, which runs Linux Mint Debian Edition (so basically counts as Debian):

Once the app is installed on both devices, you 'pair' the two of them. That's done from the phone-side of things: launch the app and select an appropriate device to pair with:

Here, 'spartky3' is listed as a PC that's running a KDE Connect agent, so I select that and then...

...I hit the 'request pairing' button. That sends a message to my music PC, on which this appears:

You are, in other words, required to accept the pairing request by clicking on the appropriate button on the media PC itself. Once accepted, the display on the phone will change, too:

The phone can now send commands to the media PC, or files, or do a bunch of other stuff: you have, in effect, configured your phone to be a remote control for the media PC. The only issue is that no commands have yet been configured, so if you click on that Run Command button on your phone, for example, you'll see this:

Not a problem: click the blue 'pen' icon, and a dialog will appear on your phone saying merely that 'You can add commands on the desktop', which seems less than helpful. Switch back to the media PC, however, and you'll now see this:

So now you have access to the dialog you need to construct useful Giocoso-controlling commands, such as:

/usr/bin/giocoso3.sh --autostop
/usr/bin/giocoso3.sh --play
/usr/bin/giocoso3.sh --pause
/usr/bin/giocoso3.sh --terminate

...such that you end up with this sort of thing:

Click [OK] to save that lot and your phone should now be able to issue those commands to the media PC:

Once that's all configured, you will be able to remotely administer your music-playing Giocoso session without ever having to remove yourself from your favourite comfy chair!

3.2 JuiceSSH

Sometimes, KDE Connect isn't quite enough for my needs. How, for example, do I get to control the audio volume with it? You can't, basically: in Giocoso, you could use the Control menu Option 6 and access the alsamixer volume control... but that requires seeing the volume slider and upping- and downing- the volume slider accordingly, in an interactive manner. That sort of interaction with programs isn't something KDE Connect does very well: it can certainly issue one-liner commands to a remote PC, but running a program interface and letting you do things with it aren't part of its design goals.

So for that sort of thing, I use JuiceSSH (other SSH Clients for non-Android mobile phones are available!): though I've linked to their website, the app is available to download from the Google Play Store as usual. Once it's installed on your phone, you launch it and use the 'Quick Connect' feature to connect it to the media PC:

So here I'm setting up a connection between my phone and the media PC, mentioning it by name (because my in-house DNS server resolves that name to an IP address: you can just use the IP address if you need to). You create the connection in the form username@remote-pc, so here I'm proposing to connect to my sparky3 media PC as user 'hjr'.

Once the connection has been created, you can launch it and this will happen:

The thing fails to connect initially because the 'Quick Connect' option doesn't prompt you to supply the username's password -but you can type that now (and click the 'Remember Password' option if you don't want to be prompted like this again). Click [OK] to submit the password credentials and you'll be taken to this:

Now... it's tiny, I realise! But, it's a command prompt, running on your phone, but as though you were typing directly onto the media PC. So you can interact with your media PC as much as you like. In this case, I can type the command alsamixer and get to this:

 

That's just standard alsamixer... so, because I didn't specify a device to control, it's opened at the master channel, which is useless to me. Instead, I need to press F6 and select my Topping E30 device to control... how do I press F6 on a phone?! Well: that FN button you see beneath the command prompt comes in handy at this point:

Instead of seeing 'ESC / | - HOME...' and so on, pressing FN turns all the options into F1, F2 and so on function keys (press that curled arrow to get back to the previous set of keyboard shortcuts). So, I can simply press F6 and, as you can see above, the usual 'pick a sound card' prompt appears. It's then trivial to select the 'E30' device:

...and control its volume in the usual way. When I'm done, press ESC, and then type exit to trigger a disconnect of the phone from the remote PC.

Incidentally,

4.0 Conclusion

So there you have it: if I'm sitting at my main PC, I can control the media PC via SSH, running under tmux so as to avoid inadvertent disconnections. If I'm not near my main PC, I can nevertheless initiate music play (or pause it, or terminate it, as the need arises) via my phone, thanks to KDE Connect. And, finally, if I need to interact with my media PC without actually touching it directly, I can do that on my phone too, via the joys of an Android SSH client such as JuiceSSH.

Sparky3 can, therefore, stay completely out of my way, locked behind its TV cabinet doors, without me ever needing to see it in person: I nevertheless can control it (and, more specifically, Giocoso running on it) with relative ease and without having to exert much by way of anything other than initial-setup efforts! Enjoy your comfy listening room seat, in like manner, too!


[ User Manual Home ]