[Plugin] pirate audio

doesnt for me either :frowning: screws up volumeio if i downgrade python

Hi @AxLED , I used spotify plugin and the artwork was displayed properly in pirate audio. But, since it only allows 100 songs in a playlist, I decided to use spotify connect. The web UI shows the album art, but not pirate audio.
Oh yeah, also the solution by @arckuk works for me.

When I do python display.py

  1. Using Spotify I get

register 5
success
register 6
success
register 16
success
register 24
success

  1. Using Spotify Connect I get

register 5
success
register 6
success
register 16
success
register 24
success
Traceback (most recent call last):
File “display.py”, line 578, in
main()
File “display.py”, line 573, in main
socketIO.wait()
File “/usr/local/lib/python2.7/dist-packages/socketIO_client/init.py”, line 251, in wait
self._process_packets()
File “/usr/local/lib/python2.7/dist-packages/socketIO_client/init.py”, line 278, in _process_packets
self._process_packet(engineIO_packet)
File “/usr/local/lib/python2.7/dist-packages/socketIO_client/init.py”, line 491, in _process_packet
delegate(parse_socketIO_packet_data(socketIO_packet_data), namespace)
File “/usr/local/lib/python2.7/dist-packages/socketIO_client/init.py”, line 513, in _on_event
namespace._find_packet_callback(event)(*args)
File “display.py”, line 334, in on_push_state
position = args[0][‘position’] # v.0.0.4
KeyError: ‘position’

im now using version 3 buster beta so looking forward to plugin support when/if it finally released

@AxLED you will have this for any “volatile” service (airplay,bluetooth, sc,tc, etc) - they don’t normally have queue position in the field…

@ksr112

i haven’t tested my plugin with all music service plugins so far. I did develop and modify the pirate audio plugin so it works with “Spotify” plugin but i didn’t modify it for “Spotify Connect” plugin (so far).

Unfortunatelly the data structure i receive from different music service plugins is always a little different, so i have to catch this with separate code.
As next steps i would like to get “pirate audio plugin” it up and running again on the volumio OS, as far as the version 3.x is officially release.
@ashthespy thanks for the hint

AxLED

This worked for me, thanks @arckuk

Hi to the pirate audio plugin users,

today i tried to find a solution for the install process (on my test pi without pirate audio hat so i need your feedback).
So maybe someone can test the following steps to get pirate audio plugin working again:
Volumio version 2.917

  • login via ssh
  • sudo apt-get update
  • wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
  • sudo python get-pip.py
  • sudo apt-get -y install python-rpi.gpio python-spidev python-pip python-pil python-numpy --no-install-recommends
  • sudo pip install st7789 socketIO-client
  • sudo pip install websocket-client==0.58.0

I am looking forward to get your response.

Conclusion:

  • pip is missing in the newer volumio versions
  • some depencies (socketIO-client, Request, …) have problem with unsupported python 2.7

Regards

AxLED

1 Like

You, sir, are a genius. Many thanks for sharing, now it works!

This looks similar to the Mopidy.conf that I did edit when using Pirate Audio with mopidy, although I could rotate the display as I wanted. I’ve never managed to reassign the buttons.

Now, in this case I’m not able to find those two files to edit (yes, I’m a newbie still struggling with managing search via SSH) the confi.json and display.py. I’d assume you simply edit with Nano?
Again, thanks a lot for sharing help!

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!

Hi AxLED,
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.

Greetings
m2001s

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.

@gattonero
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
    sendtodisplay(img3)
  File "display.py", line 182, in sendtodisplay
    disp.display(img)
  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

@frazor77

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

AxLED

1 Like

@jeromechrtn

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?

AxLED

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…