Reputation: 349
I have recently installed Kivy on a Raspberry Pi (with Raspbian system), following the instructions on the Kivy website.
I meant to test a program I wrote. It worked fine on my Linux Mint computer. However, on Raspbian it crashed with a weird error linking to one of Kivy's own functions.
Here's the terminal output:
$ python main.py
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_15-01-10_6.txt
[INFO ] Kivy v1.9.0-dev
[INFO ] [Python ] v2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3]
[INFO ] [Factory ] 173 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_pygame (img_pil, img_ffpyplayer ignored)
[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 ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [ProbeSysfs ] device match: /dev/input/event2
[INFO ] [HIDInput ] Read event from </dev/input/event2>
[INFO ] [Base ] Start application main loop
[INFO ] [HIDMotionEvent] using <CHESEN USB Keyboard>
[INFO ] [HIDMotionEvent] using <CHESEN USB Keyboard>
[INFO ] [HIDMotionEvent] using <PixArt USB Optical Mouse>
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "main.py", line 145, in <module>
MainApp().run()
File "/usr/local/lib/python2.7/dist-packages/kivy/app.py", line 825, in run
runTouchApp()
File "/usr/local/lib/python2.7/dist-packages/kivy/base.py", line 484, in runTouchApp
EventLoop.window.mainloop()
File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/window_egl_rpi.py", line 77, in mainloop
self._mainloop()
File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/window_egl_rpi.py", line 72, in _mainloop
EventLoop.idle()
File "/usr/local/lib/python2.7/dist-packages/kivy/base.py", line 324, in idle
Clock.tick()
File "/usr/local/lib/python2.7/dist-packages/kivy/clock.py", line 483, in tick
self._process_events()
File "/usr/local/lib/python2.7/dist-packages/kivy/clock.py", line 615, in _process_events
event.tick(self._last_tick, remove)
File "/usr/local/lib/python2.7/dist-packages/kivy/clock.py", line 374, in tick
ret = callback(self._dt)
TypeError: create_window() takes exactly 1 argument (2 given)
Just as a wild guess, to see how it will work, I tried to edit Kivy's "create_window()" function, located inside "/usr/local/lib/python2.7/dist-packages/kivy/core/window/window_egl_rpi.py", by adding an optional argument to its declaration. Running my program again produced some sort of segmentation error instead, and so I stopped messing with Kivy's code...
Any idea how to fix the error hinted in this log? (MainApp().run() is the very beginning of my program, and everything else is Kivy functions, apparently called automatically by this command)
Upvotes: 1
Views: 2107
Reputation: 51
I was experiencing the same error, with the same scenario - my program runs fine on a Windows machine, yet crashes with the same error on RPi. In my case, I am running an updated Python version - 2.7.9.
It appears that the Window.size assignment is the source of the crash:
class MainApp(App):
def build(self):
Window.size = (1280,800) # <---- Crashes on RPi
Removing this assignment fixed the program.
Upvotes: 5