Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Switching between OH-Playlist and Radio sources
#3
@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/d...n-stretch/ stretch main
   for Buster (Moode 6) : deb http://www.lesbonscomptes.com/upmpdcli/d.../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
Reply


Messages In This Thread
RE: Switching between OH-Playlist and Radio sources - by Stephane - 12-13-2019, 10:04 PM

Forum Jump: