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

OnOff SHIM music does resume automatically #1189

Closed
MrReSc opened this issue Dec 10, 2020 · 4 comments
Closed

OnOff SHIM music does resume automatically #1189

MrReSc opened this issue Dec 10, 2020 · 4 comments

Comments

@MrReSc
Copy link

MrReSc commented Dec 10, 2020

I used the OnOff SHIM to switch the Phoniebox on and off. If something is playing and I switch the box off with the OnOff SHIM without stopping the music, and then start it again, the music is automatically played again. Is it possible to change this behaviour?

If music is playing and I restart from the Web UI, the behaviour is different. The music does not resume automatically.

@BerniPi
Copy link
Collaborator

BerniPi commented Dec 11, 2020

Hello!

Open the file /usr/bin/cleanshutd with an editor (nano) and add the two lines

 /home/pi/RPi-Jukebox-RFID/scripts/resume_play.sh -c=savepos; mpc clear
 /usr/bin/mpg123 /home/pi/RPi-Jukebox-RFID/shared/shutdownsound.mp3

at the following place (line 86):

while true; do
    while [ "$daemon" = "on" ]; do
        if shutdown_trigger; then
            /home/pi/RPi-Jukebox-RFID/scripts/resume_play.sh -c=savepos; mpc clear
            /usr/bin/mpg123 /home/pi/RPi-Jukebox-RFID/shared/shutdownsound.mp3
            msg="BCM $trigger_pin held low, system shutdown in $shutdown_delay minutes"
            echo $msg
            wall $msg
            daemon="off"
            shutdown -h +$shutdown_delay
            break
        fi
        sleep $polling_rate
    done

@BerniPi
Copy link
Collaborator

BerniPi commented Dec 11, 2020

Alternative solution:
Add the line
/home/pi/RPi-Jukebox-RFID/scripts/playout_controls.sh -c=shutdown

instead of the two mentioned lines at the same place.

Advantage: the shutdown routine gets updated with phoniebox updates.

@s-martin
Copy link
Collaborator

s-martin commented Dec 11, 2020

Duplicate of #951

@s-martin s-martin marked this as a duplicate of #951 Dec 11, 2020
@MrReSc
Copy link
Author

MrReSc commented Dec 12, 2020

Alternative solution:
Add the line
/home/pi/RPi-Jukebox-RFID/scripts/playout_controls.sh -c=shutdown

instead of the two mentioned lines at the same place.

Advantage: the shutdown routine gets updated with phoniebox updates.

I have just found the solution myself. I did it exactly like this.

@MrReSc MrReSc closed this as completed Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants