For pimoroni pirate audio device users - python code to unleash the power of your hat

Hi pirate audio users,

as i have a pirate audio dac hat i wanted to use the display and the 4 buttons, so i wrote some code which i would like to share with the community.

Here are some pictures:

For more details see

Please let me know what you think.



Good job!


Happy new year to you and your family, as well as to the devs and the community.

I ordered a (hopfully very) similar display and will try your code beside another HAT DAC as soon as it took it‘s way from CN…

Best Regards

Well done! What about packaging your work in a “true” plugin for Volumio? You can have a look at touch display plugin and other plugins. Let us know if you need help :slight_smile:

thanks for your reply. I am not able to put it in a “true” plugin because of:

  • for displaying content i need a ST7789 library, where i didnt find out how to use it in javascript
  • i dont know if it is possible, to write a “true” plugin in javascript which calls a python script

Maybe you or someone else can give me hints or sample code snipplets, so we can make it a true pluging. Most of the work is done, it is “just” translating in different programming language.
(i know js syntax a little bit because of my magicmirror history :slight_smile: )



This is not a problem if some part are not in JS
Have a look here, clone a python folder and index.js launch a service launching python + script :upside_down_face:

thanks for the hint, i will look at it if i find some time.

So your suggestion is:

  • to start with an empty volumio plugin template
  • use my python files as they are
  • make them start as a service
  • tell the volumio plugin in to do so
  • maybe complete the rest of the template so it is adjustable via Web GUI in volumio



You can start with an empty template or an existing plugin with similar features…
have a look here :

One Pimoroni dug out of the cupboard and doing what it should - Thank you!

A few minutes to do a bit of translating and the new kitchen radio is only a case away.

I almost hate to ask but… is it possible to blank the display when not playing?

Great to hear the code works and enjoys you.
To your question: Yes it is possible, but i won’t change the code now. What do you understand with “blanking”? Just black background and backlight on an 4 Button icons show? You can leave your request as issue at github, so if collect some wishes maybe it makes sense to implement them or they can be handled by some kind of config file for "own preferences".

Hi Community,

@balbuze motivated me to create a “real” plugin with my code.
Today the plugin Pirateaudio was merged so it is available to install via the GUI.
(see plugin section (miscellanea/pirateaudio) in volumio)


  • you have to restart volumio after installation, as the install process adds informations to /boot/userconfig.txt, which are only used after a restart.
  • Output device should be set to “HiFiBerry DAC” (if not already set)
  • Volume setting -> type of mixer should be set to “Software” (if not already set)

Have fun and enjoy it (as i do).
Thanks to @balbuze, the volumio team and rusconi (i reused some code and got inspirations).



1 Like

Thank you! I have been curious about Pimoroni for some months, but didn’t want to give up Volumio (or mess it up). I’m ordering a Pimoroni tonight. :wink:

You are great!! Great work, a real power tool for pirate audio!! Thanks for your work

well done, I like it!

I don’t have e Pimoroni, but another HAT I made some time ago with ST7789 display and a few buttons.

Just to let anyone who might be interested know …

You can also connect an i2c display and use the pydPiper plugin to display the text at the same time.
I’m also using a remote with lirc to control it and the GPIO Control plugin to turn off the Pimoroni backlight when paused.
Very pleased with the way things are going, more fiddling to do…

Just noticed that it doesn’t seem to want to play high res files…

1 Like

Some photos (hopefully)


didn’t know you have 2 displays connected to your pi. I am happy if part of my code help you to build your individual volumio.
I am developing further right now, to get more useful features to the pirate audio plugin:

  • translation de and en for the static text
  • blank display if plugin is deactivated
  • draw siteindex while navigating (useful on long lists)
  • improved

Testing right now, give me some days.


Thank you so much AxLED. I recently purchased two pirate audio hats ( 1 headphone amp and line-out hat) from Microcenter to install on rasp pi zero’s. I came across your github link and installed the files and the system works perfectly. You saved me a ton of time trying to figure out the programming as I am still a noob to programing these rasp pi’s. The buttons and screen work beautifully. I just need to figure out how to change the sub menu to english. I am looking forward to any new updates you release. Thanks again!

Hi Volumio Users,

i did further development to add more useful features to the pirate audio plugin:

  • added translation de and en for the static text shown on display
  • blank display if plugin is deactivated and on boot/shutdown
  • draw siteindex while navigating - if more than one site (useful on long lists)
  • improved
  • added background for selected navigation entry

The “new” version 0.0.2 was merged (thanks to @balbuze) into plugin section (see your volumio gui).




Hey AxLED, Fantastic work!
Thank you for the english translation!
The volume up button stopped working in this build… how can I check to see if it’s configured right?