Performance issue OpenGL

542 views
Skip to first unread message

Tobias

unread,
Aug 7, 2017, 5:34:42 AM8/7/17
to KivyPie
Hey guys,

the performance on the raspberry pi 3 is very low. The complete kivy application is very slow and laggy.
I've already tried another OpenGL driver (mesa https://github.com/anholt/mesa), but this caused a segmentation fault and blackscreens. Also I tried the package python3-kivypie.
So my question: How can I increase the performance? The application works fluently on the kivypie os.

My system: 
Raspberry Pi 3 Model B
Kivy 1.10.1 Dev with SDL2 as Window Provider. Another Window Provider already tested.
Os: Raspbian Jessie (current version)


Here some log files

Without mesa OpenGL:
[INFO   ] GL: Using the "OpenGL ES 2" graphics system
[INFO   ] GL: Backend used <gl>
[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>

With mesa OpenGL
[INFO   ] GL: Using the "OpenGL ES 2" graphics system
[INFO   ] GL: Backend used <gl>
[INFO   ] GL: OpenGL version <b'2.1 Mesa 13.0.0'>
[INFO   ] GL: OpenGL vendor <b'Broadcom'>
[INFO   ] GL: OpenGL renderer <b'Gallium 0.4 on VC4 V3D 2.1'>
[INFO   ] GL: OpenGL parsed version: 2, 1
[INFO   ] GL: Shading version <b'1.20'>
[INFO   ] GL: Texture max size <2048>
[INFO   ] GL: Texture max units <16>

Regards,
Tobias

Albert Casals

unread,
Aug 7, 2017, 2:25:13 PM8/7/17
to KivyPie, tobiask...@gmail.com
Hi Tobias,

You seem to be complaining about graphics performance. You've surely checked any config.txt differences, right? Specifically the gpu_mem and hdmi_pixel_encoding settings.
Other than that, you are probably using this kivy package below, on Raspbian, which I do not know how it's been built. You could try to use it on KivyPie and see if your app slows down...

$ apt-cache show python-kivy
Package: python-kivy
Source: kivy
Version: 1.8.0+dfsg-2.1
Architecture: armhf
Maintainer: Bastian Venthur
Installed-Size: 5670

Cheers
Albert

Cristóbal Contreras Rubio

unread,
Aug 8, 2017, 5:57:16 AM8/8/17
to KivyPie
I highly recommend using KivyPie. My experience with Raspbian and Kivy is that it is very slow. KivyPie is clean and the performance it's better.

tobiask...@gmail.com

unread,
Aug 8, 2017, 11:19:50 AM8/8/17
to KivyPie, tobiask...@gmail.com
Hey,

thanks for the fast answer :D

I compared the /boot/config.txt and the /home/sysop/.kivy/config.ini. Both are nearly identical.
After some tests I found out, that the used windowprovider (sdl2) with special activation in the code:
import os
os.environ['KIVY_WINDOW'] = 'sdl2'
causes the lags. This window provider allows me to use a cursor. I've got a normal window.

The problem is, that I need a real mouse curser. My app is a thin client that should use mouse/keyboard and touchscreen.
Another big issue is the fact that I can't minimize the kivy app. So i can't open another software like a rdp client and use it.

Do you have any ideas for:
- A "real" mouse cursor
- Minimizable Window, that doesn't draw over all

PS: The package "python3-kivy" use pygame as window provider. It looks like pygame is even slower than sdl2.

Regards,
Tobias

christophe malvasio

unread,
Aug 8, 2017, 3:01:09 PM8/8/17
to KivyPie, tobiask...@gmail.com
hi
im new here ;)
the not minimizable pb need a real windows manager on top of dispmanx
to win speed on kivypie stop all logs and it will save your sd too
more speed can be given by reworking all functions of kivy and do it with raspberry userland
more speed again with rewriting python vm in arm asm
...

Cristóbal Contreras Rubio

unread,
Aug 8, 2017, 3:59:27 PM8/8/17
to KivyPie, tobiask...@gmail.com
When I used keyboard and touchscreen together, I usually watched an annoying blue fixed cursor on the screen (it is the mouse cursor of kivy but fixed). Evenmore, if click one button with your finger, the touchscreen detect multiples touch in different places. Maybe I did not configured well in the Config file...

On the other hand, Kivy has a function called minimize in the Window object. So you could minimize your app.

In your case, I would try to use Qt or PyQt. Alberto has another Raspberry Pi distro called PiCute. I don't try already but it is in my task list. Kivy is more focus on touch apps and Qt it could be a really good option for you app.

Albert Casals

unread,
Aug 8, 2017, 5:09:16 PM8/8/17
to KivyPie, tobiask...@gmail.com
Tobias, you certainly need a Window Manager.

Have a read through this: https://github.com/kivy/kivy/issues/4706

I gave it a quick go, and it would appear the kivypie package is not compiled with X11 support, hence I can't load kivy apps,
but I think it should work, meaning your kivy would integrate seamlessly with other x11 apps on your X desktop.

Surprisingly, the python-kivy package from Debian/Raspbian seems to link against SDL1.2 ??
Additionally, the VC4 driver failed to boot on one of my touch screens, but it works very well on a HDMI display.

Let us know if you delve deeper into that, if it works I'll rebuild the packages

Cheers!
Albert

tobiask...@gmail.com

unread,
Aug 11, 2017, 4:39:12 AM8/11/17
to KivyPie, tobiask...@gmail.com
Hey,

I tried to decrease the log level, but it doesnt raise the speed.
You've got some examples or a project with kivy and userland?

Regards,
Tobias

tobiask...@gmail.com

unread,
Aug 11, 2017, 4:54:17 AM8/11/17
to KivyPie, tobiask...@gmail.com
Hey,

@Cristóbal Contreras Rubio
I think you miss configured your config.ini.

I already tried it. This is not possible with egl_rpi.
On the other hand, Kivy has a function called minimize in the Window object. So you could minimize your app.

My application is nearly finished. So I wont rewrite it in Qt :-(
In your case, I would try to use Qt or PyQt


Now I recompiled Kivy with x11. It feels slower than sdl2.
I also start a new issue in Github. https://github.com/kivy/kivy/issues/5322

Regards,
Tobias

PS: Sorry for the two posts. I dont know how to edit a old one.

Cristóbal Contreras Rubio

unread,
Aug 12, 2017, 2:50:09 AM8/12/17
to KivyPie, tobiask...@gmail.com


El viernes, 11 de agosto de 2017, 10:54:17 (UTC+2), tobiask...@gmail.com escribió:
Hey,

@Cristóbal Contreras Rubio
I think you miss configured your config.ini.

It could be possible. Thanks for your feedback Toabiask ;-)
 
Reply all
Reply to author
Forward
0 new messages