lv_binding_micropython icon indicating copy to clipboard operation
lv_binding_micropython copied to clipboard

Runtime error with any example that uses event_loop on unix port

Open jath03 opened this issue 2 years ago • 2 comments

I'm trying to get the examples working on a raspberry pi through the unix port, but keep running into this error whenever an example uses the event_loop function.

Traceback (most recent call last):
  File "example3.py", line 37, in <module>
  File "display_driver.py", line 2, in <module>
  File "display_driver_utils.py", line 35, in __init__
  File "display_driver_utils.py", line 163, in init_gui
  File "display_driver_utils.py", line 42, in init_gui_SDL
  File "lv_utils.py", line 95, in __init__
  File "lv_timer.py", line 142, in init
  File "lv_timer.py", line 103, in timer_create
RuntimeError: timer_create_ error: -1 (errno = 22)

jath03 avatar Jul 27 '22 05:07 jath03

Hi @jath03 !

Please specify: on which version of lv_micropython it happens, how you built it, what display driver you are using, etc.
Also provide information about the rpi board you are using, Linux version etc.

The error you are seeing means that timer_create function returned the error EINVAL.
According to the docs this means:

Clock ID, sigev_notify, sigev_signo, or sigev_notify_thread_id is invalid.

In the code we call timer_create like this:

https://github.com/lvgl/lv_binding_micropython/blob/341134744b2a919d8a9e7773bba1bdec0fa21b44/driver/linux/lv_timer.py#L98-L101

So:

  • clockid = CLOCK_MONOTONIC
  • sigev_notify = SIGEV_SIGNAL
  • sigev_signo = SIGRTMIN + sig_id

Looks like Linux on your side has some issue with one of these arguments.

amirgon avatar Jul 27 '22 10:07 amirgon

lv_microython: commit 6ebf96a9032170a957dd07c83350480c08b79c78 built using the instructions in the README on the pi itself SDL driver Raspberry pi 3b Linux 5.15.32-v7+ Raspbian Lite

jath03 avatar Jul 27 '22 17:07 jath03

you can try this PR: https://github.com/lvgl/lv_binding_micropython/pull/278

liuyunrui123 avatar Jun 09 '23 03:06 liuyunrui123

This is probably related to https://github.com/lvgl/lv_binding_micropython/issues/273, fixed in https://github.com/lvgl/lv_binding_micropython/pull/274.

Please reopen if it doesn't fix it.

amirgon avatar Jun 10 '23 21:06 amirgon