07-18-2018, 01:05 AM
(This post was last modified: 07-18-2018, 01:26 AM by Onionhead.
Edit Reason: Problem Solved
)
Happy, Happy,Happy. I played around a bit more and some how got Spotify to find my MoOde device. Thanks
I am using a macbook pro with Spotify app. I have tried to carefully follow the build instruction. I open Spotify on computer but do not see MoOde device. I see other devices in the house and can play music to them but not the RPi3 with MoOde. Can some quickly look at the code posted below. I have tried many times, mostly like repeating same mistakes over and over. Cheers
I am using a macbook pro with Spotify app. I have tried to carefully follow the build instruction. I open Spotify on computer but do not see MoOde device. I see other devices in the house and can play music to them but not the RPi3 with MoOde. Can some quickly look at the code posted below. I have tried many times, mostly like repeating same mistakes over and over. Cheers
Code:
pi@moode:~ $ sudo apt-get install avahi-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
avahi-utils is already the newest version (0.6.32-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@moode:~ $ sudo apt-get install python-dev libffi-dev libasound2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dev is already the newest version (2.7.13-2).
python-dev set to manually installed.
libasound2-dev is already the newest version (1.1.3-5+rpi3).
The following NEW packages will be installed:
libffi-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 159 kB of archives.
After this operation, 332 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirror.os6.org/raspbian/raspbian stretch/main armhf libffi-dev armhf 3.2.1-6 [159 kB]
Fetched 159 kB in 1s (100 kB/s)
Selecting previously unselected package libffi-dev:armhf.
(Reading database ... 71533 files and directories currently installed.)
Preparing to unpack .../libffi-dev_3.2.1-6_armhf.deb ...
Unpacking libffi-dev:armhf (3.2.1-6) ...
Processing triggers for install-info (6.3.0.dfsg.1-1+b1) ...
Setting up libffi-dev:armhf (3.2.1-6) ...
Processing triggers for man-db (2.7.6.1-2) ...
pi@moode:~ $ cd /home/pi
pi@moode:~ $ mkdir spotify && cd spotify
pi@moode:~/spotify $ git clone https://github.com/Fornoth/spotify-connect-web.git
Cloning into 'spotify-connect-web'...
remote: Counting objects: 314, done.
remote: Total 314 (delta 0), reused 0 (delta 0), pack-reused 314
Receiving objects: 100% (314/314), 101.09 KiB | 148.00 KiB/s, done.
Resolving deltas: 100% (171/171), done.
pi@moode:~/spotify $ cd spotify-connect-web
pi@moode:~/spotify/spotify-connect-web $ wget https://github.com/RafaPolit/moode-spotify-connect-web/raw/master/spotify_appkey.key
--2018-07-17 17:07:00-- https://github.com/RafaPolit/moode-spotify-connect-web/raw/master/spotify_appkey.key
Resolving github.com (github.com)... 192.30.255.112, 192.30.255.113
Connecting to github.com (github.com)|192.30.255.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/RafaPolit/moode-spotify-connect-web/master/spotify_appkey.key [following]
--2018-07-17 17:07:01-- https://raw.githubusercontent.com/RafaPolit/moode-spotify-connect-web/master/spotify_appkey.key
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.40.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.40.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 321 [application/octet-stream]
Saving to: ‘spotify_appkey.key’
spotify_appkey.key 100%[===================>] 321 --.-KB/s in 0s
2018-07-17 17:07:02 (3.25 MB/s) - ‘spotify_appkey.key’ saved [321/321]
pi@moode:~/spotify/spotify-connect-web $ wget https://github.com/RafaPolit/moode-spotify-connect-web/raw/master/libspotify_embedded_shared.so
--2018-07-17 17:07:31-- https://github.com/RafaPolit/moode-spotify-connect-web/raw/master/libspotify_embedded_shared.so
Resolving github.com (github.com)... 192.30.255.112, 192.30.255.113
Connecting to github.com (github.com)|192.30.255.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/RafaPolit/moode-spotify-connect-web/master/libspotify_embedded_shared.so [following]
--2018-07-17 17:07:32-- https://raw.githubusercontent.com/RafaPolit/moode-spotify-connect-web/master/libspotify_embedded_shared.so
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.40.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.40.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 224000 (219K) [application/octet-stream]
Saving to: ‘libspotify_embedded_shared.so’
libspotify_embedded 100%[===================>] 218.75K 540KB/s in 0.4s
2018-07-17 17:07:32 (540 KB/s) - ‘libspotify_embedded_shared.so’ saved [224000/224000]
pi@moode:~/spotify/spotify-connect-web $ sudo chmod +x libspotify_embedded_shared.so
pi@moode:~/spotify/spotify-connect-web $ pip install -r requirements.txt
Collecting cffi>=0.9.2 (from -r requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz (438kB)
100% |████████████████████████████████| 440kB 409kB/s
Collecting Flask==0.11.1 (from -r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/63/2b/01f5ed23a78391f6e3e73075973da0ecb467c831376a0b09c0ec5afd7977/Flask-0.11.1-py2.py3-none-any.whl (80kB)
100% |████████████████████████████████| 81kB 842kB/s
Collecting Flask-Bootstrap<4.0,>=3.3.2.1 (from -r requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/88/53/958ce7c2aa26280b7fd7f3eecbf13053f1302ee2acb1db58ef32e1c23c2a/Flask-Bootstrap-3.3.7.1.tar.gz (456kB)
100% |████████████████████████████████| 460kB 416kB/s
Collecting Flask-Cors==2.1.2 (from -r requirements.txt (line 4))
Downloading https://files.pythonhosted.org/packages/99/c3/a65908bc5a031652248dfdb1fd4814391e7b8efca704a94008d764c45292/Flask-Cors-2.1.2.tar.gz
Collecting pycparser>=2.10 (from -r requirements.txt (line 5))
Downloading https://www.piwheels.org/simple/pycparser/pycparser-2.18-py2.py3-none-any.whl (209kB)
100% |████████████████████████████████| 215kB 12kB/s
Collecting pyalsaaudio>=0.8 (from -r requirements.txt (line 6))
Downloading https://files.pythonhosted.org/packages/52/b6/44871791929d9d7e11325af0b7be711388dfeeab17147988f044a41a6d83/pyalsaaudio-0.8.4.tar.gz (315kB)
100% |████████████████████████████████| 317kB 727kB/s
Collecting gevent>=1.0.1 (from -r requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/e6/0a/fc345c6e6161f84484870dbcaa58e427c10bd9bdcd08a69bed3d6b398bf1/gevent-1.3.5.tar.gz (4.6MB)
100% |████████████████████████████████| 4.6MB 54kB/s
Ignoring cffi: markers 'sys_platform == "win32" and platform_python_implementation == "CPython"' don't match your environment
Collecting pylast>=1.6.0 (from -r requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/22/57/afc385f67211b5c94cb13e429f2599ca348187a6a5aae1bfa49dbd63278e/pylast-2.3.0-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from Flask==0.11.1->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/dc/b4/a60bcdba945c00f6d608d8975131ab3f25b22f2bcfe1dab221165194b2d4/itsdangerous-0.24.tar.gz (46kB)
100% |████████████████████████████████| 51kB 661kB/s
Collecting click>=2.0 (from Flask==0.11.1->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
100% |████████████████████████████████| 71kB 600kB/s
Collecting Werkzeug>=0.7 (from Flask==0.11.1->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
100% |████████████████████████████████| 327kB 332kB/s
Collecting Jinja2>=2.4 (from Flask==0.11.1->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
100% |████████████████████████████████| 133kB 545kB/s
Collecting dominate (from Flask-Bootstrap<4.0,>=3.3.2.1->-r requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/43/b2/3b7d67dd59dab93ae08569384b254323516e8868b453eea5614a53835baf/dominate-2.3.1.tar.gz
Collecting visitor (from Flask-Bootstrap<4.0,>=3.3.2.1->-r requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/d7/58/785fcd6de4210049da5fafe62301b197f044f3835393594be368547142b0/visitor-0.1.3.tar.gz
Collecting Six (from Flask-Cors==2.1.2->-r requirements.txt (line 4))
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting greenlet>=0.4.13; platform_python_implementation == "CPython" (from gevent>=1.0.1->-r requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/5d/82/2e53a8def6f99db51992ca3a0a2448c3bbec1a9db3a7cbf7d5dad011e138/greenlet-0.4.14.tar.gz (59kB)
100% |████████████████████████████████| 61kB 898kB/s
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->Flask==0.11.1->-r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz
Building wheels for collected packages: cffi, Flask-Bootstrap, Flask-Cors, pyalsaaudio, gevent, itsdangerous, dominate, visitor, greenlet, MarkupSafe
Running setup.py bdist_wheel for cffi ... done
Stored in directory: /home/pi/.cache/pip/wheels/e6/9e/cd/9f0b900a715af094d5a08cc50230728c08ef745ffb195c67e8
Running setup.py bdist_wheel for Flask-Bootstrap ... done
Stored in directory: /home/pi/.cache/pip/wheels/e8/b9/93/ef6ac3b8ead2d72cbcc042b9d58b613aaf47e533b9dc5b5999
Running setup.py bdist_wheel for Flask-Cors ... done
Stored in directory: /home/pi/.cache/pip/wheels/c4/e1/6d/4b027da634247d5e9724dad268d4959ea5eaaf3ca2116f7ec4
Running setup.py bdist_wheel for pyalsaaudio ... done
Stored in directory: /home/pi/.cache/pip/wheels/90/74/b8/362c8d8e9fefe2fc2a31881c272053eccae6fd22ecd461f672
Running setup.py bdist_wheel for gevent ... done
Stored in directory: /home/pi/.cache/pip/wheels/71/16/7b/450f9344694cd63db1e690a69786558f34f04c048e80ea75a2
Running setup.py bdist_wheel for itsdangerous ... done
Stored in directory: /home/pi/.cache/pip/wheels/2c/4a/61/5599631c1554768c6290b08c02c72d7317910374ca602ff1e5
Running setup.py bdist_wheel for dominate ... done
Stored in directory: /home/pi/.cache/pip/wheels/86/7c/76/a514f343c9e4f85f4c98fe13138ab9c8f756647155c4c1f25e
Running setup.py bdist_wheel for visitor ... done
Stored in directory: /home/pi/.cache/pip/wheels/68/b0/a2/cc8c7cf94ca3d1088a7d2e27936c1e0da170e05f560973e8dd
Running setup.py bdist_wheel for greenlet ... done
Stored in directory: /home/pi/.cache/pip/wheels/c6/54/b6/34dc665cda3b4c2ce4ab1471dbebb690b1cea04cbcfd50347a
Running setup.py bdist_wheel for MarkupSafe ... done
Stored in directory: /home/pi/.cache/pip/wheels/33/56/20/ebe49a5c612fffe1c5a632146b16596f9e64676768661e4e46
Successfully built cffi Flask-Bootstrap Flask-Cors pyalsaaudio gevent itsdangerous dominate visitor greenlet MarkupSafe
Installing collected packages: pycparser, cffi, itsdangerous, click, Werkzeug, MarkupSafe, Jinja2, Flask, dominate, visitor, Flask-Bootstrap, Six, Flask-Cors, pyalsaaudio, greenlet, gevent, pylast
Successfully installed Flask-0.11.1 Flask-Bootstrap-3.3.7.1 Flask-Cors-2.1.2 Jinja2-2.10 MarkupSafe-1.0 Six-1.11.0 Werkzeug-0.14.1 cffi-1.11.5 click-6.7 dominate-2.3.1 gevent-1.3.5 greenlet-0.4.14 itsdangerous-0.24 pyalsaaudio-0.8.4 pycparser-2.18 pylast-2.3.0 visitor-0.1.3
pi@moode:~/spotify/spotify-connect-web $ cd ..
pi@moode:~/spotify $ nano spotify-connect.sh
pi@moode:~/spotify $ sudo chmod 755 spotify-connect.sh
pi@moode:~/spotify $ cd /lib/systemd/system/
pi@moode:/lib/systemd/system $ sudo nano avahi-spotify-connect-multiuser.servicepi@moode:/lib/systemd/system $ sudo nano spotify-connect-web.service
pi@moode:/lib/systemd/system $ 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:CARD=sndrpijustboomd
snd_rpi_justboom_digi,
Default Audio Device
sysdefault:CARD=sndrpijustboomd
snd_rpi_justboom_digi,
Default Audio Device
iec958:CARD=sndrpijustboomd,DEV=0
snd_rpi_justboom_digi,
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=sndrpijustboomd,DEV=0
snd_rpi_justboom_digi,
Direct sample mixing device
dsnoop:CARD=sndrpijustboomd,DEV=0
snd_rpi_justboom_digi,
Direct sample snooping device
hw:CARD=sndrpijustboomd,DEV=0
snd_rpi_justboom_digi,
Direct hardware device without any conversions
plughw:CARD=sndrpijustboomd,DEV=0
snd_rpi_justboom_digi,
Hardware device with all software conversions
pi@moode:/lib/systemd/system $ amixer controls
numid=1,iface=MIXER,name='Tx Source'
pi@moode:/lib/systemd/system $ cd /etc
pi@moode:/etc $ nano asound.conf
pi@moode:/etc $ nano asound.conf
pi@moode:/etc $ nano asound.conf
pi@moode:/etc $ cd
pi@moode:~ $ cd /etc
pi@moode:/etc $ ls
adduser.conf inputrc rc1.d
alternatives insserv.conf.d rc2.d
apache2 iproute2 rc3.d
apm issue rc4.d
apt issue.net rc5.d
avahi kernel rc6.d
bash.bashrc ldap rc.local
bash_completion ld.so.cache rcS.d
bash_completion.d ld.so.conf request-key.conf
bindresvport.blacklist ld.so.conf.d request-key.d
binfmt.d ld.so.preload resolvconf
bluealsaaplay.conf libaudit.conf resolv.conf
bluetooth libnl-3 resolv.conf.bak
ca-certificates locale.alias resolvconf.conf
ca-certificates.conf locale.gen rmt
calendar localtime rpc
chromium-browser logcheck rpi-issue
cifs-utils login.defs rsyslog.conf
console-setup logrotate.conf rsyslog.d
cron.d logrotate.d samba
cron.daily machine-id securetty
cron.hourly machine-info security
cron.monthly magic selinux
crontab magic.mime sensors3.conf
cron.weekly mailcap sensors.d
dbus-1 mailcap.order services
debconf.conf manpath.config sgml
debian_version memcached.conf shadow
default mime.types shadow-
deluser.conf minidlna.conf shellinabox
dhcp minidlna.conf.dpkg-dist shells
dhcpcd.conf mke2fs.conf skel
dhcpcd.duid modprobe.d squeezelite.conf
dhcpcd.secret modules ssh
dnsmasq.conf modules-load.d ssl
dnsmasq.d motd staff-group-for-usr-local
dphys-swapfile mpd.conf subgid
dpkg mtab subgid-
drirc nanorc subuid
emacs netconfig subuid-
environment network sudoers
fake-hwclock.data networks sudoers.d
fb.modes newt sysctl.conf
ffserver.conf nginx sysctl.d
fonts nsswitch.conf sysstat
fstab openal systemd
fuse.conf opt terminfo
gai.conf os-release timezone
gdb pam.conf tmpfiles.d
groff pam.d ucf.conf
group passwd udev
group- passwd- udisks-glue.conf
gshadow paxctld.conf ufw
gshadow- perl update-motd.d
gss php upmpdcli.conf
gtk-3.0 pip.conf upmpdcli.conf.default
hdparm.conf plymouth upmpdcli.conf-dist
hostapd polkit-1 upmpdcli-radio.conf
host.conf ppp usb_modeswitch.conf
hostname profile usb_modeswitch.d
hosts profile.d vdpau_wrapper.cfg
hosts.allow protocols vim
hosts.deny pulse wgetrc
idmapd.conf python wpa_supplicant
ifplugd python2.7 X11
init python3 xdg
init.d python3.5 xml
initramfs-tools rc0.d
pi@moode:/etc $ sudo nano asound.conf
pi@moode:/etc $ speaker-test -Dsoftvol -c2
speaker-test 1.1.3
Playback device is softvol
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
Playback open error: -2,No such file or directory
pi@moode:/etc $ sudo nano asound.conf
pi@moode:/etc $ speaker-test -Dsoftvol -c2
speaker-test 1.1.3
Playback device is softvol
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 128 to 131072
Period size range from 64 to 65536
Using max buffer size 131072
Periods = 4
was set period_size = 32768
was set buffer_size = 131072
0 - Front Left
1 - Front Right
Time per period = 2.741334
0 - Front Left
1 - Front Right
^CWrite error: -4,Interrupted system call
xrun_recovery failed: -4,Interrupted system call
Transfer failed: Interrupted system call
pi@moode:/etc $ sudo systemctl start avahi-spotify-connect-multiuser.service
pi@moode:/etc $ sudo systemctl start spotify-connect-web.service
pi@moode:/etc $ ls
adduser.conf initramfs-tools rc0.d
alternatives inputrc rc1.d
apache2 insserv.conf.d rc2.d
apm iproute2 rc3.d
apt issue rc4.d
asound.conf issue.net rc5.d
avahi kernel rc6.d
bash.bashrc ldap rc.local
bash_completion ld.so.cache rcS.d
bash_completion.d ld.so.conf request-key.conf
bindresvport.blacklist ld.so.conf.d request-key.d
binfmt.d ld.so.preload resolvconf
bluealsaaplay.conf libaudit.conf resolv.conf
bluetooth libnl-3 resolv.conf.bak
ca-certificates locale.alias resolvconf.conf
ca-certificates.conf locale.gen rmt
calendar localtime rpc
chromium-browser logcheck rpi-issue
cifs-utils login.defs rsyslog.conf
console-setup logrotate.conf rsyslog.d
cron.d logrotate.d samba
cron.daily machine-id securetty
cron.hourly machine-info security
cron.monthly magic selinux
crontab magic.mime sensors3.conf
cron.weekly mailcap sensors.d
dbus-1 mailcap.order services
debconf.conf manpath.config sgml
debian_version memcached.conf shadow
default mime.types shadow-
deluser.conf minidlna.conf shellinabox
dhcp minidlna.conf.dpkg-dist shells
dhcpcd.conf mke2fs.conf skel
dhcpcd.duid modprobe.d squeezelite.conf
dhcpcd.secret modules ssh
dnsmasq.conf modules-load.d ssl
dnsmasq.d motd staff-group-for-usr-local
dphys-swapfile mpd.conf subgid
dpkg mtab subgid-
drirc nanorc subuid
emacs netconfig subuid-
environment network sudoers
fake-hwclock.data networks sudoers.d
fb.modes newt sysctl.conf
ffserver.conf nginx sysctl.d
fonts nsswitch.conf sysstat
fstab openal systemd
fuse.conf opt terminfo
gai.conf os-release timezone
gdb pam.conf tmpfiles.d
groff pam.d ucf.conf
group passwd udev
group- passwd- udisks-glue.conf
gshadow paxctld.conf ufw
gshadow- perl update-motd.d
gss php upmpdcli.conf
gtk-3.0 pip.conf upmpdcli.conf.default
hdparm.conf plymouth upmpdcli.conf-dist
hostapd polkit-1 upmpdcli-radio.conf
host.conf ppp usb_modeswitch.conf
hostname profile usb_modeswitch.d
hosts profile.d vdpau_wrapper.cfg
hosts.allow protocols vim
hosts.deny pulse wgetrc
idmapd.conf python wpa_supplicant
ifplugd python2.7 X11
init python3 xdg
init.d python3.5 xml
pi@moode:/etc $ sudo systemctl status spotify-connect-web.service
● spotify-connect-web.service
Loaded: loaded (/lib/systemd/system/spotify-connect-web.service; disabled; ve
Active: activating (auto-restart) since Tue 2018-07-17 17:43:06 PDT; 9s ago
Process: 15736 ExecStart=/home/pi/spotify/spotify-connect.sh (code=exited, sta
Main PID: 15736 (code=exited, status=0/SUCCESS)
lines 1-5/5 (END)