Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[HOW-TO] Spotify Connect Web for Moode
(03-26-2020, 02:28 PM)doodydoo Wrote: Hi,

I originally used the Spotify Connect solution builtin to moOde but wanted some gapless goddness so I thought I'd give this a go. I've managed to get everything built and installed, and when I start up the spotify-connect-web service I see the following messages:

Loading Spotify library...
Last.fm: incomplete credentials, not launched
Device has no native mute
min_volume_range: 0
Using libspotify_embedded version: release-esdk-1.20.0-v1.20.0-g594175d4
SpInit: 0
playback_volume: 65535
corected_playback_volume: 100
public key: 7SvrwjUT64UENxNyDtoAt/mwEohLOl1dS5W75hniytF2hiQ0yaCoHNlDhjFHW9I1uOZLfp4BBBHdId5OhGTFhjQioD6JSyytWG5Nt1EDJX60jUAiYEruN83wMpoh7MND
device id: 9b14e273-68a3-439e-9383-d690b386948b
remote name: moOde Connect
account req: PREMIUM
device type: AUDIODONGLE

Which looks good to me. Until I select 'devices available' on Spotify on my phone when i get the following messages:

[2020-03-26 14:16:26,066] ERROR in app: Exception on /login/_zeroconf [GET]
Traceback (most recent call last):
  File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/pi/.local/lib/python2.7/site-packages/flask_cors/extension.py", line 188, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "main.py", line 221, in login_zeroconf
    return get_info()
  File "main.py", line 251, in get_info
    'remoteName': zeroconf_vars['remoteName']
  File "/home/pi/.local/lib/python2.7/site-packages/flask/json.py", line 254, in jsonify
    if current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] and not request.is_xhr:
  File "/home/pi/.local/lib/python2.7/site-packages/werkzeug/local.py", line 347, in __getattr__
    return getattr(self._get_current_object(), name)
AttributeError: 'Request' object has no attribute 'is_xhr'
::ffff:192.168.1.25 - - [2020-03-26 14:16:26] "GET /login/_zeroconf?action=getInfo HTTP/1.1" 500 426 0.044331

I get this block of messages everytime I select the 'devices available' option. I am on a fresh install of the current moOde (6.4.2) and the avahi service is started and a sudo systemctl status avahi-spotify-connect-multiuser.service gives me:

● avahi-spotify-connect-multiuser.service
   Loaded: loaded (/lib/systemd/system/avahi-spotify-connect-multiuser.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-03-26 14:11:28 CET; 1h 9min ago
 Main PID: 1461 (avahi-publish-s)
    Tasks: 1 (limit: 2200)
   Memory: 364.0K
   CGroup: /system.slice/avahi-spotify-connect-multiuser.service
           └─1461 /usr/bin/avahi-publish-service TestConnect _spotify-connect._tcp 4000 VERSION=1.0 CPath=/login/_zeroconf

Mar 26 14:11:28 moode systemd[1]: Started avahi-spotify-connect-multiuser.service.
Mar 26 14:11:29 moode avahi-publish-service[1461]: Established under name 'TestConnect'

I have read through the thread and can't find anything like this. I did try changing from gevent.wsgi import WSGIServer to from gevent.pywsgi import WSGIServer just in case but without luck.

Any help would be really appreciated, mixed DJ albums really don't sound the same when they're not gapless ;-)

Well I've managed to surprise myself and fix this on my own so I'll document what I did just in case anyone else has the same problem.

After working through the error messages and doing a few searches I arrived here: https://stackoverflow.com/questions/6013...-to-heroku which mentions an upgrade to the werkzurg python package which causes problems with versions of the flask package below 0.12.4. The suggestions for fixing this issue included upgrading to flask v1.0.0 and higher or downgrading werkzeug to below 1.0.

Rafa's requirements.txt includes the line Flask==0.11.1 so upgrading to V1 probably isn't a good idea so I added wekzeug<1.0, re-ran pip install -r requirements.txt, rebooted (not strictly necessarily but whatever), started both the services and now it works just fine, gapless goodness achieved!!

I'll open an issue on github so Rafa can take a look at it and verify what I've done but right now it works just fine.

Just to be complete I installed this on a fresh copy of moOde 6.4.2 on a Raspberry Pi 3B+ with an IQAudio Pi-Dac+. The only change I made to the procedure on github was to change the hw:1 to hw:0 on the slave -> pcm entry in /etc/asound.conf, mine looks like this now:

pcm.softvol {
  type softvol
  slave {
    pcm "hw:0"
  }
  control {
    name "Master"
    card 0
  }
}

Thanks to Rafa for all your work, it's so good to get gapless playback, it makes such a difference and thanks to Tim, I am so happy with moOde, it gives me everything I need and a whole lot more. Just need to get gapless playback for Spotify baked in ;-)
Reply


Messages In This Thread
RE: Spotify Connect for Moode - by Tim Curtis - 04-06-2018, 07:34 PM
RE: Spotify Connect for Moode - by RafaPolit - 04-07-2018, 05:30 AM
RE: Spotify Connect for Moode - by deafnut - 04-07-2018, 08:01 PM
RE: Spotify Connect for Moode - by RafaPolit - 04-08-2018, 05:28 AM
RE: Spotify Connect for Moode - by gabmartini - 04-09-2018, 02:08 AM
RE: Spotify Connect for Moode - by pinkdot - 04-09-2018, 04:58 PM
RE: Spotify Connect for Moode - by airdronian - 04-17-2018, 09:01 PM
RE: Spotify Connect for Moode - by Tim Curtis - 04-09-2018, 02:18 AM
RE: Spotify Connect for Moode - by franz159 - 04-11-2018, 04:43 AM
RE: Spotify Connect for Moode - by JonPike - 05-03-2018, 01:59 AM
RE: Spotify Connect for Moode - by RafaPolit - 04-11-2018, 05:43 AM
RE: Spotify Connect for Moode - by jonners - 04-11-2018, 07:39 AM
RE: Spotify Connect for Moode - by gabmartini - 04-13-2018, 11:33 PM
RE: Spotify Connect for Moode - by pinkdot - 04-14-2018, 08:10 AM
RE: Spotify Connect for Moode - by Tim Curtis - 04-14-2018, 12:14 PM
RE: Spotify Connect for Moode - by RafaPolit - 04-17-2018, 10:10 PM
RE: Spotify Connect for Moode - by airdronian - 04-17-2018, 11:31 PM
RE: Spotify Connect for Moode - by gabmartini - 04-17-2018, 11:50 PM
RE: Spotify Connect for Moode - by airdronian - 04-18-2018, 12:13 AM
RE: Spotify Connect for Moode - by airdronian - 04-19-2018, 05:34 PM
RE: Spotify Connect for Moode - by Onionhead - 04-23-2018, 01:40 AM
RE: Spotify Connect for Moode - by pinkdot - 04-23-2018, 05:50 AM
RE: Spotify Connect for Moode - by RafaPolit - 04-23-2018, 06:18 PM
RE: Spotify Connect for Moode - by Onionhead - 04-23-2018, 06:35 PM
RE: Spotify Connect for Moode - by gabmartini - 04-27-2018, 11:31 PM
RE: Spotify Connect for Moode - by pinkdot - 04-28-2018, 07:48 AM
RE: Spotify Connect for Moode - by grasshopper - 04-29-2018, 10:26 AM
RE: Spotify Connect for Moode - by JonPike - 05-03-2018, 03:05 AM
RE: Spotify Connect for Moode - by grasshopper - 05-03-2018, 07:08 PM
RE: Spotify Connect for Moode - by JonPike - 05-16-2018, 01:33 AM
RE: Spotify Connect for Moode - by grasshopper - 05-17-2018, 07:00 PM
RE: Spotify Connect for Moode - by Me2018 - 01-22-2019, 02:40 PM
RE: Spotify Connect for Moode - by npetra - 08-28-2019, 05:18 PM
RE: Spotify Connect for Moode - by grasshopper - 01-17-2019, 12:00 PM
RE: Spotify Connect for Moode - by grasshopper - 04-29-2018, 10:38 AM
RE: Spotify Connect for Moode - by RafaPolit - 04-29-2018, 10:53 AM
RE: Spotify Connect for Moode - by aBrianH - 04-30-2018, 10:11 AM
RE: Spotify Connect for Moode - by RafaPolit - 05-01-2018, 03:59 AM
RE: Spotify Connect for Moode - by gabmartini - 05-02-2018, 03:43 AM
RE: Spotify Connect for Moode - by grasshopper - 05-02-2018, 06:11 PM
RE: Spotify Connect for Moode - by RafaPolit - 05-12-2018, 12:53 AM
RE: Spotify Connect for Moode - by Tim Curtis - 05-12-2018, 12:52 PM
Error when Spotify Connect Web - by IT-Andy52 - 09-06-2019, 08:54 AM
RE: Error when Spotify Connect Web - by RafaPolit - 09-25-2019, 07:39 PM
RE: [HOW-TO] Spotify Connect Web for Moode - by doodydoo - 03-27-2020, 08:41 AM

Forum Jump: