[Plugin] pirate audio

@AxLED

Thanks for this great package I am really enjoying it!

I have found a couple of bugs that I would to share:

  1. Pause button works as expected when using spotify connect (via spotify plugin) but when using the play button (after a pause) the audio is switched from spotify to the last audio file played from internal storage. Using the play button from either the volumio mobile app or web interface works properly however (it will play from spotify instead of internal storage). Tested on volumio version 3.546 and 3.584

  2. The same thing happens with the next and previous track buttons from the menu on the buttons (again gpio buttons select internal track rather than spotify but web/app function with spotify correctly)

This ends up playing havoc with audio playback as sometimes both internal audio and spotify are trying to play at once. As well as this the web interface and app have the controls for spotify rather than the internal audio which is playing after the button press so there is sometimes no way to pause the internal audio easily.

Hopefully this is just an issues with the wrong API call from the pirate audio plugin which can be swapped over! Or might be an issue with how volumio handles GPIO buttons?! I don’t know how the app works so I’ll leave it in your hands.

@deepblue

thanks for investigating. I am not sure if i can help you, as i

Which service (e.g webradio, etc) is diplayed under volumio.local/dev, if it happens?

AxLED

I’m happy to try and investigate further and make a PR to the pirate-audio python package if I can find the issue (I’ll might need some pointers though)

“service”:“spop” in the player state on /dev

Cheers.

I assume form your last message that you got it to work.

Regarding the bet versions. You can activate beta for plugins and beta for volumio separately, you only need to activate the beta for plugins. I am using the last version of both Volumio (stable) and pirate audio plugin (beta).

I have the exact same model of board and DAC than you so everything should be the same :slight_smile:

I only managed to get it working with the beta version of volumio not the current stable version.

Which beta version of the plugin are you using? I can see v0.1.1(stable), v0.1.0(beta) and v0.0.7(beta)

There was an issue with the last stable Volumio where they changed something related to the GPIO, you can see it above (Update to volumio 3.569 breaks GPIO (permission) - #3 by Darmur). It’s been fixed in the last beta and will be added to the next stable release.

I am using the last available version of the plugin, so v0.1.1(stable).

Hi @AxLED ,

I’m going to look into fixing the issues with Spotify and the GPIO buttons, is this GitHub repo the latest version of the plugin for me to work on? GitHub - Ax-LED/volumio-pirate-audio: Python code (Plugin) to use pirate audio dac with volumio (including display and the 4 buttons) and a raspberry pi.

@deepblue
the source for the latest version is https://github.com/Ax-LED/volumio-plugins-sources/tree/master/pirateaudio

AxLED

Hi @AxLED ,

I’ve found out that the commands which work with spotify are:

SOCKETIO.emit(‘volatilePlay’)
SOCKETIO.emit(‘pause’)
SOCKETIO.emit(‘stop’)
SOCKETIO.emit(‘next’)
SOCKETIO.emit(‘prev’)

The command which doesn’t work is: SOCKETIO.emit(‘play’) - https://github.com/volumio/volumio-plugins-sources/blob/master/pirateaudio/display.py#L541C34-L541C34

The previous/ next track seems to play the next/prev position (https://github.com/volumio/volumio-plugins-sources/blob/master/pirateaudio/display.py#L331C25-L347) instead of using SOCKETIO.emit(‘prev’), is there a reason behind this? - only the SOCKETIO.emit(‘prev’) or ‘next’ being emitted work with spotify.

Worth nothing that SOCKETIO.emit(‘volatilePlay’) doesn’t work with playing music from internal storage library, here SOCKETIO.emit(‘play’) is needed, so there needs to be a way to differentiate when spotify is playing.
From the /dev webpage it would be possible to use the “volatile” key in the player state. It is “volatile”:false,“service”:“mpd” for playing internal storage music and “volatile”:true,“service”:“spop” when playing spotify.

I’m happy to edit the package code and submit a PR with the code updated to work with spotify

Cheers

Another way of handling could be to call the volumio binaries as they work for all cases, would have to call via os.system:

/usr/local/bin/volumio toggle (for pause/play)
/usr/local/bin/volumio next (for next song)
/usr/local/bin/volumio previous (for previous song)

This wouldn’t require checking if “volatile”:false or “volatile”:true

Cheers

Hi all, just assembled a Pi02W Pirate Audio Headphone Amp portable player last night using the Waveshare Battery HAT sandwiched in between and was really excited to try and get Volume working on it based on some of these posts but it seems like the most recent versions of Volumio have broken the plugin?

I tried on the latest stable and beta Volumio versions, and all three (stable and two beta) versions of the plugin but never got the display or buttons to work. The unit plays audio just fine, but hopeful the inputs/screen can work again!

the issue with the plugin has been fixed long ago, it should work

Hello everyone. I’ve been trying to run Pirate Audio for two days, but it doesn’t work. I’m downloading the latest version of Volumio and I still have a black screen despite using the appropriate plug-in. Please help.

I don’t know how else to troubleshoot short of reflashing pulling apart and reassembling. The screen stayed on before Volumio was setup and updated, then it would flash on and turn off once I was getting into Volumio remotely. The HAT is separated from the Pi by a waveshare USB-C battery HAT and a pin extender but the fact that the audio is outputting fine and it’s running fine on battery power and all the pins looked ok makes it less likely to me that there’s a signal issue. If the screen gets its signal and power from the same ribbon cable then I know it at least is connected because it’s getting power.

Any suggestions appreciated.

Hello . Please . or some good person :slight_smile: Maybe someone can help me run pirate audio on rpi zero step by step. Thank you.

Hi @Rafal84 . The post above gives a good guide to installing pirate audio from the beginning: [Plugin] pirate audio - #261 by forte89

Hi, ive been reading and trying to use volumio, via your pirate hat plugin. so far its the closest to getting my line out pirate audio to work ive been able to achieve. it failed completely with raspberry pi os and mopidy. at least now with your plugin and volumio, i have a web interface i can get into and control and get audio out.
my problem is that while my a button does work, the other 3 wont do anything, and my screen is blank. though im starting to wonder if its a pin issue. i only, through this thread, figured out that the pinout may have changed and i may have the old pinout pinned exclusively. tomorrow im going to pull out this new/old lead solder i managed to get my hands on and im going to fully pin out the pizero2w.
so the question i have now is, did they move the pins for i2c? i dont believe they can. so why do i still have no image on my pirate audio after following the beautiful instructions by forte89? for the last two days ive been toying with the idea that its the fact that im running volumio 3.661 and they broke the plugin again.

im really hoping this plugin isnt dead. i know life moves on for devs, which is totaly what id describe AxLED as. this plugin is my last hope for pimoroni products. i have two of their nvme sleds that failed to work with a pi 5, and now this line out pirate hat that i cant get to work because they build product but dont support them beyond a few months after initial production. the only people keeping their products alive and working is folks like AxLED, and the others here who are helping keep his software running on an ever changing OS landscape.
thank you all for your incredible work! you have been doing what capitalism cannot.

I had it working without too much trouble. It’s now on storage as I’ve been traveling, but it was working 100% last time I’ve used it.

Quick question: did you also installed the Touch Display plugin? IIRC, it’s also needed.

just tried it. did not help. in fact because that plugin installs chromium for some reason its now slower than peanut butter. ill have to remove it pretty quick because the thing boots too slow as it is. it went from 70ish seconds to around 180 seconds.

I give up. i tried all day, with nothing but failure at getting the screen to work. ive been at it a week now.
pimoroni products require too much expertise and time to get or keep working. nothing but trouble, have i had with their products. not necessarily their faults, but certainly they arnt helping.