首页 > 解决方案 > 覆盆子上的kivy opengl分段错误

问题描述

我正在使用 kivy 1.11.0.dev0 在我的 Raspberry3 上开发一个应用程序,一切正常。上周我又买了一个树莓派,从那以后我一直试图让软件在这个树莓派上运行,但没有成功。我在两个系统上都执行了相同的步骤来让 kivy 运行:

我不知道为什么第二个不起作用。两个系统都使用 Raspbian Jessie。

工作的输出:

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_18-11-02_1.txt
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, 
img_gif (img_ffpyplayer ignored)
[INFO   ] [Kivy        ] v1.11.0.dev0, git-0471549, 20180720
[INFO   ] [Python      ] v3.4.2 (default, Oct 19 2014, 13:31:11) 
[GCC 4.9.1]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: egl_rpi
[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>
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[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   ] [Base        ] Start application main loop
[INFO   ] [HIDMotionEvent] using <b'Lenovo Optical USB Mouse\x00 
...

故障的输出(带有 log_level:trace):

[INFO   ] [Logger      ] Record log in /root/.kivy/logs/kivy_18-11-02_9.txt
[INFO   ] [Kivy        ] v1.11.0.dev0, git-ad7ec53, 20181102
[INFO   ] [Python      ] v3.4.2 (default, Oct 19 2014, 13:31:11) 
[GCC 4.9.1]
[INFO   ] [Factory     ] 184 symbols loaded
[DEBUG  ] [Cache       ] register <kv.lang> with limit=None, timeout=None
[TRACE  ] [Lang        ] load file /usr/local/lib/python3.4/dist-packages/kivy/data/style.kv
[TRACE  ] [Parser      ] parsing 1291 lines
[TRACE  ] [Parser      ] got directive <kivy 1.0>
[TRACE  ] [Builder     ] build rule for <Label>
[TRACE  ] [Builder     ] build rule for <-Button,-ToggleButton>
[TRACE  ] [Builder     ] build rule for <BubbleContent>
[TRACE  ] [Builder     ] build rule for <BubbleButton>
[TRACE  ] [Builder     ] build rule for <Slider>
[TRACE  ] [Builder     ] build rule for <ProgressBar>
[TRACE  ] [Builder     ] build rule for <SplitterStrip>
[TRACE  ] [Builder     ] build rule for <Scatter>
[TRACE  ] [Builder     ] build rule for <RelativeLayout>
[TRACE  ] [Builder     ] build rule for <Image,AsyncImage>
[TRACE  ] [Builder     ] build rule for <EffectWidget>
[TRACE  ] [Builder     ] build rule for <TabbedPanelContent>
[TRACE  ] [Builder     ] build rule for <TabbedPanelStrip>
[TRACE  ] [Builder     ] build rule for <StripLayout>
[TRACE  ] [Builder     ] build rule for <TabbedPanelHeader>
[TRACE  ] [Builder     ] build rule for <Selector>
[TRACE  ] [Builder     ] build rule for <TextInput>
[TRACE  ] [Builder     ] build rule for <TextInputCutCopyPaste>
[TRACE  ] [Builder     ] build rule for <CodeInput>
[TRACE  ] [Builder     ] build rule for <TreeViewNode>
[TRACE  ] [Builder     ] build rule for <TreeViewLabel>
[TRACE  ] [Builder     ] build rule for <StencilView>
[TRACE  ] [Builder     ] build rule for <FileChooserListLayout>
[TRACE  ] [Builder     ] build rule for <FileChooserListView>
[TRACE  ] [Builder     ] build template for [FileListEntry@FloatLayout+TreeViewNode]
[TRACE  ] [Builder     ] build rule for <FileChooserIconLayout>
[TRACE  ] [Builder     ] build rule for <FileChooserIconView>
[TRACE  ] [Builder     ] build template for [FileIconEntry@Widget]
[TRACE  ] [Builder     ] build rule for <FileChooserProgress>
[TRACE  ] [Builder     ] build rule for <Switch>
[TRACE  ] [Builder     ] build rule for <ModalView>
[TRACE  ] [Builder     ] build rule for <Popup>
[TRACE  ] [Builder     ] build rule for <SpinnerOption>
[TRACE  ] [Builder     ] build rule for <Spinner>
[TRACE  ] [Builder     ] build rule for <ActionBar>
[TRACE  ] [Builder     ] build rule for <ActionView>
[TRACE  ] [Builder     ] build rule for <ActionSeparator>
[TRACE  ] [Builder     ] build rule for <ActionButton,ActionToggleButton>
[TRACE  ] [Builder     ] build rule for <ActionLabel>
[TRACE  ] [Builder     ] build rule for <ActionGroup>
[TRACE  ] [Builder     ] build rule for <ActionCheck>
[TRACE  ] [Builder     ] build rule for <ActionPreviousImage@Image>
[TRACE  ] [Builder     ] build rule for <ActionPreviousButton@Button>
[TRACE  ] [Builder     ] build rule for <ActionPrevious>
[TRACE  ] [Builder     ] build rule for <ActionGroup>
[TRACE  ] [Builder     ] build rule for <ActionOverflow>
[TRACE  ] [Builder     ] build rule for <ActionDropDown>
[TRACE  ] [Builder     ] build template for [AccordionItemTitle@Label]
[TRACE  ] [Builder     ] build rule for <AccordionItem>
[TRACE  ] [Builder     ] build rule for <SettingSpacer>
[TRACE  ] [Builder     ] build rule for <SettingItem>
[TRACE  ] [Builder     ] build rule for <SettingBoolean>
[TRACE  ] [Builder     ] build rule for <SettingString>
[TRACE  ] [Builder     ] build rule for <SettingPath>
[TRACE  ] [Builder     ] build rule for <SettingOptions>
[TRACE  ] [Builder     ] build rule for <SettingTitle>
[TRACE  ] [Builder     ] build rule for <SettingSidebarLabel>
[TRACE  ] [Builder     ] build rule for <SettingsPanel>
[TRACE  ] [Builder     ] build rule for <Settings>
[TRACE  ] [Builder     ] build rule for <InterfaceWithSidebar>
[TRACE  ] [Builder     ] build rule for <InterfaceWithSpinner>
[TRACE  ] [Builder     ] build rule for <MenuSpinner>
[TRACE  ] [Builder     ] build rule for <MenuSidebar>
[TRACE  ] [Builder     ] build rule for <ContentPanel>
[TRACE  ] [Builder     ] build rule for <InterfaceWithTabbedPanel>
[TRACE  ] [Builder     ] build rule for <ScrollView>
[TRACE  ] [Builder     ] build rule for <VideoPlayerPreview>
[TRACE  ] [Builder     ] build rule for <VideoPlayerAnnotation>
[TRACE  ] [Builder     ] build rule for <VideoPlayer>
[TRACE  ] [Builder     ] build rule for <CheckBox>
[TRACE  ] [Builder     ] build rule for <ScreenManager>
[TRACE  ] [Builder     ] build rule for <ColorPicker_Input@TextInput>
[TRACE  ] [Builder     ] build rule for <ColorPicker_Label@Label>
[TRACE  ] [Builder     ] build rule for <ColorPicker_Selector@BoxLayout>
[TRACE  ] [Builder     ] build rule for <ColorWheel>
[TRACE  ] [Builder     ] build rule for <ColorPicker>
[DEBUG  ] [Cache       ] register <kv.image> with limit=None, timeout=60
[DEBUG  ] [Cache       ] register <kv.atlas> with limit=None, timeout=None
[TRACE  ] [Image       ] Unable to use <gif> as loader!
[TRACE  ] 
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/kivy/core/__init__.py", line 129, in core_register_libs
    level=0)
  File "/usr/local/lib/python3.4/dist-packages/kivy/core/image/img_ffpyplayer.py", line 7, in <module>
    import ffpyplayer
ImportError: No module named 'ffpyplayer'
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[DEBUG  ] [Cache       ] register <kv.texture> with limit=1000, timeout=60
[DEBUG  ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600
[INFO   ] [Text        ] Provider: sdl2
[TRACE  ] [Parser      ] parsing 19 lines
[TRACE  ] [Builder     ] build rule for <-CoverBehavior>
[DEBUG  ] [App         ] Loading kv <./test.kv>
[DEBUG  ] [App         ] kv <./test.kv> not found
[INFO   ] [Window      ] Provider: egl_rpi
[DEBUG  ] [Window      ] Actual display size: 1920x1080
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[DEBUG  ] [GL          ] glActiveTexture is not available
[DEBUG  ] [GL          ] glAttachShader is not available
[DEBUG  ] [GL          ] glBindAttribLocation is not available
[DEBUG  ] [GL          ] glBindBuffer is not available
[DEBUG  ] [GL          ] glBindFramebuffer is not available
[DEBUG  ] [GL          ] glBindRenderbuffer is not available
[DEBUG  ] [GL          ] glBindTexture is not available
[DEBUG  ] [GL          ] glBlendColor is not available
[DEBUG  ] [GL          ] glBlendEquation is not available
[DEBUG  ] [GL          ] glBlendEquationSeparate is not available
[DEBUG  ] [GL          ] glBlendFunc is not available
[DEBUG  ] [GL          ] glBlendFuncSeparate is not available
[DEBUG  ] [GL          ] glBufferData is not available
[DEBUG  ] [GL          ] glBufferSubData is not available
[DEBUG  ] [GL          ] glCheckFramebufferStatus is not available
[DEBUG  ] [GL          ] glClear is not available
[DEBUG  ] [GL          ] glClearColor is not available
[DEBUG  ] [GL          ] glClearStencil is not available
[DEBUG  ] [GL          ] glColorMask is not available
[DEBUG  ] [GL          ] glCompileShader is not available
[DEBUG  ] [GL          ] glCompressedTexImage2D is not available
[DEBUG  ] [GL          ] glCompressedTexSubImage2D is not available
[DEBUG  ] [GL          ] glCopyTexImage2D is not available
[DEBUG  ] [GL          ] glCopyTexSubImage2D is not available
[DEBUG  ] [GL          ] glCreateProgram is not available
[DEBUG  ] [GL          ] glCreateShader is not available
[DEBUG  ] [GL          ] glCullFace is not available
[DEBUG  ] [GL          ] glDeleteBuffers is not available
[DEBUG  ] [GL          ] glDeleteFramebuffers is not available
[DEBUG  ] [GL          ] glDeleteProgram is not available
[DEBUG  ] [GL          ] glDeleteRenderbuffers is not available
[DEBUG  ] [GL          ] glDeleteShader is not available
[DEBUG  ] [GL          ] glDeleteTextures is not available
[DEBUG  ] [GL          ] glDepthFunc is not available
[DEBUG  ] [GL          ] glDepthMask is not available
[DEBUG  ] [GL          ] glDetachShader is not available
[DEBUG  ] [GL          ] glDisable is not available
[DEBUG  ] [GL          ] glDisableVertexAttribArray is not available
[DEBUG  ] [GL          ] glDrawArrays is not available
[DEBUG  ] [GL          ] glDrawElements is not available
[DEBUG  ] [GL          ] glEnable is not available
[DEBUG  ] [GL          ] glEnableVertexAttribArray is not available
[DEBUG  ] [GL          ] glFinish is not available
[DEBUG  ] [GL          ] glFlush is not available
[DEBUG  ] [GL          ] glFramebufferRenderbuffer is not available
[DEBUG  ] [GL          ] glFramebufferTexture2D is not available
[DEBUG  ] [GL          ] glFrontFace is not available
[DEBUG  ] [GL          ] glGenBuffers is not available
[DEBUG  ] [GL          ] glGenerateMipmap is not available
[DEBUG  ] [GL          ] glGenFramebuffers is not available
[DEBUG  ] [GL          ] glGenRenderbuffers is not available
[DEBUG  ] [GL          ] glGenTextures is not available
[DEBUG  ] [GL          ] glGetActiveAttrib is not available
[DEBUG  ] [GL          ] glGetActiveUniform is not available
[DEBUG  ] [GL          ] glGetAttachedShaders is not available
[DEBUG  ] [GL          ] glGetAttribLocation is not available
[DEBUG  ] [GL          ] glGetBooleanv is not available
[DEBUG  ] [GL          ] glGetBufferParameteriv is not available
[DEBUG  ] [GL          ] glGetError is not available
[DEBUG  ] [GL          ] glGetFloatv is not available
[DEBUG  ] [GL          ] glGetFramebufferAttachmentParameteriv is not available
[DEBUG  ] [GL          ] glGetIntegerv is not available
[DEBUG  ] [GL          ] glGetProgramInfoLog is not available
[DEBUG  ] [GL          ] glGetProgramiv is not available
[DEBUG  ] [GL          ] glGetRenderbufferParameteriv is not available
[DEBUG  ] [GL          ] glGetShaderInfoLog is not available
[DEBUG  ] [GL          ] glGetShaderiv is not available
[DEBUG  ] [GL          ] glGetShaderSource is not available
[DEBUG  ] [GL          ] glGetString is not available
[DEBUG  ] [GL          ] glGetTexParameterfv is not available
[DEBUG  ] [GL          ] glGetTexParameteriv is not available
[DEBUG  ] [GL          ] glGetUniformfv is not available
[DEBUG  ] [GL          ] glGetUniformiv is not available
[DEBUG  ] [GL          ] glGetUniformLocation is not available
[DEBUG  ] [GL          ] glGetVertexAttribfv is not available
[DEBUG  ] [GL          ] glGetVertexAttribiv is not available
[DEBUG  ] [GL          ] glHint is not available
[DEBUG  ] [GL          ] glIsBuffer is not available
[DEBUG  ] [GL          ] glIsEnabled is not available
[DEBUG  ] [GL          ] glIsFramebuffer is not available
[DEBUG  ] [GL          ] glIsProgram is not available
[DEBUG  ] [GL          ] glIsRenderbuffer is not available
[DEBUG  ] [GL          ] glIsShader is not available
[DEBUG  ] [GL          ] glIsTexture is not available
[DEBUG  ] [GL          ] glLineWidth is not available
[DEBUG  ] [GL          ] glLinkProgram is not available
[DEBUG  ] [GL          ] glPixelStorei is not available
[DEBUG  ] [GL          ] glPolygonOffset is not available
[DEBUG  ] [GL          ] glReadPixels is not available
[DEBUG  ] [GL          ] glRenderbufferStorage is not available
[DEBUG  ] [GL          ] glSampleCoverage is not available
[DEBUG  ] [GL          ] glScissor is not available
[DEBUG  ] [GL          ] glShaderBinary is not available
[DEBUG  ] [GL          ] glShaderSource is not available
[DEBUG  ] [GL          ] glStencilFunc is not available
[DEBUG  ] [GL          ] glStencilFuncSeparate is not available
[DEBUG  ] [GL          ] glStencilMask is not available
[DEBUG  ] [GL          ] glStencilMaskSeparate is not available
[DEBUG  ] [GL          ] glStencilOp is not available
[DEBUG  ] [GL          ] glStencilOpSeparate is not available
[DEBUG  ] [GL          ] glTexImage2D is not available
[DEBUG  ] [GL          ] glTexParameterf is not available
[DEBUG  ] [GL          ] glTexParameteri is not available
[DEBUG  ] [GL          ] glTexSubImage2D is not available
[DEBUG  ] [GL          ] glUniform1f is not available
[DEBUG  ] [GL          ] glUniform1fv is not available
[DEBUG  ] [GL          ] glUniform1i is not available
[DEBUG  ] [GL          ] glUniform1iv is not available
[DEBUG  ] [GL          ] glUniform2f is not available
[DEBUG  ] [GL          ] glUniform2fv is not available
[DEBUG  ] [GL          ] glUniform2i is not available
[DEBUG  ] [GL          ] glUniform2iv is not available
[DEBUG  ] [GL          ] glUniform3f is not available
[DEBUG  ] [GL          ] glUniform3fv is not available
[DEBUG  ] [GL          ] glUniform3i is not available
[DEBUG  ] [GL          ] glUniform3iv is not available
[DEBUG  ] [GL          ] glUniform4f is not available
[DEBUG  ] [GL          ] glUniform4fv is not available
[DEBUG  ] [GL          ] glUniform4i is not available
[DEBUG  ] [GL          ] glUniform4iv is not available
[DEBUG  ] [GL          ] glUniformMatrix4fv is not available
[DEBUG  ] [GL          ] glUseProgram is not available
[DEBUG  ] [GL          ] glValidateProgram is not available
[DEBUG  ] [GL          ] glVertexAttrib1f is not available
[DEBUG  ] [GL          ] glVertexAttrib2f is not available
[DEBUG  ] [GL          ] glVertexAttrib3f is not available
[DEBUG  ] [GL          ] glVertexAttrib4f is not available
[DEBUG  ] [GL          ] glVertexAttribPointer is not available
[DEBUG  ] [GL          ] glViewport is not available
[INFO   ] [GL          ] Backend used <sdl2>

我也尝试sdl2用作窗口提供程序。它正在工作,但它太滞后了,对我来说似乎不是最好的解决方案。

过了一会儿,在我看来这是一个 OpenGL 问题。更改 raspi-confg 会产生以下结果:

我尝试了很多东西,比如sudo BRANCH=next rpi-update*使用旧图像、新图像、python3.5 等多次更新固件或重新安装所有东西。

从现在开始,我不知道要修复此错误。当然,我可以克隆第一个图像,但我的目标是拥有一个新的、“干净”的图像

编辑

就像在https://github.com/kivy/kivy/issues/6007中讨论的那样,问题是 Raspbian 的新版本/更新。我切换回旧版本,现在运行良好!

另一种解决方案可能是使用

os.environ['KIVY_GL_BACKEND'] = 'gl'

标签: python-3.xopenglkivyraspberry-pi3raspbian

解决方案


推荐阅读