Kivy: Falha de segmentação no Raspberry 3B +

Criado em 22 out. 2018  ·  44Comentários  ·  Fonte: kivy/kivy

Versões

Descrição

Estou tentando executar o demo app_with_kv.py mas sempre mostra um erro segmentation fault . Estou usando a tela TFT daqui .

Código e registros

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_18-10-22_12.txt
[INFO   ] [Kivy        ] v1.11.0.dev0, git-916b77b, 20181022
[INFO   ] [Python      ] v3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516]
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: egl_rpi
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
Segmentation fault
RPi High SDL2 Confirmed

Comentários muito úteis

Teve um problema semelhante com ele. Por alguma razão, sdl2 é chamado em vez de gl para back-end. Não sei se existe uma solução permanente para isso, mas depois de algum tempo tentando encontrar uma solução, a única solução que consegui pensar é adicionar 2 linhas no topo do seu aplicativo, antes de importar o Kivy. Deve ser assim:

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

Espero que ajude. Boa sorte!

PS Se você deseja executar seu aplicativo no Windows, pode querer comentar os.environ['KIVY_GL_BACKEND'] = 'gl' caso contrário, ele não será executado.

Todos 44 comentários

Teve um problema semelhante com ele. Por alguma razão, sdl2 é chamado em vez de gl para back-end. Não sei se existe uma solução permanente para isso, mas depois de algum tempo tentando encontrar uma solução, a única solução que consegui pensar é adicionar 2 linhas no topo do seu aplicativo, antes de importar o Kivy. Deve ser assim:

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

Espero que ajude. Boa sorte!

PS Se você deseja executar seu aplicativo no Windows, pode querer comentar os.environ['KIVY_GL_BACKEND'] = 'gl' caso contrário, ele não será executado.

Estou recebendo o mesmo erro no Zero W. A sugestão do @goadik corrigiu o 3B + para mim, ainda não tentei no Zero.

Também confirmo que a solução do @goadik funciona! E também aponto que, como é um problema de variável de ambiente, você pode simplesmente exportar a variável da seguinte forma:

export KIVY_GL_BACKEND=gl

E então execute o script.

SDL2 é usado para consultar o símbolo dinamicamente.
Seria bom ter um backtrace para entender e corrigir o problema.
Mudar para o back-end GL para rpi pode ser implementado dependendo da plataforma, mas prefiro corrigir o problema de subjacência.

Use gdb --args python main.py , digite r , quando ele travar, faça bt all . Publique as coisas inteiras.

OK. Esta é a saída para gdb --args python main.py :

GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/python3 main.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_18-10-27_0.txt
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Kivy        ] v1.11.0.dev0, git-916b77b, 20181022
[INFO   ] [Python      ] v3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516]
[INFO   ] [Factory     ] 184 symbols loaded
[DEBUG  ] [App         ] Loading kv <./main.kv>
[DEBUG  ] [App         ] kv <./main.kv> not found
[INFO   ] [Window      ] Provider: egl_rpi
[New Thread 0x74758470 (LWP 973)]
[New Thread 0x73dff470 (LWP 974)]
[New Thread 0x735ff470 (LWP 975)]
[New Thread 0x72dff470 (LWP 976)]
[DEBUG  ] [Window      ] Actual display size: 800x480
[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>

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()

Além disso, como bt all lançou um "Sem símbolo" todos "no contexto atual." mensagem, tenho a saída de thread apply all bt , que é a seguinte:

Thread 5 (Thread 0x72dff470 (LWP 976)):
#0  0x76f88014 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, 
    expected=1, futex_word=0x748885ec <cecservice_notify_available_event+24>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x748885ec <cecservice_notify_available_event+24>, 
    abstime=0x0) at sem_waitcommon.c:115
#2  0x76f88158 in __new_sem_wait_slow (
    sem=0x748885ec <cecservice_notify_available_event+24>, abstime=0x0)
    at sem_waitcommon.c:282
#3  0x7486ec44 in cecservice_notify_func () from /opt/vc/lib/libbcm_host.so
#4  0x747d7cc4 in vcos_thread_entry (arg=0x74888600 <cecservice_notify_task>)
    at /home/dc4/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5  0x76f7efc4 in start_thread (arg=0x72dff470) at pthread_create.c:335
#6  0x76e0cbc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
   from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0x735ff470 (LWP 975)):
#0  0x76f88014 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, 
    expected=1, futex_word=0x74887864 <tvservice_notify_available_event+24>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x74887864 <tvservice_notify_available_event+24>, 
    abstime=0x0) at sem_waitcommon.c:115
#2  0x76f88158 in __new_sem_wait_slow (
    sem=0x74887864 <tvservice_notify_available_event+24>, abstime=0x0)
---Type <return> to continue, or q <return> to quit---
    at sem_waitcommon.c:282
#3  0x7486e084 in tvservice_notify_func () from /opt/vc/lib/libbcm_host.so
#4  0x747d7cc4 in vcos_thread_entry (arg=0x74887878 <tvservice_notify_task>)
    at /home/dc4/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5  0x76f7efc4 in start_thread (arg=0x735ff470) at pthread_create.c:335
#6  0x76e0cbc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
   from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0x73dff470 (LWP 974)):
#0  0x76f88014 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, 
    expected=1, futex_word=0x748886e8 <dispmanx_notify_available_event+24>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x748886e8 <dispmanx_notify_available_event+24>, 
    abstime=0x0) at sem_waitcommon.c:115
#2  0x76f88158 in __new_sem_wait_slow (
    sem=0x748886e8 <dispmanx_notify_available_event+24>, abstime=0x0)
    at sem_waitcommon.c:282
#3  0x74872150 in dispmanx_notify_func () from /opt/vc/lib/libbcm_host.so
#4  0x747d7cc4 in vcos_thread_entry (arg=0x74889428 <dispmanx_notify_task>)
    at /home/dc4/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#5  0x76f7efc4 in start_thread (arg=0x73dff470) at pthread_create.c:335
#6  0x76e0cbc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
   from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
---Type <return> to continue, or q <return> to quit---

Thread 2 (Thread 0x74758470 (LWP 973)):
#0  0x76e0580c in ioctl () at ../sysdeps/unix/syscall-template.S:84
#1  0x747f1010 in completion_thread () from /opt/vc/lib/libvchiq_arm.so
#2  0x747d7cc4 in vcos_thread_entry (arg=0x74804318 <vchiq_instance+16>)
    at /home/dc4/projects/staging/userland/interface/vcos/pthreads/vcos_pthreads.c:144
#3  0x76f7efc4 in start_thread (arg=0x74758470) at pthread_create.c:335
#4  0x76e0cbc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
   from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x76ff7010 (LWP 967)):
#0  0x00000000 in ?? ()

#1  0x74bb28d0 in __pyx_pf_4kivy_8graphics_6opengl_138glGetString (
    __pyx_self=<optimized out>, __pyx_v_name=<optimized out>)
    at /tmp/pip-bp1kpwjd-build/kivy/graphics/opengl.c:12436
#2  __pyx_pw_4kivy_8graphics_6opengl_139glGetString (__pyx_self=<optimized out>, 
    __pyx_arg_name=<optimized out>)
    at /tmp/pip-bp1kpwjd-build/kivy/graphics/opengl.c:12415
#3  0x000b1df8 in PyEval_EvalFrameEx ()
#4  0x000b1a7c in PyEval_EvalFrameEx ()
#5  0x000b1a7c in PyEval_EvalFrameEx ()
#6  0x001985c8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

OK, parece que SDL_GL_GetProcAddress não consegue encontrar nada :( agora entendo.
Nosso método para detectar e carregar opengl está vinculado ao provedor do Windows usado.
Mas, neste caso, egl_rpi é usado, não SDL2, portanto, a função SDL2 não funcionará.

Requer uma correção, obrigado por relatar!

Não tenho certeza se é relevante adicionar aqui, mas acho que tem algo a ver com a nova versão do Raspbian. Experimentei o mais antigo (tenho uma imagem) e funcionou perfeitamente.

O problema com a falha de segmentação no início do aplicativo pode ser corrigido com uma variável de ambiente, mas também, ele trava com a mesma falha de segmentação toda vez que carrego o gráfico com muitos dados para mostrar.

O problema com o GDB é que se eu tentar usá-lo assim gdb --args python main.py e replicar o travamento, o RPI congela e a única coisa que resta a fazer neste ponto é reiniciá-lo. Quando eu verifico os logs, eles estão vazios.

Queria adicioná-lo aqui.

Eu tive o mesmo problema e como @goadik disse que pode ser um bug da nova versão do raspbian porque na minha imagem mais antiga (Raspberry3, kivy v1.11.0.dev0, python v3.4.2) o aplicativo kivy está funcionando bem. Meu problema está descrito aqui: https://stackoverflow.com/questions/53122908/kivy-opengl-segmentation-fault-on-raspberry

@krrrambambuli

na minha imagem mais antiga (Raspberry3, kivy v1.11.0.dev0, python v3.4.2), o aplicativo kivy está funcionando bem

Então, por que você não usa a imagem mais antiga?

RPi Devs são notórios por lançar novas "atualizações" que estão quebrando todos os tipos de coisas. Tive tantas experiências desagradáveis ​​com isso, que desativei completamente todas as atualizações relacionadas ao sistema operacional provenientes da RPi org.

@ E3V3A

Então, por que você não usa a imagem mais antiga?

Porque eu tinha um RPI que já estava configurado com a última atualização do raspbian. E eu estava me perguntando por que kivy não está correndo, embora eu estivesse fazendo exatamente as mesmas coisas de antes. Agora mudei para a imagem antiga e está funcionando bem!

A partir de agora, vou cuidar de atualizações rápidas;)

Talvez totalmente não relacionado, mas a menos que eu esteja errado: Kivy depende de SDL2 e SDL2 depende de cffi e / ou Cairo, e cffi é difícil de construir independente da arquitetura. Mas me deparei com o seguinte pacote pip, talvez tente isso?

# pip3 search cairocffi 
cairotft (0.1.2)   - UI library for small tft screens using cairocffi

@ E3V3A
Já mudei para a imagem antiga. Talvez seja bom saber para o futuro

Posso perguntar qual imagem você está usando e onde posso encontrá-la? Estou usando Rpi 3 B + e kivy 1.11.0.dev0, que imagem devo usar?

@ E3V3A
Já mudei para a imagem antiga. Talvez seja bom saber para o futuro

Estou usando o raspbian jessie, atualizado pela última vez em 18/11/18 sem atualizações. Rpi3, Kivy v1.10.1 e Python 3.4.2
Meu Log:

[INFO] Registrador: Registre o login em /home/pi/.kivy/logs/kivy_18-11-14_11.txt
[INFO] Kivy: v1.10.1
[INFO] Python: v3.4.2 (padrão, 19 de outubro de 2014, 13:31:11)
[GCC 4.9.1]
[INFO] KivyMD: versão KivyMD: 0.1.2
[INFO] Fábrica: 194 símbolos carregados
[INFO] Imagem: Provedores: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignorado)
Janela [INFO]: Provedor: egl_rpi
[INFO] GL: Usando o sistema gráfico "OpenGL ES 2"
[INFO] GL: Back-end usado
[INFO] GL: versão OpenGL [INFO] GL: Fornecedor OpenGL [INFO] GL: renderizador OpenGL
[INFO] GL: Versão analisada OpenGL: 2, 0
[INFO] GL: Versão sombreada
[INFO] GL: Tamanho máximo da textura <2048>
[INFO] GL: Unidades máximas de textura <8>
Janela [INFO]: teclado virtual permitido, modo multiusuário, não encaixado
[INFO] Texto: Provedor: sdl2
[INFO] GL: Suporte para textura NPOT está disponível
[INFO] Área de transferência: Provedor: xclip
[INFO] CutBuffer: suporte a buffer de corte habilitado
[INFO] ProbeSysfs: correspondência de dispositivo: / dev / input / event0
...

Obrigado, tive o mesmo problema.
exportar KIVY_GL_BACKEND = gl
consertou.

tem exatamente o mesmo problema no raspberry pi 3b + ..é possível instalar o kivy no núcleo do Ubuntu ou qualquer outro sistema operacional compatível com o raspberry pi 3b +?

também qual imagem Raspbian devo usar em raspberry pi 3b + para fazer o kivy funcionar

este problema não foi corrigido
usando o sistema operacional de importação
os.environ ['KIVY_GL_BACKEND'] = 'gl'
import kivy
é apenas uma solução temporária

Ainda não foi mencionado neste tópico, mas pode ser pertinente se alguém tem a versão Lite ou PIXEL do Raspbian.

screen shot 2018-12-17 at 8 34 11 am

sdl2 inclui uma dependência do X windows e o Raspbian Lite obviamente não inclui isso.

Posso confirmar que esgueirando ...

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

... no início do meu script Python faz o aplicativo "Hello, Button" funcionar. Estou na versão Stretch Lite.

Qual versão do raspbian devo usar para não ter esse problema?
Tentei fazer o donwngrade do meu sistema operacional para Raspbian Jessie 8.0, mas tenho a mesma falha de seg ...

Qual versão do raspbian devo usar para não ter esse problema?
Tentei fazer o donwngrade do meu sistema operacional para Raspbian Jessie 8.0, mas tenho a mesma falha de seg ...

O mesmo problema aqui com um framboesa pi 3b +:

Programa inicial: / usr / bin / python3 /home/pi/sorbito/main.py
[Thread de depuração usando libthread_db habilitado]
Usando a biblioteca libthread_db do host "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[INFO] [Logger] Registro de login em /home/pi/.kivy/logs/kivy_19-02-13_3.txt
[INFO] [Kivy] v1.11.0.dev0, git-233cdd1, 20190212
[INFO] [Python] v3.5.3 (padrão, 27 de setembro de 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO] [Fábrica] 184 símbolos carregados
[INFO] [Imagem] Provedores: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignorado)
[INFO] [Texto] Provedor: sdl2
Provedor [INFO] [Window]: egl_rpi
[Novo Tópico 0x747ff470 (LWP 2420)]
[Novo Tópico 0x73dff470 (LWP 2421)]
[Novo Tópico 0x735ff470 (LWP 2422)]
[Novo tópico 0x72dff470 (LWP 2423)]
[INFO] [GL] Usando o sistema gráfico "OpenGL ES 2"
[INFO] [GL] Back-end usado

Thread 1 "python3" recebeu sinal SIGSEGV, falha de segmentação.
0x00000000 em ?? ()

Registro:
[INFO] Registrador: Registre o login em /home/pi/.kivy/logs/kivy_19-02-13_3.txt
[INFO] Kivy: v1.11.0.dev0, git-233cdd1, 20190212
[INFO] Python: v3.5.3 (padrão, 27 de setembro de 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO] Fábrica: 184 símbolos carregados
[INFO] Imagem: Provedores: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignorado)
[INFO] Texto: Provedor: sdl2
Janela [INFO]: Provedor: egl_rpi
[INFO] GL: Usando o sistema gráfico "OpenGL ES 2"
[INFO] GL: Back-end usado

Ainda não há solução para isso?

os.environ ['KIVY_GL_BACKEND'] = 'gl'não ajuda em nada com v1.11.0.dev0, git-9ebad2d, 20190516

Obtendo: [CRITICAL] [App] Incapaz de obter uma janela, aborte

E com uma versão mais antiga como 1.10.1 eu não recebo nenhum suporte PNG transparente ... todos os PNGs transparentes são desenhados com um fundo preto ... o mesmo código funciona bem no Debian 9 ...

Então RPi Stretch-Lite nunca mais terá suporte?

Leia meu último comentário neste tópico. Ele funciona para mim no Raspbian Stretch Lite (novembro de 2018) e meu 1.10.1 _não_ suporta os cerca de cem gráficos PNG que estou usando com fundos transparentes.

Confirmar uma compilação usando o estável mais recente (1.11.0) em uma instalação stretch-lite totalmente atualizada em qualquer RPI causa essa falha de segmentação. Deve construir o stable-1.10.1 para rodar em um RPI. Não sei por que você lançaria um estável que teve esse problema em uma plataforma principal por mais de 6 meses.

Também estou tendo esse problema no raspberry 3 B +, no raspbian lite

Uma boa solução agora é certificar-se de que Pillow está instalado e, em seguida, execute o kivy com KIVY_WINDOW=sdl2 . Não há necessidade de definir o backend gl neste caso, pois sdl2 será usado. Se você quiser usar o provedor de janela egl_rpi , então o back-end gl precisa ser definido.

Isso definitivamente se qualifica como um bug de regressão. Instalando no RPI 3B + como

pip install git+https://github.com/kivy/[email protected]

renderiza na falha de segmentação, enquanto

pip install git+https://github.com/kivy/[email protected]

Funciona como um encanto.

Estou planejando consertar no pós-lançamento.

Na quarta-feira, 12 de junho de 2019, 13:11 RafalSkolasinski [email protected]
escreveu:

Isso definitivamente se qualifica como bug de regressão. Instalando no RPI 3B + como

pip install git + https://github.com/kivy/[email protected]

renderiza na falha de segmentação, enquanto

pip install git + https://github.com/kivy/[email protected]

Funciona como um encanto.

-
Você está recebendo isto porque comentou.
Responda a este e-mail diretamente, visualize-o no GitHub
https://github.com/kivy/kivy/issues/6007?email_source=notifications&email_token=AAMRN7T3A2SZJ5OE4QQ63NDP2EU2XA5CNFSM4F6QJQM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXREWFA#issuecomment-501369620 ,
ou silenciar o tópico
https://github.com/notifications/unsubscribe-auth/AAMRN7XWDPCYLGW5QREDN3DP2EU2XANCNFSM4F6QJQMQ
.

Você pode testar https://github.com/kivy/kivy/pull/6384 ? Isso deve corrigi-lo e também permitir que você use qualquer um dos três back-ends quando selecionado manualmente (egl_rpi, sdl2 e x11 se compilado).

Posso testar mais tarde hoje ou amanhã.

Na quinta-feira, 13 de junho de 2019, 22:52 matham, [email protected] escreveu:

Você pode testar # 6384 https://github.com/kivy/kivy/pull/6384 ? Isto deveria
consertá-lo e também permitir que você use qualquer um dos três back-ends quando selecionado
manualmente (egl_rpi, sdl2 e x11 se compilado).

-
Você está recebendo isto porque comentou.
Responda a este e-mail diretamente, visualize-o no GitHub
https://github.com/kivy/kivy/issues/6007?email_source=notifications&email_token=ACTL75LVT74IBQJQ4W5QARTP2K6RXA5CNFSM4F6QJQM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXVEJXA#issuecomment-501892316 ,
ou silenciar o tópico
https://github.com/notifications/unsubscribe-auth/ACTL75OGYIBPXEVW33B57KLP2K6RXANCNFSM4F6QJQMQ
.

6384 Corrige para mim usando egl_rpi no raspbian-lite, nenhuma exportação necessária.

[INFO] Registrador: Registre o login em /home/pi/.kivy/logs/kivy_19-06-14_1.txt
[INFO] Imagem: Provedores: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignorado)
[INFO] Kivy: v2.0.0.dev0, git-dccba95, 20190614
[INFO] Kivy: Instalado em "/home/pi/Stuff/kivy-fix/kivy/__init__.py"
[INFO] Python: v3.5.3 (padrão, 27 de setembro de 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO] Python: intérprete em "/ usr / bin / python3"
[INFO] Fábrica: 184 símbolos carregados
[INFO] Texto: Provedor: sdl2
Janela [INFO]: Provedor: egl_rpi
[INFO] GL: Usando o sistema gráfico "OpenGL ES 2"
[INFO] GL: Back-end usado
[INFO] GL: versão OpenGL [INFO] GL: Fornecedor OpenGL [INFO] GL: renderizador OpenGL
[INFO] GL: Versão analisada OpenGL: 2, 0
[INFO] GL: Sombreamento v

Sim, funciona.
Inicialmente tive um problema e encontrei alguns erros

[CRITICAL] [Window      ] Unable to find any valuable Window provider.

mas depois de adicionar pillow começou a funcionar.
Acho que pillow são novas dependências adicionadas em 1.11 ?

editar:
Essa correção será lançada em 1.11.1 ? eu vejo

[INFO ] Kivy: v2.0.0.dev0, git-dccba95, 20190614

em logs.

Isso será escolhido a dedo em um lançamento posterior de 1.11.0.post0 (https://github.com/kivy/kivy/pull/6357). Desta forma, as pessoas que visam 1.11.0 durante a instalação obterão automaticamente a versão corrigida (assumindo que o pip faz a coisa certa aqui e instala 1.11.0.post0 quando 1.11.0 é solicitado).

Normalmente, eu iria para 1.11.1, mas isso não funciona muito bem com nosso fluxo de trabalho, dado o nosso salto para 2.0.0 e o próximo lançamento quebrando coisas como o suporte a python 2. Este lançamento deve acontecer muito em breve.

Quanto ao travesseiro, não tenho certeza do que está acontecendo. sdl2_image deveria ter funcionado (acho que funcionou no passado?), Mas por algum motivo não foi possível carregar a imagem. Acho que precisaria ser mais solucionado (PRs bem-vindos). Em qualquer caso, atualizei os documentos para listar o travesseiro como dependência.

Eu escolheria 1.11.1, pois fica claro que uma correção de bug está incluída. Vamos
espero que o pip estejamos fazendo a coisa certa.

Na sexta-feira, 14 de junho de 2019, 17:11 matham, [email protected] escreveu:

Isso será escolhido a dedo em uma pós-lançamento de 1.11.0.post0 (# 6357
https://github.com/kivy/kivy/pull/6357 ). Desta forma, as pessoas que visam
1.11.0 durante a instalação obterá automaticamente a versão corrigida (assumindo
pip faz a coisa certa aqui e instala 1.11.0.post0 quando 1.11.0 é
Requeridos).

Normalmente, eu iria para 1.11.1, mas isso não funciona muito bem com nosso
fluxo de trabalho, dado o nosso salto para 2.0.0 e a próxima versão quebrando coisas como
como suporte a python 2. Este lançamento deve acontecer muito em breve.

Quanto ao travesseiro, não tenho certeza do que está acontecendo. sdl2_image deveria ter funcionado
(Acho que funcionou no passado?), Mas por algum motivo não consegue carregar
a imagem. Acho que precisaria ser mais solucionado (PRs bem-vindos). No
de qualquer forma, atualizei a documentação para listar o travesseiro como dependência.

-
Você está recebendo isto porque está inscrito neste tópico.
Responda a este e-mail diretamente, visualize-o no GitHub
https://github.com/kivy/kivy/issues/6007?email_source=notifications&email_token=ACTL75LMHH3Q2FDKYW4HTUTP2O7LDA5CNFSM4F6QJQM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXXH4HQ#issuecomment-502169118 ,
ou silenciar o tópico
https://github.com/notifications/unsubscribe-auth/ACTL75NBY6O6KBPR4QT3LPDP2O7LDANCNFSM4F6QJQMQ
.

Se você pedir 1.11.0 , pip provavelmente não instalará 1.11.1 , mas 1.11.0 exatamente. Não tenho certeza do que faria se pedíssemos 1.11 ,

Oh, eu quis dizer que ele irá instalar o patch ".post0" quando pedirmos "1.11.0" :)

Na sexta-feira, 14 de junho de 2019, 19:29 matham, [email protected] escreveu:

Se você solicitar 1.11.0, o pip provavelmente não instalará 1.11.1, mas 1.11.0
exatamente. Não tenho certeza do que faria se pedíssemos 1.11,

-
Você está recebendo isto porque está inscrito neste tópico.
Responda a este e-mail diretamente, visualize-o no GitHub
https://github.com/kivy/kivy/issues/6007?email_source=notifications&email_token=ACTL75JZDOPPHORTC3LEVZTP2PPPNA5CNFSM4F6QJQM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXXTMNI#issuecomment-502216245 ,
ou silenciar o tópico
https://github.com/notifications/unsubscribe-auth/ACTL75KC3BTJGUQTTBMAHLDP2PPPNANCNFSM4F6QJQMQ
.

conforme discutido acima, adicionei export KIVY_GL_BACKEND=gl ao caminho e agora estou recebendo outro problema que diz ...
create_window() takes 1 positional argument but 2 were given

por favor me ajude a sair desse erro.
quando executo meu código no raspberry pi

sudo python3 main.py
[AVISO] [Config] Versão de configuração mais antiga detectada (0 em vez de 14)
[AVISO] [Config] Atualizando a configuração em andamento.
[INFO] [Logger] Registro de login em /root/.kivy/logs/kivy_19-06-17_0.txt
[INFO] [Kivy] v1.9.1
[INFO] [Python] v3.5.3 (padrão, 27 de setembro de 2018, 17:25:39)
[GCC 6.3.0 20170516]
[INFO] [Fábrica] 179 símbolos carregados
[INFO] [Imagem] Provedores: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignorado)
[INFO] [Texto] Provedor: sdl2
[INFO] [OSC] usandopara soquete
Provedor [INFO] [Window]: sdl2 (['window_egl_rpi'] ignorado)
erro: XDG_RUNTIME_DIR não definido no ambiente.
[CRÍTICO] [Janela] Impossível encontrar qualquer provedor de janela valioso!
egl_rpi - ImportError: não é possível importar o nome 'bcm'
Arquivo "/usr/lib/python3/dist-packages/kivy/core/__init__.py", linha 59, em core_select_lib
fromlist = [modulename], level = 0)
Arquivo "/usr/lib/python3/dist-packages/kivy/core/window/window_egl_rpi.py", linha 12, em
de kivy.lib.vidcore_lite import bcm, egl

sdl2 - RuntimeError: b'Nenhum dispositivo de vídeo disponível '
Arquivo "/usr/lib/python3/dist-packages/kivy/core/__init__.py", linha 67, em core_select_lib
cls = cls ()
Arquivo "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", linha 138, em __init__
super (WindowSDL, self) .__ init __ ()
Arquivo "/usr/lib/python3/dist-packages/kivy/core/window/__init__.py", linha 722, em __init__
self.create_window ()
Arquivo "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", linha 237, em create_window
self.fullscreen, redimensionável, estado)
Arquivo "kivy / core / window / _window_sdl2.pyx", linha 80, em kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window (kivy / core / window / _window_sdl2.c: 1893)
Arquivo "kivy / core / window / _window_sdl2.pyx", linha 55, em kivy.core.window._window_sdl2._WindowSDL2Storage.die (kivy / core / window / _window_sdl2.c: 1479)

x11 - ImportError: Nenhum módulo denominado 'kivy.core.window.window_x11'
Arquivo "/usr/lib/python3/dist-packages/kivy/core/__init__.py", linha 59, em core_select_lib
fromlist = [modulename], level = 0)

[CRITICAL] [App] Incapaz de obter uma janela, aborte.
Exceção ignorada em: 'kivy.properties.dpi2px'
Traceback (última chamada mais recente):
Arquivo "/usr/lib/python3/dist-packages/kivy/utils.py", linha 513, em __get__
retval = self.func (inst)
Arquivo "/usr/lib/python3/dist-packages/kivy/metrics.py", linha 175, em dpi
EventLoop.ensure_window ()
Arquivo "/usr/lib/python3/dist-packages/kivy/base.py", linha 126, em verify_window
sys.exit (1)
Sair do sistema: 1
[CRITICAL] [App] Incapaz de obter uma janela, aborte.

Alguém, por favor me diga o que devo fazer.

@ jayeshsingh9767 você tentou com o master ou a última versão? Isso foi corrigido no master, mas ainda não fizemos uma nova versão que inclua a correção.

@ harshp1301 este erro não está relacionado a este problema. Isso também parece ser um problema com o seu sistema e não com o kivy. Para suporte, por favor, pergunte no discord.

@matham Obrigado, mas o problema foi corrigido quando removi Window.size() do meu código.
Acho que não podemos gerenciar o app kivy Window no Raspberry pi .... Mas alguém poderia me explicar por quê?
Nota: Wimdow.size() estava funcionando perfeitamente no Ubuntu ...

Isso não está relacionado a este problema, então talvez abra um novo problema para isso (se não houver um)? Mas talvez isso não seja possível com o backend da janela egl_rpi. Eu tentaria com o back-end sdl2 ou back-end de janela x11 (acho que ambos são redimensionáveis ​​mesmo no pi).

Tive problemas semelhantes com o sistema operacional raspbian real (2020-05-27) -> após o primeiro carregamento, obtive uma falha de segmentação. Então tentei mudar para 'gl'. Depois disso, obtive uma tela e um cursor preto sem nenhum conteúdo da minha GUI.
Se eu voltasse para uma lite anterior de framboesa, ela funcionaria com o Kivy 1.11.1. Na verdade eu não sei exatamente qual é a diferença. Parece que existem algumas atualizações que causam esse problema (libs, firmware ...?). Felizmente, fiz backup do cartão SD antigo e restaurei-o para minha GUI realmente usada.
Decidi usar o Kivy porque não preciso instalar o X11. Minha GUI está sendo executada no console ...

@AndreasPantle Estou tendo a mesma experiência com 1.11.1 e Raspberry PI OS (renomeado Raspbian). Vou dar uma olhada em 1.10.1 e ver o que acontece. kivy é uma dependência do controlador de mídia Mission Pinball, portanto, pode não ter a opção de inverter a versão.

Esta página foi útil?
0 / 5 - 0 avaliações
bleepcoder.com usa informações licenciadas publicamente pela GitHub para fornecer aos desenvolvedores em todo o mundo soluções para seus problemas. Não somos afiliados à GitHub, Inc. nem a nenhum desenvolvedor que utilize GitHub para seus projetos. Nós não hospedamos nenhum dos vídeos ou imagens em nossos servidores. Todos os direitos pertencem a seus respectivos proprietários.
Fonte para esta página: Fonte

Linguagens de programação populares
Projetos populares do GitHub
Mais projetos GitHub

© 2024 bleepcoder.com - Contact
Made with in the Dominican Republic.
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.