Rotary Encoder KY-040 Issue - Error statement: "Error in parameters Failed to add Overlay"

I am having difficulty making an KY-040 work for volume control and play/stop on my Volumio system. Here is the data on my system:

  • Platform: Raspberry Pi 4B 8Gig
  • Volumio System Version: 4.119
  • Active Plugin Version I have Tried: Rotary Encoder II (V2.2.0, V2.2.1)
  • Other Active Plug Ins: Now Playing (v1.0.6), Touch Display (3.6.0)
  • Inactive Plugins: FusionDSP (v2.0.79)
  • Encoder Type: KY-040
  • HAT: Innomaker Amp Pro HAT
  • Plugin Driver: Innomaker Amp Pro
  • Pins Used to Interface: I have used multiple combinations of pins. There was only one instance when I was able to get the Play/Pause to work. The volume has never worked
  • Error Statements Received: Error in parameters - Failed to add Overlay,…

I am using the BCM designations when I configure the plugin, not the pin numbers that the wires are attached to. Every time I go down to save the config, it will briefly flash a long error statement beginning with what I show above. Then, it will give me a gray box that said the config was saved.

ROTARY ENCODER II Settings:

  • Rotary Encoder 1: On
  • Periods Per Tick: 1/2
  • Pin A GPIO: 22
  • Pin B GPIO: 17
  • Dial Action: Volume
  • Pushbutton GPIO: 27
  • Debounce-Time(Ms): 100
  • Button Logic-Level Active Low: On
  • Short Press Action: Play
  • Long Press Action: Stop
  • Delay for A Long Button Press(MS): 1500
  • Double Press Action: Repeat
  • Maximum Interval for Double Press(Ms): 700

In the Playback Options, I have it set up as follows:

AUDIO OUTPUT:
-I2S DAC: On
-DAC Model: Innomaker Amp Pro

GENERAL PLAYBACK OPTIONS:
-DSD Playback Mode: DSD Direct
-DSD Auto Volume Level: On
-Volume Normalization: On
-Audio Buffer: 2MB
-Persistent Queue: On
-Playback Mode: Continuous

VOLUME OPTIONS:
-Mixer Type: Software
-Default Startup Volume: Disabled
-Max Volume Level: 100
-OneClick Volume Steps 1
-MPD Clients Volume Control: Off

AUDIO RESAMPLING:
-Off

Any suggestions on what I can do to make this work would be appreciated.

John G.

Seems you have chosen a GPIO that is already in use.
Try this, which is working for me:
PinA=6
PinB=5
Switch=22

THANK YOU!!! I spent several hours switching the wires around and trying different pins/GPIOs with not luck. But, the combo you used above worked on the first try!

Do you know if the Volume Control set to Hardware or Software makes a difference? I have not switched that one.

HW control doesn’t impact audio quality. (this happens after the DAC)
SW Control does impact audio quality, but if you can distinguish it that’s for you to decide by listening to it. (Happens before the DAC)
To avoid a complex study on this matter. Some basic info.
SW control of sounds results in lost of bit depth, Rule of thumb:

  • ‑6 dB ≈ lose 1 bit
  • ‑12 dB ≈ lose 2 bits
  • ‑18 dB ≈ lose 3 bits

A 2nd unwanted side effect of SW control.
Every system has a noise floor, Noise can’t be controlled by volume.
So let’s say your system has a base noise of 1%.
At 100% Volume the S/N ratio is 1% ((100 / 100) * 1)
At 50% Volume the S/N ratio is 2% ((100 / 50) * 1)

Thanks - that is great info.

I actually did a little more work and went through every GPIO port to see which ones I could map the KY-040 to while using the Innomaker Amp Pro. Here are the results (this may help others in the future):

GPIO Port - (Yes/No)

1 - Yes
2 - No
3 - No
4 - Yes
5 - Yes
6 - Yes
7 - No
8 - No
9 - Yes
10 - Yes
11 - Yes
12 - Yes
13 - No
14 - No
15 - No
16 - No
17 - No
18 - No
19 - No
20 - No
21 - No
22 - Yes
23 - No
24 - No
25 - Yes
26 - Yes
27 - Yes

Hope that helps others that are using this Amp / Raspberry Pi combo to get the KY-040 working.

This night also come in handy: