Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure autoplay playlist / webradio on startup #219

Closed
jo-me opened this issue Oct 19, 2016 · 34 comments
Closed

Configure autoplay playlist / webradio on startup #219

jo-me opened this issue Oct 19, 2016 · 34 comments

Comments

@jo-me
Copy link
Contributor

jo-me commented Oct 19, 2016

There are a couple of mentions of this in the forum but it without a real solution..
There should be a configuration on what to play after booting, so either a playlist or a webradio station or auto-play the remaining queue.

Maybe you could set this in the libary's context menu on the corresponding item ("Play on startup").

Along with this goes a startup volume setting so it doesnt blow the roof off after booting just because it was loud the last time.

The corresponding forum thead is here: https://volumio.org/forum/configure-autoplay-playlist-webradio-startup-t4851.html

@macmpi
Copy link

macmpi commented Oct 19, 2016

Feature request initially flagged here as issue 329 on volumio2 repo

@malcolmjlear
Copy link

malcolmjlear commented Dec 20, 2016

I'm not at all sure this is the same request, more like #420. Issue #329 refers to the idea of replacing the start up sound with a fixed playlist, whilst here I think we are considering auto-playing the remaining queue saved on shutdown. If Volumio has been installed in a car its almost essential to have a resume playlist and track feature much like CD players and which Volumio 1.55 had as a default. I think it would be beneficial to also restore states such as 'repeat'.
I'd second jo-me's suggestion of the startup volume setting when this resume feature is enabled.

@thomasdoerr
Copy link

thomasdoerr commented Feb 8, 2017

I also need a way to start volumio playing after switching it on, since I have an old tube radio, which functions as a webradio now.
I tried a few things and ended up with a plugin, which you only need to install and activate. After booting volumio it starts the first entry in the queue. It's really simple, but I does what I need for my webradio.
If someone wants to try it...feel free.
auto_play.zip

@GRIzmak
Copy link

GRIzmak commented Feb 9, 2017

I have came up with such solution.:

#!/bin/bash
TIME=0
if [ "$#" -ne "0" ]
then
    TIME=$1
else
    TIME=0
fi
echo
for ((a=TIME;a>=0;a--))
do
    printf "\rWaiting for %3d" "$a"
    sleep 0.9
done
echo
/volumio/app/plugins/system_controller/volumio_command_line_client/volumio.sh next

Above script is started from rc.local with 120 seconds delay parameter.
This way I have working autoplay on volumio2 on Rpi zero.

The trick here is to use volumio.sh from /volumio/app/plugins/system_controller/volumio_command_line_client with next parameter instead of mpc

It's important to use next since no other option worked.

@malcolmjlear
Copy link

malcolmjlear commented Feb 12, 2017

Excellent, this seems to do the trick. I had no idea that this command line client existed, very useful when fully operational.

@DFPozzi
Copy link

DFPozzi commented Feb 27, 2017

@thomasdoerr I install it correctly, but when it is active the web interface is reset and it is disabled. Any ideas?
Rasp. 3, Volumio2.0

@thomasdoerr
Copy link

Hi, not sure if I really understand what you mean.
As far as I remember, the plugin upload process itself is not bug free. Directly after finishing the upload, the page doesn't refresh, but it does, if you navigate to another page and go back. Then you see the plugin and I was able to activate it.

Do you use a second plugin? (I played around with spotify and I far remember, that the list didn't handle more than one plugin correctly. But this was a few weeks ago, with the same volumio version, but I'm unable to exactly remember what the problem was.)

Which volumio version are you running?
I installed it on my two rasp.pi 3, volumio 2.041.

You can go to your pi (ssh) and start the command "sudo journalctl -f" in order to see, whats going on. Here is a nice documentation of that: https://volumio.github.io/docs/Development_How_To/Set_up_a_development_environment.html
Regards
Thomas

@DFPozzi
Copy link

DFPozzi commented Feb 28, 2017

Thanks for your attention. First I want to tell you that I am not an expert on Rasp or Linux, very basic knowledge.
I have Rasp3 and Volumio 2.041
I installed the Plugin from Volumio / Setup / Plugin.
Attached is a video of how it behaves.
Also a capture of the command journalctl -f
I hope you can help me.
https://youtu.be/k9jZX4Ky2Ys
autoplay

@thomasdoerr
Copy link

Hi Daniel, that's really funny to see everything in Volumio in a different language :-)
The thing is, that my code is waiting until the MPD is ready and then on top, I'm waiting for X seconds, before I simulate the 'play' button.
I noticed, that you installed 2 different plugins, which might be a problem in the sense, that all behaves different on your machine.
Could you disable the GPIO and the spotify plugin to check, if my plugin runs without them?
Let me at the end tell you, that I'm not sure, if I'm a specialist on linux and rasp :-), I just needed this plugin in order to move from volumio 1.55 to volumio 2.

@DFPozzi
Copy link

DFPozzi commented Feb 28, 2017

I also tried disabling plugins installed, it does not work.
The same was good the attempt :) We will solve it.

@thomasdoerr
Copy link

Hmm, I was just looking through the code and for the moment I don't have a clue why this happens.
What about the "Artist: ANNIE PEENBROOK". In your video I saw, that you have a webradio station in your queue and nothing else. Is Annie Peenbrook an artist, that you added before and somehow deleted the file or so? Might that be a dead entry in your playlist, which you can't see anymore?
Could you try to re-add your webradtio station by "clear and play"?

image

@DFPozzi
Copy link

DFPozzi commented Mar 1, 2017

I do not know who "Artist: ANNIE PEENBROOK" is not on my lists.
I do not know where it comes from.
I uninstalled the plugin, I cleaned the playlist, I added only my favorite radio web, and in the log it continues to appear "Artist: ANNIE PEENBROOK".
Regards

@thomasdoerr
Copy link

thomasdoerr commented Mar 1, 2017 via email

@thomasdoerr
Copy link

auto_play.zip

Daniel, I quickly changed the lib I'm using behind it to connect to mpd. On my volumio instance it worked (in a first test). Would you try this one in order to check, whether that fixes the problem. The thing is, that the bug occurs in the lib behind and not in my code, which make it hard to find it :-)
Regards, Thomas

@DFPozzi
Copy link

DFPozzi commented Mar 2, 2017

Well ... I uninstall the old version of AutoPlay, I see that it does not. I delete it manually via filezilla. All good. I install auto_play new version. All ok.
Works correctly, play the radio wen in queue. But ... there is no way I can start any web radio, do not add to the queue, too many problems.
I decide to restore to factory settings, it never starts again.
Apparently the SD card has been damaged ... There is no way to recover it.
I leave for a few days, when I return I keep trying. With a new SD.

@macmpi
Copy link

macmpi commented Mar 2, 2017

@GRIzmak wrote:

Above script is started from rc.local with 120 seconds delay parameter.

rc.local invocation is not recommended in systemd environment as process sequence can not be properly managed.
You may want to have a look at michelangello's great tutorial in order to embed it properly into sytemd: this may help solving some issues.

@LifelessDead
Copy link

@thomasdoerr Thanks! 🤘
I tried the latest auto_play.zip and it works as expected. Also for webradio!

### Note to others: Plugins don't automatically get activated after install, so don't forget to actually activate them!

@thomasdoerr
Copy link

perfekt :-) The latest version was a test version I created for DFPozzi in order to find his problem.

But before, I created a pull request with this version: https://github.com/volumio/Volumio2-UI/files/761286/auto_play.zip. If you could do me favor, please uninstall the latest and try this one. Then I'm sure, that my code, once it was accepted by the team, works.

@LifelessDead
Copy link

LifelessDead commented Mar 5, 2017 via email

@LifelessDead
Copy link

LifelessDead commented Mar 7, 2017 via email

@DFPozzi
Copy link

DFPozzi commented Mar 7, 2017

Thanks, now it works correctly, I used the previous plugin :(
@thomasdoerr, you're a genius!

@malcolmjlear
Copy link

malcolmjlear commented Mar 9, 2017

@thomasdoerr, excellent. I've been testing this on RPi 2B and 3 without any obvious issues.

@drejc
Copy link

drejc commented Mar 12, 2017

Works on RPi 3B no problems

@tatoosh
Copy link

tatoosh commented Mar 18, 2017

Same here, RPi 3B - thanks for the nice plugin!

https://github.com/volumio/Volumio2-UI/files/761286/auto_play.zip

@malcolmjlear
Copy link

Now tested on RPi Zero and Zero W without any problems.

@macmpi
Copy link

macmpi commented Mar 20, 2017

@thomasdoerr: really cool, thanks.
To fully comply with plugin install procedures, you may want to add as last statements

  • echo "plugininstallend" in install.sh
  • echo "pluginuninstallend" in uninstall.sh

@tatoosh
Copy link

tatoosh commented Mar 20, 2017

@thomasdoerr can you init a git project for your code? So i can add some features like startup a special playlist on startup, now only the last one.

@thomasdoerr
Copy link

@tatoosh I created a pull request https://github.com/volumio/volumio-plugins/pulls. When it's merged, you could implement directly on that code. Feel free to extend it!

@tatoosh
Copy link

tatoosh commented Apr 12, 2017 via email

@pjmprinz
Copy link

Hi Thomas,
First of all, thanks for writing the plugin. I am using a RPI3 and i was able to install it, and let it work. The only thing is that i am a little confused. I am using it with a few internet radio stations, and after switching on, it plays the first station in the playlist. I thought the idea was to play the last station in the list after startup. If you could comment on this, thank you. regards, Paul

@thomasdoerr
Copy link

Hi Paul,
thanks for using the plugin 👍 . The answer is easy: The plugin is very simple, it just starts the first entry in your queue after volumio started. In my case it always starts playing with "SWR3", which was and is enough for what I need. There is no logic which stores the last entry you heard before volumio stopped.
Hope that helps.
Regards, Thomas

snip20180118_1

@pjmprinz
Copy link

pjmprinz commented Jan 18, 2018 via email

@Spike160490
Copy link

@thomasdoerr When auto_play active the web interface is reset and it is disabled. Please help
Raspberry zero w , Volumio2

@thomasdoerr
Copy link

hi, please try my plugin which you can find in this thread: volumio/volumio-plugins#85 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests