Thank you for your donation!


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


Solved: Spotify renderer not working on rpi zero
#1
I see in the config menu there is a Spotify area, but I can not figure out how to either connect to this to my account or play from spotify to this device.

How is the built in Spotify support intended to be used? I have been searching the forums and do not see any instructions.

EDIT:

Tim discovered that librespot needs to be compiled specifically for the rpi zero to work. I imagine he will have this fixed soon but in the mean time here are the steps to fix it.


Code:
sudo apt-get -y install portaudio19-dev

cd ~
wget https://github.com/moode-player/moode/raw/master/other/librespot/librespot-master-a4e0f58.zip
unzip librespot-master-a4e0f58.zip
curl https://sh.rustup.rs -sSf | sh
# choose 1

sudo reboot

cd librespot-master/
cargo build --release --features alsa-backend
#wait for 6 hours

sudo cp target/release/librespot /usr/local/bin
cd ~
sudo rm -rf librespot-master
sudo reboot
Reply
#2
You just turn on the Spotify renderer and then the Spotify app on your client device should list Moode Spotify in the list of devices. It only works with Spotify Premium account.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(10-26-2018, 08:24 PM)Tim Curtis Wrote: You just turn on the Spotify renderer and then the Spotify app on your client device should list Moode Spotify in the list of devices. It only works with Spotify Premium account.

How do I turn on the renderer?

EDIT: I see it now, menu -> config -> audio, under renderers. Turned it on. Still not showing up.

Is there a trick to this? I have restarted Spotify and the rpi with moode on it.

EDIT2: from the troubleshooting you had in another thread.

pgrep -l librespot returns nothing.

aplay -L | grep -v ALSA | grep -w default returns

Code:
default:CARD=BossDAC

And moode.log

Code:
20181026 161324 worker: - Start
20181026 161324 worker: Successfully daemonized
20181026 161326 worker: Session loaded
20181026 161326 worker: Debug logging (off)
20181026 161326 worker: - Platform
20181026 161329 worker: Host (MusicBox)
20181026 161329 worker: Hdwr (Pi-Zero W 512MB v1.1)
20181026 161329 worker: Arch (armv6l)
20181026 161329 worker: Rasp (9.4)
20181026 161329 worker: Kver (4.14.72+)
20181026 161329 worker: Ktyp (Standard)
20181026 161329 worker: Gov  (performance)
20181026 161329 worker: Rel  (Moode 4.3 2018-09-27)
20181026 161329 worker: Upd  (None)
20181026 161329 worker: MPD  (0.20.20)
20181026 161329 worker: USB boot not enabled yet
20181026 161329 worker: File system not expanded yet
20181026 161330 worker: HDMI port on
20181026 161330 worker: File check ok
20181026 161330 worker: - Network
20181026 161330 worker: eth0 exists
20181026 161331 worker: eth0 (10.32.6.8)
20181026 161331 worker: wlan0 exists
20181026 161331 worker: wifi country (CA)
20181026 161331 worker: wlan0 SSID is blank
20181026 161331 worker: eth0 addr exists, AP mode not started
20181026 161331 worker: wlan0 address not assigned
20181026 161331 worker: - Audio
20181026 161332 worker: ALSA outputs unmuted
20181026 161332 worker: ALSA card number (0)
20181026 161332 worker: Audio out (I2S audio device)
20181026 161332 worker: Audio dev (Allo MiniBoss DAC)
20181026 161332 worker: ALSA mixer name (Digital)
20181026 161332 worker: MPD volume control (software)
20181026 161332 worker: Hdwr volume controller exists
20181026 161332 worker: Chip options (Burr Brown PCM5122)
20181026 161332 worker: - Services
20181026 161332 worker: Reset renderer active
20181026 161334 worker: MPD started
20181026 161334 worker: MPD scheduler policy (time-share)
20181026 161334 worker: Configure MPD outputs
20181026 161335 worker: MPD output 1 ALSA default (on)
20181026 161335 worker: MPD output 2 ALSA crossfeed (off)
20181026 161335 worker: MPD output 3 ALSA parametric eq (off)
20181026 161335 worker: MPD output 4 ALSA graphic eq (off)
20181026 161335 worker: MPD output 5 ALSA bluetooth (off)
20181026 161335 worker: MPD crossfade (off)
20181026 161335 worker: Spotify receiver started
20181026 161335 worker: - Music sources
20181026 161335 worker: USB sources (none attached)
20181026 161337 worker: NAS sources (mountall initiated)
20181026 161337 worker: - Miscellaneous
20181026 161338 worker: Volume level (100) restored
20181026 161338 worker: Maintenance interval (21600)
20181026 161338 worker: Screen saver activation (Never)
20181026 161338 worker: Watchdog started
20181026 161338 worker: Ready

EDIT3: Running rpi0w with a usb attached ethernet dongle and the mini boss dac.
Reply
#4
It seems librespot is not running, it must be crashing on start but I can not figure out where to find more debug info on librespot directly.
Reply
#5
Is this not a supported feature?
Reply
#6
Turn on moOde debug logging in System config and then restart the Spotify renderer.

Then post contents of /var/log/moode.log

This will show the Spotify renderer launch string.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
(10-30-2018, 10:27 PM)Tim Curtis Wrote: Turn on moOde debug logging in System config and then restart the Spotify renderer.

Then post contents of /var/log/moode.log

This will show the Spotify renderer launch string.

Code:
20181030 173702 worker: - Start
20181030 173703 worker: Successfully daemonized
20181030 173703 engine-mpd: Connect
20181030 173703 engine-mpd: Session loaded
20181030 173703 engine-mpd: Open socket
20181030 173703 openMpdSocket(): connection failed (1)
20181030 173703 openMpdSocket(): errorno: 111, Connection refused
20181030 173704 openMpdSocket(): connection failed (2)
20181030 173704 openMpdSocket(): errorno: 111, Connection refused
20181030 173704 openMpdSocket(): connection failed (3)
20181030 173704 openMpdSocket(): errorno: 111, Connection refused
20181030 173704 worker: Session loaded
20181030 173704 worker: Debug logging (on)
20181030 173704 worker: - Platform
20181030 173705 openMpdSocket(): connection failed (4)
20181030 173705 openMpdSocket(): errorno: 111, Connection refused
20181030 173705 engine-mpd: Connection to MPD failed
20181030 173707 worker: Host (MusicBox)
20181030 173707 worker: Hdwr (Pi-Zero W 512MB v1.1)
20181030 173707 worker: Arch (armv6l)
20181030 173707 worker: Rasp (9.4)
20181030 173707 worker: Kver (4.14.72+)
20181030 173707 worker: Ktyp (Standard)
20181030 173707 worker: Gov  (performance)
20181030 173707 worker: Rel  (Moode 4.3 2018-09-27)
20181030 173707 worker: Upd  (None)
20181030 173707 worker: MPD  (0.20.20)
20181030 173708 worker: USB boot not enabled yet
20181030 173708 worker: File system not expanded yet
20181030 173708 worker: HDMI port on
20181030 173709 worker: File check ok
20181030 173709 worker: - Network
20181030 173709 worker: eth0 exists
20181030 173709 worker: eth0 (10.32.6.8)
20181030 173709 worker: wlan0 exists
20181030 173709 worker: wifi country (CA)
20181030 173709 worker: wlan0 SSID is blank
20181030 173709 worker: eth0 addr exists, AP mode not started
20181030 173709 worker: wlan0 address not assigned
20181030 173709 worker: - Audio
20181030 173710 worker: ALSA outputs unmuted
20181030 173710 worker: ALSA card number (0)
20181030 173710 worker: Audio out (I2S audio device)
20181030 173710 worker: Audio dev (Allo MiniBoss DAC)
20181030 173710 worker: ALSA mixer name (Digital)
20181030 173710 worker: MPD volume control (software)
20181030 173711 worker: Hdwr volume controller exists
20181030 173711 worker: Chip options (Burr Brown PCM5122)
20181030 173711 worker: - Services
20181030 173711 worker: Reset renderer active
20181030 173713 worker: MPD started
20181030 173713 worker: MPD scheduler policy (time-share)
20181030 173713 worker: Configure MPD outputs
20181030 173713 readMpdResponse(): reading response
20181030 173713 readMpdResponse(): success $str=(OK MPD 0.20.0)
20181030 173713 readMpdResponse(): success $resp[0]=(OK MPD 0.20.0)
20181030 173713 readMpdResponse(): reading response
20181030 173713 readMpdResponse(): success $str=(OK)
20181030 173713 readMpdResponse(): success $resp[0]=(outputid: 0)
20181030 173713 worker: MPD output 1 ALSA default (on)
20181030 173713 worker: MPD output 2 ALSA crossfeed (off)
20181030 173713 worker: MPD output 3 ALSA parametric eq (off)
20181030 173713 worker: MPD output 4 ALSA graphic eq (off)
20181030 173713 worker: MPD output 5 ALSA bluetooth (off)
20181030 173713 worker: MPD crossfade (off)
20181030 173713 worker: (librespot --name "MusicBox" --bitrate 160 --initial-volume 0 --cache /var/local/www/spotify_cache --backend alsa --device "default:CARD=BossDAC" --onevent /var/local/www/commandw/spotevent.sh > /dev/null 2>&1 &)
20181030 173713 worker: Spotify receiver started
20181030 173713 worker: - Music sources
20181030 173714 worker: USB sources (none attached)
20181030 173716 wrk_sourcemount(): mountstr=(mount -t cifs "//10.7.17.0/root/Music" -o username=anonymous,password='',rsize=61440,wsize=65536,iocharset=utf8,vers=2.0,ro,dir_mode=0777,file_mode=0777 "/mnt/NAS/QNAP")
20181030 173716 wrk_sourcemount(): sysoutput=()
20181030 173716 worker: NAS sources (mountall initiated)
20181030 173716 worker: - Miscellaneous
20181030 173716 worker: Volume level (100) restored
20181030 173716 readMpdResponse(): reading response
20181030 173716 readMpdResponse(): success $str=(OK)
20181030 173716 readMpdResponse(): success $resp[0]=(OK)
20181030 173716 worker: Maintenance interval (21600)
20181030 173716 worker: Screen saver activation (Never)
20181030 173716 worker: Watchdog started
20181030 173716 worker: Ready
20181030 173717 engine-mpd: Connect
20181030 173717 engine-mpd: Session loaded
20181030 173717 engine-mpd: Open socket
20181030 173717 readMpdResponse(): reading response
20181030 173717 readMpdResponse(): success $str=(OK MPD 0.20.0)
20181030 173717 readMpdResponse(): success $resp[0]=(OK MPD 0.20.0)
20181030 173717 engine-mpd: Get initial status
20181030 173717 readMpdResponse(): reading response
20181030 173717 readMpdResponse(): success $str=(OK)
20181030 173717 readMpdResponse(): success $resp[0]=(volume: 100)
20181030 173717 engine-mpd: UI state=(undefined), MPD state=(stop)
20181030 173717 engine-mpd: Generating enhanced metadata
20181030 173717 readMpdResponse(): reading response
20181030 173717 readMpdResponse(): success $str=(OK)
20181030 173717 readMpdResponse(): success $resp[0]=(file: http://listen.sub.fm/hi/;&type=mp3)
20181030 173717 enhanceMetadata(): Radio station
20181030 173717 engine-mpd: Metadata returned to client: Size=(29)
20181030 173717 engine-mpd: Connect
20181030 173717 engine-mpd: Session loaded
20181030 173717 engine-mpd: Open socket
20181030 173717 readMpdResponse(): reading response
20181030 173717 readMpdResponse(): success $str=(OK MPD 0.20.0)
20181030 173717 readMpdResponse(): success $resp[0]=(OK MPD 0.20.0)
20181030 173717 engine-mpd: Get initial status
20181030 173717 readMpdResponse(): reading response
20181030 173717 readMpdResponse(): success $str=(OK)
20181030 173717 readMpdResponse(): success $resp[0]=(volume: 100)
20181030 173717 engine-mpd: UI state=(stop), MPD state=(stop)
20181030 173717 engine-mpd: Idle
20181030 173717 engine-mpd: Wait for idle timeout
20181030 173717 readMpdResponse(): reading response
20181030 173815 readMpdResponse(): reading response
20181030 173816 readMpdResponse(): success $str=(OK)
20181030 173816 readMpdResponse(): success $resp[0]=(directory: NAS)
20181030 173816 readMpdResponse(): reading response
20181030 173816 engine-mpd: Connect
20181030 173816 engine-mpd: Session loaded
20181030 173816 engine-mpd: Open socket
20181030 173816 readMpdResponse(): success $str=(OK)
20181030 173816 readMpdResponse(): success $resp[0]=(playlist: RADIO/WCLV Cleveland 104.9 - Classical.pls)
20181030 173816 readMpdResponse(): reading response
20181030 173816 readMpdResponse(): success $str=(OK MPD 0.20.0)
20181030 173816 readMpdResponse(): success $resp[0]=(OK MPD 0.20.0)
20181030 173816 engine-mpd: Get initial status
20181030 173816 readMpdResponse(): reading response
20181030 173816 readMpdResponse(): success $str=(OK)
20181030 173816 readMpdResponse(): success $resp[0]=(volume: 100)
20181030 173816 engine-mpd: UI state=(undefined), MPD state=(stop)
20181030 173816 engine-mpd: Generating enhanced metadata
20181030 173816 readMpdResponse(): reading response
20181030 173816 readMpdResponse(): success $str=(OK)
20181030 173816 readMpdResponse(): success $resp[0]=(file: http://listen.sub.fm/hi/;&type=mp3)
20181030 173816 enhanceMetadata(): Radio station
20181030 173816 engine-mpd: Metadata returned to client: Size=(29)
20181030 173816 readMpdResponse(): reading response
20181030 173816 readMpdResponse(): success $str=(OK)
20181030 173816 readMpdResponse(): success $resp[0]=(file: http://listen.sub.fm/hi/;&type=mp3)
20181030 173816 engine-mpd: Connect
20181030 173816 engine-mpd: Session loaded
20181030 173816 engine-mpd: Open socket
20181030 173816 readMpdResponse(): reading response
20181030 173816 readMpdResponse(): success $str=(OK MPD 0.20.0)
20181030 173816 readMpdResponse(): success $resp[0]=(OK MPD 0.20.0)
20181030 173816 engine-mpd: Get initial status
20181030 173816 readMpdResponse(): reading response
20181030 173816 readMpdResponse(): success $str=(OK)
20181030 173816 readMpdResponse(): success $resp[0]=(volume: 100)
20181030 173816 engine-mpd: UI state=(stop), MPD state=(stop)
20181030 173816 engine-mpd: Idle
20181030 173816 engine-mpd: Wait for idle timeout
20181030 173816 readMpdResponse(): reading response

I also tried running librespot from command line.

Code:
root@MusicBox:~ # librespot --name "MusicBox" --verbose --bitrate 160 --initial-volume 0 --cache /var/local/www/spotify_cache --backend alsa --device "default:CARD=BossDAC" --onevent /var/local/www/commandw/spotevent.sh > /dev/null 2>&1 &
[3] 1506
[2]   Illegal instruction     librespot --name "MusicBox" --verbose --bitrate 160 --initial-volume 0 --cache /var/local/www/spotify_cache --backend alsa --device "default:CARD=BossDAC" --onevent /var/local/www/commandw/spotevent.sh > /dev/null 2>&1


Googling "Illegal instruction" seems to suggest an issue with some versions of librespot and the rpi0w? Not sure how to go about replacing the files to test that though.
Reply
#8
I can try and repro on my ZeroW and then we can see where that leads.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#9
I get same.

Code:
pi@rp2:~ $ librespot
Illegal instruction

That suggests a compatibility issue with armv6, prolly something in the compile options or possibly the librespot code itself.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#10
This is what I found https://www.max2play.com/en/forums/topic...not-start/

So they are doing something different with the install after detecting the board is an rpi0w. 

The one post though "I replaced file /opt/spotifyconnect/librespot from precompiled file librespot version v20170717-910974e"

I am not sure where to obtain that file.
Reply


Forum Jump: