Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buster RPi4B unable to find valuable Window provider from Desktop-less console #6474

Closed
frankgould opened this issue Aug 15, 2019 · 113 comments · Fixed by #6568
Closed

Buster RPi4B unable to find valuable Window provider from Desktop-less console #6474

frankgould opened this issue Aug 15, 2019 · 113 comments · Fixed by #6568

Comments

@frankgould
Copy link

After 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

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.
@somber02
Copy link

same behavior found in RPi 4B: 1G version. Previously, I saw in other SBC forum, to use sdl2 window provider, needs to recompile the sdl2 with KMS support. Not sure if this will be helpful.
Tinker Board: https://groups.google.com/forum/m/#!topic/kivy-users/jwBnYxe969g
Jetson Nano:
https://devtalk.nvidia.com/default/topic/1057120/kivy-app-fails-on-jetson-nano-/

@OutsourcedGuru
Copy link

Likewise, I spent three days of testing, attempting to find a viable Raspbian Lite configuration which would display a GUI on the SunFounder 10" touchscreen (reasonably compatible with the standard Raspberry Pi Foundation display) on a Raspberry Pi 4B with 4GB RAM.

Error condition: Kivy app crash (unresponsive) requiring a kill from another session
Error message: "failed to add service - already in use?" (seen after subsequent attempts)
Error: No GUI output (when using Legacy KMS option) immediately after boot but seemingly-happy log output

@frankgould
Copy link
Author

Well, I've already had problems with HDMI not functioning properly due to the new dual micro-HDMI ports. I have not tested the 7" Official Touchscreen with the 4B models and can imagine there is problems with that. I've reported the micro-HDMI issue. Good luck with the DSI.

@matham
Copy link
Member

matham commented Aug 19, 2019

I encountered failed to add service - already in use? on buster full, when trying to use the egl_rpi backend. Fixing it by commenting out dtoverlay=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?

@Gawezi
Copy link

Gawezi commented Aug 20, 2019

I encountered failed to add service - already in use? on buster full, when trying to use the egl_rpi backend. Fixing it by commenting out dtoverlay=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?

Had same problem but now got. Just disabled openGL in raspi-config
x11 - ImportError: No module named window_x11
File "/home/pi/project/venv/local/lib/python2.7/site-packages/kivy/core/init.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
Using raspbian buster, python2.7, virtualenv and kivy 1.10.1.

@matham
Copy link
Member

matham commented Aug 20, 2019

@Gawezi You need to set kivy to use the egl_rpi window, not x11 by setting KIVY_WINDOW=egl_rpi. If you did mean to run x11, then make sure to compile kivy with x11 support at installation time (USE_X11=1).

@masynthetic
Copy link

Having the same/similar issue on Pi 3B running Buster on #6418 thank you for posting your progress and i'm really hoping the solution comes soon!

@frankgould
Copy link
Author

@matham Can you elaborate where to set USE_X11=1? I think this is my problem with both Buster and ALARM (haven’t tested this same issue from console boot without desktop). I’ve been trying to run kivy without desktop and think that’s my problem. I need to compile kivy with x11 support as you say.

@rnixx
Copy link
Member

rnixx commented Aug 22, 2019

@frankgould export VIDEOCOREMESA=1 environment variable before compiling kivy (fa9932d)

Otherwise it will always compile against proprietary drivers on rpi.
Further you must install x11 and start a session and start the kivy app inside the x11 session.
You can use a minimal window manager like i3wm which make things simpler.

@frankgould
Copy link
Author

@rnixx Thanks for the info. I’ll take a shot at that today.

@frankgould frankgould changed the title Buster RPi4B unable to find valuable Window provider from CLI Buster RPi4B unable to find valuable Window provider from Desktop-less console Aug 22, 2019
@matham
Copy link
Member

matham commented Aug 22, 2019

USE_X11=1 needs to be in the environment when you compile kivy.

However, that is not likely to fix your issues of running kivy without desktop because if you run without desktop I'm guessing you're running without x support in the OS, so having x support in kivy won't help.

Only egl_rpi is supposed to work without x support afaik.

@frankgould
Copy link
Author

frankgould commented Aug 22, 2019

Thanks @matham. I added that key=Val combo in /etc/environment along with KIVY_GRAPHICS=“gles” and VIDEOCOREMESA=1 but none worked without the desktop. It could not open a window. I need to go dig into an older RPi3A+ to see how I installed it to get it to run without a desktop on ALARM.

Update: The above test were on ALARM 4.19, not Buster. So, this comment is outside this thread but relevant. I will be testing this on Buster next.

@frankgould
Copy link
Author

Today I tested RPi4B:4GB Raspbian 4.19 kivy installed with the following /etc/environment contents:

USE_X11=1
VIDEOCOREMESA=1
KIVY_GRAPHICS="gles"

Here is the results of the run using default environment values:

pi@SlideShowPi:~/SlideShow $ python3 test.py
[INFO   ] [Logger      ] Record log in /home/pi/.masterpics/logs/SlideShowPi_19-08-23_15.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/usr/local/lib/python3.7/dist-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.2.0]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python3"
[INFO   ] [Factory     ] 184 symbols loaded
[DEBUG  ] [Cache       ] register <kv.lang> with limit=None, timeout=None
[DEBUG  ] [Cache       ] register <kv.image> with limit=None, timeout=60
[DEBUG  ] [Cache       ] register <kv.atlas> with limit=None, timeout=None
[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
[DEBUG  ] [Text        ] Provider <pango> ignored by config
[INFO   ] [Text        ] Provider: sdl2(['text_pango'] ignored)
[DEBUG  ] [App         ] Loading kv <./test.kv>
[DEBUG  ] [App         ] kv <./test.kv> not found
[DEBUG  ] [Window      ] Ignored <egl_rpi> (import error)
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[DEBUG  ] [Window      ] Ignored <x11> (import error)
[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
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

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

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.

@OutsourcedGuru
Copy link

  • Raspberry Pi 4B with 4GB
  • Raspbian Buster Lite 7-10-2019
  • Kivy 1.11.1
  • Python 3.7.3
  • SunFounder 10.1" capacitive TFT display

I'm getting a segmentation fault on my rig.

gdb --args python3 test.py # then press 'r' to run it

GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 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 test.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_19-08-23_16.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/usr/local/lib/python3.7/dist-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.2.0]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python3"
[Detaching after fork from child process 3301]
[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(['text_pango'] ignored)
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[New Thread 0xb4171460 (LWP 3302)]
[New Thread 0xb37ff460 (LWP 3303)]
[New Thread 0xb2ffe460 (LWP 3304)]
[New Thread 0xb27fd460 (LWP 3305)]
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <gl>

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0xb6fbc1dc in strlen () from /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so

@frankgould
Copy link
Author

frankgould commented Aug 24, 2019

I think I found my solution for Arch Linux build on RPi3A+. Below is what the boot executes on auto-login and my start screen systemd service, also below. So, it appears the boot starts X11 and that's how kivy starts (on pastebin). I need to test this on Buster to see if I get the same results.

.xinitrc content:

#!/bin/sh
# ~/.xinitrc
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec startlxde

My screen-start.service:

[Unit]
Description=Remote Control Screen
Requires=time-sync.target
After=time-sync.target

[Service]
Environment="DISPLAY=:0.0"
ExecStart=/usr/bin/python3 /home/remote/app/main.py
RemainAfterExit=yes
Restart=always
RestartSec=3

[Install]
WantedBy=default.target

The kivy environment value at startup:

#! /usr/bin/python3
import os
os.environ['KIVY_VIDEO']='ffpyplayer'

@kuzeyron
Copy link
Contributor

This runs both ways on Buster with Pi3B+
But for the Pi4 I've found a few things I should investigate. But that's on Monday @OutsourcedGuru ?!

@OutsourcedGuru
Copy link

OutsourcedGuru commented Aug 24, 2019

Actually, I'm here on a Saturday testing this nonsense.

Same Raspbian Lite rig as stated above, plus attempting to add the x11 interface. I tried to just get the bare minimum but that wouldn't bring up the GUI desktop. Starting it from the Pi itself having started x then worked as seen below.

sudo apt-get install --no-install-recommends xserver-xorg # Trying for the PIXEL desktop
sudo apt-get install --no-install-recommends xinit # Need the startx script
sudo pip3 install --force-reinstall kivy
python3 test.py # Didn't work - segmentation fault
startx # Didn't work - wouldn't start the desktop
sudo apt-get install --yes raspberrypi-ui-mods # Desktop
python3 test.py # Didn't work - segmentation fault
startx # Worked - then open a terminal from the upper menu
python3 test.py # Works - displays a window

@OutsourcedGuru
Copy link

Same Raspbian Lite rig (with x11/Desktop added) still suffers in the Python2 world. It freezes up, isn't responsive to Ctl-C, doesn't display another window, logs normally otherwise.

@kuzeyron
Copy link
Contributor

@OutsourcedGuru You should ignore using python2 from the beginning. Its support ends this year.
So what you should do is only install for python3 and use only pip3. I don't know why Raspbian haven't put python3 to be the default python. If you follow up with Arch Linux you'll know python3 is the default version which is perfect.

@OutsourcedGuru
Copy link

And yet, since January I've been working on a plugin for OctoPrint. It doesn't yet support Py3 on the master branch. I've just spent all morning rigging up something to their devel branch to test this. I'll likely spend days modifying my plugin in an effort to get it to work on something that's not even pushed to the viable platform. And then I can cross my fingers and hope that their code-in-development doesn't break my own stuff. (This is for what will be a production printer and beta code isn't normally what you prefer in a case like this.)

@frankgould
Copy link
Author

“Alas, poor Yorick, I knew him well.”

@OutsourcedGuru, I once read a Raspberry Pi moderator say that no one should base a business model on Raspbian, or Raspberry Pi for that matter. He could be right at the time but over time, they make progress for more possibilities. As you can see above, I got ALARM to work with my app; however, since then the HDMI audio is hosed. It’s clean in python command line but when running from systemd, it’s garbage.

So, it’s a tech curve that developers are chasing. You can pound on it all day, like I did today, and still get no results. Just keep pounding, if it’s worth it for you.

@gtetil
Copy link

gtetil commented Aug 30, 2019

Did anyone try this suggestion? Looks like he's changing KIVY_TEXT as well. I will try this weekend if I get a chance.

https://stackoverflow.com/questions/56947840/kivy-1-10-1-and-1-11-0-not-working-on-raspberry-pi4-buster

@masynthetic
Copy link

masynthetic commented Sep 12, 2019

So everyone still unable to get Kivy running on Buster..?

@lucadetweede
Copy link

It's easy to run Kivy programs on the desktop version, but still didn't find a way to work myself to start it in console boot.

Anyone else?

@masynthetic
Copy link

Thanks haha, I feel pretty dumb for not trying that now... I had only been trying through ssh but just gave it a shot through vnc and it did indeed work. If it's of any interest, tkinter (other python UI library) also does not work through console but does with desktop.

I do really need a reliable way to start from console or at least startup but thank you for mentioning this I finally have a workaround!

@frankgould
Copy link
Author

@masynthetic On ALARM, my .xinitrc starts windows then my Kivy app autoruns after windows are up. I can give more info if you need it. I’m not in my office right now and need to boot the tablet to see exactly how I implemented it.

@masynthetic
Copy link

masynthetic commented Sep 14, 2019 via email

@OutsourcedGuru
Copy link

That would be useful. @frankgould

I do think we need a good solution for the the Desktop-less version of this. I'm hoping to just return to this later and the underlying operating system and driver set works as it did before. Being cynical, I kind of doubt it though.

@lucasnzone
Copy link

yes @Lauszus
i've got crw-rw---- 1 root i2c 13, 64 Mar 12 22:56 event0 and crw-rw---- 1 root i2c 13, 64 Mar 12 22:56 mouse0 inside the container

@Lauszus
Copy link
Contributor

Lauszus commented Mar 12, 2020

Try to just cat the output i.e. cat /dev/input/event0. Does it print anything when you touch the screen?

@lucasnzone
Copy link

@Lauszus it does, random characters
now i'm more confused than before

@Lauszus
Copy link
Contributor

Lauszus commented Mar 12, 2020

Super that means that the container is getting the input. What you are seeing is the raw byte stream, so it will not make sense to you. Anyway this means that it's something in your Kivy configuration is not correct.

Can you try to compile and run this C code (it's some old code I used for debugging my screen):

#include <stdio.h>
#include <linux/input.h>
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>

static volatile sig_atomic_t run = 1;

void sigint(int sig) {
    run = 0;
}

int main() {
    signal(SIGINT, sigint);

    int fd = open("/dev/input/event0", /*O_NONBLOCK |*/ O_RDONLY);
    if (fd < 0) {
        printf("Failed to open device\n");
        return 1;
    }

    while (run) {
        struct input_event ev;
        int num_bytes = read(fd, &ev, sizeof(ev));
        if (num_bytes != sizeof(ev)) {
            printf("Failed to read device\n");
            return 1;
        }
        printf("%u, %u, %u, %u, %d\n", ev.time.tv_sec, ev.time.tv_usec, ev.type, ev.code, ev.value);
    }

    printf("Closing device\n");
    close(fd);
    return 0;
}

You can compile and run it like so:

gcc touch.c -o touch && ./touch

@lucasnzone
Copy link

lucasnzone commented Mar 13, 2020

@Lauszus
I get some output from touch:

1584058230, 998152, 1, 330, 1
1584058230, 998152, 3, 0, 477
1584058230, 998152, 3, 1, 3477
1584058230, 998152, 3, 24, 64790
1584058230, 998152, 0, 0, 0
1584058231, 15687, 1, 330, 0
1584058231, 15687, 3, 24, 0
1584058231, 15687, 0, 0, 0

that's bottom left corner

@Lauszus
Copy link
Contributor

Lauszus commented Mar 13, 2020

Okay. Try to add the following to the very top of the code (it's important that's it's above any other imports):

from kivy.config import Config
Config.set('input', 'mtdev_%(name)s', 'probesysfs,provider=mtdev')

@lucasnzone
Copy link

lucasnzone commented Mar 13, 2020

ok, this is the output when I run my app, with that code at the very top:

[INFO ] Logger: Record log in /root/.kivy/logs/kivy_20-03-13_3.txt
[INFO ] Kivy: v2.0.0.dev0, git-cef99e4, 20191024
[INFO ] Kivy: Installed at "/root/venv-kivy/lib/python3.7/site-packages/kivy/init.py"
[INFO ] Python: v3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.2.0]
[INFO ] Python: Interpreter at "/root/venv-kivy/bin/python3"
[INFO ] Factory: 184 symbols loaded
[INFO ] Image: Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO ] Text: Provider: sdl2
[INFO ] Window: Provider: sdl2(['window_egl_rpi'] ignored)
[INFO ] GL: Using the "OpenGL ES 2" graphics system
[INFO ] GL: Backend used
[INFO ] GL: OpenGL version <b'2.1 Mesa 19.3.2'>
[INFO ] GL: OpenGL vendor <b'Broadcom'>
[INFO ] GL: OpenGL renderer <b'V3D 4.2'>
[INFO ] GL: OpenGL parsed version: 2, 1
[INFO ] GL: Shading version <b'1.20'>
[INFO ] GL: Texture max size <4096>
[INFO ] GL: Texture max units <16>
[INFO ] Window: auto add sdl2 input provider
[INFO ] Window: virtual keyboard not allowed, single mode, not docked
[INFO ] Base: Start application main loop
[INFO ] GL: NPOT texture support is available

it still doesn't respond to touch

@Lauszus
Copy link
Contributor

Lauszus commented Mar 13, 2020

Can you try to install the libmtdev1 package?

@lucasnzone
Copy link

sure can, i'll try now and run it again

@lucasnzone
Copy link

@Lauszus it was already installed, same issues

@lucasnzone
Copy link

@Lauszus I got it working! Thanks for all your help mate!
%(name)s = hidinput,/dev/input/event0
I added that line to the [input] section in .kivy/config.ini
Thanks again mate!

@Lauszus
Copy link
Contributor

Lauszus commented Mar 13, 2020

@lucasnzone great to hear that :)

@Lauszus
Copy link
Contributor

Lauszus commented Mar 13, 2020

For anyone reading this; #6769 has now been merged, so no changes to Kivy is no longer needed, but you still need to compile SDL2 from source. Instructions can be found in the official docs: https://kivy.org/doc/master/installation/installation-rpi.html.

@somber02
Copy link

@Lauszus ,
I followed your instruction with 1Gb version Raspberry pi 4 with 2020-02-13 Lite OS. But still can not find a valuable window provider. Any thought?

Best,

@matham
Copy link
Member

matham commented Mar 13, 2020

@somber02 It would be better if you ask for further support on our official support channels (e.g. discord). We prefer to use github issues primarily for actual bugs and not support.

@Lauszus
Copy link
Contributor

Lauszus commented Mar 14, 2020

@matham the issue is that there is a problem with the CI workflow that generates the docs, so it's not updated on the website: https://github.com/kivy/kivy/runs/506000991.

@somber02 for now you can find the documentation here: https://github.com/Lauszus/kivy/blob/45f7ec3851e09220b2b5dc8f34523d6eebff17c2/doc/sources/installation/installation-rpi.rst until the website gets updated.

@matham
Copy link
Member

matham commented Mar 14, 2020

Ok, my bad, I forgot to merge kivy/kivy-server#17. Should be fixed now.

@Lauszus
Copy link
Contributor

Lauszus commented Mar 14, 2020

@matham thanks. Please see: #6775, as that is preventing the docs from being built.

@somber02
Copy link

somber02 commented Mar 14, 2020

@Lauszus , Hi Lauszus. Thank you for the instruction. I followed the link with updated information but it still failed with "Unable to find any window provider". and "sdl2-runtimeError"could not initialze EGL" Test condition:

  1. raspberry pi 4 1Gb version 2020-02-13 Lite Raspberrian.
  2. after recompiled sdl2, restart
  3. tested with global install from latest release pypi, from master branch, from latest wheel and from latest development version.
  4. In few situations error message shows it can not find x11 window provider, I will KIVY_WINDOW=sdl2 to force it use sdl2 in that case.

Am I doing something wrong?

@Lauszus
Copy link
Contributor

Lauszus commented Mar 14, 2020

@somber02 did you compile Kivy from the master branch? If not please do so, as the pre-built wheels has not been updated yet.

@Lauszus
Copy link
Contributor

Lauszus commented Mar 14, 2020

@somber02 also note that you should NOT install these dependencies using apt:

libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev

As you want to use the version you compiled yourselves.

@somber02
Copy link

@Lauszus Thank you. I just copied the dependencies without close look.... Thank you that is the reason. After I purged these package and reinstalled the compiled sdl2 package, it works.

Thank you so much for your hard work.

@Lauszus
Copy link
Contributor

Lauszus commented Mar 15, 2020

@somber02 great to hear that. I just send yet another PR to make it more clear: #6780.

Btw did you experience this issue as well: #6778? Or was it hardware accelerated?

@somber02
Copy link

@Lauszus , I can confirm that it is hardware accelerated. Thank you

@OutsourcedGuru
Copy link

@Lauszus

note that you should NOT install these dependencies using apt:

In a case like this for the Kivy installation instructions you might even suggest that the user actively do a sudo apt-get remove ... or sudo apt-get purge ... for that short list at the beginning before then compiling sdl2. For most of us, we're probably trying to fix an earlier attempt and so we would have installed the default package version.

@pwdavari
Copy link

@Lauszus Amazing work - this resolved all the issues of getting kivy running on buster lite for me.

Can I suggest just for clarification that the guide state that step 2 altogether is skipped if you are doing a buster lite setup on pi 4?

Additionally, is there a work around for maintaining hardware acceleration that would enable you to rotate orientation for configuration? The only way I can see that this works is with x11 or by disabling the V3D driver.

pimoroni/hyperpixel4#39

@Lauszus
Copy link
Contributor

Lauszus commented Jul 25, 2020

@pwdavari step 2 should not be skipped if you are using Buster lite, as you need to compile SDL2 from source unless they have updated the SDL2 package?

You can rotate the display by adding the following kernel commands in /boot/cmdline.txt:

video=HDMI-A-1:1920x1080M@60,margin_left=0,margin_right=0,margin_top=0,margin_bottom=0,rotate=90,reflect_x

See: https://www.raspberrypi.org/documentation/configuration/cmdline-txt.md

If you only want to rotate the display in Kivy:

from kivy.config import Config
Config.set('input', 'mtdev_%(name)s', 'probesysfs,provider=mtdev,param=rotation=90,param=invert_y=1')

@pwdavari
Copy link

@Lauszus Thanks for the reply

I was just referring to this point from step 3 of the documentation:

3. Now simply follow the Raspberry Pi 1-4 installation instructions to install Kivy, but do NOT install the SDL2 packages using apt.

Should we not just skip step 2 of the normal Pi 1-4 setup if you have already installed sdl packages from source and followed the steps -> sudo make install for each?

Or is it saying that you should follow the steps but do not install with apt so you would do:

install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev

@pwdavari
Copy link

@Lauszus

I wasn't putting the video= parameters on the same line. Wasn't until you pointed me back to the documentation that I noticed it very explicitly states that all cmdline.txt parameters/configs need to be on one line. Rookie mistake.

Thanks for your help!

@Lauszus
Copy link
Contributor

Lauszus commented Jul 26, 2020

@pwdavari yes you need to skip step 2 under "Raspberry Pi 1-4 installation".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.