Questions about zynthian OS automated build system

Right, so I finally made it!!
I only had to edit the jack config from the web interface, according to the listed device by aplay.
Now I’m facing another issue:
ERROR:zynthian_gui.refresh_status: [Errno 2] No such file or directory: ‘vcgencmd’: ‘vcgencmd’

I see that this is raspbian-specific, so I might as well get into the python code and place some dummy values. At this moment, the UI does not do anything, besides flashing an “m” when pressing keys and some x-runs from time-to-time (which kind of worries me, but that is without doing any cpu governor changes).
Keybindings do not work. Moving through the menu items with the arrows do nothing. I’m suspecting it’s because of that pesky error.

1 Like

Yes ! At least you’ve managed to get the display to work. Well done. Webconf is running too and you’re not that far to get it done .

Usually the IP error splash screen comes when the the audio sub system isn’t well configured (jack server or alsa stuff).

That’s why I would say that messages are in “contratictions”:
Logs from webconf seems to told that Jackd sound server isn’t running while systemctl screenshot shows a jack running instance.

This could be helpfull:

  • What is your audio setup (hardware and how it is configured in webconf)
  • A copy of webconf home page
  • Output of lsmod, dmesg, aplay -l, aplay -L commands

Excellent.

Do you have the Zynthian UI up ?

What about trying to use a USB mouse?

Yes, I have it.
I tried customizing it from the webconf and it works, I now have a CPU load indicator. However… the rest of the UI is still frozen.
@Baggypants Tried with my mouse-keyboard combo, as well as with another mice. I can see the cursor, but it’s not moving.
Also, got rid of that previous error, it was a quick fix.
I got a new error now :smiley: :
ERROR:zynthian_gui.osc_init: ZYNTHIAN-UI OSC Server can’t be started: server error 9904: b’cannot find free port’
Nov 02 23:33:28 zynthian startx[3246]: Exception in thread Thread-9:
Nov 02 23:33:28 zynthian startx[3246]: Traceback (most recent call last):
Nov 02 23:33:28 zynthian startx[3246]: File “/usr/lib/python3.7/threading.py”, line 917, in _bootstrap_inner
Nov 02 23:33:28 zynthian startx[3246]: self.run()
Nov 02 23:33:28 zynthian startx[3246]: File “/usr/lib/python3.7/threading.py”, line 865, in run
Nov 02 23:33:28 zynthian startx[3246]: self._target(*self._args, **self._kwargs)
Nov 02 23:33:28 zynthian startx[3246]: File “./zynthian_gui.py”, line 1293, in zyncoder_thread_task
Nov 02 23:33:28 zynthian startx[3246]: self.osc_receive()
Nov 02 23:33:28 zynthian startx[3246]: File “./zynthian_gui.py”, line 298, in osc_receive
Nov 02 23:33:28 zynthian startx[3246]: while self.osc_server.recv(0):
Nov 02 23:33:28 zynthian startx[3246]: AttributeError: ‘zynthian_gui’ object has no attribute ‘osc_server’

Right, after further investigations, it seems like the gui is not listening to the keybindings. A bit late here to troubleshoot right now, but the debug log lines in the ui python file don’t reflect in the webconf UI logs.

run ss -plunt and post the output. Armbian may have some other remote config service listening on port 8000 or 9000 or something.

Netid   State    Recv-Q   Send-Q     Local Address:Port      Peer Address:Port                                                                                    
udp     UNCONN   0        0                0.0.0.0:68             0.0.0.0:*                                                                                        users:(("dhcpcd",pid=1709,fd=12))
udp     UNCONN   0        0                0.0.0.0:111            0.0.0.0:*                                                                                        users:(("rpcbind",pid=612,fd=5),("systemd",pid=1,fd=36))
udp     UNCONN   0        0                0.0.0.0:36490          0.0.0.0:*                                                                                        users:(("avahi-daemon",pid=1619,fd=14))
udp     UNCONN   0        0                0.0.0.0:5353           0.0.0.0:*                                                                                        users:(("avahi-daemon",pid=1619,fd=12))
udp     UNCONN   0        0              127.0.0.1:323            0.0.0.0:*                                                                                        users:(("chronyd",pid=1763,fd=5))
udp     UNCONN   0        0                0.0.0.0:1370           0.0.0.0:*                                                                                        users:(("zynthian_gui.py",pid=1920,fd=20))
udp     UNCONN   0        0                   [::]:45042             [::]:*                                                                                        users:(("avahi-daemon",pid=1619,fd=15))
udp     UNCONN   0        0                      *:546                  *:*                                                                                        users:(("dhcpcd",pid=1709,fd=15))
udp     UNCONN   0        0                   [::]:111               [::]:*                                                                                        users:(("rpcbind",pid=612,fd=7),("systemd",pid=1,fd=38))
udp     UNCONN   0        0                   [::]:5353              [::]:*                                                                                        users:(("avahi-daemon",pid=1619,fd=13))
udp     UNCONN   0        0                  [::1]:323               [::]:*                                                                                        users:(("chronyd",pid=1763,fd=6))
tcp     LISTEN   0        128              0.0.0.0:111            0.0.0.0:*                                                                                        users:(("rpcbind",pid=612,fd=4),("systemd",pid=1,fd=35))
tcp     LISTEN   0        128              0.0.0.0:80             0.0.0.0:*                                                                                        users:(("zynthian_webcon",pid=1640,fd=3))
tcp     LISTEN   0        128              0.0.0.0:22             0.0.0.0:*                                                                                        users:(("sshd",pid=1781,fd=3))
tcp     LISTEN   0        128              0.0.0.0:443            0.0.0.0:*                                                                                        users:(("zynthian_webcon",pid=1640,fd=8))
tcp     LISTEN   0        128                 [::]:111               [::]:*                                                                                        users:(("rpcbind",pid=612,fd=6),("systemd",pid=1,fd=37))
tcp     LISTEN   0        128                 [::]:80                [::]:*                                                                                        users:(("zynthian_webcon",pid=1640,fd=4))
tcp     LISTEN   0        128                 [::]:22                [::]:*                                                                                        users:(("sshd",pid=1781,fd=4))
tcp     LISTEN   0        128                 [::]:443               [::]:*                                                                                        users:(("zynthian_webcon",pid=1640,fd=9))

I also found this in the journalctl, right after starting the UI

Nov 03 10:49:35 zynthian systemd[1]: Starting MOD ttymidi...
Nov 03 10:49:36 zynthian jack_wait[2203]: server is available
Nov 03 10:49:36 zynthian systemd[1]: Started MOD ttymidi.
Nov 03 10:49:36 zynthian ttymidi[2206]: /dev/ttyAMA0: No such file or directory
Nov 03 10:49:36 zynthian systemd[1]: mod-ttymidi.service: Main process exited, code=exited, status=255/EXCEPTION
Nov 03 10:49:36 zynthian systemd[1]: mod-ttymidi.service: Failed with result 'exit-code'.
Nov 03 10:49:37 zynthian systemd[1]: mod-ttymidi.service: Service RestartSec=1s expired, scheduling restart.
Nov 03 10:49:37 zynthian systemd[1]: mod-ttymidi.service: Scheduled restart job, restart counter is at 9.
Nov 03 10:49:37 zynthian systemd[1]: Stopped MOD ttymidi.
Nov 03 10:49:37 zynthian systemd[1]: mod-ttymidi.service: Start request repeated too quickly.
Nov 03 10:49:37 zynthian systemd[1]: mod-ttymidi.service: Failed with result 'exit-code'.
Nov 03 10:49:37 zynthian systemd[1]: Failed to start MOD ttymidi.

I have no idea where ttymidi comes in handy, but I can see the midi events in the webconf.

Also @riban since I saw that you are the author of keybind feature, can you give us a very brief introduction on how this feature works? That would hopefully aid in finding out why there are no debug logs on that part.
I don’t know if the frozen mouse pointer has anything to do with that.

@jofemodo I saw that there were similar issues in september, with frozen UI. Is this linked in any way to that?

LE:
FIXED! :smiley:
All I needed to do is to install xserver-xorg-input-evdev and xserver-xorg-input-mouse.

Original post:
Alright, so I did some more digging and found out that the displays are rendered using Tkinter on a canvas-basis system.
Initially I thought the UI is frozen because of a main-thread lock issue (looks to be very common with tkinter), but since I found out that the midi icon, the CPU load and so on are being displayed on a status canvas, this is out of the question. So tkinter is working.
But the issue looks like there’s no input to tkinter for either mouse pointer/buttons or keyboard.
I may be wrong but tkinter runs on top of X, thus X should be passing any mouse/keyboard events to tkinter.
So, my suspicion is that X does not properly handle the inputs.
libinput-bin and libinput10 are installed.
Are your mice mounted in any way under /dev?
Maybe X is looking for the mouse on some specific path which does not exist OR the mouse/keyboard are not automounted properly

Found these lines at the end of X log:

[  2729.172] (II) config/udev: Adding input device r_gpio_keys (/dev/input/event0)
[  2729.172] (II) No input driver specified, ignoring this device.
[  2729.172] (II) This device may have been added with another device file.
[  2729.179] (II) config/udev: Adding input device 2.4G Wireless Keyboard&Mouse (/dev/input/event1)
[  2729.179] (II) No input driver specified, ignoring this device.
[  2729.179] (II) This device may have been added with another device file.
[  2729.183] (II) config/udev: Adding input device 2.4G Wireless Keyboard&Mouse (/dev/input/event2)
[  2729.184] (II) No input driver specified, ignoring this device.
[  2729.184] (II) This device may have been added with another device file.
[  2729.188] (II) config/udev: Adding input device 2.4G Wireless Keyboard&Mouse (/dev/input/event3)
[  2729.188] (II) No input driver specified, ignoring this device.
[  2729.189] (II) This device may have been added with another device file.
[  2729.193] (II) config/udev: Adding input device 2.4G Wireless Keyboard&Mouse Consumer Control (/dev/input/event4)
[  2729.193] (II) No input driver specified, ignoring this device.
[  2729.193] (II) This device may have been added with another device file.
[  2729.197] (II) config/udev: Adding input device 2.4G Wireless Keyboard&Mouse System Control (/dev/input/event5)
[  2729.197] (II) No input driver specified, ignoring this device.
[  2729.197] (II) This device may have been added with another device file.
[  2729.202] (II) config/udev: Adding input device GeneralPlus USB Audio Device (/dev/input/event6)
[  2729.202] (II) No input driver specified, ignoring this device.
[  2729.202] (II) This device may have been added with another device file.
[  2729.206] (II) config/udev: Adding input device sunxi-ir (/dev/input/event7)
[  2729.206] (II) No input driver specified, ignoring this device.
[  2729.206] (II) This device may have been added with another device file.

LE1:
Managed to get the kernel output on the display.
Apparently dtoverlays are installed using an armbian tool
Got an overlay for opizero which I modified to run on SPI0 instead of SPI1 and changed some pins.
Also installed xserver-xorg-video-fbturbo.
Now fb1 appears under /dev but X is still crashing
Failed to load module "fbturbo" (module does not exist, 0)
and
[ 2465.451] (II) LoadModule: "fbdevhw" [ 2465.452] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so [ 2465.452] (II) Module fbdevhw: vendor="X.Org Foundation" [ 2465.453] compiled for 1.20.4, module version = 0.0.2 [ 2465.453] ABI class: X.Org Video Driver, version 24.0 [ 2465.453] (II) FBDEV(0): using /dev/fb1 [ 2465.453] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support [ 2465.453] (EE) Screen 0 deleted because of no matching config section. [ 2465.453] (II) UnloadModule: "fbdev" [ 2465.453] (II) UnloadSubModule: "fbdevhw" [ 2465.453] (EE) Device(s) detected, but none match those in the config file. [ 2465.453] (EE) Fatal server error: [ 2465.453] (EE) no screens found(EE) [ 2465.453] (EE)

Original post:
Right, since the UI works now and all the bells and whistles, I played a bit with zynthian over HDMI. I am really amazed by the performance and flexibility of it.
No xruns, but sporadic UI crashes from time to time, nothing major. Thanks a lot to everyone who made and contributed to this project!

The next big challenge now is though, adding a screen to this contraption.
Bought an ili9341 screen and tested it on a stm32 to make sure it works, at least, and it does indeed.
However, it doesn’t on the orange pi…
Issues:

  1. fbtft wasn’t built-in to the kernel (I’m running 5.10) so loaded it as a kernel module.
  2. fbtft_devices was removed since 5.40 and I see that also zynthian is using dtoverlays. Rpi_screen should work for me since I see that it’s meant for an ili9341. Since I am not running a standard raspberry pi configuration, I will have to override some pin configuration (cs, dc, reset), which should be done in UI in the advanced display settings.
  3. Even though I configured everything correctly, I can’t see fb1 under /dev, and I’m clueless at this point. Any help I found online relates to fbtft_devices not starting, but since this is now removed, I don’t really know what’s the cause…
  4. Is fbtft listing the framebuffer device only after it has found a device on the spi interface?
    Is there a specific HAL that fbtft is using to control the hardware pins?
    Because that would be different from the raspi.

Hi @xanderz I’m glad to hear that you’ve made some progresses.

  • It’s strange that your board doesn’t support 2 displays.
  • looks like you have to compile it :hugs: and even configure it (in /usr/share/X11/xorg.conf.d/99-fbturbo.conf or so).
    Something like (as from here):

Section “Device”
Identifier “Allwinner A10/A13 FBDEV”
Driver “fbturbo”
Option “fbdev” “/dev/fb1”
Option “SwapbuffersWait” “true”
EndSection

Off topic:
These SPI display are a real pain to handle. The fbtft lib that was working (with more or less hassle) on previous kernels versions is since a couple of years in the stagging kernel driver directory <=> not in the official source tree.
I’ve read elsewhere on some kernel developer mailing list that it’s quiet impossible to integrate it in the kernel source tree because of the new enhancements made in the kernel video layer.

Well I got it working for me, after some head banging on the table :smiley:
I was experiencing a major performance loss versus the HDMI scenario.
Lots of Xruns, and the FPS wasn’t very high either (something in the lines of like 20FPS), that is, with a 48MHz clock and the display being a 320x240.
I didn’t look on the source code yet, but I am only hoping they are not involving CPU for each byte transfer from the framebuffer, but using the DMA.
In some other words, the CPU usage wasn’t high either, so I don’t know what’s the root cause of that performance loss… I’ll have yet to investigate more :roll_eyes:

But maybe that’s only on my side. What’s your experience with fbtft(with newer kernels, preferably)?