pimoroni pirate audio

hi guys,

did somebody check out the new pirate audio dac’s from pimoroni… https://shop.pimoroni.com/collections/pirate-audio… i have one at home but i’m no linux guru nice small board with lcd/buttons/amp for a raspberry pi

I’m using 1 to drive some FaitalPro 3FE25 speakers. For a very simple, easy to power small player, it’s very impressive.

I use it on my LMS running picoreplayer on a RPIZero.

For it to output music, you need to use a HiFiBerry DAC driver (dtoverlay=hifiberry-dac), and add gpio=25=op,dh to your config.txt file.

I have the screen working on PCP, but would have no idea how to get it working on Volumio…

thanks for the info

i’ve got the thing finally playing with mopidy (the original install script were broken by the new version of moped)

but it would be very nice at least to have this board running volumio

What all did you need to do in PCP? Just tell it to use the HiFiBerry DAC and input that info into the config.txt? And it plays info on the screen for music and such?

Th screen becomes a Jivelite display, showing album art etc, and the buttons are used for volume control etc. The steps are a little more than simple, so it’s probably best to head over the the Slimdevices forum thread:

https://forums.slimdevices.com/showthread.php?111502-Jivelite-on-a-Pirate-Audio-240x240-screen&p=963991&viewfull=1#post963991

Got one of the pirate audio line-out DACs recently and spend a few minutes today figuring out how to drive the display on it from volumio:

  1. The display requires SPI to be on so go and add the line dtparam=spi=on to /boot/config.txt and reboot the device

  2. There is a handy python library for driving the display here:
    pypi.org/project/RPI-ST7789/
    It is used in this github.com/rusconi/TFT-MoodeCoverArt moode OS python script to display the album art on that system

  3. install python3 and the library with:

apt install python3 python3-rpi.gpio python3-spidev python3-pip python3-pil python3-numpy pip3 install ST7789
and you should be able to interact with the display using python.

Here is a quick test code I wrote to see if the display can be used with volumio album art:

[code]from PIL import Image
import ST7789
import requests
from io import BytesIO

disp = ST7789.ST7789(port=0,cs=ST7789.BG_SPI_CS_FRONT,dc=9,backlight=13,spi_speed_hz=80 * 1000 * 1000)

disp.begin()

img = Image.new(‘RGB’, (240, 240), color=(0, 0, 0, 25))

state = requests.get(‘http://127.0.0.1:3000/api/v1/getstate’).json()

coverUrl = state[‘albumart’]
if( coverUrl[0] == ‘/’):
coverUrl = ‘http://127.0.0.1:3000’ + coverUrl

coverImg = Image.open(BytesIO(requests.get(coverUrl).content))

img.paste(coverImg.resize((240,240), resample=Image.ANTIALIAS).convert(‘RGB’))

disp.display(img)[/code]

Simply running this script with python3 should put the current album art on the display. I currently just set this to run every few seconds on my pi. A proper solution would likely use the API to poll the state (or get event messages from it?) to see when the track changes and run the cover updater script only when actually needed.

It seems to work just fine for both local files and spotify connect on my setup.

Also: The 4 buttons on the DAC board are simply connected to GPIO (BCM 5, 6, 16, 20) so it shoud be trivial to make them control volumio functions.

1 Like

I got one of these the other day, and after coming off Volumio to Mopidy, I would rather run Volumio on this. Looking for handholding to get this done with screen and buttons working.

1 Like

Bouncing this up if thats ok - just wondering if there is a simply way/guide to use the Pirate Audio with Screen in volumio?

Andy

+1, pretty please…

In the past i spend some hours and got it working.
See https://community.volumio.org/t/need-working-example-of-websocket-or-restapi-call-in-python/12678/5 and https://community.volumio.org/t/need-working-example-of-websocket-or-restapi-call-in-python/12678/9

AxLED

Thanks AxLED - i see that’s over two threads and still not sure what to do - any chance of a simple guide?

Andy