Using a Raspberry Pi as a Bluetooth Speaker with PipeWire
collabora.com
collabora.com
[1]: https://github.com/sandreas/raspberry-bluetooth-receiver
[2]: https://stackoverflow.com/questions/50190477/bluez-and-dbus-...
But really, the extra USB audio adapter is a must here. The internal Pi audio hardware, I found to be very noisy. The USB DACs I bought were also super cheap (<$10). You can scale this up in cost as much as you’d like.
I can play music directly from my mobile Spotify (so supports Spotify Connect). I can see all my Squeezebox players there, combines synced players flawlessly.
Also plays local files. And also directly from youtube.
I have about 9 players on different rooms and could not be more happy with the setup.
If you would like to know any specific details, just ask. Happy to elaborate.
Squeezeboxes are rather durable, probably will use those for many more years. Have been also collecting little replacement player stock :)
Wanted to evaluate esp32 -based player mainly for hacking purposes, but havent found yet time to work on those.
You can snipe at 1x from the usual rpi vendors when they come back in stock, if you make the effort.
That's why the legit vendors like Adafruit now set a quantity limit and also require registration (with phone number IIRC) to buy them.
But, it's a cool writeup and a nice learning process that is documented well.
But what if you wanted to do something more fancy like build a jukebox that also had BT in addition to a web based control front end?
even if you wanted to stay over-powered but try to remain budget friendly a ~3-5usd esp32 would handle this.
I have a similar setup in my workshop and it has been solid for years.
There are loads of these projects, often in docker containers you can launch with a single command:
> https://hub.docker.com/r/flaviostutz/rpi-spotify
> https://github.com/qSharpy/raspotify-docker-compose
> https://github.com/Spotifyd/spotifyd
etc etc.
I've several speakers integrated with various Spotify API based solutions around my home running on various RPi hardware. Some of these projects do even more, like add Airplay streaming too.
Pi + DSP Hat + AIYIMA A07 + decent speakers + Roon (or other) = A fantastic and inexpensive sound system. You could spend 50x as much and not get as good sounding system.
However, for this use case, I’d recommend one of those Bluetooth “pen drives” with a P2 conector. I’ve used one powered by a phone charger connected to a stereo for over a decade. It’s cheep and works as well as Bluetooth possibly can (pairing sucks, range too, etc)
As a bluetooth speaker, perhaps yeah. To me, the title described a capability clearly. I might already have, for example, a KodiTV media rpi. Now I know I can add more features to this system easily.
General purpose computing is great. We can keep exploring & expanding what we do; being limited only by imagination is excellent. We could add public announcement capabilities, could have the rpi connected to webconference software, could set up music-playing daemons or internet radio (somewhat covered by KodiTV). This article was a clear way to state what capability is possible. And it's mostly all built-in to the latest greatest free desktop technology, requiring only a little glue to make the bluetooth connection seamless:
> It provides Bluetooth® A2DP support with optional codecs (SBC-XQ, LDAC, aptX, aptX HD, aptX-LL, FastStream) out of the box. At the same time, WirePlumber automatically creates the connection between the A2DP source and the audio chipset when a remote device, like a phone or a laptop, connects. This makes the configuration very easy, as PipeWire will work out of the box. We will only need to set up BlueZ to make the system headless.
It would be cool to write a guide to Linux programming that went over all the stuff you should know to do it the modern way.
dbus is a message bus that lets apps communicate. But it's object oriented and corba-ish and really complicated. It's wonderful if you don't have to think about it and are just copying and pasting. If you have to actually think about it , it becomes just OK. I'm still a big fan though.
Also, it's not really a pure message bus, it also does stuff like RPC calls. It's not just an MQTT type thing.
Gstreamer is a node based audio framework. It is the second best way to handle media as far as I'm concerned, the best being to not do so at all and use existing stuff because media always seems to be a nightmare in new ways every time.
You mostly never touch any actual media. You just set up nodes with code.
glib is a utility library that has to to with the GTK and gnome people , like gstreamer. It tries to give C the things that other languages I'd rather be using have. I'd still rather be using them instead.
There's also gobj. They have this object thing for C and they can auto generate bindings for python with introspection. This is how gstreamer works in python.
Unfortunately it is totally possible to make resources leaks and such using those bindings, autocomplete won't work, you may get unhelpful error messages, or just annoying unpythonic things, and you will probably need GDB to debug any segfaults, should you want to do anything very complicated.
I never much cared for audio applications but I can distinctly remember it being trivial to use my Ubuntu PC as an audio device for pretty much anything else. Dread to think of the Bluetooth delay though.
Use a sound card.
.
There's some niche usecases (e.g. lengthy video editing on a PC while wanting to move around listening to music on your phone - airfoil (wifi) technically works but at the time was a bit laggy).
I mean, you do you, but that sounds like a very inconvenient "solution".