2

在我的 Raspberry Pi 上运行 Kivy 应用程序会得到如下输出:

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_16-04-26_23.txt
[INFO   ] [Kivy        ] v1.9.2-dev0
[INFO   ] [Python      ] v2.7.9 (default, Mar  8 2015, 00:52:26)
[GCC 4.9.2]
[INFO   ] [Factory     ] 193 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: pygame
[INFO   ] [Window      ] Provider: egl_rpi
[INFO   ] [GL          ] OpenGL version <OpenGL ES 2.0>
[INFO   ] [GL          ] OpenGL vendor <Broadcom>
[INFO   ] [GL          ] OpenGL renderer <VideoCore IV HW>
[INFO   ] [GL          ] OpenGL parsed version: 2, 0
[INFO   ] [GL          ] Shading version <OpenGL ES GLSL ES 1.00>
[INFO   ] [GL          ] Texture max size <2048>
[INFO   ] [GL          ] Texture max units <8>
[INFO   ] [Shader      ] fragment shader: <Compiled>
[INFO   ] [Shader      ] vertex shader: <Compiled>
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [OSC         ] using <multiprocessing> for socket
[INFO   ] [Base        ] Start application main loop
[INFO   ] [GL          ] NPOT texture support is available

但是,没有窗口启动。注意Provider: egl_rpi.

在我的 Windows Kivy 中,Provider 是 SDL2。此外,我可以使用 SDL 作为 Raspberry Pi 上的提供程序来启动示例 mp3 视频,其中包括:

sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 mplayer -vo sdl -framedrop test.mpg

我的问题是:如何将 Pi 上 Kivy 的 Provider 更改为 SDL2?

4

1 回答 1

2

将以下代码行添加到 Python 文件的顶部应将提供程序切换到 sdl2

import os
os.environ['KIVY_WINDOW'] = 'sdl2'

参考:这里

我和你有同样的问题,没有显示窗口egl_rpi。我切换到SDL2但应用程序无法加载。我相信这是由于我的 3.5" SPI 显示器的自定义驱动程序。也许您的视频驱动程序会更好。

于 2017-02-04T17:30:40.357 回答