KivyMD
KivyMD copied to clipboard
Slow loading, graphical issues, and freezes when running on Raspberry Pi
It seems like this occurs when adding too many widgets. I first noticed when I added a new screen with around 20 widgets in it. Before the screen was added, the app ran normally, however, upon adding the new screen, it took several minutes to load and upon loading many graphical issues were seen, such as label text not showing (replaced by black boxes). I also added a screen with 10 images, and doing so caused the same issues.
This is the startup log:
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_22-04-06_54.txt
[INFO ] [Kivy ] v2.1.0
[INFO ] [Kivy ] Installed at "/home/pi/.local/lib/python3.7/site-packages/kivy/__init__.py"
[INFO ] [Python ] v3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0]
[INFO ] [Python ] Interpreter at "/usr/bin/python3"
[INFO ] [Logger ] Purge log fired. Processing...
[INFO ] [Logger ] Purge finished!
[INFO ] [Factory ] 189 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2(['text_pango'] ignored)
[INFO ] [KivyMD ] 0.104.2, git-bc7d1f5, 2021-06-06 (installed at "/home/pi/.local/lib/python3.7/site-packages/kivymd/__init__.py")
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used <sdl2>
[INFO ] [GL ] OpenGL version <b'OpenGL ES 2.0'>
[INFO ] [GL ] OpenGL vendor <b'Broadcom'>
[INFO ] [GL ] OpenGL renderer <b'VideoCore IV HW'>
[INFO ] [GL ] OpenGL parsed version: 2, 0
[INFO ] [GL ] Shading version <b'OpenGL ES GLSL ES 1.00'>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <8>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard allowed, single mode, docked
Finished logging setup
[<Element 'File' at 0x65923810>]
[INFO ] [GL ] NPOT texture support is available
<kivy.uix.vkeyboard.VKeyboard object at 0x6405cf30>
[INFO ] [Clipboard ] Provider: xclip
[INFO ] [CutBuffer ] cut buffer support enabled
[WARNING] Deprecated property "<VariableListProperty name=padding_y>" of object "<__main__.RoundedTextField object at 0x63e2ebb0>" was accessed, it will be removed in a future version
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [MTD ] Read event from </dev/input/event0>
[INFO ] [MTD ] Set custom rotation to 270
[INFO ] [MTD ] Set custom invert_x to 0
[INFO ] [MTD ] Set custom invert_y to 1
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [HIDInput ] Set custom rotation to 270
[INFO ] [HIDInput ] Set custom invert_x to 0
[INFO ] [HIDInput ] Set custom invert_y to 1
[WARNING] [Base ] Unknown <wm_touch> provider
[WARNING] [Base ] Unknown <wm_pen> provider
[INFO ] [Base ] Start application main loop
[INFO ] [MTD ] </dev/input/event0> range position X is 0 - 800
[INFO ] [HIDMotionEvent] using <WaveShare WS170120>
[INFO ] [MTD ] </dev/input/event0> range position Y is 0 - 480
[INFO ] [HIDMotionEvent] <WaveShare WS170120> range ABS X position is 0 - 800
[INFO ] [MTD ] </dev/input/event0> range touch major is 0 - 0
[INFO ] [HIDMotionEvent] <WaveShare WS170120> range ABS Y position is 0 - 480
[INFO ] [MTD ] </dev/input/event0> range touch minor is 0 - 0
[INFO ] [HIDMotionEvent] <WaveShare WS170120> range ABS pressure is 0 - 255
[INFO ] [MTD ] </dev/input/event0> range pressure is 0 - 255
[INFO ] [HIDMotionEvent] <WaveShare WS170120> range position X is 0 - 800
[INFO ] [MTD ] </dev/input/event0> axes invertion: X is 0, Y is 1
[INFO ] [HIDMotionEvent] <WaveShare WS170120> range position Y is 0 - 480
[INFO ] [MTD ] </dev/input/event0> rotation set to 270
[INFO ] [HIDMotionEvent] <WaveShare WS170120> range pressure is 0 - 255
In this case, the code hung on the last line for several minutes before booting to a blank white screen. Also in this specific case, I have a total of 11 screens each with around 10 widgets.
Versions
- OS: Raspbian GNU/Linux (buster)
- Python: v3.7.3
- Kivy: v2.1.0
- KivyMD: v0.104.2
@bkontou Unfortunately, I can't help you, because I don't have a device with a Raspberry Pi. As far as I know Raspberry Pi has problems not only with KKivyMD but also with Kivy.
Understandable. I was running Kivy before KivyMD and never encountered a problem like this though. Hopefully someone is able to reproduce the error and help.
Can you check if added this line change something (top of main.py)
from kivy.config import Config
Config.set('input', 'mtdev_%(name)s', 'probesysfs,provider=mtdev')