UI Encoder Hang [SOLVED]

After an upgrade to the Pi and an update to the software, I have a nearly fully functional Zynthian.

However, there is still one issue that was consistent right from the start that I was expecting to be fixed in this process. At random, when an option from any menu in the Zynthian UI is selected using the select encoder, the loading animation begins in the top right corner and all four encoders stop working.

The touchscreen still works to switch between options, but I cannot select any of them to open. I am also unable to navigate back with touch gestures. The only thing I am able to do is use SSH or the Web UI to reboot the device, or if there is no internet access, pull out the power cable.

The top command shows that zynthian-gui is still using resources during this hang:

This happens at complete random, in no specific menu, after no specific time. This build was from scratch, but with all the same hardware a standard Zynthian contains, making a hardware issue seem unlikely.

This is the last step for a fully functioning build for me, so any help would be much appreciated :slight_smile:


EDIT: After continuing to play around, I have found that if a layer is already loaded, all midi and audio input and output continues to work. Nothing but the local UI stops working.

what kind of engines were you using?
It would help, if you find something we can reproduce

I cannot seem to reproduce it with any specific engine - I can be at any menu when it occurs.

From my knowledge, if the UI is only displaying a single loading image, the high CPU usage might suggest a loop failing to break? However, the fact that nobody has had any similar issue before does suggest something is wrong with either my image or hardware.

I’ll continue looking for clues.

have you stopped the zynthian service already and started it manually via ssh, so that you might see any exceptions?

I tried this, but not with the right service it would seem. I’ll give it another shot.

Switching to single channel mode triggers it every time, I discovered.

    DEBUG:root:ZCTRL 'Action': 4 (0 -> 19), None, None
    DEBUG:root:WS >> stats 19.6 0
    INFO:root:Short Switch 3
    INFO:root:Single Channel Mode ON
    WARNING:root:zynthian_gui.zyncoder_read() => list index out of range

There’s the source of the error, in the encoder read script. I’ll enable zynthian_raise_exceptions and post the output.

Got It.

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
  File "/usr/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "./zynthian_gui.py", line 672, in zyncoder_thread_task
  File "./zynthian_gui.py", line 691, in zyncoder_read
    raise err
  File "./zynthian_gui.py", line 688, in zyncoder_read
  File "./zynthian_gui.py", line 387, in zynswitches
  File "./zynthian_gui.py", line 586, in zynswitch_short
  File "/zynthian/zynthian-ui/zyngui/zynthian_gui_selector.py", line 257, in switch_select
    self.click_listbox(None, t)
  File "/zynthian/zynthian-ui/zyngui/zynthian_gui_selector.py", line 253, in click_listbox
    self.select_action(self.index, t)
  File "/zynthian/zynthian-ui/zyngui/zynthian_gui_admin.py", line 123, in select_action
  File "/zynthian/zynthian-ui/zyngui/zynthian_gui_admin.py", line 289, in toggle_single_channel
    "ZYNTHIAN_MIDI_SINGLE_ACTIVE_CHANNEL": str(int(zynthian_gui_config.midi_single_active_channel))
  File "/zynthian/zynthian-ui/zynconf/zynthian_config.py", line 217, in update_midi_profile
    save_config(midi_params, False, fpath)
  File "/zynthian/zynthian-ui/zynconf/zynthian_config.py", line 141, in save_config
IndexError: list index out of range

Are you sure that you updated everything? This bug was fixed a couple of days ago

1 Like

Ah, brilliant.

I just commented the line, which removed the problem, but keeping my software up to date is likely a better solution.