Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotary doesn't work with Volumio 2.246 #7

Open
nullgat opened this issue Aug 19, 2017 · 28 comments
Open

Rotary doesn't work with Volumio 2.246 #7

nullgat opened this issue Aug 19, 2017 · 28 comments
Assignees

Comments

@nullgat
Copy link

nullgat commented Aug 19, 2017

Looking at jb-rotary.py I think the issue is that volumio recently changed the internal names of the justboom cards.

@nullgat nullgat changed the title No longer works with Volumio 2.246 Rotary doesn't work with Volumio 2.246 Aug 19, 2017
@shawaj
Copy link
Member

shawaj commented Aug 19, 2017

Is it just the rotary encoder script that doesn't work?

@francesco-vannini
Copy link
Contributor

francesco-vannini commented Aug 21, 2017

Yes @nullgat see this volumio/Volumio2#1307 too. I'll check what happened although the script should have handled the new name too. If you have it handy what does aplay -l return with?

@francesco-vannini francesco-vannini self-assigned this Aug 21, 2017
@francesco-vannini
Copy link
Contributor

aplay -l outputs
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndrpijustboomd [snd_rpi_justboom_dac], device 0: JustBoom DAC HiFi pcm512x-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

AFAICT the script should still be working. What's the error you get?

@francesco-vannini
Copy link
Contributor

@nullgat could you also provide the output of sudo systemctl status jb-rotary.service

@nullgat
Copy link
Author

nullgat commented Aug 26, 2017

fixed config.txt and got the aplay output to look identical, but still receive this

● jb-rotary.service - Starts JustBoom Rotary Volume Control
   Loaded: loaded (/etc/systemd/system/jb-rotary.service; enabled)
   Active: failed (Result: exit-code) since Sat 2017-08-26 21:20:59 UTC; 4min 59s ago
  Process: 488 ExecStart=/opt/justboom/jb-rotary.py (code=exited, status=1/FAILURE)
 Main PID: 488 (code=exited, status=1/FAILURE)

Aug 26 21:20:50 volumio systemd[1]: Starting Starts JustBoom Rotary Volume Control...
Aug 26 21:20:50 volumio systemd[1]: Started Starts JustBoom Rotary Volume Control.
Aug 26 21:20:59 volumio jb-rotary.py[488]: Traceback (most recent call last):
Aug 26 21:20:59 volumio jb-rotary.py[488]: File "/opt/justboom/jb-rotary.py", line 5, in <module>
Aug 26 21:20:59 volumio jb-rotary.py[488]: import alsaaudio
Aug 26 21:20:59 volumio jb-rotary.py[488]: ImportError: No module named alsaaudio
Aug 26 21:20:59 volumio systemd[1]: jb-rotary.service: main process exited, code=exited, status=1/FAILURE
Aug 26 21:20:59 volumio systemd[1]: Unit jb-rotary.service entered failed state.

on a zero w and using amp zero

@tvoverbeek
Copy link
Contributor

Looks like you do not have the package python-alsaaudio installed.
Try to install it: 'sudo apt-get install python-alsaaudio' and see if you get a bit further.

@nullgat
Copy link
Author

nullgat commented Sep 8, 2017

Solved, I had to manually install some dependencies, python, alsaaudio, and RPI.GPIO. Not sure why these weren't already on my pi, or not being fixed by the install script?

@shawaj
Copy link
Member

shawaj commented Sep 8, 2017

I guess Volumio just don't have that stuff installed by default to keep it lightweight

@francesco-vannini
Copy link
Contributor

@nullgat the install already takes care of installing those two libraries so I am not really sure what happened with your particular installation. Glad you fixed things in the end.

@shawaj
Copy link
Member

shawaj commented Sep 9, 2017

@francesco-vannini will ALSA itself already be installed on all systems? Not just the python add on?

@francesco-vannini
Copy link
Contributor

Indeed the problem for this issue was the lack of -y in the install script. We'll fix that

francesco-vannini added a commit that referenced this issue Sep 9, 2017
Modified for silent install by adding -y to apt-get install see #7
@fabianbrunke
Copy link

fabianbrunke commented Feb 25, 2018

Cannot get this to work on Volumio (v. 2.368). Don't want to open a new issue though..

During install I got this error:

volumio@volumio:~$ curl -sSL https://pisupp.ly/jb-rotarycode | sudo bash
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: Counting objects: 99, done.
remote: Total 99 (delta 0), reused 0 (delta 0), pack-reused 99
Unpacking objects: 100% (99/99), done.
Checking connectivity... done.
Created symlink from /etc/systemd/system/multi-user.target.wants/jb-rotary.service to /etc/systemd/system/jb-rotary.service.
volumio@volumio:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: sndrpijustboomd [snd_rpi_justboom_dac], device 0: JustBoom DAC HiFi pcm512x-hifi-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0
volumio@volumio:~$ sudo systemctl status jb-rotary.service
● jb-rotary.service - Starts JustBoom Rotary Volume Control
   Loaded: loaded (/etc/systemd/system/jb-rotary.service; enabled)
   Active: failed (Result: exit-code) since Sun 2018-02-25 20:11:37 UTC; 9min ago
 Main PID: 478 (code=exited, status=1/FAILURE)

Feb 25 20:11:28 volumio systemd[1]: Started Starts JustBoom Rotary Volume Control.
Feb 25 20:11:36 volumio jb-rotary.py[478]: Traceback (most recent call last):
Feb 25 20:11:36 volumio jb-rotary.py[478]: File "/opt/justboom/jb-rotary.py", line 5, in <module>
Feb 25 20:11:36 volumio jb-rotary.py[478]: import alsaaudio
Feb 25 20:11:36 volumio jb-rotary.py[478]: ImportError: No module named alsaaudio
Feb 25 20:11:37 volumio systemd[1]: jb-rotary.service: main process exited, code=exited, status=1/FAILURE
Feb 25 20:11:37 volumio systemd[1]: Unit jb-rotary.service entered failed state.

After manually installing python-alsaaudio and python.rpi-gpio following error occurs:

volumio@volumio:~$ systemctl status jb-rotary.service
● jb-rotary.service - Starts JustBoom Rotary Volume Control
   Loaded: loaded (/etc/systemd/system/jb-rotary.service; enabled)
   Active: inactive (dead) since Sun 2018-02-25 20:23:48 UTC; 6s ago
  Process: 5871 ExecStart=/opt/justboom/jb-rotary.py (code=exited, status=0/SUCCESS)
 Main PID: 5871 (code=exited, status=0/SUCCESS)

Feb 25 20:23:47 volumio systemd[1]: Started Starts JustBoom Rotary Volume Control.
Feb 25 20:23:48 volumio jb-rotary.py[5871]: ('Configuring rotary encoder as ', 'standard')
Feb 25 20:23:48 volumio jb-rotary.py[5871]: There are no suitable cards

@francesco-vannini
Copy link
Contributor

Volumio seems to have changed something for which the Digital mixer is no longer available

>>> print alsaaudio.cards()
[u'ALSA', u'sndrpijustboomd']
>>> print alsaaudio.mixers()
[u'PCM']

I don't know how to sort this at the moment, let's keep an eye at there next version. @tvoverbeek do you have any ideas?

@francesco-vannini
Copy link
Contributor

aplay and amixer of course reports the same

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sndrpijustboomd [snd_rpi_justboom_dac], device 0: JustBoom DAC HiFi pcm512x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

amixer
Simple mixer control 'PCM',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback -925 [88%] [-9.25dB] [on]

amixer finally finds the Digital mixer when issuing:

amixer -c 1
Simple mixer control 'DSP Program',0
  Capabilities: enum
  Items: 'FIR interpolation with de-emphasis' 'Low latency IIR with de-emphasis' 'High attenuation with de-emphasis' 'Fixed process flow' 'Ringing-less low latency FIR'
  Item0: 'FIR interpolation with de-emphasis'
Simple mixer control 'Analogue',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 1
  Mono:
  Front Left: Playback 1 [100%] [0.00dB]
  Front Right: Playback 1 [100%] [0.00dB]
Simple mixer control 'Analogue Playback Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 1
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Auto Mute',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'Auto Mute Mono',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Auto Mute Time Left',0
  Capabilities: enum
  Items: '21ms' '106ms' '213ms' '533ms' '1.07s' '2.13s' '5.33s' '10.66s'
  Item0: '21ms'
Simple mixer control 'Auto Mute Time Right',0
  Capabilities: enum
  Items: '21ms' '106ms' '213ms' '533ms' '1.07s' '2.13s' '5.33s' '10.66s'
  Item0: '21ms'
Simple mixer control 'Clock Missing Period',0
  Capabilities: enum
  Items: '1s' '2s' '3s' '4s' '5s' '6s' '7s' '8s'
  Item0: '1s'
Simple mixer control 'Deemphasis',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Digital',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 207
  Mono:
  Front Left: Playback 180 [87%] [-13.50dB] [on]
  Front Right: Playback 180 [87%] [-13.50dB] [on]
Simple mixer control 'Max Overclock DAC',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 40
  Mono: 0 [0%]
Simple mixer control 'Max Overclock DSP',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 40
  Mono: 0 [0%]
Simple mixer control 'Max Overclock PLL',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 20
  Mono: 0 [0%]
Simple mixer control 'SoftMaster',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 99
  Front Left: 59 [60%]
  Front Right: 59 [60%]
Simple mixer control 'Volume Ramp Down Emergency Rate',0
  Capabilities: enum
  Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
  Item0: '1 sample/update'
Simple mixer control 'Volume Ramp Down Emergency Step',0
  Capabilities: enum
  Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
  Item0: '4dB/step'
Simple mixer control 'Volume Ramp Down Rate',0
  Capabilities: enum
  Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
  Item0: '1 sample/update'
Simple mixer control 'Volume Ramp Down Step',0
  Capabilities: enum
  Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
  Item0: '1dB/step'
Simple mixer control 'Volume Ramp Up Rate',0
  Capabilities: enum
  Items: '1 sample/update' '2 samples/update' '4 samples/update' 'Immediate'
  Item0: '1 sample/update'
Simple mixer control 'Volume Ramp Up Step',0
  Capabilities: enum
  Items: '4dB/step' '2dB/step' '1dB/step' '0.5dB/step'
  Item0: '1dB/step'

@shawaj
Copy link
Member

shawaj commented Mar 2, 2018 via email

@tvoverbeek
Copy link
Contributor

Noticed on the Volumio github that the justboom cards are specified as I2S without any mixer definition. Could that have something to do with it? I am no audio expert ...

@shawaj
Copy link
Member

shawaj commented Mar 2, 2018 via email

@shawaj
Copy link
Member

shawaj commented Mar 2, 2018 via email

@tvoverbeek
Copy link
Contributor

From https://github.com/volumio/Volumio2/blob/master/app/plugins/system_controller/i2s_dacs/dacs.json the justboom definitions:

{"id":"justboom-amp","name":"JustBoom Amp Boards","overlay":"justboom-dac","alsanum":"1","mixer":"Digital","modules":"","script":"","eeprom_name":["JustBoom DAC HAT","JustBoom DAC HAT v1.1"],"needsreboot":"yes"},
{"id":"justboom-dac","name":"JustBoom DAC Boards","overlay":"justboom-dac","alsanum":"1","mixer":"Digital","modules":"","script":"","eeprom_name":["JustBoom DAC HAT","JustBoom DAC HAT v1.1"],"needsreboot":"yes"},
{"id":"justboom-digi","name":"JustBoom Digi Boards","overlay":"justboom-digi","alsanum":"1","mixer":"","modules":"","script":"","eeprom_name":["JustBoom Digi HAT","JustBoom Digi HAT v1.1"],"needsreboot":"yes"},

justboom-digi has an empty mixer definition.

@shawaj
Copy link
Member

shawaj commented Mar 3, 2018 via email

@francesco-vannini
Copy link
Contributor

The interesting/annoying bit is that alsamixer shows instead the mixer with the various controls. I really don't understand what happened and how it should be fixed in Volumio.

@shawaj
Copy link
Member

shawaj commented Mar 5, 2018 via email

@francesco-vannini
Copy link
Contributor

For the Digi is a different story and in fact we have a virtual control for that in the script. @fabbaf is however using a DAC so the "Digital" control should be listed when issuing:
In Python

print alsaaudio.mixers()

or on the shell

amixer -c 1

In previous versions of Volumio we had no problems with this.

@tvoverbeek
Copy link
Contributor

tvoverbeek commented Mar 5, 2018

Found out what the problem is. Nothing to do with Volumio, but a logic error in jb-rotary.py.
If you follow the justboom install instructions for Raspbian, the internal alsa soundcard is disabled and the justboom card is the only one available. Then the code works.

If the internal sound card is also present, then justboom is card 1 and the internal one card 0.
The for loop starting at line 84 of jb-rotary.py first tests card 0.
There is no 'Digital' in the alsaaudio.mixers() output -> so you go to the else clause on line 93 and the program exits.
By the way alsaaudio.mixers() on lines 87 and 90 should be alsaaudio.mixers(i)
Will test a mod with my justboom zero-dac and then submit a pull request later.

@francesco-vannini
Copy link
Contributor

Well spotted @tvoverbeek on both accounts. Something must have changed in Volumio though because as wrong as the code was it used to work before so maybe the onboard audio card maybe used to get disabled and now isn't anymore. Good that getting rid of those bugs will make the code more robust, you are a star ... as usual

@tvoverbeek
Copy link
Contributor

Just submitted PR #10.
Please review and test.

@FedorMil
Copy link

Good day! I have the system RPi Zero + Justboom Amp Zero + Volumio v2.368. Installed the plug-in on the encoder and still it does not work. When the script is manually started, the signal from the encoder goes, but there are no changes in the volumio mixer.

When run systemctl status jb-rotary.service
● jb-rotary.service - Starts JustBoom Rotary Volume Control
Loaded: loaded (/usr/lib/systemd/system/jb-rotary.service; static)
Active: active (running) since Wed 2018-04-11 03:16:19 UTC; 2min 33s ago
Main PID: 616 (python)
CGroup: /system.slice/jb-rotary.service
└─616 python /opt/justboom/jb-rotary.py

Apr 11 03:16:19 luckymen systemd[1]: Started Starts JustBoom Rotary Volume ...l.
Hint: Some lines were ellipsized, use -l to show in full.

What could be the problem???

@FedorMil
Copy link

https://github.com/francesco-vannini Today, the plugin has been reinstalled, but nothing has changed

volumio@luckymen:~$ systemctl -l status jb-rotary.service
● jb-rotary.service - Starts JustBoom Rotary Volume Control
Loaded: loaded (/usr/lib/systemd/system/jb-rotary.service; static)
Active: active (running) since Thu 2018-04-12 03:51:23 UTC; 2min 26s ago
Main PID: 579 (python)
CGroup: /system.slice/jb-rotary.service
└─579 python /opt/justboom/jb-rotary.py

Apr 12 03:51:23 luckymen systemd[1]: Started Starts JustBoom Rotary Volume Control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants