N00b looking for advice on Pirate Audio / Parts List

Like a lot of other people, with school being out and/or virtual, I am looking for something productive for my kids to do. I also have a handful of Raspberry Pis around the house for a project that I never started with them a few years back. I thought it would be cute to get each of them a Pirate Audio board and have them make a spotify radio for their rooms, but I had a bunch of questions, and I thought this would be a good place to start, so here goes:

Some of the basic questions:

  • It seems that this will work with the B+ or the Pi Zero (non W), but will the performance be okay to play music, or will it be laggy?

  • Beyond the parts and accessories for the Raspberry Pi itself, and buying the Pirate Audio board and speakers, is there anything else I would need?

  • Beyond the web interface, is there another way for them to control the audio?

  • Can I have more than one of these connected to the same spotify account?

Some more advanced questions:

  • Is there a way to Sync Audio across a few of these - i.e. play the same spotify playlist on multiple devices in sync?

  • Can I also add a small second screen to display the time/news/alerts/etc (in addition to the Music Screen)?

Thanks in advance for your help.

I can’t speak for the new Pirate Audio, but I have one of the original Pirate Radio’s that is a pHat Beat and Pi Zero W. Other than a bit of a delay booting up it seems more than capable of playing my Internet Radio stream. I would think the Pirate Audio will work with any Pi that has a 40 pin GPIO.
If your worried about performance and on a budget a 3A+ may be a good choice. I have several setup as web cameras. It’s a nice cost saving over a 3B and almost as fast performance wise.

The display on the Pirate Audio uses SPI. If you want to add a second display you may want to go with one that uses i2c. Have a look at the Breakout garden oled ones.

Hi,

I have a similar project and I bought a couple of pirate audio amp and speakers for my kids. I just installed one of them on a raspberry pi 0 W (you may want Wifi for Spotify ?) and played with it for a few (tens of) minutes. The experience is not completely smooth:

  • some hiccup when pass from one track to another sometimes, I think this is due to a download lag rather than raspberry pi performances
  • modifying the volume, up or down, takes about 1 second to take effect. Again, not sure this is due to a lack of performances of the pi.
    Overall I’m not too worry with performance of the pi 0. I bought it to take and process pictures of birds, an application much more demanding.

The audio is served by mopidy and there is no obvious way to control the audio by something else than the web interface. Since one of my goal is to put my son away from screed, this is something on which i’ll have to work. I saw here in the forrum some attempt to add buttons and more control.

To be short, if you want to add features, you’ll have to code it. For audio sync’ing, there is a plugin for mopidy : https://github.com/badaix/snapcast I don’t know how to use it in this particurlar setup but it’s start.

I had it easy, the VLC Radio install for my pHat Beat version has all the buttons already setup. I have very simple needs though. I only ever listen to the one classic rock channel / steam.

Thanks for everyone’s responses so far - now I have some follow-up questions:

  • How is the display on the Pirate Radio board driven/addressed. Will it show cover art for whatever is playing in mopidy/iris regardless of the source?

  • I came across this article on the original pirate radio board’s product page - https://learn.pimoroni.com/tutorial/sandyj/streaming-airplay-to-your-pi - obviously, I could run this on the new Pirate Audio board, but how would I get cover art or stream info on the display?

TIA

That display is SPI driven

1.3" IPS colour LCD (240x240px) (ST7789 driver) which I believe is basically this


With a slightly different pinout hookup on the GPIO

Thanks to everyone for their advice so far. I bought myself a Pi 3A+ and a Pirate Audo Board and speakers, I’ll let you know how it goes (or, you’ll probably know from my next posts in the forum).

Bought one of these a while ago, finally got round to getting it working this weekend. Here are a few hints from the things I tripped up over.

If you have music files locally on the pi then you will find the “sudo mopidyctl local scan” command in the instructions will fail. Yhis is because the installer is missing a module, as highlighted here Pirate Radio/Mopidy setup issue post
need to do the following
sudo python3 -m pip install Mopidy-Local

In the config file you need to add
[local]
media_dir = /xxxxxx
where /xxxxxx is the location of your music files

If you get timeouts during the scan you could also add the following to increase the timeout
scan_timeout = 10000

You will then find the local music is added correctly.

To be able to use the web interface from another device (rather than just running the browser on the pi), you need to change the hostname in the [http] section to ::

If you have an Android device mopidy-mobile provides a much nicer interface than the web page. Install the modipy extension
sudo python3 -m pip install Mopidy-Mobile
and download the app Mopidy Mobile from the play store

By the way, connecting the speaker wires is a bit fiddly. Rather than connect the speakers directly I have connected some wires to a connector block so that I can add/remove the speakers without having to remove the HAT.

So far I am using it to play my music library and BBC radio stations. Have fun.

It’s me again - thanks again to everyone for their help. I received the Pirate Audio Board and speakers and wired them up to an RPi B+ that I had lying around. I also set up Shairport-sync, and it works great - I now have a nifty little speaker that I can play music on via Airplay.

Here’s the question - Right now the LCD on the audio board is idle. I’d love to have it display album art and current playing info. In my head, I probably need to answer the following questions:

  • I imagine that this library/project will give me the code I need to write to the display - https://github.com/pimoroni/st7789-python - beyond that is there anything else I need?

  • How can I tell what song is being played via Shairport?

  • Does shairport also have the album art available?

Hello. Have exactly the same in my head. Installed Shairport-Sync on Raspi Zero. Works fine! But now I want to light up the lcd which is in idle all the time. But how I can do? Installed https://github.com/pimoroni/st7789-python and cloned the examples to my Raspi Zero but can’t get it work… Get errors for import pip, import ST7789 as ST7789 and import numpy as np…

I have the stand alone Breakout Garden version of that display.
This is what I went through to get mine working.

Keep in mind that the one on the Pirate Audio may be wired up differently (use different GPIO pins) than the Breakout Garden setup. You may have to edit the examples to get them to work. Namely the backlight pin used and CE pin used.

On the Pirate Audio setup it uses BCM 13 physical pin 33 for the backlight and BCM 8 physical pin 24 as the CS (SPI0 CE0)

So I started working on this since my last post, here is what I’ve done:

  • I loaded the ST7789 Libraries, at first it didn’t work, but then poked around and made some changes to my boot.config to enable SPI, and I was able to send text messages to the display using the ST7789 library (you can enable SPI using the Preferences -> Raspberry Pi Configuration from the main menu as well)

  • The same person who wrote Shairport, also wrote another project Shairport-Sync Meta-Data - https://github.com/mikebrady/shairport-sync-metadata-reader . That parses the meta data sent by Shairport.

So now I can write to my pirate audio’s display, and I can load the metadata reader in the terminal and watch it change as the song changes, here is what is left:

  • Modify the directions here - https://appcodelabs.com/show-artist-song-metadata-using-airplay-on-raspberry-pi - to write to the display (probably easy, I just haven’t had the time to finish it)

  • A little bit harder is to figure out how to extract the cover art image (the meta data reader is already parsing it) and have it display - writing out the image once I have it, should be relatively trivial.

  • I’m having a couple of busy work days, but I should have another update in a week or two

SPI not being enabled bit me. I could have sworn I had enabled it, double checked it, enabled it, and one issue resolved.

Thanks. Examples work now.

After I installed python-rpi.gpio python-spidev python-pip python-pil python-numpy and install another library with “sudo pip3 install ST7789” my lcd displays something for the first time.

Of course, now I start playing with it, and when I write to the display, it kills the audio, I need to make sure I don’t have a bad setting somewhere :)

Detected the same issue while playing with the examples… Display works, audio crashes…

BCM 19 is used for i2s on the Pirate Audio. It’s also used for the LCD Backlight with the Breakout garden examples. You need to change it to BCM 13 for the Pirate Audio setup.

1 Like

Does this require a wiring change, or just specifying a different pin?

Unless you have jumpers between your Pirate Audio and Pi, its a (software) configuration change.
The GPIO pins used are hard wired between the Pi and Pirate audio pHat.
EDIT:
Try changing backlight=19 to backlight=13 in the examples

1 Like

A bit late to the party.
I bought a Pirate Audio (headphones variant) and a Pi Zero WH with soldered header.

With the exception of the missing install noted above, it went well.


I have a large collection of CDS, and following on from Martin O’Hanlon’s post here:

I also use it to transfer music from CDs (though the Zero is a tad under powered for the music conversion - it take about 40 minutes per CD). When it is not being a music source, it sits next to the television, so I just add a CDs as I have the time.