volumio / Volumio2-UI

Volumio2 Web Based User Interface
http://volumio.org
168 stars 163 forks source link

Configure autoplay playlist / webradio on startup #219

Closed jo-me closed 7 years ago

jo-me commented 8 years ago

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 commented 8 years ago

Feature request initially flagged here as issue 329 on volumio2 repo

malcolmjlear commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

DFPozzi commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

thomasdoerr commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

Shi... :-) give me some time to think about it, Daniel

On 1 Mar 2017, at 14:42, DFPozzi notifications@github.com wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

thomasdoerr commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

@thomasdoerr Thanks! :metal: 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 commented 7 years ago

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 commented 7 years ago

Tested...

Yes! Resumes playback automatically! Tested for a couple of days now, works flawlessly, also after update to volumio 2.118.

*) Was not intending to do this, but there is a bug in volumio. Plugin install hangs when uploading a filename called "auto_play (1).zip".

LifelessDead commented 7 years ago

Volumio bug, rename to a simple filename like auto_play.zip, without the (1), then it will work just fine.On Mar 7, 2017 13:51, DFPozzi notifications@github.com wrote:Is it correct to drag & drop the file auto_play.zip in Plugin / Upload Plugin? When I do this it is freezed in 10% of the download. Is it the correct way to install the plugin or should I use FileZilla with sftp? In what direction? Go screenshot.

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.

DFPozzi commented 7 years ago

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

malcolmjlear commented 7 years ago

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

drejc commented 7 years ago

Works on RPi 3B no problems

tatoosh commented 7 years ago

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

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

malcolmjlear commented 7 years ago

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

macmpi commented 7 years ago

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

tatoosh commented 7 years ago

@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 commented 7 years ago

@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 commented 7 years ago

thx but i changed from Volumio to Dietpi, so the pull will never come from me ;)

2017-03-20 19:54 GMT+01:00 Thomas Dörr notifications@github.com:

@tatoosh https://github.com/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!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/volumio/Volumio2-UI/issues/219#issuecomment-287861906, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgDe4FwPLVlmP9QiW4HwQ8vJ29EzX9fks5rnstdgaJpZM4Kawp9 .

pjmprinz commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Hi Thomas,

Thanks for your prompt response. I understand and i am happy that you cleared my question.

Best regards, Paul

From: Thomas Dörr Sent: Thursday, January 18, 2018 6:58 AM To: volumio/Volumio2-UI Cc: pjmprinz ; Comment Subject: Re: [volumio/Volumio2-UI] Configure autoplay playlist / webradio on startup (#219)

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Spike160490 commented 6 years ago

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

thomasdoerr commented 6 years ago

hi, please try my plugin which you can find in this thread: https://github.com/volumio/volumio-plugins/issues/85#issuecomment-372118846