GithubHelp home page GithubHelp logo

rafapolit / moode-spotify-connect-web Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 4.0 158 KB

moOde OS - spotify-web-connect install instructions and required files.

License: MIT License

Shell 39.31% JavaScript 60.69%

moode-spotify-connect-web's People

Contributors

rafapolit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moode-spotify-connect-web's Issues

Has this been tested with Moode 4 using an i2s Dac?

I tried today with Moode 4 Beta 12.
I believe I followed all steps correctly, but I hear no audio from Moode

  • I can start (stop) the service spotify-connect-web

  • I see the service from the device-menu in spotify and can connect to it

  • I can monitor status
    eg
    {
    "active": true,
    "logged_in": true,
    "playing": true,
    "repeat": false,
    "shuffle": false
    }

  • I can monitor metadata
    eg
    {
    "album_name": "Back from the Edge",
    "album_uri": "spotify:album:7oiJYvEJHsmYtrgviAVIBD",
    "artist_name": "James Arthur",
    "artist_uri": "spotify:artist:4IWBUUAFIplrNtaOHcJPRM",
    "context_uri": "spotify:station:artist:6eUKZXaKkcviH0Ku9w2n3V",
    "cover_uri": "spotify:image:c8637be962e25fe28fc53d9f6d6896b60589aeff",
    "data0": "Ed Sheeran",
    "duration": 211466,
    "track_name": "Say You Won't Let Go",
    "track_uri": "spotify:track:5uCax9HTNlzGybIStD3vDh",
    "volume": 65535
    }

BUT, as I said, I do not have any audio output on Moode

I'm using a Dac IQaudIO PiDac+

Any recommendation on how to DEBUG?

Still necessary for Mode 6.4.0?

New Moode user here. Booted up 6.4.0 for the first time, and Spotify Connect seems to work out of the box (once enabled under Audio settings).

Is this repo integrated into the main release now? Does it offer something different? Did I miss something?

Index out of Range

As i try to use the Start Command:

spotify-connect-web/spotify-connect-web --playback_device hw:1 -m PCM --mixer_device_index 1 --bitrate 320 --name "moOde Connect" --key spotify-connect-web/spotify_appkey.key

in it's form provided by the Readme, i get this error:

Loading Spotify library...
Traceback (most recent call last):
File "loader.py", line 3, in
File "runpy.py", line 180, in run_module
File "runpy.py", line 72, in _run_code
File "/home/pi/spotify/spotify-connect-web/main.py", line 14, in
from connect import Connect
File "/home/pi/spotify/spotify-connect-web/connect.py", line 9, in
from console_callbacks import audio_arg_parser, mixer, error_callback, connection_callbacks, debug_callbacks, playback_callbacks, playback_setup
File "/home/pi/spotify/spotify-connect-web/console_callbacks.py", line 24, in
audio_arg_parser.add_argument('--mixer', '-m', help='alsa mixer name for volume control', default=alsa.mixers()[0])
IndexError: list index out of range
Failed to execute script loader

I already tried changing the mixer_device_index to 0, still the same.

Output of aplay -L:

null
Discard all samples (playback) or generate zero samples (capture)
crossfeed
ladspa
default:CARD=sndrpihifiberry
snd_rpi_hifiberry_dac,
Default Audio Device
sysdefault:CARD=sndrpihifiberry
snd_rpi_hifiberry_dac,
Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac,
Direct sample mixing device
dsnoop:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac,
Direct sample snooping device
hw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac,
Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_dac,
Hardware device with all software conversions

I can't fix it, and need help. Thanks!

Tremendous static when playing

Hey there,
I follow your steps to the letter, and I can connect (occasionally - it keeps disappearing?) to the moode connect point.
However, when I play something from spotify, it gives tremendous static (i can faintly hear my music) and I cannot change the volume (it's really loud no matter if I change the moode volume or the spotify volume) (i also tried using your softvol conf , but to no avail)

I have an Audioquest Dragonfly DAC and a Raspi3, I requested an authorization key from Spotify but for now I am using the one you provided.
I have configured both scripts as startup services, these are the settings from spotify-connect-web.service:

Description=Spotify Connect Web
After=network.target avahi-spotify-connect-multiuser.service
[Service] ExecStart=/home/SpotifyConnect/spotify-connect-web/spotify-connect-web --playback_device softvol --bitrate 320 --name "moOde Connect" --key
/home/SpotifyConnect/spotify-connect-web/spotify_appkey.key -m Master --mixer_device_index 0
Restart=always
RestartSec=10
StartLimitInterval=30
StartLimitBurst=20

[Install]
WantedBy=multi-user.target

I've no idea what I did wrong?

Inez

Add 'run as a service at startup' options

Depending on the timeframe it takes to integrate this into Moode (if ever it happens), I'll be adding instructions to configure this as a service at startup very soon.

Cannot see moOde connect on 'devices available' in Spotify

After building spotify-connect-web and starting both the avahi and spotify-connect services I get the followling messages each time I select the 'devices available' option in Spotify:

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_functionsrule.endpoint
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

After doing a few searches I found this: https://stackoverflow.com/questions/60131900/weird-is-xhr-error-when-deploying-flask-app-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.

As the requirements.txt includes the line Flask==0.11.1 I assumed there was a strict dependency on that version and 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.

"exit-code" fail when testing Spotify connect

Hi There

Thanks for the great piece of code:-)
I am having some trouble when I want to test if the Spotify connect is working. I get the following error:
"spotify-connect-web.service: Failed with result 'exit-code'."
I am using a I2S DAC using a PCM1794 from Twisted Pear Audio. I am using the "DDDAC1794 NOS" driver and newest Moode.

I have set the HW to "CARD=sndrpirpidac,DEV=0" and that plays static left and right using the speaker-test. I have changed "mixer_device_index" to 0, 1 and 2 in the spotify-connect.sh script, but still the same error with exit-code.

Could you have any idea of what I am doing wrong please?

Thanks in advance.

Best regards Mikkel

skaermbillede 2018-05-14 kl 11 31 03

Device not listed in spotify.

I got through the entire process. I am using a USB DAC and the pink noise is properly routed through to the correct speakers. When I reboot I cannot get the moode device to show up in spotify. I have tried both device index 1 and 0, hoping to get some assistance.

Connection drops after a couple of minutes

I managed to get everything working but in the end, the connection drops in a similar way to how embedded Spotify connect in Moode player drops. I get the following log messages by using journalctl -u spotify-connect-web.service

Apr 03 21:29:51 moodeege spotify-connect.sh[13356]: AttributeError: 'Request' object has no attribute 'is_xhr'
Apr 03 21:29:51 moodeege spotify-connect.sh[13356]: ::ffff:192.168.178.144 - - [2020-04-03 21:29:51] "GET /api/info/status HTTP/1.1" 500 426 0.003658
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]: [2020-04-03 21:29:56,343] ERROR in app: Exception on /api/info/status [GET]
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]: Traceback (most recent call last):
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     response = self.full_dispatch_request()
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     rv = self.handle_user_exception(e)
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "/home/pi/.local/lib/python2.7/site-packages/flask_cors/extension.py", line 188, in wrapped_function
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     return cors_after_request(app.make_response(f(*args, **kwargs)))
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     reraise(exc_type, exc_value, tb)
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     rv = self.dispatch_request()
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     return self.view_functions[rule.endpoint](**req.view_args)
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "main.py", line 153, in info_status
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     'logged_in': bool(lib.SpConnectionIsLoggedIn())
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "/home/pi/.local/lib/python2.7/site-packages/flask/json.py", line 254, in jsonify
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     if current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] and not request.is_xhr:
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:   File "/home/pi/.local/lib/python2.7/site-packages/werkzeug/local.py", line 347, in __getattr__
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]:     return getattr(self._get_current_object(), name)
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]: AttributeError: 'Request' object has no attribute 'is_xhr'
Apr 03 21:29:56 moodeege spotify-connect.sh[13356]: ::ffff:192.168.178.144 - - [2020-04-03 21:29:56] "GET /api/info/status HTTP/1.1" 500 426 0.005533

Funny enough, I observe the same behavior when I use librespot with a command like librespot --name stablepi --bitrate 320 --initial-volume 50 --enable-volume-normalisation --linear-volume --verbose

Is there another underlying problem causing all this?

Failed building wheel for cffi

When installing, an error is given:
Failed building wheel for cffi

Reason:
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory

I believe that libffi-dev has to be installed before building, but that this is not yet checked for beforehand?

alsaaudio.ALSAAudioError: Unable to find mixer control

Hi,
i can't understand what mixer should i specify, i tried in the sh script given my configuration below. i got the sound coming out of the speakers but i can't have the service running and stops with the error reported below. Any clue about what i am missing? thanks

pi@robbamusic:~/spotify/spotify-connect-web $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
btaplay_dmix
alsaequal
plug_alsaequal
btstream
crossfeed
plug_bs2b
eqfa4p
plug_eqfa4p
default
sysdefault:CARD=sndrpihifiberry
    snd_rpi_hifiberry_digi, 
    Default Audio Device
iec958:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_digi, 
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_digi, 
    Direct sample mixing device
dsnoop:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_digi, 
    Direct sample snooping device
hw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_digi, 
    Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_digi, 
    Hardware device with all software conversions

pi@robbamusic:~/spotify/spotify-connect-web $  amixer controls
numid=1,iface=MIXER,name='Tx Source'

~/spotify/spotify-connect-web $ sudo vim /etc/asound.conf 

pcm.!default  {
 type hw card 0
}
ctl.!default {
 type hw card 0
}

Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]: Loading Spotify library...
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]: Last.fm: incomplete credentials, not launched
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]: Traceback (most recent call last):
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]:   File "main.py", line 16, in <module>
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]:     from connect import Connect
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]:   File "/home/pi/spotify/spotify-connect-web/connect.py", line 9, in <module>
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]:     from console_callbacks import audio_arg_parser, mixer, error_callback, connection_callbacks, debug_callbacks, playback_callbacks, playback_setup
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]:   File "/home/pi/spotify/spotify-connect-web/console_callbacks.py", line 105, in <module>
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]:     mixer = alsa.Mixer(args.mixer, **mixer_card_arg)
Jun 24 15:18:05 robbamusic spotify-connect.sh[21410]: alsaaudio.ALSAAudioError: Unable to find mixer control Master,0 [default]

seqfault

I am running moOde os on raspberry pie zero, when I try follow the instruction i get a segmentation fault when I run ./spotify-connect-web .

Unable to acquire device: Device or resource busy [hw:0,0]

I'm using RPi3, latest moode and IQaudIO Pi-DAC Pro, connect to RCA speaker. just tried clone repo and key file, then

/home/pi/spotify-connect-web/spotify-connect-web --playback_device hw:0,0 -m Digital --mixer_device_index 0 --bitrate 320 --name "moOde Connect" --key /home/pi/spotify-connect-web/spotify_appkey.key

but an error appear same as title. here's are log and my environment. what am i wrong? and how fix?

pi@moode:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
plugequal
equal
crossfeed
ladspa
default:CARD=IQaudIODAC
    IQaudIODAC, 
    Default Audio Device
sysdefault:CARD=IQaudIODAC
    IQaudIODAC, 
    Default Audio Device
dmix:CARD=IQaudIODAC,DEV=0
    IQaudIODAC, 
    Direct sample mixing device
dsnoop:CARD=IQaudIODAC,DEV=0
    IQaudIODAC, 
    Direct sample snooping device
hw:CARD=IQaudIODAC,DEV=0
    IQaudIODAC, 
    Direct hardware device without any conversions
plughw:CARD=IQaudIODAC,DEV=0
    IQaudIODAC, 
    Hardware device with all software conversions
pi@moode:~ $ 

pi@moode:~ $ amixer controls
numid=6,iface=MIXER,name='DSP Program'
numid=3,iface=MIXER,name='Analogue Playback Boost Volume'
numid=2,iface=MIXER,name='Analogue Playback Volume'
numid=10,iface=MIXER,name='Auto Mute Mono Switch'
numid=11,iface=MIXER,name='Auto Mute Switch'
numid=8,iface=MIXER,name='Auto Mute Time Left'
numid=9,iface=MIXER,name='Auto Mute Time Right'
numid=7,iface=MIXER,name='Clock Missing Period'
numid=5,iface=MIXER,name='Deemphasis Switch'
numid=4,iface=MIXER,name='Digital Playback Switch'
numid=1,iface=MIXER,name='Digital Playback Volume'
numid=20,iface=MIXER,name='Max Overclock DAC'
numid=19,iface=MIXER,name='Max Overclock DSP'
numid=18,iface=MIXER,name='Max Overclock PLL'
numid=16,iface=MIXER,name='Volume Ramp Down Emergency Rate'
numid=17,iface=MIXER,name='Volume Ramp Down Emergency Step'
numid=12,iface=MIXER,name='Volume Ramp Down Rate'
numid=13,iface=MIXER,name='Volume Ramp Down Step'
numid=14,iface=MIXER,name='Volume Ramp Up Rate'
numid=15,iface=MIXER,name='Volume Ramp Up Step'
pi@moode:~ $ 

Loading Spotify library...
min_volume_range: 0.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: zxhOMKoag8pIiRK+6hAR5u/FOVZnLUSjoLoc7wF9qI9t2J6i2Lt93Rj9pJIG6veMv1eutKHYdA8QABxdHcyeE/stL0W4oeMcLlq/rLvmmZ5iCNbCap8jrPNeY1ql2qG4
device id: 78dc3452-8f39-451d-a050-10814a71cfdc
remote name: moOde Connect
account req: PREMIUM
device type: AUDIODONGLE
kSpConnectionNotifyLoggedIn
mwfJaB+SmRYJps7gAI9JwZM/KcI/Qp90HIgOzAiZnYoURAilL1W5gx13KQIBZR983E9cDzMZ6gXsPIbQOGoJdbnT4L4EQw1hPzsrXII3sZrLrTt48L8xtJbiNcFaOHi+cLmOCUf8a5kPkGEbFN+y5ghOLxssyQzWLum+WAz1QyY=
kSpPlaybackNotifyPlay
playback_seek: 99243
kSpPlaybackNotifyTrackChanged
192.168.10.5 - - [2017-09-23 00:19:33] "GET /login/_zeroconf?action=getInfo HTTP/1.1" 200 605 0.018189
kSpPlaybackNotifyBecameActive
kSpPlaybackNotifyTrackChanged
playback_seek: 101069
kSpPlaybackEventAudioFlush
kSpPlaybackNotifyPlay
Unable to acquire device:  Device or resource busy [hw:0,0]
192.168.10.5 - - [2017-09-23 00:19:35] "GET /login/_zeroconf?action=getInfo HTTP/1.1" 200 605 0.015974
192.168.10.5 - - [2017-09-23 00:19:37] "GET /login/_zeroconf?action=getInfo HTTP/1.1" 200 605 0.016330
192.168.10.5 - - [2017-09-23 00:19:39] "GET /login/_zeroconf?action=getInfo HTTP/1.1" 200 605 0.015938
kSpPlaybackNotifyBecameInactive
playback_seek: 108729
playback_seek: 108519
^CkSpPlaybackEventAudioFlush
kSpConnectionNotifyLoggedOut
pi@moode:~ $ 

'Illegal instruction' output when tying to run the spotify-connect.sh

I have the Rpi zero w and when I try to run the spotify connect.sh it gives this output:

pi@moode:~/spotify $ ./spotify-connect.sh
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
Illegal instruction

I have tried changing the name of the device in main.py because I got that error and tried changing the master in the spotify-connect.sh.

Also I noticed that the spotify-connect-web.service is constantly restarting.

I am using a generic USB sound card which outputs sound with the command provided in the instructions. I also tried two different ones so I don't think(hope) that is the issue

Thanks already for the help
Best Regards
Lukas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.