Hello Pimoroni gurus,
I’m having a blast with a Pirate Audio, successfully jamming with Mopidy loading local files. I’m pairing it with a Raspberry 2 W running Raspberry Pi OS (Legacy, 64-bit [Debian Bullseye 2024-03-12]). My hope is to make this a tactile music experience for my little one who is curious about different genres (plus it’s FUN to make). We’re finding the voice interfaces not as exploratory.
I’m leaning towards making use of Spotify under the hood, yet I understand the old abandoned Spotify library and am experiencing an adventure of other disjointed connectivity (with some progress). A bit has changed since issue 17. I don’t really need any solid answers here, yet I could cover those adventures and see if anyone has cool ideas?
I started with the Pirate Audio install script and Modipy/Iris. The guide was great. It was neat to load up the device-hosted website and explore local files once loaded. I’m not excluding this as an option. I just don’t own a lot of digital files to throw in there right now.
On the Spotify track, I looked at Mopidy-Spotify. Although, Spotify seems installed in Iris for browsing, which was confusing. Installing Mopidy-Spotify wasn’t so bad yet it now depends on a gstreamer plugin, gst-plugins-spotify. I first went the route of trying to build from source, however the install process froze my poor little Pi a couple of times, requiring reboots. I then installed “successfully” from a debian package file (the armhf one). However, the plugin didn’t seem to register with gstreamer. I can expand on this if there’s interest.
Then I thought, why not start from the basics with librespot that powers a couple of the options? After a couple of rough install attempts, I settled on librespot-dev instructions. This got me very close to successfully streaming Spotify (haven’t checked if I could control Spotify with it yet). It successfully creates an instance that is visible to stream to in Spotify. I can start the stream with no visible error. I just don’t hear anything, yet. I can return to this and fiddle with the “device” option perhaps (learned more about this later).
I jumped over to Pimoroni’s PiDi Spotify beta powered by Raspotify, a fork of librespot. With the Raspotify install, I’m noticing a few significant changes over the last four years since PiDi Spotify was last updated. Mainly, centered around the config file that moved to /etc/raspotify/conf
, with updated options and prefix to each variable. I was able to get this running mostly (can expand on this as needed/if there’s interest) and I can once again see a device listed in Spotify that can be streamed to. Clicking that device in Spotify triggers an error that kills the connection immediately. It could* be related to the device option of LIBRESPOT_DEVICE="hw:1,0"
. It could also be an RPI.GPIO odd thing I’m seeing (“RuntimeError: This module can only be run on a Raspberry Pi!”). I figured it was time to see what others were doing these days…
I avoided posting a bunch of logs and such here as this is not a Pimoroni bug report. The Pirate Audio device works great and I received my money’s worth (looking forward to hacking at the screen too!).
I’m mainly curious about what others are doing with Spotify today. It seems like activity was huge then Spotify killed their dead library in 2022 (unsupported since 2016). Then new options came out yet still feel fragmented, at least for me at the moment and I’m not the expert.
I still have hope. Any ideas on how to make use of Spotify in 2024 on a Pi?
Thanks for letting me ramble and have an awesome day/night.
Update: For memory before I wipe my Pi and try again:
librespot -n "Librespot" -b 160 -c ./cache --enable-volume-normalisation --initial-volume 20 --verbose --username MY_SPOTIFY_USERNAME --password MY_SPOTIFY_PASSWORD --device "hw:1,0"
Result (yet raspotify is also running at the same time now, will start over soon):
Audio Sink Error Connection Refused: <AlsaSink> Device hw:1,0 May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'ENOENT: No such file or directory'