Raspberry Pi的触摸屏Kivy应用 [英] Touchscreen Kivy app for Raspberry Pi

查看:127
本文介绍了Raspberry Pi的触摸屏Kivy应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这种情况下:我已经使用python框架 Kivy 编写了一个gui,我想在一个带有此触摸屏的树莓派.我已完成安装,并且TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen FRAMEBUFFER=/dev/fb1 nohup startx &使xwindow桌面gui运行正常.但是,我一直无法使我的kivy gui工作.我能够通过以下方式使测试tkinter应用程序正常运行 设置DISPLAY环境变量.

Here's the scenario: I've written a gui using the python framework Kivy, and I want to run it on a raspberry pi with this touchscreen. I've done the installation fine, and TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen FRAMEBUFFER=/dev/fb1 nohup startx & gets the xwindow desktop gui running fine. I've been unable to get my kivy gui working, though. I was able to get a test tkinter application working ok, by setting the DISPLAY environment variable.

我尝试将以下内容放在我的kivy应用程序的顶部,但无济于事:

I tried putting the following at the top of my kivy app, but to no avail:

os.environ['SDL_VIDEODRIVER'] = 'fbcon'
os.environ['SDL_FBDEV'] = '/dev/fb1'
os.environ['SDL_MOUSEDRV'] = 'TSLIB'
os.environ['SDL_MOUSEDEV'] = '/dev/input/touchscreen'

运行应用程序时,这是调试输出:

When I run my application, this is the debug output:

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_14-04-21_10.txt
[INFO   ] Kivy v1.8.1-dev
[INFO   ] [Python      ] v2.7.3 (default, Mar 18 2014, 05:13:23) 
[GCC 4.6.3]
[INFO   ] [Factory     ] 157 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
[INFO   ] [Text        ] Provider: pygame
[INFO   ] [Loader      ] using a thread pool of 2 workers
[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   ] [GL          ] NPOT texture support is available
[INFO   ] [OSC         ] using <multiprocessing> for socket
[INFO   ] [ProbeSysfs  ] device match: /dev/input/event0
[INFO   ] [HIDInput    ] Read event from </dev/input/event0>
[INFO   ] [Base        ] Start application main loop
[INFO   ] [HIDMotionEvent] using <stmpe-ts>

我对帧缓冲区之类的东西一无所知.我希望有人可以指出正确的方向.看来我提到的上述环境变量对于让pygame应用程序显示很有用,并且kivy是基于pygame构建的.

I don't know much (anything) about framebuffers and such; I'm hoping someone can point me in the right direction. It appears that the above environment variables I mentioned are useful for getting pygame applications to show up, and kivy is built on pygame.

一些链接:

  • 是我现在正在尝试的方法,以防DISPLAY和需要设置一个FBDEV.我还将检查是否已实际安装Directfb或fbcon.
  • 相关的基维Google群组问题
  • 叉子我可以尝试
  • This is something I'm trying right now, in case both DISPLAY and a FBDEV need to be set. I'm also going to check and see if I have directfb or fbcon actually installed.
  • The relevant kivy google group issue
  • A fork I may try

比去年四月晚得多,我很难直接找到任何东西.

I've had a hard time finding anything directly on this much later than April of last year.

任何帮助将不胜感激.预先感谢!

Any help would be greatly appreciated. Thanks in advance!

推荐答案

这将不起作用. SPI屏幕在由您的CPU控制的SPI上起作用: http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

This will not works. SPI screen works on SPI which is controlled by your CPU: http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

请使用Raspberry Pi的GPU,而不是SPI或X11.据我了解,在SPI上显示加速的GLES应用程序是行不通的.

Kivy use the GPU of the Raspberry Pi, not the SPI or X11. As my understanding, displaying an accelerated GLES application on SPI will not work.

即,您可以通过从X11外部的命令行执行任何GLES软件来确认此行为

这篇关于Raspberry Pi的触摸屏Kivy应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆