I resolved my issue with the
SpInit: 0
Traceback (most recent call last):
File “main.py”, line 27, in
connect_app = Connect(web_error_callback)
File “/usr/src/app/connect.py”, line 75, in init
lib.SpPlaybackUpdateVolume(mixer_volume)
OverflowError: can’t convert negative number to unsigned
error message by reverting back to the 3.18.5-v7+ kernel after having updated it. After that spotify connect is now starting and working fine.
The only issue I am now having is that since then the volume control in volumio does not work. I can control the volume from spotify when using connect but when playing things through the volumio web interface the volume control does nothing.
I presume it is that connect is not releasing the mixer control when it is not playing a track but I am unsure how to resolve this.
Thank you very much for all information provided in this thread.
I got Spotify Connect running without a problem, including autostart.
Is there a possible way of resampling audio from it? In volumio I have it set to 32/192, but via spotify connect it goes directly to 44. I like upsampling and would like to stick to that option. Thank you in advance for help.
As off topic, I might have a small advise if someone would like to install chroot directly in our user home folder, instead of root.
Follow first two steps of instllation, starting in our home directory i.e. /home/pi:
There might be a different way to install, however this is what I have been struggling with and it might be the case for other users. I saw posts of people copying from root to home directory (this is what I did for the first time, as I could now make it autorun after restart).
I also had problems with the --mixer switch. I performed the install as written in the readme on github. I think the --mixer problems occur on the analog hifiberryDAC. I use it with an RPi B. My fix is to comment all code using the mixer and volume. And I got it working.
I’m still not 100% sure if there isn’t an more elegant way. So that is still under investigation. It should be possible to pass an working playback_volume if the mixer is not available.
But for now the result is a working spotify:connect and with that i’m pleased. Tomorrow I will put the whole config to a more thorough test.
Can you tell me what happens if you start “amixer” or “alsamixer” from console? Is “alsamixer” telling you “This sound device does not have any controls.”?
root@volumio:~# amixer -v
amixer version 1.0.27.2
root@volumio:~# amixer
root@volumio:~#
alsamixer gives a gui. I installed in my search for the solution.
I am under the imperession that the problem is the DAC itself. I t doesnt support volume_controle. For example i had (and have) no problems playing spotify playlists through the volumio gui. If it really is an mixer problem, this also shouldnt be working (for a far a i understand it).
After disabling all the lines you mentioned I get the following error:
Loading Spotify library…
Traceback (most recent call last):
File “main.py”, line 11, in
from connect import Connect
File “/usr/src/app/connect.py”, line 12, in
class Connect:
File “/usr/src/app/connect.py”, line 13, in Connect
def init(self, error_cb = error_callback):
NameError: name ‘error_callback’ is not defined
Did you disable “#playback_volume” only in the “playback_callbacks” in file “console_callbacks”?
the last comment is indeed a bit tricky. I tried to keep the code as original as posible. Therefor I had to comment the #, at the end of the line before the playback_volume line.
first of all, thank for this great work, bringing Spotify Connect to Volumio!!
I’ve installed the latest version (chroot) from github “Fornoth/spotify-connect-web” and it works perfect. Beside Spotify Connect I’m using volumio’s UPNP renderer with JRivers - JRemote to stream from my local music library. Switching between the two apps is easily accomplished using the stop button and than changing the application.
Now, I have started to think about controlling volumio with a IR remote control using lirc. For that case I’m looking for a possibility to stop the spotify player and for example to start mpc with a radio stream.
So, is there a possibility to stop the spotify player without killing and restarting the whole process?
I did a plain new installation of Volumio 1.55 (flashed a new SD-card)
I deleted the original console_callbacks.py in the /home/volumio/spotify-connect-web-chroot/usr/src/app/ folder and substituted it with the console_callbacks.py from https://github.com/Fornoth/spotify-connect-web/blob/855b92b49555cdcc11d0ab4c71866475cd7c9499/console_callbacks.py. So far I understand this step is important. The console_callbacks.py from Fornoth gives the mixer free when the spotify-connect playback is stopped. In doing so, other applications (e.g., mpd) are able to ‘grab’ the mixer and to play music. The original console_callbacks.py still ‘owns’ the mixer even when spotify-connect playback is stopped. Therefore, other applications are not able to playback music because the mixer is ‘blocked’. (Please correct me if I am wrong.)
I modified the connect.py in the /home/volumio/spotify-connect-web-chroot/usr/src/app/ folder.
I changed the line:
The mixer volume has to be set to 1 because the hifiberry digi has no volume control. It simply gives out the bit perfect data via the optical or electrical port. The data have to be transformed to an analog signal by an external digital-analog-converter (DAC; in my case a Musical Fidelity V90DAC which is connected via coax through the electrical output). The volume cannot be changed via the spotify-app. It has to be changed directly at your power amplifier.
I disabled the onboard soundcard (analog and HDMI) of the raspberry pi.
I changed this line in the /etc/modules:
Conclusion: I think, step 3 is the most important step. However, step 2 is also important if you want to use spotify-connect alongside with other playback applications (e.g., mpd).
I hope this is helpful for you. Thank you very much for writing this awesome feature. It is a great pleasure to playback spotify music on your raspberry pi - hifiberry digi system and controlling it over the spotify app on your smart phone.
I tried this with success, i also have the hifiberry digi+ and changing volume from the phone works great. BUT, sound quality is taking a hit. Wife heard it as well so its not in my head. Or is it?
I have two set-ups (one for my livingroom and one for my bedroom):
Raspberry Pi 2–> Hifiberry Digi + → Musical Fidelity V90 DAC (connected via coax) → Yamaha AS 700 power amplifier
Raspberry Pi B Rev 2 → Hifiberry Digi → Wolfson WM8718 DAC integrated in my Onkyo A9050 power amplifier (connected via optical output)
For both set-ups I disabled the volume control in the Volumio settings and I set the mixer_volume to 1 in the connect.py:
I control the volume directly at my power amplifier (analog volume control). If I compare a loosy 320 kbit ogg vorbis file from Spotify with a lossless flac file played in Volumio (I have several recordings that are available on Spotify and in my local music collection [lossless flac rips from CDs I own]) I can’t hear a big difference. I think that in a blind test I am not able to tell whether it is a lossy compressed 320 kbit ogg vorbis file from Spotify or a lossless flac file from my local music collection. So if the volume control in the Spotify app degrades your sound quality, it might be the case that this is caused by some kind of software volume control. I heard that software volume control can affect the sound quality (Is anybody here who can explain why?) . As far as I know from the Hifiberry forum, there is no hardware volume control available in the Hifiberry Digi. See this post from Daniel (a developer from the Hifiberry team https://support.hifiberry.com/hc/en-us/community/posts/201845971-RPI-2-amp-Digi-Hardware-volume-in-Rune-Audio-):
I don’t know if the Hifiberry Digi + has a hardware volume control. Does anybody know this? In your case, it might be helpful to disable the volume control in volumio and directly use the analog volume control in your power amplifier. This might be less comfortable but may increase sound quality.
I have installed on my RPi 1B 512mb Volumio 1.55 and the spotify connect chroot.
My RPi 1B is connected with hdmi to my yamaha receiver. I use the standard hdmi audio output.
I always keep the RPi alive, but my other AV devices are going into standby mode and the tv is off during the night
spotify connect Works like a charm however i have one problem. When i turn on the all av devices in the morning, there is no sound on spotify connect device but the spotify connect device is still visible. Only a restart is solving the problem. Without the spotify connect chroot, volumio has no such problem.
Additional: I also have a RPi kodi/openelec attached to the Receiver
In some cases the spotify connect service disappears from my network, so I can’t find it on other devices in Spotify. The spotify connect web service is still running. I’ve to manually restart the service to make the service available again.