[PLUGIN] Volspotconnect2 - SpotifyConnect for Volumio2

For the brave who are willing to help test the new development version of Volspotconnect2 - we have implemented direct volume control, dynamic playlists (radio) and other goodies.

Full details over at balbuze/volumio-plugins/pull/191 and github.com/ashthespy/Volumio-SpotifyConnect

The plugin’s daemon still uses librespot but has been implemented specific for Volumio - hence dubbed vollibrespot

To install - remove the previous version of volspotconnect2 from the webUI, and then via install the usual way via SSH:

wget https://files.gitter.im/ashthespy/MVG2/Volspotconnect2_0.8.0.zip
mkdir ./volspotconnect2
miniunzip Volspotconnect2_0.8.0.zip -d ./volspotconnect2
cd ./volspotconnect2
volumio plugin install

Logs are available with

# Volumio logs
sudo journalctl -f -o cat
# vollibrespot logs
sudo journalctl -f -o cat -u volspotconnect2.service

Looking forward to some feedback! :slight_smile:

Hi Ash,

Thanks for the major update.
Enjoying the plugin on a daily basis it is good to see development is still going strong.

alsa support is really appreciated, but I don’t get why I still can set the starting volume,
wouldn’t it be better if volspotconnect got that from volumio?

radio support is a great thing, does this also include getting newer songs after the end of a playlist?

On a side note, I noticed that starting playing spotify connect doesn’t stop the new implementation of Tidal or Qobuz.
Not sure if this is on the volumio side or on the plugin side.

Thank you so much (again)

Dennis

Thanks for your development!

Unfortunately i can’t disover the volumio in spotify.

Log says:

/data/plugins/music_service/volspotconnect2/startconnect.sh: line 3: ./vollibrespot: No such file or directory volspotconnect2.service: main process exited, code=exited, status=127/n/a Unit volspotconnect2.service entered failed state.

Looks like vollibrespot hasn’t been installed correctly.

I think I had that too, you have to reboot the device.
after that it worked fine

This option was to set the default volume on starting the daemon, but I see your point, it should just use the Volumio ‘startup’ volume.
On subsequent Connect sessions, it should uses the last set volume.

Hmm, if the playlist was started as a Playlist radio then yes - it doesn’t do anything with the Recommended Songs the normal client sees at the end of the playlist.
What doesn’t work is the dailymixes unfortunately.

The plugin sends out the default ‘Stop’ command to Volumio - unsure why it fails only for the new stuff. Could you share a log snippet when you try this?

Hmm, can you check if the file exists in the directory?

ls /data/plugins/music_service/volspotconnect2/

There were some issues with extracting the archive before, could you try downloading it again to the plugin directory?
You can do this either manually downloading the binary again from github (for your device cpu architecture)
or run gist.github.com/ashthespy/8f86f … c63d7ce683
you could directly pipe it to bash if you like (This is NOT recommended for scripts you don’t trust!)

curl https://gist.githubusercontent.com/ashthespy/8f86f1825acbd716fc4b78c63d7ce683/raw/06f9a33ff9e39f6a7b83d97ab758cbe98ef64f9e/getVollibrespot.sh | bash

oke so playing qobuz song and then starting spotify(allready connected)
volumio system says it is starting volumioconnect playing, but doesn’t display
in browser it says there is no music playing, but qobuz keeps playing until the song ends…

also the other way around doesn’t work properly,
so when librespot plays and I select a radio station or local file,
librespot stops the selected music starts playing but nothing on the display.

will try more tonight, when my wife and children are fast asleep…

cheers

and here are the logs…

https://pastebin.com/8jGi2V5C

(edited because I figured the logs would be better of somewhere else)

I will try it tomorrow and report back. Thanks!

Gesendet von meinem Pixel 2 mit Tapatalk

Hmm - looks like the plugin wasn’t able to switch from the Volumio state to Spotify - specifically this

Nov 22 13:48:20 woonkamer volumio[976]: info: CONSUME SERVICE: Received update from a service different from the one supposed to be playing music. Skipping notification. Current mpd Received volspotconnect2

Does this also happen when you have multiple items in your play queue? Could you confirm if it happens also with a single item?

I’m not really sure I understand what you mean…
Both Librespot and the volumio playque has more items in it then it happens, but it also hapens when I select a radio station on my ir remote control
then there is only one item in the playcue (the radio station)

btw. I’ll try this tomorrow on my work with the old volspotconnect2 and myvolumio, I think it reacted simular, but I didn’t think much of it at the time.

cheers
Dennis

As far as i understand vollibrespot was installed?

volumio@volumio:~$ ls /data/plugins/music_service/volspotconnect2/ SpotConnController.js logger.js startconnect.sh UIConfig.json node_modules uninstall.sh config.json onstart1.sh vollibrespot-armv6l.tar.xz i18n package-lock.json volspotconnect2.service.tar index.js package.json volspotconnect2.tmpl install.sh remove.sh

Because the archive of it (vollibrespot-armv6l) is already in the folder the getvollibrespot-bash doesn’t work i assume:

curl https://gist.githubusercontent.com/ashthespy/8f86f1825acbd716fc4b78c63d7ce683/raw/06f9a33ff9e39f6a7b83d97ab758cbe98ef64f9e/getVollibrespot.sh | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1657 100 1657 0 0 7186 0 --:--:-- --:--:-- --:--:-- 7235 Detected cpu architecture as armv6l Supported device (arch = armv6l), downloading required packages https://github.com/ashthespy/Vollibrespot/releases/download/v0.1.2/vollibrespot-armv6l.tar.xz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 617 0 617 0 0 1046 0 --:--:-- --:--:-- --:--:-- 1049 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file vollibrespot-armv6l.tar.xz: Permission Warning: denied curl: (23) Failed writing body (0 != 16360) Failed to download vollibrespot daemon. Stopping installation now. Check your internet connection, and check DNS settings in Volumio for possible cause Exitting now volumio@volumio:~

Maybe i try a new installation of volumio this evening.
BTW i am running on raspberry pi zero w.

Nope, it has been downloaded, but has been unable to extract it. Strange.
You could try removing the archive and re-downloading/extracting it via that script I posted:

rm  vollibrespot-armv6l.tar.xz
curl https://gist.githubusercontent.com/ashthespy/8f86f1825acbd716fc4b78c63d7ce683/raw/06f9a33ff9e39f6a7b83d97ab758cbe98ef64f9e/getVollibrespot.sh | bash

Or, you can try extracting the archive manually with:

tar -xf  vollibrespot-armv6l.tar.xz
# Test the new binary 
./vollibrespot -v

That shouldn’t be an issue - I run it on a pi zero myself :slight_smile:

Had some questions about the volume.
because now when I restart the plugin it resets the volumio volume to 33 or
whatever volume the initial volume is set.

you mentioned setting the volume to the start volume of volumio, but wouldn’t it be much
better to check the volume of volumio at the start of each song?
this way it will never be to soft or to loud?

cheers
Dennis

After removing and downloading again:

[code]volumio@volumio:/data/plugins/music_service/volspotconnect2$ curl https://gist ithubusercontent.com/ashthespy/8f86f1825acbd716fc4b78c63d7ce683/raw/06f9a33ff9e3 9f6a7b83d97ab758cbe98ef64f9e/getVollibrespot.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1657 100 1657 0 0 8481 0 --:–:-- --:–:-- --:–:-- 8541
Detected cpu architecture as armv6l
Supported device (arch = armv6l), downloading required packages
https://github.com/ashthespy/Vollibrespot/releases/download/v0.1.2/vollibrespot- armv6l.tar.xz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 617 0 617 0 0 923 0 --:–:-- --:–:-- --:–:-- 923
100 4441k 100 4441k 0 0 1202k 0 0:00:03 0:00:03 --:–:-- 1921k
Extracting…
-rw-r–r-- 1 volumio volumio 4548188 Nov 23 22:01 vollibrespot-armv6l.tar.xz
tar (child): lbzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

volumio@volumio:/data/plugins/music_service/volspotconnect2$ ls
SpotConnController.js logger.js startconnect.sh
UIConfig.json node_modules uninstall.sh
config.json onstart1.sh vollibrespot-armv6l.tar.xz
i18n package-lock.json volspotconnect2.service.tar
index.js package.json volspotconnect2.tmpl
install.sh remove.sh
[/code]

If i try to extract it manually i get the same error.

My oversight, fixed it only for armv7 - it should now work properly for your armv6 as well - can you remove the archive and retry the script?

Well - the initial volume flag was left in place for people who don’t have a mixer in their volumio setup - but the more I think of it, the more I feel this flag is redundant now that we hook into the alsa subsystem directly.
To clarify though - when you start playing a new song from Spotify - it uses the last volume set on the player, this flag is only for when the daemon is initialised.

Thanks it works now!

Hi,

I have two VOLUMIO on ODROID C2 boards. Both are very similar … One is for daily play ( let me say stable previous configuration), and the another is for testing ( new updates) …

The latest volspotconnect2 version 0.8.0 does not start on latest volumio odroid-c2 version 2.513.
But volspotconnect2 version 0.7.4 on latest volumio odroid-c2 version 2.513 runs well and
volspotconnect2 version 0.8.0 on previous stable volumio odroid-c2 version 2.344 runs well to.

The log :

As volspotconnect2 is enabled on volumio UI, the volspotconnect2 DAEMON fall into endless start-panic-fail-stop -> start-panic-fail-stop -> … cycles.

Any idea ? Suggestion ? Where to start debugging ?

How can I capitalise the system name? I.e. shows streamer and I want to show Streamer?

The ssh name and hostname is capitalised.

From the logs the issue is in determining the right ALSA device:

[Vollibrespot] : Setting up new mixer: card:hw:2 mixer:XMOS Clock Selector,1 index:0 thread 'main' panicked at 'Couldn't find SelemId', libcore/option.rs:1000:5 stack backtrace:

I haven’t looked into what has changed fr0m 2.344 => 2.513, they could have made some changes to the card naming scheme, got to check.
In the meantime, can you share your alsa setup fromstartconnect.sh file and from aplay -l?

change the --name flag in startconnect.sh - but this will be rewritten on every reboot. I started working on this from the Volumio side, but got side tracked as there were to many other things to fix first (like persistent UI warnings and others).
For something more permanent, just hard-code it into the volspotconnect2.tmpl file and remove the '${devicename}' entry.

Currently I’m using HiFi Shield 2 as the output device. VSC2 dev 0.8.0 works well. But here are your requested results :

/data/plugins/music_service/volspotconnect2//startconnect.sh :

aplay -l :

My next post will contains results with Topping D30 USB DAC as output device

Currently I’m using Topping D30 USB DAC as the output device. Here are your requested results :
After changing output device from HiFi Shield 2 to Topping D30 USB DAC.
VSC2 dev ver 0.8.0 was NOT RESTARTED !!

/data/plugins/music_service/volspotconnect2/startconnect.sh

aplay -l

VSC2 dev ver 0.8.0 was RESTARTED !! VSC" ON->OFF->ON the endless loop start again, and the startconnect.sh changed !

/data/plugins/music_service/volspotconnect2/startconnect.sh :

The journal is :
sudo journalctl -f -o cat -u volspotconnect2.service :