Encoder Settings killing Zynthian software?

For the UI, you can omit the full path and use only the script name like that:

zynthian.sh

For the webconf, i think you have to be on the directory, like that:

cd /zynthian/zynthian-webconf
./zynthian_webconf.sh

Regards,

You shouldn’t update the OS. It could break things …

Regards,

I’ve missed that. Thanks

Great, thanks! That’s kind of interesting.: after setting all the encoder-pins to “0” via SSH and rebooting, webconf does work again.
Curiously, when I click on hardware - audio, there is an error:
“500: Internal Server Error” all the other pages of the webconf menu work. I am beginning to wonder whether there is something wrong with my audio hardware…

coincidence? i think not…

I also have error 500 on the same page after update.

connected to this error maybe…

Feb 10 20:45:50 zynthian startx[526]: ERROR:zynthian_gui.init_midi: ERROR initializing MIDI : ‘NoneType’ object has no attribute ‘set_midi_filter_tuning_freq’

??

for the record… behringer usb soundcard… has no on board midi… in case that may explain?

It looks like something is broken elsewhere:

Sorry guys! I can’t reproduce the problem and i tried to burn a fresh SD and update, but nothing. Everything works OK on my zynthians. Have you tried to update again and reboot?

Regards,

I just burned a new SD card myself and will try it ASAP.
Updating Zynthian, but not the OS :slight_smile:

Thank you so much for your help guys.

just tried doing this… something changed… I can now see my sound card settings but my zynth screen is still ERROR

1 Like

I just updated and now get the ERROR screen. I’m using my zynthian with 7" rpi touchscreen, no encoders and rbpi headphones on RPI4. Also noticed the same error as MrBroccoli reported: ERROR:zynthian_gui.init_midi: ERROR initializing MIDI : ‘NoneType’ object has no attribute ‘set_midi_filter_tuning_freq’

So I grabbed another sd card and burned a new image Build Date: 2020-09-05. Booted, changed settings and Zynthian was working fine. I should mention when audio is set to rbpi headphones in webconf, I get the ERROR screen, but when I change settings to Hifiberry dac+ Light everything works. So I do a software update from webconf and just like the other sd card, the ERROR screen returns. Here’s the UI log:
– Logs begin at Thu 2021-02-11 05:10:27 GMT. –
Feb 11 05:46:42 zynthian startx[459]: screen_obj.hide();
Feb 11 05:46:42 zynthian startx[459]: File “/home/pi/zynthian-ui/zyngui/zynthian_gui_midi_key_range.py”, line 275, in hide
Feb 11 05:46:42 zynthian startx[459]: zyncoder.lib_zyncoder.set_midi_learning_mode(0)
Feb 11 05:46:42 zynthian startx[459]: AttributeError: ‘NoneType’ object has no attribute ‘set_midi_learning_mode’
Feb 11 05:46:43 zynthian startx[459]: zynseq exit
Feb 11 05:46:43 zynthian startx[459]: PNG file: /zynthian/config/img/fb_zynthian_error_ip.png - Application must supply a known background gamma
Feb 11 05:46:43 zynthian startx[459]: /zynthian/config/img/fb_zynthian_error_ip.png is 800x480 PNG image, color type RGB_ALPHA, 8 bit, file gamma 0.4546
Feb 11 05:46:43 zynthian startx[459]: Zooming image by 100%…done
Feb 11 05:46:43 zynthian startx[459]: Merging…done
Feb 11 05:46:43 zynthian startx[459]: Building XImage…done
Feb 11 05:46:48 zynthian startx[459]: lilv_world_load_bundle(): warning: Replacing version 2071.7 of http://gareus.org/oss/lv2/b_whirl#extended from <file:///zynthian/zynthian-plugins/lv2/b_whirl.lv2/>
Feb 11 05:46:48 zynthian startx[459]: lilv_world_load_bundle(): note: New version 2071.11 found in <file:///zynthian/zynthian-plugins/lv2/b_whirl/>
Feb 11 05:46:48 zynthian startx[459]: lilv_world_load_bundle(): warning: Replacing version 2071.7 of http://gareus.org/oss/lv2/b_whirl#simple from <file:///zynthian/zynthian-plugins/lv2/b_whirl.lv2/>
Feb 11 05:46:48 zynthian startx[459]: lilv_world_load_bundle(): note: New version 2071.11 found in <file:///zynthian/zynthian-plugins/lv2/b_whirl/>
Feb 11 05:46:48 zynthian startx[459]: lilv_world_load_bundle(): warning: Ignoring bundle <file:///zynthian/zynthian-plugins/lv2/b_synth.lv2/>
Feb 11 05:46:48 zynthian startx[459]: lilv_world_load_bundle(): note: Newer version of http://gareus.org/oss/lv2/b_synth loaded from <file:///zynthian/zynthian-plugins/lv2/b_synth/>
Feb 11 05:46:55 zynthian startx[459]: libjackpeak registering as ‘jackpeak’.
Feb 11 05:46:55 zynthian startx[459]: libjackpeak created input ports
Feb 11 05:46:56 zynthian startx[459]: ERROR: PatternManager failed to open file for load /zynthian/zynthian-my-data/sequences/patterns.zynseq
Feb 11 05:47:00 zynthian startx[459]: WARNING:zynthian_autoconnect.cb_jack_xrun: Jack Audio XRUN!
Feb 11 05:47:00 zynthian startx[459]: ERROR:zynthian_gui.init_midi: ERROR initializing MIDI : ‘NoneType’ object has no attribute ‘set_midi_filter_tuning_freq’
Feb 11 05:47:00 zynthian startx[459]: WARNING:zynthian_autoconnect.cb_jack_xrun: Jack Audio XRUN!
Feb 11 05:47:00 zynthian startx[459]: WARNING:zynthian_autoconnect.cb_jack_xrun: Jack Audio XRUN!
Feb 11 05:47:00 zynthian startx[459]: WARNING:zynthian_autoconnect.cb_jack_xrun: Jack Audio XRUN!
Feb 11 05:47:01 zynthian startx[459]: Can’t init zyncoder library: /home/pi/zyncoder/build/libzyncoder.so: undefined symbol: zyncoder_mcp23017_bankA_ISR
Feb 11 05:47:01 zynthian startx[459]: zynseq: Jack samplerate: 44100
Feb 11 05:47:01 zynthian startx[459]: zynseq: Jack buffer size: 512
Feb 11 05:47:01 zynthian startx[459]: Traceback (most recent call last):
Feb 11 05:47:01 zynthian startx[459]: File “./zynthian_gui.py”, line 1701, in
Feb 11 05:47:01 zynthian startx[459]: zyngui.start()
Feb 11 05:47:01 zynthian startx[459]: File “./zynthian_gui.py”, line 373, in start
Feb 11 05:47:01 zynthian startx[459]: self.show_screen(‘main’)
Feb 11 05:47:01 zynthian startx[459]: File “./zynthian_gui.py”, line 418, in show_screen
Feb 11 05:47:01 zynthian startx[459]: self.hide_screens(exclude=screen)
Feb 11 05:47:01 zynthian startx[459]: File “./zynthian_gui.py”, line 404, in hide_screens
Feb 11 05:47:01 zynthian startx[459]: screen_obj.hide();
Feb 11 05:47:01 zynthian startx[459]: File "/home/pi/zynthian-

Looks to me like the latest commit on zyncoder.c has an error in the #ifdef logic, that causes the zyncoder_mcp23017_bankA_ISR function to be referenced, but not defined when using anything else than MCP23008_ENCODERS or MCP23017_ENCODERS:

The functions are embedded in this IFDEF:

#ifdef MCP23017_ENCODERS
// wiringpi node structure for direct access to the mcp23017
struct wiringPiNodeStruct *zyncoder_mcp23017_node;

// two ISR routines for the two banks
void zyncoder_mcp23017_bankA_ISR() {
	zyncoder_mcp23017_ISR(zyncoder_mcp23017_node, MCP23017_BASE_PIN, 0);
}
void zyncoder_mcp23017_bankB_ISR() {
	zyncoder_mcp23017_ISR(zyncoder_mcp23017_node, MCP23017_BASE_PIN, 1);
}
void (*zyncoder_mcp23017_bank_ISRs[2])={
	zyncoder_mcp23017_bankA_ISR,
	zyncoder_mcp23017_bankB_ISR
};
#endif

but the logic that decides when to reference them is different:

#ifdef MCP23008_ENCODERS
		if (pin<MCP23008_BASE_PIN) {
			wiringPiISR(pin,INT_EDGE_BOTH, update_zynswitch_funcs[i]);
			update_zynswitch(i);
		}
#else
		// this is a bit brute force, but update all the banks
		zyncoder_mcp23017_bankA_ISR();
		zyncoder_mcp23017_bankB_ISR();
#endif

So, when choosing DUMMY_ENCODERS in the webconf, I assume the library will be recompiled and then failing because of a reference to a function that doesn’t exist:

(from zyncoder/CMakeLists.txt at master · zynthian/zyncoder · GitHub):

if (("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_ENCODERS") 
 OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_EXTRA")
 OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_ZynScreen")
 OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_EPDF")
 OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_EPDF_REVERSE"))
	message("++ Defined MCP23017_ENCODERS")
	add_definitions(-DMCP23017_ENCODERS)
elseif(NOT ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "DUMMIES"))
	message("++ Defined MCP23008_ENCODERS")
	add_definitions(-DMCP23008_ENCODERS)
else()
	message("++ Defined DUMMY_ENCODERS")
	add_definitions(-DDUMMY_ENCODERS)
endif()
2 Likes

Sorry guys! I can’t reproduce the problem and i tried to burn a fresh SD and update, but nothing. Everything works OK on my zynthians.

I assume being @jofemodo El Jefe of the Zynthian kits, you will not have a lowly config with dummy inputs/custom encoders :grin:?

1 Like

I think @wyleu reported this in GitHub. We certainly diagnosed this whilst teaching his recent issues with I2C.

1 Like

Excuse my noobness. Do you think, choosing any entry other than “DUMMY_ENCODERS” would be a temporary fix? I was close to giving up, but I’ll try it as soon as I can.

Very inspiring forum :+1:

1 Like

@OnklFlo , you can try, it will probably make the webconf start again, but then it will assume you have that type of encoder and I’m not sure how well it will behave if you don’t

I’m running an encoderless setup wich was fine until I’ve updated software. I was then facing same problems.
The workaroud I’ve found:

3 Likes

This worked for me, too. Thanks!
So the bug must be in the “DUMMIES” preset.
I wonder, whether or not to try add other GPIO-Pinnumbers into the Custom Layout and sill try to connect my ‘naked’ encoders … :thinking:

I would say: let’s go for it, good luck and keep us informed :sweat_smile: :sweat_smile: :sweat_smile:

:sweat_smile: :sweat_smile: You are true, @matt!
But the problem should be solved now. Thanks for the fine analysis :ok_hand:

Please, update and test.

Cheers!

:+1:
yeah, my encoderless setup is now working with the “dummies” settings, under master branch and under feature/stepseq branch too (tested with RpiHeadphones and usb soundcard).

Sooo, it was the zyncoder lib that was faulty

thank you @jofemodo