Spotify Connect Web


  • I don't know but I think the sound is a bit overmodulated? Also I have a problem when I start/stop my vpn, spotify connect breaks and doesn't come back up.

    Hello riverside70,

    Thank you for your feedback
    The quality of the sound depends on your hardware and on the software (spotify-connect-web).
    As for the problem caused by the VPN, a log would help (make sure to remove your credentials before you share it).

  • I don't know but I think the sound is a bit overmodulated? Also I have a problem when I start/stop my vpn, spotify connect breaks and doesn't come back up.

    First of all - great idea with "configuration wizard", very user friendly

    I have tested with my Trust 5.1 USB soundcard and I was now able to control the volume, using the following device/mixer combinations:

    • Device: default:CARD=Device + Mixer "Speaker"
    • Device: sysdefault:CARD=Device + "Mixer "Speaker"


    Mixer "Line" didn't work for both of them - no sound output, at least for my soundcard cabling.

    BUT: the sound was blurred - not a problem of overmodulation, rather it looks like as if the channels are not adressed properly. Within in Kodi you can choose the channel configuration (e.g. 2.1) - maybe the same needs to be done too here in the config.

    Another comment, that may help during bugfixing - I got an UI popup add-on error, when I choose one of the following items as device:front:CARD=Device,DEV=0
    surround21:CARD=Device,DEV=0
    surround40:CARD=Device,DEV=0
    surround41:CARD=Device,DEV=0
    surround50:CARD=Device,DEV=0
    surround51:CARD=Device,DEV=0
    surround71:CARD=Device,DEV=0
    iec958:CARD=Device,DEV=0

    The error log for the above error is as follows:

    Python
    Aug 09 18:37:11 LibreELEC sh[9443]: Starting spotify-connect-webAug 09 18:37:14 LibreELEC sh[9443]: Loading Spotify library...Aug 09 18:37:14 LibreELEC sh[9443]: Traceback (most recent call last):Aug 09 18:37:14 LibreELEC sh[9443]: File "loader.py", line 3, in <module>Aug 09 18:37:14 LibreELEC sh[9443]: File "runpy.py", line 180, in run_moduleAug 09 18:37:14 LibreELEC sh[9443]: File "runpy.py", line 72, in _run_codeAug 09 18:37:14 LibreELEC sh[9443]: File "/storage/.kodi/addons/service.spotify-connect-web/main.py", line 14, in <module>Aug 09 18:37:14 LibreELEC sh[9443]: from connect import ConnectAug 09 18:37:14 LibreELEC sh[9443]: File "/storage/.kodi/addons/service.spotify-connect-web/connect.py", line 9, in <module>Aug 09 18:37:14 LibreELEC sh[9443]: from console_callbacks import audio_arg_parser, mixer, error_callback, connection_callbacks, debug_callbacks, playback_callbacks, playback_setupAug 09 18:37:14 LibreELEC sh[9443]: File "/storage/.kodi/addons/service.spotify-connect-web/console_callbacks.py", line 104, in <module>Aug 09 18:37:14 LibreELEC sh[9443]: mixer = alsa.Mixer(args.mixer, **mixer_card_arg)Aug 09 18:37:14 LibreELEC sh[9443]: alsaaudio.ALSAAudioError: Unable to find mixer control Mixer,0 [hw:1]Aug 09 18:37:14 LibreELEC sh[9443]: Failed to execute script loaderAug 09 18:37:14 LibreELEC systemd[1]: service.spotify-connect-web.service: Main process exited, code=exited, status=255/n/aAug 09 18:37:14 LibreELEC systemd[1]: service.spotify-connect-web.service: Unit entered failed state.Aug 09 18:37:14 LibreELEC systemd[1]: service.spotify-connect-web.service: Failed with result 'exit-code'.Aug 09 18:37:14 LibreELEC systemd[1]: service.spotify-connect-web.service: Service hold-off time over, scheduling restart.Aug 09 18:37:14 LibreELEC systemd[1]: Stopped spotify-connect-web.Aug 09 18:37:14 LibreELEC systemd[1]: Started spotify-connect-web.Aug 09 18:37:14 LibreELEC sh[9466]: The hw:d,s device specification is unreliable. Use names instead


    I hope this helps.

    Cheers
    Chunki

  • Thank you for the feedback!

    As for the sound quality, it may be due to the fact that the cards are not configured properly. Addinhg a mixer interface to the addon is however not within the scope I had given to the addon, and well beyond my league. I nevertheless consider bundling alsamixer with the addon.

    As for the error, it looks like the listed PCMs do not have a mixer. I will review my code.

  • Hello riverside70,

    Thank you for your feedback
    The quality of the sound depends on your hardware and on the software (spotify-connect-web).
    As for the problem caused by the VPN, a log would help (make sure to remove your credentials before you share it).

    I installed spotify connect before on the musicbox OS, the sound was ok. But now on Libreelec I have problems with the sound, and tried several settings in the addon. I use my pi over an AV Receiver with hdmi.

  • I have updated my addon a bit:
    - the erroneous bit rate setting should be solved;
    - the wizard should now handle device:CARD=card,DEV=n PCMs

    The addon is said to work on S805, Wetek Play and Wetek Core, but I do not own such boxes.
    Would anyone here be so kind to verify this for me?

    As for the sound quality, I would not know where the problem comes from.
    I add a link to alsamixer built for LE8 to inspect/modify your card's settings.
    I have submitted a pull request to add alsamixer to the multimedia-tools addon.

    Spotify Connect Web 101 for LE7
    Spotify Connect Web 101 for LE8
    alsamixer for LE8
    [hr]

    I installed spotify connect before on the musicbox OS, the sound was ok. But now on Libreelec I have problems with the sound, and tried several settings in the addon. I use my pi over an AV Receiver with hdmi.

    Hello riverside70,

    To help you I would need you to provide me with the following information:
    - what version of LibreELEC you are using
    - what version of the addon you are using
    - what settings you have tried
    - what your problems with the sound are? If you think it is overmodulated, have you tried to reduce the volume with your Spotify app?
    - a log, to assess the problems you have with the sound, as well as those caused by the VPN

  • I use LE 7 (newest stable), I use the preview version I quoted in my first post, I tried the default mixer and PCM, I tried to reduce the volume and it works but everytime I must set it again. The vpn problem is not really a problem anymore, the script connects after a longer time again.
    In the next few days I hear again and decide wheter its a problem or not. The overmodulation is not so heavy so its difficult to hear.

  • I just tested version101 of the addon on a Raspberry Pi2 running LE7, latest stable.
    The Pi is connected via HDMI with my Pioneer hifi receiver.
    The Spotify app on my iOS device is able to connect and play but with NO sound.
    If I run the Spotify Connect Server on volumio (volumio.com), everything is working as expected.
    Here is the log output from the addon, but the last entry is from June so I'm not sure if this is meaningful:

    # -- Logs begin at Wed 2016-06-22 17:58:21 CEST, end at Tue 2016-08-16 23:38:32 CEST. not found
    # Jun 22 17:58:24 LibreELEC systemd[1]: Started spotify-connect-web.
    # Jun 22 17:58:24 LibreELEC sh[350]: amixer: Control default open error: No such file or directory

    Amixer is installed and working:
    Simple mixer control 'PCM',0
    Capabilities: pvolume pvolume-joined pswitch pswitch-joined
    Playback channels: Mono
    Limits: Playback -10239 - 400
    Mono: Playback -2791 [70%] [-27.91dB] [on]

    The addon settings are following:
    The playback device is set to "default:card=alsa", mixer is set to "PCM", playback route is set to "HDMI".

    aplay -l produces following output:
    LibreELEC:~ # aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
    Subdevices: 8/8
    Subdevice #0: subdevice #0
    Subdevice #1: subdevice #1
    Subdevice #2: subdevice #2
    Subdevice #3: subdevice #3
    Subdevice #4: subdevice #4
    Subdevice #5: subdevice #5
    Subdevice #6: subdevice #6
    Subdevice #7: subdevice #7
    card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    And aplay -L this one:
    LibreELEC:~ # aplay -L
    null
    Discard all samples (playback) or generate zero samples (capture)
    default:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
    sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device

    Any ideas why I don't get it working while connected via HDMI?
    [hr]
    BTW: thanks for your great work

    Edited once, last by soeren (August 17, 2016 at 9:52 PM).

  • Hello soeren!

    Are you using the addon from the repository (it should have been updated there today)?

    Have you used the wizard to configure the settings (click the wizard button)?

    According to the information you provide, playback device should be default:CARD=ALSA and the mixer PCM (case sensitive!)

    Finally, you can set initial volume (default 80%) with the latest addon settings. You can increase the volume with your Spotify app.

    To see what the service is up to, use command:
    journalctl -u service.spotify-connect-web

    Hope this helps

  • Hi awiouy, thanks for your work on this addon.

    If I understand correctly, it's not possible at the moment to run the addon on other devices than the RPi. Myself, I have a machine running the generic x86_64 LibreELEC build. I did see Debian/Ubuntu mentioned on GitHub - Fornoth/spotify-connect-web, so does that mean that is possible to compile spotify-connect-web and the addon for the x86_64 build? If you (or anyone) know how to build the addon for my machine, I'd love to learn how. Thanks!


  • Hi awiouy, thanks for your work on this addon.

    If I understand correctly, it's not possible at the moment to run the addon on other devices than the RPi. Myself, I have a machine running the generic x86_64 LibreELEC build. I did see Debian/Ubuntu mentioned on GitHub - Fornoth/spotify-connect-web, so does that mean that is possible to compile spotify-connect-web and the addon for the x86_64 build? If you (or anyone) know how to build the addon for my machine, I'd love to learn how. Thanks!

    Hello marcvangend!

    The spotify-connect-web project is based on a binary library built for arm (spotify_embedded_shared.so).

    The source of this library is not available, and it is therefore not possible to compile it for other architectures.

    If it had been, I would have.

    Ubuntu/Debian mentioned at your link refer to Ubuntu/Debian for arm.

    If you find a similar library for x86_64, let me know.

  • Hey Anton,

    thanks so much for your support.
    I previously used the version from your google drive but today I've updated to the latest one from the repository.
    There is still no sound when playing via HDMI :(
    I used the wizard to configure alsa, I changed the initial volume, I tried different playback devices (via the wizard) and I changed the bit rate, all with no luck.
    Here is the output from journalctl:
    -- Logs begin at Wed 2016-06-22 17:58:21 CEST, end at Thu 2016-08-18 21:15:37 CEST. --
    Jun 22 17:58:24 LibreELEC systemd[1]: Started spotify-connect-web.
    Jun 22 17:58:25 LibreELEC sh[355]: Simple mixer control 'PCM',0
    Jun 22 17:58:25 LibreELEC sh[355]: Capabilities: pvolume pvolume-joined pswitch pswitch-joined
    Jun 22 17:58:25 LibreELEC sh[355]: Playback channels: Mono
    Jun 22 17:58:25 LibreELEC sh[355]: Limits: Playback -10239 - 400
    Jun 22 17:58:25 LibreELEC sh[355]: Mono: Playback -3855 [60%] [-38.55dB] [on]
    Jun 22 17:58:25 LibreELEC sh[355]: numid=3,iface=MIXER,name='PCM Playback Route'
    Jun 22 17:58:25 LibreELEC sh[355]: ; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
    Jun 22 17:58:25 LibreELEC sh[355]: : values=2
    Aug 18 21:10:51 LibreELEC systemd[1]: Stopping spotify-connect-web...
    Aug 18 21:10:51 LibreELEC sh[355]: Loading Spotify library...
    Aug 18 21:10:51 LibreELEC sh[355]: min_volume_range: 0.0
    Aug 18 21:10:51 LibreELEC sh[355]: Using libspotify_embedded version: release-esdk-1.20.0-v1.20.0-g594175d4
    Aug 18 21:10:51 LibreELEC sh[355]: SpInit: 0
    Aug 18 21:10:51 LibreELEC sh[355]: playback_volume: 39321
    Aug 18 21:10:51 LibreELEC sh[355]: corected_playback_volume: 60
    Aug 18 21:10:51 LibreELEC sh[355]: public key: xxx
    Aug 18 21:10:51 LibreELEC sh[355]: device id: xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx
    Aug 18 21:10:51 LibreELEC sh[355]: remote name: LibreELEC
    Aug 18 21:10:51 LibreELEC sh[355]: account req: PREMIUM

    For me the corrected_playback_volume looks a little wired but I'm not the developer ;)
    I'm also wondering why the playback channel is set to "Mono"...
    I've also manually changed the numid value to 2 (HDMI). Could that cause the problem? That's what I did when setting up the plugin in "volumio".
    Any additional help would be appreciated.
    Thanks

  • I see nothing wrong in the log you provide. Mixer is PCM, playback route is set to HDMi.

    Volume is set to 60%, which might be quite low (volume does not increase linearly). Have you tried setting it at 100%, or to increase it via your Spotify app?

    Also, I do not see any activity after the last message, ie login, playback, volume, etc

    To have a better idea of what is going on:
    1. ssh to LE and launch the following commands
    2. systemctl stop service.spotify-connect-web
    3. spotify-connect-web.start
    4. connect your app to the service
    4. play some tracks and/or set volume from your app

    You should see some activity on your screen (or not)

    I hope thus will help us to find out what is going on.


  • The spotify-connect-web project is based on a binary library built for arm (spotify_embedded_shared.so).

    [...]

    Ubuntu/Debian mentioned at your link refer to Ubuntu/Debian for arm.

    Hi awiouy, thanks for the reply. That totally explains why there is no x86 version. I didn't realize there is an ARM version of Ubuntu...

    Regarding other libraries, I did come across GitHub - plietar/librespot: Open Source Spotify client library and GitHub - sashahilton00/spotify-connect-resources: A repository to hold any data/stuff related to reversing the Spotify Connect protocol. Mostly just data dumps at the moment, but if you have something to add to it, be it an implementation, information or just another data dump, make a PR and I will add it asap., but I'm sure you had already found those yourself.

  • hi awiouy,

    i've been using this for a while now and absolutely love it, so thakns very much for putting this together for the community!
    However, there is one small problem...

    My Raspbery Pi Kodi audio settings are set to "Audio output device - PI:HDMI and Analogue"
    This is so that when i am listening to music, sometimes i switch off the TV and swith the amplifier over to AUX input which is connected from the headphone jack on the Pi to the AUX input on my amplifier. The reason i have to do it this way is because my amplifier does not carry video signal, so i'm forced to use the TV's optical out but the TV has to be on for the optical out to work, hence the reason i have an audio singal coming straight from the headphonen jack aswell.

    I can set your sevice to use Headphone jack, HDMI or auto detect but not BOTH. Not sure what Auto Detect is suppose to do as it always just seems to play from HDMI.
    Are you able to have a setting for both?

    Cheers,
    keep up the good work.

    Loggio.

    Edited once, last by Loggio (August 19, 2016 at 11:24 PM).

  • Hello Loggio,

    As for sound, the addon and Kodi are independent.
    You can use HDMI for Kodi, and the headphone jack (or another sound card) for the addon. It is what I do.

    The onboard sound interface routes playback to either the jack or HDMI, but not to both.

    Auto detection can be summarized like this: if, when the RPi boots, the display claims to have speakers, sound is output via HDMI by default; if not, it is output via the headphone jack. Auto detection is not always acurrate.

  • Hi Anton,

    I found the cause of the problem and I would like to share my findings.
    I noticed that the Pi was listed under the Airplay/Blutooth devices in Spotify and not under the single playback devices. Once I disable Airplay in LE, the Pi wasn't listed anymore. And because of the limited Airplay support in Kodi I didn't here a sound.
    I saw that the Spotify web-connect plugin is also running a web server which is accessable under port 4000. On the web site I saw that I'm not logged in. I manually logged in and everything was working as expected. I double checked the addon settings and there was a spelling error in the user name
    Once I fixed the error, the addon starts working
    I know that this is a very stupid error but to prevent others to run into the same problem, maybe you can add a login check once entered the credentials.
    Thanks again for your great support and the hard work to get this addon working.

  • Hello soeren!
    I am glad to hear that the addon is working for you!
    Enjoy!

    The web server is documented in the links of the first post. I found it rather useless, until now. Thank you for the pointer!
    I take your feedback into account, for further improvement.
    I will experiment with avahi, if no one beats me at it,