balbuze / volumio-plugins

volumio's plugins from balbuze
190 stars 60 forks source link

Spotify connect plugin does not start #5

Closed ENSen closed 7 years ago

ENSen commented 7 years ago

Installed the spotify connect plugin but it does not start. image

I found this in /var/log/volumio.log

`2016-11-17T21:39:10.368Z`` - info: Volspotcoonect status error: 2016-11-17T21:39:10.371Z - info: Error: connect ECONNREFUSED 127.0.0.1:4000 at Object.exports._errnoException (util.js:1026:11) at exports._exceptionWithHostPort (util.js:1049:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14) 2016-11-17T21:39:10.374Z - info: Volspotconnect status error: 2016-11-17T21:39:10.375Z - info: Error: connect ECONNREFUSED 127.0.0.1:4000 at Object.exports._errnoException (util.js:1026:11) at exports._exceptionWithHostPort (util.js:1049:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)

ENSen commented 7 years ago

I have a RPI 3B and volumio 2.001, also tried 2.027 with the same result.

balbuze commented 7 years ago

Sorry but I can't see what is wrong with that. Could you please tell what is your DAC, mixer setting, and give the content of /data/pluugins/music-service/voslpotconnect/spotify-connect-web/startconnect.sh ( change credentials with xxx). what retruns aplay -l ?

ENSen commented 7 years ago

I am using a USB dac with an xmos based USB receiver (WaveIO). I found one problem in startconnect.sh. As you can see below the mixer name contains blanks.

cd /data/plugins/music_service/volspotconnect/spotify-connect-web ./spotify-connect-web --username 'xxxxx' --password 'xxxxx' --bitrate 320 --name 'Volumio' --playback_device hw:5 --mixer Luckit Audio 2.0 Output --mixer_device_index 5 --dbrange 45 # & avahi-publish-service 'Volumio' _spotify-connect._tcp 4000 VERSION=1.0 CPath=/login/_zeroconf

To get around that I manually updated it to look like this;

' cd /data/plugins/music_service/volspotconnect/spotify-connect-web ./spotify-connect-web --username 'xxxxx' --password 'xxxxx' --bitrate 320 --name 'Volumio' --playback_device hw:5 --mixer 'Luckit Audio 2.0 Output' --mixer_device_index 5 --dbrange 45 # & avahi-publish-service 'Volumio' _spotify-connect._tcp 4000 VERSION=1.0 CPath=/login/_zeroconf'

Then the plugin became active and "Volumio" showed up in my spotify app on my phone. I could select to play Spotify to Volumio but I did not get any sound. I ran startconnect.sh to be able to see the output from it and when pressing play in my spotify app I got this message from startconnect.sh

Ups! Some badness happened: Data size must be a multiple of framesize

balbuze commented 7 years ago

I'm going to change some things to support mixer with space in name ! . By waiting, you can change in volspotconnect.tmpl . With that you can change and save config. I keep you in touch with that. For last point I don't know... I have to investigate.

ENSen commented 7 years ago

Thank you for the response! I have some faint memory of having problems a couple of years ago with WaveIO. The problem was, I think, that WaveIO only will accept 32 bit LE. Could that have something to do with this issue?

balbuze commented 7 years ago

In fact changing volspotconnect.tmpl won't work.... I'm changing it it index.js. I really don't know for what you see about 32 LE. And there is no option in spotify connect web. Maybe using resampling ....

ENSen commented 7 years ago

I have no idea if 32LE have something to do with it. I just remember having to to resample in ALSA config a couple of years ago using Ubuntu. Using Volumio to play music from my NAS works without problems and I have not changed any ALSA configuration.

balbuze commented 7 years ago

I just uploaded a new version that supports space in mixer name...

ENSen commented 7 years ago

Thanks

balbuze commented 7 years ago

I haven't found teh source of your problem but I think there is something to do with that : https://larsimmisch.github.io/pyalsaaudio/libalsaaudio.html

ENSen commented 7 years ago

I agree. I am still thining about the format. In this thread for example there was a format problem with airplay. But maybe the problem in that case lies with spotify web connect and not your plugin? I will create a .asoundrc file and change format to S32_LE and see if that helps.

ENSen commented 7 years ago

It seems to work if I change playback_device from hw:5,0 to plughw:5,0 in startconnect.sh

balbuze commented 7 years ago

Good ! The problem is that I had problem with some dac with plughw.... I have to make some test... Anyway thank you for investigating ! Does your mixer work as expected ?

balbuze commented 7 years ago

If you want something more convenient, you can change in index.js following line var hwdev = 'hw:' + outdev; in var hwdev = 'plughw:' + outdev; save and killall node to apply

balbuze commented 7 years ago

And a very important point for me is that I can't get sound with software mixer... Everthing seems ok, the plugin is activated and I can see the device from Spotify app, but no sound.... I really struggle with that !

ENSen commented 7 years ago

Sorry for the late feedback. I changed index.js according to your instruction and that worked fine! The mixer works but I have not tried sw mixer.

Thanks for your work, it is very much appreciated. The next step is to try brutefir.

balbuze commented 7 years ago

Just to say that it is now included in the plugin. So if you reinstall, nothing to do !

twirre commented 7 years ago

thanks!! it is working for me. Had trouble with a RPI2 and and hifiberry DAC.