Buster RPi4B unable to find valuable Window provider from Desktop-less console
See original GitHub issueAfter logging on the Raspberry Pi 4B to the command line (using raspi-config boot to CLI), cannot execute kivy because of critical error when attempting to use any kivy Window provider: egl_rpi, sdl2, pygame, or x11. This issue lists the attempts and results of each of these Window providers. These providers are listed on the following page:
https://kivy.org/doc/stable/guide/environment.html
KIVY_WINDOW Implementation to use for creating the Window Values: sdl2, pygame, x11, egl_rpi
Versions
- Python: 3.7.3
- OS: Raspbian Buster 4.19
- Kivy: 1.11.1
- Kivy installation method: https://github.com/kivy/kivy/issues/6413
Description
The same test.py program listed below was used to test all of the Window providers listed above. The second line is changed for each test results.
import os
#os.environ['KIVY_WINDOW'] = 'egl_rpi'
from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
def build(self):
return Button(text='Hello World')
TestApp().run()
When no (default) KIVY_WINDOW defined (test.py above), gets the following results:
[DEBUG ] [Window ] Provider <egl_rpi> ignored by config
[DEBUG ] [Window ] Provider <sdl2> ignored by config
[DEBUG ] [Window ] Provider <x11> ignored by config
[CRITICAL] [Window ] Unable to find any valuable Window provider.
[CRITICAL] [App ] Unable to get a Window, abort.
After changing line 2 by removing the # sign, got the following results:
[DEBUG ] [Window ] Ignored <egl_rpi> (import error)
[DEBUG ] [Window ] Provider <sdl2> ignored by config
[DEBUG ] [Window ] Provider <x11> ignored by config
[CRITICAL] [Window ] Unable to find any valuable Window provider.
egl_rpi - ImportError: cannot import name 'bcm' from 'kivy.lib.vidcore_lite' (/usr/local/lib/python3.7/dist-packages/kivy/lib/vidcore_lite/__init__.py)
File "/usr/local/lib/python3.7/dist-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/local/lib/python3.7/dist-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
from kivy.lib.vidcore_lite import bcm, egl
[CRITICAL] [App ] Unable to get a Window, abort.
After changing line 2 to os.environ['KIVY_WINDOW'] = 'sdl2'
, got the following results:
[DEBUG ] [Window ] Provider <egl_rpi> ignored by config
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
[DEBUG ] [Window ] Provider <x11> ignored by config
[CRITICAL] [Window ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
sdl2 - RuntimeError: b'Could not initialize EGL'
File "/usr/local/lib/python3.7/dist-packages/kivy/core/__init__.py", line 71, in core_select_lib
cls = cls()
File "/usr/local/lib/python3.7/dist-packages/kivy/core/window/window_sdl2.py", line 152, in __init__
super(WindowSDL, self).__init__()
File "/usr/local/lib/python3.7/dist-packages/kivy/core/window/__init__.py", line 981, in __init__
self.create_window()
File "/usr/local/lib/python3.7/dist-packages/kivy/core/window/window_sdl2.py", line 290, in create_window
self.get_gl_backend_name())
File "kivy/core/window/_window_sdl2.pyx", line 224, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window
File "kivy/core/window/_window_sdl2.pyx", line 74, in kivy.core.window._window_sdl2._WindowSDL2Storage.die
[CRITICAL] [App ] Unable to get a Window, abort.
After changing line 2 to os.environ['KIVY_WINDOW'] = 'pygame'
, got the following results:
[DEBUG ] [Window ] Provider <egl_rpi> ignored by config
[DEBUG ] [Window ] Provider <sdl2> ignored by config
[DEBUG ] [Window ] Provider <x11> ignored by config
[CRITICAL] [Window ] Unable to find any valuable Window provider.
[CRITICAL] [App ] Unable to get a Window, abort.
After changing line 2 to os.environ['KIVY_WINDOW'] = 'x11'
, got the following results:
[DEBUG ] [Window ] Provider <sdl2> ignored by config
[DEBUG ] [Window ] Ignored <x11> (import error)
[CRITICAL] [Window ] Unable to find any valuable Window provider.
x11 - ModuleNotFoundError: No module named 'kivy.core.window.window_x11'
File "/usr/local/lib/python3.7/dist-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
[CRITICAL] [App ] Unable to get a Window, abort.
Issue Analytics
- State:
- Created 4 years ago
- Comments:113 (40 by maintainers)
Here are the instructions on how to install and run a Kivy app at boot on Buster lite:
First install xserver-org, as we need it to show the actual window:
Next I install nodm from source, so it includes the following fix: https://github.com/spanezz/nodm/pull/10:
Now enable graphical login:
Configure nodm and start our app at boot:
Setup a virtual enveriment:
Install Kivy dependencies:
Now it’s time for compiling and installing Kivy. Note that I use my fork with a patch, so it does not use the proprietary Broadcom drivers that are not available on the Raspberry Pi 4 (https://github.com/Lauszus/kivy/commit/9cdcada34a6149b7fd6bd4c57285afc828d69948):
Finally create a small test app:
Now reboot and enjoy 😃
I encountered
failed to add service - already in use?
on buster full, when trying to use theegl_rpi
backend. Fixing it by commenting outdtoverlay=vc4-kms-v3d
in/boot/config.txt
made the error go away, but then kivy didn’t show anything at all.I wonder if it’s the same on buster lite?