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

plugin no longer working after waking from suspend #296

Open
AstroKosmoNaut opened this issue Jan 20, 2021 · 8 comments
Open

plugin no longer working after waking from suspend #296

AstroKosmoNaut opened this issue Jan 20, 2021 · 8 comments

Comments

@AstroKosmoNaut
Copy link

I am running volumio with the volspotconnect2 plugin on an Asus eeePC900 netbook, and the latest version is working like a charm with gapless playback.

There is one thing though: I have configured volumio to go into suspend mode using the power button. When waking from suspend, volumio itself works, but the volspotconnect2 plugin isn't visible from other spotify devices on my network.

it seems the plugin either doesn't wake from sleep or doesn't reconnect to the ntework. is there anything i can do to nudge the plugin to wake up, e.g from a script to run on wake.

@AstroKosmoNaut
Copy link
Author

it took me a little while, as my nineties UNIX knowledge is quite rusty, but I solved the issue for now. Don't know if it is the proper way to do it, but at least it works.

I have created a script named /lib/systemd/system-sleep/99restartvollibrespot with the following contents:

#!/bin/sh

set -e

if [ "$2" = "suspend" ] || [ "$2" = "hybrid-sleep" ]; then
case "$1" in
pre) true ;;
post) sleep 1 && killall vollibrespot ;;
esac
fi

as far as I am concerned, this issue can be closed, although the developer(s) may want to incorporate this fix or another one,

@ashthespy
Copy link

ashthespy commented Jan 21, 2021

I would reckon when coming out of suspend, the daemon doesn't behave properly as it doesn't have any reconnect capabilities.

Your solution would work, but I'd suggest restarting the service instead (vollibrespot2volspotconnect2.service)

@AstroKosmoNaut
Copy link
Author

AstroKosmoNaut commented Jan 21, 2021

Thanks for the suggestion. I tried it, but it doesn't work. Listing the services didn't show that service, however it did show a volspotconnect2.service, and using that did the trick. I assume a little typo, or should there be a service named vollibrespot2.service?

For anyone who wants to know, my current script is:

#!/bin/sh

set -e

if [ "$2" = "suspend" ] || [ "$2" = "hybrid-sleep" ]; then
case "$1" in
pre) true ;;
post) sleep 1 && systemctl restart volspotconnect2.service ;;
esac
fi

@ashthespy
Copy link

Sorry my bad.. it is indeed volspotconnect2 :doh:

@AstroKosmoNaut
Copy link
Author

I noticed that when volumio is playing a track when you put the system to sleep, it will resume in play mode, but without any audio being sent to output. after some experiments I arrived at the following scipt to make volumio stop and start properly:

#!/bin/sh

set -e

if [ "$2" = "suspend" ] || [ "$2" = "hybrid-sleep" ]; then
    case "$1" in
        post)  volumio vstart
                systemctl restart volspotconnect2.service
                break
                ;;
        *) volumio vstop
                sleep 2 ;;
    esac
fi

@ashthespy
Copy link

If you stop and start the Volumio service, you don't need to restart volspotconnect2.service as it will be picked up by the main Volumio service anyway..

@AstroKosmoNaut
Copy link
Author

Actually I tested both scenarios, and it looked like including the statement works faster. When I have time, i will investigate further.

@ashthespy
Copy link

Well, that is true, the VLS daemon will get started only after Volumio is completely booted, and launches all plugins.
Given that the VLS daemon doesn't require Volumio to have started up to play music, your approach would speed things up indeed :-)

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

2 participants