Moode Forum
Switching between OH-Playlist and Radio sources - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: Switching between OH-Playlist and Radio sources (/showthread.php?tid=1975)



Switching between OH-Playlist and Radio sources - Stephane - 12-11-2019

Hi moodeaudio community,

Being myself a passionate moodeaudio fan, I'm used to control my Moodeaudio player (version 4.0 and above) with the Open-Home control app. Bubble DS (Android) that allows to switch between so called "Open-Home" (songs) Playlists and Radio lists (defined in the /etc/upmpdcli-radio.conf file). Advantage : as long as the player is running it is possible to switch from the one to the other without mixing (unlimited) radio streams with the classical songs playlists. But when an OH-Radio source was selected when the player is powered off the OH-Playlist is unfortunately lost (the opposite being false, radio list is always preserved as it comes from the fixed upmpdcli-radio.conf file).

To avoid this I'm trying to find the "command" allowing to automatically switch back from OH-Radio source to OH-Playlist before shutdown (using e.g. an hardware push-button switch connected to the GPIO that is set for shutdown) but was unable to find it, neither in the mpc nor in the upmpdcli documentation. In other words which command is sent to the Pi when I do this e.g. with the Bubble DS App ?

May someone able to help ?

Thanks beforehand, Stéphane


RE: Switching between OH-Playlist and Radio sources - TheOldPresbyope - 12-11-2019

@Stephane

Hi.

I've read your description several times and I'm still not sure I understand it exactly. 

It sounds like you are asking about how information is cached in the BubbleDS app. It's true that BubbleDS gets the information from your moOde player (in its role as a Media Server), but that's all done with standard DLNA/UPnP message exchanges. There's no "switch". 

If playlists disappear in BubbleDS when you select the Radio directory while the moOde player is off, then it's because BubbleDS cleared its playlist cache. Obviously the moOde player can't tell it to do that; it's turned off. I think the larger question is, why doesn't BubbleDS clear its Radio directory too? It can't be due to upmpdcli's radio config file in the moOde player because, again, you stipulated the moOde player is off.

Remember, all the moOde Media Server function can do is tell BubbleDS what it has when it is asked. And it can't tell BubbleDS anything when it's off.

Perhaps you can reach out to the BubbleDS developers to get more information about how their app works.

Regards,
Kent


RE: Switching between OH-Playlist and Radio sources - Stephane - 12-13-2019

@Kent and who it may interest

indeed my request makes sense but was maybe a bit of "naively" worded. Sorry but I'm not a professional programmer :-)

Open Home (OH) renderers runs by definition independently from the Control Point status. Once the PlayList created and launched this last one can be switched off and the player continues to play (even endlessly if a PL repeat was set). Thus for sure the songs PL is saved somewhere in the Pi Player, and the same for the OH-Radios (here I even know where : /etc/upmpdcli-radio.conf). Moreover when the Pi is shutdown from the song PL mode (even when set up with Bubble DS) the PL is preserved and if the "Autoplay after start" is enabled it even start again to play from where it was. Now the issue is that in case of shutdown from the OH-Radio mode (accessible with any OH compatible Control Point such as Bubble DS on Android but also with e.g. Kazoo (Linn) on Windows etc ...) practice shows that the song PL is lost and the player kept in "single track" play set up. To avoid this it is required to not forget "selecting" back from the OH-Radio to the Song PL mode before shutdown. No particularly convenient.

That's why I was trying a way to automatize it in a shutdown script launched by a hard push button switch connected to the GPIO. I finally obtain the solution from the upmpdcli "package" developer medoc92 some of you may know (Jean-Francois Dockes)   : https://www.lesbonscomptes.com/upmpdcli/  : it is required to install this small script radio-to-playlist.py e.g. in /home/pi.

Before running it :
- edit a new /etc/apt/sources.list.d/upmpdcli.list file and fill it with the following line :
   for Stretch (Moode 4 and 5) :  deb http://www.lesbonscomptes.com/upmpdcli/downloads/raspbian-stretch/ stretch main
   for Buster (Moode 6) : deb http://www.lesbonscomptes.com/upmpdcli/downloads/raspbian/ buster main
- import repository key as described here : Import the repository key
- sudo apt-get update
- sudo apt-get install python3-libupnpp
- sudo apt-get install python3-dev   (where python3 is not already installed)
- install this python3 script in /home/pi  radio-to-playlist.py  - replace where both mentioned devname by its friendly UPNP service name set in moodeaudio/Configure/Audio Config 
- sudo chmod a+x /home/pi/radio-to-playlist.py - to make it executable

now the script may be launched with : /home/pi/radio-to-playlist.py devname
I integrated in in my global shutdown script and from now on no more risk to loose my OH Song PlayLists   [Image: smile.png]

Good continuation and first of all enjoy the music !
Stéphane


RE: Switching between OH-Playlist and Radio sources - TheOldPresbyope - 12-14-2019

Clearly I misunderstood your original problem statement. Glad to hear JFD had a solution.

Regards,
Kent