Encoder switches False trigger

I have built a DIY Zynthian. I have used in sinse 2020. I had no issues whatsoever.
The only complaint I had in an older Zynthian version is that MIDI recorder was very slow. After hitting record I had to wait for 10-15 seconds. And that’s on Raspverry Pi 4 version B.
A few weeks ago I got myself a new SD card and installed a new version of Zynthian.
There was no hardware modifications, the only difference is the version of Zynthian.
Now when I press CTRL-2 (back) button I get to Mixer, so all is working correctly.
But, in a few seconds Admin window opens just by itself.
Also, when I click other control button sometimes CTRL-4 (select) long press false triggers and I’m getting Turn Off dialogue.
I have tested with oscilloscope and there’s no false trigger on the encoder contacts. There’s no voltage spikes. I’ve checked and rechecked all the wiring, and as I said before there was no HW modifications to my build. So the difference is in Zynthian soft.
My build is simple and all encoders and switches go directly to raspberry Pi 4 header. I do not use MCP23017.
As for the sound output I use a cheap pcm5102 board, configured as Hifiberry dac + Light.

Wiring: Custom
Encoder A: 25,0,4,22
Encoder B: 27,7,3,21
Switches: 23,5,2,26

I wonder if any of those pins are just not suitable in the latest update and are used for something else.

Any ideas or suggestions would be appreciated greatly!
I would hate to go back to previos Zynthian version, as I love the features in the latest version.

Michael

Hi,

I have the same problem with the new software. I had so many accidental switch off and switch to Multitimbral Mode (I press the Select anywhere else but the Turn off or the Admin appears just before the press) that I connected a mouse and a keyboard instead.

Similar hardware, encoders connected direct to gpio. I have KY-040 encoder moduls, 3.3v connected - the experts say here this isn’t the best, but it was very easy, and worked until now. Hifiberry DAC+ ADC soundcard here.

1 Like

Hi! Thanks for confirming this issue! I’ll try using MCP chip, but that’s in the mail and will take some time before I try it.

@riban @jofemodo any advise?

@gilrain Created a ticket just in case: Encoder switches False trigger in the latest Zynthian update · Issue #839 · zynthian/zynthian-issue-tracking · GitHub

2 Likes

Thanks!

1 Like

Thanks for raising a ticket. I am away for a few more weeks so don’t have access to a device on which to test this specific confirmation.

2 Likes

Like @riban , i’m not at home and have no access to hardware to test. I have tested the last stable in v1 zynthians, what are directly connected to RBPi pins, and it worked flawlessly.

Anyway, the encoder code has been deeply refactored and things work quite differently now, so perhaps your encoders are not working OK, specially if they didn’t have debouncing capacitors. I strongly recommend to have 10uF on each encoder pin, and 100uF capacitors for switches.

Regards,

1 Like

Thanks @jofemodo . Would the Basic Kit v4 be the real solution?

1 Like
  1. Tried encoder modules with 5 pins, those have 5v in and pull up resistors.
  2. Tried bare encoders with debouncing caps.
  3. Tried bare encoders without debouncing caps.
    On old Zynthian os not a single issue with all 3 setups above.
    Same 3 setups on latest Zynthian- power off, mixer false trigger all the time.
    After opening Mixer by pressing CTRL-2 (back) button, in about 5-6 second Admin window opens. When trying to add instruments in the middle of that process Admin window keeps opening, interrupting the workflow.

It seems like the release is not being captured and the presses are being managed like long presses. I’ve tested the new code with bare encoders with debouncing capacitors and they work nicely, anyway, i will test again and will try to reproduce your issue. @riban, perhaps we should scale the priority for implementing a proper event queue instead of the direct call approach we are using currently. Do you remember our talk?

1 Like

I remember everything… eventually!

2 Likes

I’m pretty sure of that! :sweat_smile:

1 Like

Got MCP23017 as I was hitting a wall with my encoders soldered to GPIO. Even though I had those debouncing caps soldered in, the value of caps were correct. So by soldered encoders to MCP23017 I resolved my issue.

Congratulations…!

I’m not a big advocate of using the GPIO pins . . .

Agree, but using GPIO makes Zynthian more accessible to DIY noobs. The less components required, the lesser is a chance of a mistake :slight_smile:

The available GPIO pins are becoming more and more restricted and especially with the changes required by Pi5 they ain’t really the most reliable mechanism.
I’ve had to alter my early zynths twice because pins I’d used were swallowed up by some lower level Pi mechanism…
And once you add the number of buttons that the v5 Zynthian uses it becomes easier to pass off the functionality to something external probably running off 12C… This is how things develop. IT also becomes a little more side stepped as the API develops.

Such is progress.

Here’s some early wyleu GPIO efforts…

hifiberry-amp2
hifiberry-amp

2 Likes

It’s like looking at Cave Art Paintings of the Lascaux Cave!

I particularly like the way the yellow knob indicators complement the yellow labels.

1 Like

Yes, the marketing department went throu’ hell coming up with that…

The alignment of the speaker screws and the holes was primarily optomised about the devices response in the sub woofer range…

Hifi zealots were particularly impressed and you can obviously see the oxygen free plastic used on the wires. . .

1 Like

So, if, some time in the future, I would want to add more buttons, should I just buy a second MCP23017?
Currently I only have 4 encoders and 4 buttons attached to MCP23017. There’s no more empty pins there I think, and even if there were, I wouldn’t know how to add and assign those.
But at the same time I got lots of unused GPIO pins that I could have used to attach extra buttons to.
Currently, instead of trying to do the 2 things I’ve mentioned earlier, I’ve built an arduino based pedal board with Program Change and Control Change buttons. I’ve used MIDI learn on Zynthian to assign those to what I need. But that seems like a workaround. In theory I could implant that arduino into Zynthian case, drill some holes and put those buttons where I want them :slight_smile:
My case is a DIY wooden triangle box, so it would be easy to do.