1.0 Introduction
The 'Resume a Global Play' menu option was only introduced to Giocoso in Version 3.30. It is used in a Giocoso Pro environment to allow one Giocoso installation to resume a play of a recording that another Giocoso device has paused. For example, you might pause a play in your main listening room so that you can continue listening to it in the bedroom on a laptop. The option will only do anything if (a) you're properly configured to use a Giocoso Pro server; and (b) if there are actually any paused 'plays' on other configured Giocoso-using devices.
Configuring a Giocoso installation to run in 'Pro mode' means using the Administration menu, Option 2 and supplying the IP address of a remote Giocoso Pro Server that you've built and configured ahead of time. If you haven't done that then taking the 'Resume a Global Play' menu option simply triggers the display of the following error message:
If you have configured your local installation of Giocoso to access a Giocoso Pro server, however, then taking this menu option does the following:
- A query is made of the Giocoso Pro's global_pausestatus table to see if any other Giocoso devices have paused a play
- If no other devices have plays paused, a message is displayed informing you that nothing is currently paused, so nothing can be resumed
- If there is one other device that has something paused, the recording in question will immediately begin playing on your current Giocoso device
- If there is more that one other device that has something paused, you'll be prompted to pick the device you wish to resume (devices being listed by their configured hostnames)
- Once a paused device has been picked, the paused recording will immediately begin playing on your current Giocoso device
2.0 The Pause Status Table
When a Giocoso device running in Pro mode selects to pause a playing recording, some data is transferred to the Giocoso Pro Server's global_pausestatus table. The data consists of three pieces of information:
- device name (the hostname of the device doing the pausing)
- recording name (in the form of the rechashvalue, derived directly from the composer and composition metadata tags associated with the paused FLAC)
- current play position (derived directly from the ffmpeg music playing engine that was previously playing the recording)
Here's a screenshot of the relevant table (using a program called DBeaver, which is a free piece of software that provides a graphical way to manage and inspect MySQL databases, which is what a Giocoso Pro Server runs):
You can see Giocoso is playing some Haydn at the top of the screen; beneath is the DBeaver display of the global_pausestatus table ...and it has no records in it. Now let me pause the Haydn play:
Now you can see that the Haydn playback has been paused: the 'Pause/Resume' option in the control bar is bright green. You'll also notice from the top right of the Giocoso window that I've played 1 hour, 22 minutes and 21 seconds of this recording before pausing. If you do a bit of maths, you'll be able to work out that this is equivalent to 4,941 seconds of elapsed play-time before the pause button was activated.
Beneath the now-paused Haydn window, we see that the global_pausestatus table now has a single record: it tells us that a PC with a hostname of 'schumann' has paused a recording with a unique identifier of 'e1504f66d5...' at 4,941 seconds. Don't get confused by that first column: it's not saying that a piece of music by Robert Schumann has been paused! You're viewing the perhaps-unfortunate habit I have of giving my PCs, laptops and servers names of composers when I build them: so this is "a PC with an assigned hostname of 'schumann'", nothing to do with the composer's music!
Anyway: the point is, that pausing a Play when operating in 'Pro' mode causes data to be written to the global_pausestatus table -and if you un-pause a recording, that data is deleted. The pausestatus table therefore only has rows of data in it when something is actually and actively paused.
Note that the primary key of the pausestatus table is the devicename column: that means you cannot have the same PC with more than one row of data describing something being paused. Hopefully, that's an obvious and realistic consequence of the fact that a single PC cannot actually play more than one piece of music at a time ...and therefore certainly can't be pausing more than one recording at a time! It does mean, however, that Giocoso device names have to be unique -which they need to be on a network anyway, so that shouldn't be an issue, either. Just be aware, however, that if a Giocoso device in mid-pause happens to crash or suffer a power loss, it likely won't be able to clear out its row from the pausestatus table... and that would prevent you from ever pausing anything again! Accordingly, every time Giocoso is freshly launched on a PC, a 'delete from pausestatus where devicename=the name of the device I'm currently launching on' is performed, ensuring that every new Giocoso session starts with a cleaned-out pausestatus table.
So: at this stage, we have one Giocoso session that has just paused a recording it was in the middle of playing. Now let's launch Giocoso on a completely separate device and see what happens.
3.0 Pause Resumption
On a completely separate PC, I take Option 6 from the Play Music menu and this happens:
Music starts playing! It's not terribly dramatic and it all just happened automatically... because there was only one piece of data in the pausestatus table, so there was no ambiguity about which other device's play I was wanting to 'pick up' and resume. You might want to take a closer look at the program display's top right-hand corner, though. Here is the original session:
Compare that to the one shown on my second PC's Giocoso display:
Notice how the new session suddenly thinks that Haydn's Creation only lasts for 27 minutes, when the original knew it lasts for over and hour and three quarters?! That's because the resuming session is only told what's left of a recording to play, not what the actual length of the recording would be if it was playing it from the start. You'll also notice that where the first session had been playing the Creation as one of a series of 10 plays in succession, the resuming session is only playing this one recording and then it will stop playing anything further. Resumed plays are not part of a 'cycle of plays', in other words, but are considered to be one-off affairs.
4.0 Ambiguous Pause Resumption
When multiple Giocoso devices have paused their playback, the pausestatus table in the Giocoso Pro Server will contain multiple rows. A new session coming along and asking to resume playback therefore has to be prompted to say which playback it wants to resume. Taking the Play Music menu, Option 6 on a third PC whilst two others are paused therefore triggers this display:
The list of available devices is constructed by querying the global_pausestatus table, so if a particular device name is not listed, it's because it's not present in that table (for whatever reason). Your job at this point is simply to up- and down-arrow to highlight the appropriate device name and then press [the Space Bar] to put an asterisk next to the chosen name, indicated that it has indeed been selected. You then just press [Enter] to confirm the selection (or tab around to the [OK] button and then press [Enter]).
Music playback then immediately begins, as soon as the appropriate paused device has been selected.
5.0 Some other points...
Some other brief points to make about this global resumption mechanism, in no particular order:
- A play paused on device 1, resumed on device 2, can itself be paused on device 2 and resumed on device 3: there's no limit to the number of devices that can pause and resume the same recording. You could even pause the recording on device 3 and resume it back on device 1: the music playback can follow you right round the house, if you so wished!
- A paused play continues to be paused on the original device, even though it resumes playback on a new device. If you pause something in the bedroom on the laptop and resume it in the listening room on the main PC, when you go back to your laptop the same recording will still be in paused mode, exactly where you left it. Completing a play on a new device doesn't alter where the original device thinks it got to with it, basically! You can, of course, hit the [Terminate] option on the original device to kill off its original, interrupted play.
- All participating devices have to be part of the same home network, with equal access to the Giocoso Pro Server. All need to have the MySQL Client software installed: this will be done for you automatically if you install Giocoso fresh, but if you are upgrading from a pre-Version 3.30 Giocoso, you'll have to take care of that yourself, as follows:
- Arch-based distros: sudo pacman -S mariadb
- Debian-based distros: sudo apt install mariadb-client
- Ubuntu-based distros: sudo apt install mariadb-client
- Fedora-based distros: sudo dnf install mariadb
- OpenSuse-based distros: sudo zypper install mariadb-client
- Until your Giocoso devices have the MySQL client installed on them, any attempt to resume a global paused play will result in the 'there are no paused devices' message:
There may well be actual paused clients on the network, but if you don't have the client tools needed to query the relevant database to see which ones they are, then you can't pick up their paused plays!
[ User Manual Home ] | [ Play Music ] | [ Database Management ] | [ Reporting ] | [ Administration ] | [ Pro ]