Pimoroni Pirate Radio Project Enhanced

Hi everyone,

I would like to introduce you to a project based on Pimoroni Pirate Radio - a cool DIY music player project based on RPi Zero W and PhatBeat DAC that Santa brought this year :wink: As it has just started a few days ago, I will be sharing with you the progress on the go.

The goals are to:

  1. find the best available software solution, which will:
    [list=a]
    [*] be compatible with PhatBeat DAC, together with itā€™s VU meter and buttons
  2. provide an up-to-date mobile-friendly Web UI which is easy to navigate, yet powerful. An Android app would be nice to have as well
  3. support playback of Internet radios & podcasts and Youtube
    [/:m]
    [
    ] build a case that would make the Pirate Radio truly portable[/:m]
    [
    ] and last, but not least, make that thing something that all the expensive BT speakers owners would be jealous of :laughing: [/*:m][/list:o]

[size=200]OS & Software[/size]

By default, Pimoroni suggests to choose Raspbian OS and install PhatBeat DAC libraries together with VLC-based project on top of it for music player capabilities with Web UI. Itā€™s a great start to see what PhatBeat DAC is capable of in terms of sound quality, volume, itā€™s awesome VU meter and buttons. However, it is very poor when it comes to the Web UI and overall remote controlling features. Therefore, Iā€™ve started a research on available music-oriented software or whole OSā€™es or for RPi that represent a modern approach and provide fully-featured Web UIs, possibly together with an Android app. Iā€™ve finished with those:

Here are my experiences with them:

[size=150]Raspbian OS + Mopidy[/size]
[spoiler]Itā€™s one of the best combinations. Thanks to Raspbian OS we have a great support community, and Pimoroni officially supports this OS as well with their libraries! Therefore, simply speaking, we are getting all the good from default recommended setup (sound quality, volume, VU meter), and enhance it with great Mopidy software which based on MPD. Mopidy provides a plugin-rich platform that is quite flexible and extensible. There is a wide choice of available Web UIā€™s as well. I personally like Iris the most, for itā€™s modern design, usability and stability. Additionally, since itā€™s based on MPD, there are a few Android applications that allow controlling it remotely. While most of them are quite ugly in design, one of them - Remotedy - is pretty and functional. Another point for Mopidy :slight_smile:

However, there are a few bottlenecks I found while playing with this setup. First of all, itā€™s the codecs. After you install Mopidy, you will find out that only a few music sources work out-of-the-box. Mopidy is coupled with GStreamer (however, Iā€™ve seen plugins that replace GStreamer with MPlayer) , and by default only the ā€œgoodā€ ones are installed. Therefore, the tutorials suggest installation of the ā€œbadā€ and ā€œuglyā€ as wellā€¦ But that sometimes is still not enough. In my case, I couldnā€™t also play MP3s - turned out Iā€™m missing the Fluendo MP3 extension. MP3 is not supported by default? :confused: On the other hand, even though there is quite a community around Mopidy, not all the basic flows are covered by plugins available. Example? The Youtube plugin is very poor, and there is no easy replacementā€¦

At this point, Iā€™ve been 80% satisfied, made an image of SD card, and decided to search furtherā€¦

Loose thoughts and experiences:

  • Internet radios are not supported out of the box. After installing Mopidy-TuneIn, you have access to all TuneIn stations, however they are quite hidden in the Web UI. I donā€™t know if itā€™s specific to Iris UI, but there is no dedicated ā€œInternet Radioā€ tab, you need to ā€œBrowseā€ like you would play sth local, then ā€œTuneInā€, and then choose something from the categoriesā€¦[/spoiler]
    [size=150]Pi MusicBox OS[/size]
    [spoiler]Not tested yetā€¦[/spoiler]
    [size=150]Volumio OS[/size]
    [spoiler]Volumio is probably the best out-of-the-box solution for music-oriented RPi setup. It has the prettiest UI, many functions are already inbuilt, plugins are easily available, and is overall well-thought. It is lacking an Android app to control it (or rather there is an official app, but itā€™t not free, and has bad ratings), but the Web UI is very mobile-friendly and you could easily create yourself a shortcut to it. Itā€™s also the only OS that took care of wireless headless setups (without monitor, keyboard and wired LAN). Setting it up with RPi Zero W was a breeze thanks to a hotspot that is automatically created on first boot - connect to it, go to volumio.local, and you are welcomed with a Configuration Wizard that will take you through the most important settings you need to let the fun begin. Sounds great so far :slight_smile: Or ā€¦ not.

Even though Volumio has an inbuilt support of many I2S DACā€™s (together with PhatBeat), it is tightly coupled with ALSA audio sinkā€¦ In result, of course, we are able to listen to music, but the maximum volume will be about 25% of what the hardware is capable ofā€¦ I donā€™t know why PhatBeat DAC does not play well with ALSA, but apparently Pomoroni is aware and their libraries do replace it with PulseAudio sink. Any of advice found on the Internet, and anything I tried, failed to fix the problem with ALSA. Therefore, even though Volumio team struggles with replacing ancient ALSA with PulseAudio (bugs raised in 2015, not yet solved), and even though every trace of attempt to use Volumio with PulseAudio I found didnā€™t succeed,
I decided to try as the world runs fast, and what you tried 3 months ago, could have become possible today :slight_smile: I will document that in separate topic,
but yes, itā€™s possible, however Iā€™m yet to solve lack of volume control in such setup (I have an idea though).

Thatā€™s my current setup, and in the nearest future, I will be elaborating on it.

Loose thoughts and experiences:

  • Volumio is a bit buggy when you play too much with it. Some switches do not work in settings, when you create a playlist it wonā€™t show up, you need to refresh page (there is a bug registered, not solved yet)ā€¦[/spoiler]
    [size=150]RuneAudio OS[/size]
    [spoiler]RuneAudio OS is yet another project based on MPD, however itā€™s even more specific than Volumio. I mean, it is probably one of the best out-of-the-box solutions, but only if what you have is officially supported. Otherwise, it is the least friendly solution I stumbled upon. First of all, RPi Zero is not supported even though it premiered in 2015ā€¦ Second of all, the authors did not understand when someone asked for a possibility of wireless headless setupā€¦ Cables in 2017? Come onā€¦ Third of all, it is based on Arch Linux, it has dynamic filesystem analogic to Volumio, the default user is root, there is no apt-get, no sudo, so running PhatBeat library installer is a no-goā€¦ Plus, any manual changes of the OS files are heavily discouraged by RuneAudio team, as you may clash with their deamon observing the filesystem and making changes to itā€¦ Yes, PhatBeat DAC is kind of supported (Hifiberry DAC is supported which is same thing), but RuneAudio is tightly coupled to ALSA as well, so the sound is too quiet to accept.

Having learned all that, I backed out :confused:[/spoiler]
[size=150]piCorePlayer OS[/size]
[spoiler]Not tested yetā€¦[/spoiler]

To sum up, the crucial requirement is for the software to work well with PulseAudio, as otherwise, the setup with PhatBeat DAC will never stand up to itā€™s purpose. Then, it all comes down to playback capabilities and UI that feels like you paid for itā€¦ :slight_smile:

My current choice, considering the best experience I got so far, is Volumio :slight_smile: However, Iā€™m still straightening a few things out with it so it could be a daily driver rather than something I have to play from command-line with oftenā€¦

[size=200]Hardware[/size]

When it comes to hardware, there are a few things I would like to change. However, the very first thing I will focus on is creating a proper case for my project. I would like a full box rather than a faceplate with wobbly backlegs like it is now. Since I own a 3D printer, I will probably create soon a project that I will print out that will be an extension to acrylic sheets provided in the kit. Iā€™m aware there is an existing project available, but itā€™s just a speaker chamber leaving the boards uncoveredā€¦ Additionally, Iā€™m also thinking of another case that would also pack a place for powerbank, to make the whole thing truly portable :slight_smile:

Thatā€™s all for now, thanks for your interest :slight_smile: I will be appending the above as soon as I progress on the project. Stay tuned!

Cheers!