[Plugin] pirate audio

FWIW, I have tried the workaround from ARCUK and within minutes the display&buttons were working, didn’t get all the error when executing “sudo pip install socketIO-client”.
I have Volumio 2.917 on Rpi3, the command “wget https://bootstrap.pypa.io/pip/2.7/get-pip.py” seems to overcome the errors so thank you for putting together the pieces, it works for me.

Thumbs up!

Working for me - install the old Plugin, ssh, follow the instructions above = success!

thank you for the update. I have tried it out. For me the instructions worked flawlessly on the Raspberry Pi Zero. Excellent! Used the latest image, tested your instructions, installed and activated the plugin. Bingo, everything is up and running. (Except I had to remap the button for “louder”.)

Internet radio, music from SD card or web server were working and showing the cover. Airplay worked, no cover was shown.
If I can test anything else, let me know.


I’m having some strange behaviour from the “Y” button (louder volume). Since it stopped working either as volume or select button, I tried to reassign it via GUI between GPIO 20 and 24, to no avail.
Now when the “Y” button is pressed, it would mess the screen with random lines. Any reason for this? It was working fine for the first few days.

By the way, the background image that’s displayed in the board screen (not the one in the browser GUI) always shows the “Volumio” letters and overlaps with the the menu lines, making hard to read the small display. I suppose there’s a config. file that can be edited?

Again, many thanks for the good work done!

Hi @AxLED ,

I see back in March you added a feature for “switching display backlight off”? Is this the same as the “After how many minutes should sleeptimer shut down volumio?” config item for the plugin? (I’m running plugin v0.0.4)

I’ve set that to “15” and nothing happens… so wondering if either something is wrong or if I’m misinterpreting how its supposed to work? (My aim is for the display to dim/switch off when nothing is playing, to save power and prevent screen-burn)

I should probably add that I only recently set up Pirate Audio (~2m ago) originally using @arckuk 's instructions… and then @~2 weeks ago applied all the steps in your (@AxLED) 2.917 install instructions to make doubly sure all the dependencies were present and correct. Let me know if there’s anything I can try or any debug/log information that would be useful.

display.py is in /data/plugins/miscellanea/pirateaudio
config.json is found in /data/configuration/miscellanea/pirateaudio (note different directory, config.json is also in the plugins directory, but I think this is the default copy)
You can edit them with any text editor, I use vi, but nano will work too.
You can also browse and the directory structure over ssh using e.g. Putty on windows, and edit files over SSH too.

1 Like

Hello !
Thanks a lot @AxLED and @arckuk for your work and support.

II’ve tried what you suggested on October 10th but it doesn’t work, my screen is on but it’s all scrambled.

When I try “display.py”, I have this error :

volumio@volumio:/data/plugins/miscellanea/pirateaudio$ python display.py
Traceback (most recent call last):
  File "display.py", line 256, in <module>
    display_stuff('bg_default', obj_trans['DISPLAY']['WAIT'], 0, 0, 'info')
  File "display.py", line 251, in display_stuff
  File "display.py", line 182, in sendtodisplay
  File "/usr/local/lib/python2.7/dist-packages/ST7789/__init__.py", line 339, in display
    pixelbytes = self.image_to_data(image, self._rotation)
  File "/usr/local/lib/python2.7/dist-packages/ST7789/__init__.py", line 361, in image_to_data
    return result.byteswap().tobytes()
AttributeError: 'numpy.ndarray' object has no attribute 'tobytes'

Do you have any dea ?

Thanks in advance


i added a sleeptimer function, which can be configured via Web Gui → pirate audio plugin settings (set time to sleep). This function can be selected on the pirate audio dac hat and does following:

  • switches of display backlight
  • shutdown volumio/pi after xx Minutes(see pirate audio plugin setting




a scrambled screen appears on boot up, have you wait until your pi/volumio was fully booted?
Which music service was used (webradio, local files, etc) when the scrambled screen appears?


1 Like

Thank you for your answer.

Yes, pi was fully booted.
I’ve tried with webradio and spotify and the same “scrambled screen”… Buttons don’t work either…

before trying what you said on october 10th, I had nothing on screen. So it’s a small advance…

@AxLED, have you had a look at pirateaudio on Volumio 3 betas? I took a look today, as I have a Pi Zero 2 W, which will only boot on Volumio 3. I could install the plugin on the latest Volumio 3 (with some warnings), but I think there were problems with the ST7789 module. I couldn’t run display.py or any of the programs in the ST7789 example folder without a “TypeError: Non-Int/Long value in arguments” error. Any experience or ideas?

Ah so maybe I’ve misunderstood what it does then… What I wanted was for the display to turn off after x mins (Ideally when no music is playing so in a stopped/paused state)… and then to come back on when a button was pressed. I.e. when they player is not in use I wanted the display to automatically turn off.

Replying to myself - managed to make pirateaudio work in Volumio 3 beta version 3.129 on a Pi Zero 2 W.
SSH to volumio, clone the plugins to any convenient location (volumio home directory will do):
git clone https://github.com/volumio/volumio-plugins.git
cd volumio-plugins/plugins/miscellanea/pirateaudio/
volumio plugin install
Then configure via the plugin page. Unfortunately it would not run correctly, and the service failed to start. When I ran the plugin manually with:
python /data/plugins/miscellanea/pirataudio/display.py
It was reporting the following error every time:
TypeError: Non-Int/Long value in arguments: 76d1b320 (or similar hex value)
This seems to result from an upgrade to the ST7789 python module, which was updated 6 days ago to version 0.0.4. The previous version I had working with Volumio 2 on a Pi Zero W was ST7789 version 0.0.3.
So I uninstalled version 0.0.4:
sudo pip uninstall ST7789
and installed 0.0.3:
sudo pip install 'ST7789==0.0.3'
Rebooting the system works fine, and the pirate audio plugin works nicely. The Pi Zero 2 W is a lot more responsive, and the display seems to update more rapidly.
Thanks @AxLED for your excellent work!



thanks for finding out some problems and solutions. I will collect them until Volumio 3 public is released and than do some redesign/programming to the pirate audio plugin. One target is, that my pluging will work “out of the box” again and all needed settings can be done by the plugin settings (so that no ssh is needed for users).



out of interest , how long did the plugin install take ? mine seems to hang on “Finalizing installation”
I’ve left the process running, but in the gui the plugin appears as being “off” and inactive

hmm, had fun and games with this, I had to manually …

cd /data/plugins/miscellanea/pirateaudio
chmod +x install.sh
sudo ./install.sh

That then failed with
importerror “No Module named Setuptools”

which was fixed with

sudo apt-get install python-setuptools
sudo ./install.sh

^^ just to be clear this was for a Pi Zero 2W. I’m going to 3d print a case for this, once I’ve got it right I’ll upload the model here

1 Like

Apologies @mjb152, I may have already run the steps to update pip on python 2.7 that I ran further up the thread:
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python get-pip.py
before running the plugin install, I don’t thing it would have worked correctly without doing this.

1 Like

:grinning: don’t apologise, I got there in the end, and I wouldnt have without your post , so thanks !!!

1 Like

Thank you!
I’m saving this, have stashed the Pirate Audio setup in one ISO on my backup folder. One day I’ll get again onto, now I’ve done the BIG mistake of looking for my first 3D printer (!) insert any emoticon you want :-))