PiSupply / JustBoom

Resources for JustBoom range
https://JustBoom.co
15 stars 5 forks source link

Rotary Encoder control won't install on JustBoom Player (15-04-18) #17

Closed pharrisuk closed 5 years ago

pharrisuk commented 5 years ago

I've installed the JustBoom Player on a Pi Zero-W with the Justboom AMP phat, but the rotary encoder control code won't install (can't find pre-reqs):

justboom@justboom:~$ curl -sSL https://pisupp.ly/jb-rotarycode | sudo bash

We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for justboom: Reading package lists... Done Building dependency tree Reading state information... Done whiptail is already the newest version. git is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python-alsaaudio Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python-rpi.gpio E: Couldn't find any package by regex 'python-rpi.gpio' Cloning into 'JustBoom'... remote: Enumerating objects: 118, done. remote: Total 118 (delta 0), reused 0 (delta 0), pack-reused 118 Receiving objects: 100% (118/118), 56.73 KiB | 0 bytes/s, done. Resolving deltas: 100% (55/55), done. Checking connectivity... done. Failed to execute operation: Not a directory Failed to execute operation: Not a directory Failed to start jb-rotary.timer: Unit jb-rotary.timer failed to load: Not a directory. justboom@justboom:~$

ChristopherRush commented 5 years ago

You need to run an update first sudo apt-get update

pharrisuk commented 5 years ago

Doh! Thanks. I did this on my first attempt with Volumio, but forgot, when I re-installed with JustBoom. Could be added to the instructions?

pharrisuk commented 5 years ago

The service still wouldn't install properly, as the directory /usr/lib/systemd/system did not exist (got "Failed to execute operation: Not a directory" errors). I cleaned everything up, created the directory, re-ran, and now the jb-rotary.service is loaded and running. Now I get the following: justboom@justboom:~/JustBoom$ python jb-rotary.py -t keyes ('Configuring rotary encoder as ', 'keyes') There are no suitable cards

I've also lost all sound output (was working fine before I tried to install the rotary encoder).

ChristopherRush commented 5 years ago

You need to setup your JustBoom card in the settings first. You should then see something like the following:

Screen Shot 2019-06-06 at 14 26 08
pharrisuk commented 5 years ago

It wasn't that (I'd already setup the card). jb-rotary.py was returning an empty array from the call to list the cards. Turned out I needed to run it with sudo (as above), which I wasn't. That could be altered on the instructions too.

I think the main issue however, is that after an install of JustPlayer there's no /usr/lib/systemd/system so your install script copies the service to a file of that name, instead of into the directory. That needs to be addressed, as it won't work as-is. I eventually managed to get the encoder sending signals, but no sound from the speakers - I'll continue to investigate, or dump the idea of using an encoder, as I'm running out of patience ;)

Even without the encoder the Player doesn't work properly. With a fair wind I can get it to start playing a track, but going back to browse the music causes something to reset more often than not (spinning spots, startup chimes sound eventually etc), even though the existing track continues to play. Top shows near 100% CPU utilisation by 'node' processes whilst this is happening. The whole thing is still unusable after three evenings of messing around with it.

pharrisuk commented 5 years ago

I've created a pull request with suggested changes to problems described in this issue: https://github.com/PiSupply/JustBoom/pull/18

pharrisuk commented 5 years ago

Have reverted back to Volumio, which isn't giving me the same problems as the Justboom player. I installed the rotary encoder, and edited /usr/lib/systemd/system/jb-rotary.service to specify keyes encoder, and alter volume increment: ExecStart=/opt/justboom/jb-rotary.py -t keyes -i 5

All working now :)