I’ve been using Raspotify for a little while, and I am very satisfied with it. I’m running it on a Pi Zero next to my stereo, where I also have 2 other Pi 3’s doing various stuff. Suddenly it hit me that it would be nice to have a Raspotify/Librespot add-on for Hass.io, since it would free up my Pi for other projects. It also seem to be fairly easy to run, and Librespot is docker ready.
Anyone want to help me build it? I know nada about how to make add-ons (tried the guides already)
Are you using the built in HDMI or jack for output? Are you able to get any sound?
I’m using the USB DAC on my Hegel receiver and I get this message:
INFO:librespot::player: Track “Purple Light - Few Wolves & Bastiaan Remix” loaded
ALSA lib pcm.c:8403:(snd_pcm_set_params) Rate doesn’t match (requested 44100Hz, get 48000Hz)
thread ‘’ panicked at ‘called Option::unwrap() on a None value’, /checkout/src/libcore/option.rs:335:20
note: Run with RUST_BACKTRACE=1 for a backtrace.
Probably just a small hickup, but I was wondering if you get the same message.
I’m using HDMI which is splitted by an hdmi matrix.
The sound quality is very good this way.
Which “speaker” option did you set ? The default one is for hdmi : "hw:0,1"
Also, can you copy what you have in the logs between [Info] Show audio device and Starting spotify connect ?
I’m working on an update which will support more options from librespot (bitrate, initial_volume) and allow to run multiple instances on the same add-on.
My receiver has an USB input that gives far better sound quality connected directly in the USB port of the Pi, than when I used AUX to RCA cables from the Pi or via an USB soundcard. I was actually blown away how big the difference was. Less noise, clearer quality (USB soundcard cost 1 dollar on eBay) and signal was stronger, so fewer turns on the volume knob. Next step up will probably be a HiFi-berry or something (higher bitrate, more direct transport over i2s), but then again Spotify itself will be the bottleneck soundwise.
USB is the next best thing to a dedicated hat for the Pi. The signal from the aux output is not the best (it’s a 35$ computer, not a HiFi component). Noise is the most noticable problem you get out of the AUX-RCA cable, so USB is a good upgrade.
@victorcerutti 1,0 is the input part and will give out a broken pipe error. 99 % sure the 1,1 setting is correct. Only tried Google assistant on jack output, so no experiences there. But I’m upgrading now, and will keep you posted. Again, thank you a million times for putting your time into this, your my favourite person on the interwebs nowadays!
The audio output of the RPi is good only for some bleep blop alert sounds, absolutely bad for music. It’s not a DAC but a PWM signal smoothed and filtered with a pair of capacitor and a pair of diodes.
Ok, I think I’m stuck @victorcerutti . I can see your add-on works perfectly on HDMI, no errors there. I tried installing 0.5 but I get the same error. Since the DAC works with Raspotify, which is also based on librespot, this should be able to work as well. Hardest part here for me is the Docker-world, because I know nothing of it. Am I able to access ALSA inside hass.io somehow? I think what I need to do (what worked on Raspotify installed on raspbian lite) is disable the built in BCM2835, and make the DAC default output. Is that even possible in a docker environment?
Also, I’m running on a Pi Zero right now, I don’t know if that is a bad idea.