[Plugin] pirate audio

Rapberry Pi Zero W
Voumio System Verion 2.882
Nothing else connected.
No other plugins are installed.

The install is about 2 weeks old.
After install i added my Nas as a music storage.
It ran with a usb dac for the first week while waiting for my Pirate Audio board.
I may try another fresh install on another sdcard if i have one.
I have a 3a board available also.

Just tried a full fresh sdcard install
Same problem at sudo pip install socketIO-client

volumio@zero:~$ sudo pip install socketIO-client
[sudo] password for volumio:
Downloading/unpacking socketIO-client
  Downloading socketIO-client-0.7.2.tar.gz
  Running setup.py (path:/tmp/pip-build-534_n7/socketIO-client/setup.py) egg_info for package socketIO-client

    warning: no files found matching '*.html'
    warning: no files found matching '*.js'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking requests>=2.7.0 (from socketIO-client)
  Downloading requests-2.26.0-py2.py3-none-any.whl (62kB): 62kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1266, in prepare_files
    req_to_install.extras):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2401, in requires
    dm = self._dep_map
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2597, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2621, in _compute_dependencies
    parsed = next(parse_requirements(distvers))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 49, in <lambda>
    next = lambda o: o.next()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2721, in parse_requirements
    "version spec")
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2686, in scan_list
    raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', 'charset-normalizer ~=2.0.0', 'at', ' ~=2.0.0')

Storing debug log for failure in /root/.pip/pip.log

@Jayman,

i looks like the pip install is broken, please try:

  • login via ssh
  • sudo python -m pip install --upgrade --force setuptools
  • sudo python -m pip install --upgrade --force pip
  • Install socketIO-Client: sudo pip install socketIO-client
  • uninstall websocket-client with following command: sudo pip uninstall websocket-client
  • install a specific version of websocket-client with the following command: sudo pip install websocket-client==0.58.0
  • enable pirate audio plugin (via web GUI)
  • tell me the results

AxLED

Looks not so good…

 volumio@radio:~$ sudo python -m pip install --upgrade --force setuptools
Downloading/unpacking setuptools
  Downloading setuptools-57.4.0.tar.gz (2.1MB): 2.1MB downloaded
  Running setup.py (path:/tmp/pip-build-gjpJ0D/setuptools/setup.py) egg_info for package setuptools
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "setuptools/__init__.py", line 16, in <module>
        import setuptools.version
      File "setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "pkg_resources/__init__.py", line 1367
        raise SyntaxError(e) from e
                                ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 3, in <module>

  File "setuptools/__init__.py", line 16, in <module>

    import setuptools.version

  File "setuptools/version.py", line 1, in <module>

    import pkg_resources

  File "pkg_resources/__init__.py", line 1367

    raise SyntaxError(e) from e

                            ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-gjpJ0D/setuptools
Storing debug log for failure in /root/.pip/pip.log
volumio@radio:~$ sudo python -m pip install --upgrade --force pip
Downloading/unpacking pip
  Downloading pip-21.2.3.tar.gz (1.6MB): 1.6MB downloaded
  Running setup.py (path:/tmp/pip-build-YtAOjw/pip/setup.py) egg_info for package pip
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip-build-YtAOjw/pip/setup.py", line 7
        def read(rel_path: str) -> str:
                         ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip-build-YtAOjw/pip/setup.py", line 7

    def read(rel_path: str) -> str:

                     ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-YtAOjw/pip
Storing debug log for failure in /root/.pip/pip.log
volumio@radio:~$ Install socketIO-Client: sudo pip install socketIO-client
-bash: Install: command not found
volumio@radio:~$ sudo pip install socketIO-client
Downloading/unpacking socketIO-client
  Downloading socketIO-client-0.7.2.tar.gz
  Running setup.py (path:/tmp/pip-build-bWYJSk/socketIO-client/setup.py) egg_info for package socketIO-client
    
    warning: no files found matching '*.html'
    warning: no files found matching '*.js'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking requests>=2.7.0 (from socketIO-client)
  Downloading requests-2.26.0-py2.py3-none-any.whl (62kB): 62kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1266, in prepare_files
    req_to_install.extras):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2401, in requires
    dm = self._dep_map
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2597, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2621, in _compute_dependencies
    parsed = next(parse_requirements(distvers))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 49, in <lambda>
    next = lambda o: o.next()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2721, in parse_requirements
    "version spec")
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2686, in scan_list
    raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', 'charset-normalizer ~=2.0.0', 'at', ' ~=2.0.0')

Storing debug log for failure in /root/.pip/pip.log
volumio@radio:~$ sudo pip uninstall websocket-client
Uninstalling websocket-client:
  /usr/local/bin/wsdump.py
  /usr/local/bin/wsdump.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/__init__.py
  /usr/local/lib/python2.7/dist-packages/websocket/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_abnf.py
  /usr/local/lib/python2.7/dist-packages/websocket/_abnf.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_app.py
  /usr/local/lib/python2.7/dist-packages/websocket/_app.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_cookiejar.py
  /usr/local/lib/python2.7/dist-packages/websocket/_cookiejar.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_core.py
  /usr/local/lib/python2.7/dist-packages/websocket/_core.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_exceptions.py
  /usr/local/lib/python2.7/dist-packages/websocket/_exceptions.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_handshake.py
  /usr/local/lib/python2.7/dist-packages/websocket/_handshake.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_http.py
  /usr/local/lib/python2.7/dist-packages/websocket/_http.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_logging.py
  /usr/local/lib/python2.7/dist-packages/websocket/_logging.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_socket.py
  /usr/local/lib/python2.7/dist-packages/websocket/_socket.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_ssl_compat.py
  /usr/local/lib/python2.7/dist-packages/websocket/_ssl_compat.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_url.py
  /usr/local/lib/python2.7/dist-packages/websocket/_url.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/_utils.py
  /usr/local/lib/python2.7/dist-packages/websocket/_utils.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/tests/__init__.py
  /usr/local/lib/python2.7/dist-packages/websocket/tests/__init__.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/tests/data/header01.txt
  /usr/local/lib/python2.7/dist-packages/websocket/tests/data/header02.txt
  /usr/local/lib/python2.7/dist-packages/websocket/tests/test_cookiejar.py
  /usr/local/lib/python2.7/dist-packages/websocket/tests/test_cookiejar.pyc
  /usr/local/lib/python2.7/dist-packages/websocket/tests/test_websocket.py
  /usr/local/lib/python2.7/dist-packages/websocket/tests/test_websocket.pyc
  /usr/local/lib/python2.7/dist-packages/websocket_client-0.58.0.dist-info/COPYING.LESSER
  /usr/local/lib/python2.7/dist-packages/websocket_client-0.58.0.dist-info/LICENSE
  /usr/local/lib/python2.7/dist-packages/websocket_client-0.58.0.dist-info/METADATA
  /usr/local/lib/python2.7/dist-packages/websocket_client-0.58.0.dist-info/RECORD
  /usr/local/lib/python2.7/dist-packages/websocket_client-0.58.0.dist-info/WHEEL
  /usr/local/lib/python2.7/dist-packages/websocket_client-0.58.0.dist-info/top_level.txt
Proceed (y/n)? y
  Successfully uninstalled websocket-client
volumio@radio:~$ sudo pip install websocket-client==0.58.0
Downloading/unpacking websocket-client==0.58.0
  Downloading websocket_client-0.58.0-py2.py3-none-any.whl (61kB): 61kB downloaded
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from websocket-client==0.58.0)
Installing collected packages: websocket-client
Successfully installed websocket-client
Cleaning up...
volumio@radio:~$

Umm, pip has dropped compatibility for Python 2.7 with the 21.0 versions.

So you need to pin your version to the last supported version 20.3 for Python 2.7.

Try doing a sanity check – on a fresh Volumio 2.x install, check what version of pip is installed

python -m pip --version

# if it's the wrong version,
# force it back to the right version 
python -m pip install --upgrade pip==20.3

Personally, I’d move to Python 3.x by using the Buster beta versions of Volumio.

Hi, any update on this problem?

I just did a fresh volumio install on rpi zero (using volumio-2.907-2021-07-02-pi.img.zip) and I have this issue:

volumio@xxx:/data/plugins/miscellanea/pirateaudio$ **python display.py**
Traceback (most recent call last):
  File "display.py", line 8, in <module>
    import ST7789 as ST7789
ImportError: No module named ST7789
volumio@xxx:/data/plugins/miscellanea/pirateaudio$

PIP reports version:

volumio@xx:/data/plugins/miscellanea/pirateaudio$ **pip --version**
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)

But manual install of socketIO-client does not work:

volumio@xxx:/data/plugins/miscellanea/pirateaudio$ **sudo pip install socketIO-client**

Downloading/unpacking socketIO-client
  Downloading socketIO-client-0.7.2.tar.gz
  Running setup.py (path:/tmp/pip-build-ihzyf9/socketIO-client/setup.py) egg_info for package socketIO-client

    warning: no files found matching '*.html'
    warning: no files found matching '*.js'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking requests>=2.7.0 (from socketIO-client)
  Downloading requests-2.26.0-py2.py3-none-any.whl (62kB): 62kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1266, in prepare_files
    req_to_install.extras):
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2401, in requires
    dm = self._dep_map
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2597, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2621, in _compute_dependencies
    parsed = next(parse_requirements(distvers))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 49, in <lambda>
    next = lambda o: o.next()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2721, in parse_requirements
    "version spec")
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2686, in scan_list
    raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', 'charset-normalizer ~=2.0.0', 'at', ' ~=2.0.0')

Storing debug log for failure in /root/.pip/pip.log

@miskor
i will try to adapt my plugin to a new volumio release based on buster if it is finally released. In the actual image i have some depencies on python 2.7 and pip and socketio client which makes my plugin not working anymore. Some workarounds are mentioned above. AxLED

@miskor @JanK I had the same problems as you on a volumio install with current version today on a Pi Zero W. I installed modules for websocket-client==0.58.0 and ST7789, but I couldn’t get pip to update from by any of the mentioned methods. I eventually went back to fundamentals and used get_pip. Note that for python, you need a particular version of get_pip. From my fresh install (after trying all the suggested methods for update)

$ pip --version
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)
$ wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
$ sudo python get-pip.py 
....
$ pip --version
pip 20.3.4 from /home/volumio/.local/lib/python2.7/site-packages/pip (python 2.7)

From there I could:

$ sudo pip install socketIO-client
....
Successfully installed certifi-2021.5.30 chardet-4.0.0 idna-2.10 requests-2.26.0 socketIO-client-0.7.2 urllib3-1.26.6

I don’t know if installing pip this way will mess anything else up, or packages will get out of order - I’m not a python or pip expert, but at least it gets the display to work!

1 Like

@arckuk
good to hear you found a working workaround.
Thanks for sharing also.

As mentioned some posts ago i will try to adapt my plugin to a new volumio release based on buster if it is finally released. In the actual image i have some depencies on python 2.7 and pip and socketio client which makes my plugin not working anymore.

AxLED

2 Likes

hey, any news of update for volumio 2.909? just got pirate audio headphone and would love to use this plugin.

Yep, the same question. Just received my Pirate Radio.
Solution by @arckuk doesn’t work for me.

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!