20 comments
-
eaedev Here is an example of how it sounds: https://sndup.net/4xzx
-
Frank Verdonk Hi EAEDEV.
I have changed the step count in /etc/audiocontrol2.conf
Bellow my rotary config:
[controller:ac2.plugins.control.rotary.Rotary]
clk = 27
dt = 17
sw = 22
step = 2Rg Frank
-
steamfan Hello,
I also have an issue with the rotary encoder and the above mentioned guide:
The proposed mentioned /data/ac2plugins is not available in HifiBerry 20201022; /data is available but not ac2plugins.
Is it okay to create it and put rotary.py into it (which access rights should be used?) or is another location more appropriate?
Kind regards
steamfan
-
HiFiBerry team The plugin already comes with the latest versions of HiFiBerryOS. You don't need to install it separately.
-
steamfan Okay,
so far so good. I edited /etc/audiocontrol.conf and uncommented the lines to enable to rotary encoder:
[controller:ac2.plugins.control.rotary.Rotary]
clk = 23
dt = 24
sw = 25
step = 5The issue now is that the sound is muted when turning the rotary encoder; this means:
Sound is on --> encoder is turned by one step --> sound is off ---> encoder is turned by one step --> sound is one (same volume as before).
Is this a effect of that above listed values? I can send pictures of my installation if necessary.
Kind regards
steamfan
-
HiFiBerry team Could be that the library used for this has problems with some GPIOs. You might try the GPIOs that are used in the example on Github
-
HiFiBerry team It's also possible that one of the GPIOs your using is already in use:
https://www.hifiberry.com/docs/hardware/gpio-usage-of-hifiberry-boards/ -
steamfan I'm following this guide: https://github.com/hifiberry/audiocontrol2/blob/master/doc/rotary-controller-plugin.md
Here's a picture of the installation:
- On top is a 3.5" display
- I'm using an IC holder for the mounting on the AMP2 pin header, so no soldering to the AMP2 or RPi board
- GPIO7 (Mute for AMP2 / CLK from encoder) is already used by AMP2
-
HiFiBerry team Sure, if you connect CLK to the MUTE GPIO, it will mute the Amp. You need to use unused GPIOs.
-
steamfan Okay, so you propose not to use GPIO7 for MUTE as explained in the guide under GitHub.
In which file can I change to GPIO configuration for the rotary.py module?
Kind regards
steamfan
-
HiFiBerry team You posted the configuration file by yourself:
https://support.hifiberry.com/hc/en-us/community/posts/360012992598/comments/360003419178 -
steamfan I think I know what you want to say:
- Currently my CLK signal ist connected to GPIO4 = RPi PIN7
- as this GPIO is used by AMP2 I have to change it
- in /etc/audiocontrol.conf it is already configured; I should change my physical connection to these GPIOs
- clk = 23: GPIO23 = RPi PIN16
- dt = 24: GPIO24 = RPi PIN18
- sw = 25: GPIO25 = RPi PIN22
- Additionally I have to connect the encoder to GPIO3v3 = RPi PIN 1 and GPIO_GROUND = RPI PIN20 (or any other of the 7 more GPIO_GROUND)
Did I understand this correctly?
Regards
steamfan
-
HiFiBerry team Sounds about right.
-
steamfan Yes, it works now as expected. Thanks for the help.
-
armaster Hi,
I'm also using AMP2. Followed this instructions, I managed to work rotary encoder. But rotary encoder works this way:
- rotating clockwise decreases volume
- rotating counterclockwise increases volume.
Is it possible to set rotary encoder to in opposite way: rotating clockwise should increase volume, rotating counterclockwise should decrease volume? -
HiFiBerry team Just switch the CLK and DT pins (or switch it in the configuration)
-
armaster It works! Thanks.
-
eaedev Hi!
Could you please save an audio increasing or decreasing volume? I would like to check it you have an small stop in sound as I have.
Thank you in advance
-
Tapani alho Hi, I'm ver new with SSH. I really don't get (https://github.com/hifiberry/audiocontrol2/blob/master/doc/rotary-controller-plugin.md guide. It says "Once you have configured the plugin, you need to put into one of the directories in audiocontrol's PYTHONPATH If you're using HiFiBerryOS, we recommend to put it into /data/ac2plugins. Don't put it into /opt/... as these files will be lost on the next update." How can I get access to that directory?
-
Ni En Same here as with Tapani alho - is there video about the process?
Can I just copy and paste the code once logged in the Hifiberry via SSH?
thank you very much