SHART
Posts: 4
Joined: Sun Mar 08, 2020 7:54 pm

Kivy app not output to HDMI

Sun Mar 08, 2020 8:13 pm

Hello Everyone,
I'm run python with kivy on pi-4 B, but it is not output to HDMI .
(code is run from ssh)
that code is OK on pi-3 B+ .
I spended 3-day to fix this problem, but not ok.
Could anyone help me pls?

==================================================
Modified config.txt

Code: Select all

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
max_framebuffers=2
hdmi_force_hotplug:0=1
#hdmi_safe=1
hdmi_group:0=1
hdmi_mode:0=1
==================================================
Code's output

Code: Select all

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_20-03-09_5.txt
[INFO   ] [Kivy        ] v2.0.0rc1, git-Unknown, 20200308
[INFO   ] [Kivy        ] Installed at "/home/pi/.local/lib/python3.7/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python3"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer, img_gif ignored)
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[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      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Clipboard   ] Provider: xclip
[INFO   ] [CutBuffer   ] cut buffer support enabled
[INFO   ] [GL          ] NPOT texture support is available
[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   ] [ProbeSysfs  ] device match: /dev/input/event0
[INFO   ] [HIDInput    ] Read event from </dev/input/event0>
[INFO   ] [Base        ] Start application main loop
[INFO   ] [HIDMotionEvent] using <SIGMACHIP USB Keyboard Consumer Control>

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Kivy app not output to HDMI

Mon Mar 09, 2020 11:19 am

Is X-windows/desktop running ?

SHART
Posts: 4
Joined: Sun Mar 08, 2020 7:54 pm

Re: Kivy app not output to HDMI

Tue Mar 10, 2020 2:52 am

Yes, Desktop and lite both.
and run that code from remote (ssh).

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Kivy app not output to HDMI

Tue Mar 10, 2020 6:43 am

Do you get any on-screen messages when you start the program?
Does it work when you run it locally (not using SSH)?

SHART
Posts: 4
Joined: Sun Mar 08, 2020 7:54 pm

Re: Kivy app not output to HDMI

Tue Mar 10, 2020 9:32 am

If local is Desktop, OK
If local is CLI, not OK.

But, that code can run on pi-3 CLI & Desktop ( from both local and remote ).

Code: Select all

[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_20-03-10_1.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/home/pi/.local/lib/python3.7/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0]
[INFO   ] [Python      ] Interpreter at "/usr/bin/python3"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[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' (/home/pi/.local/lib/python3.7/site-packages/kivy/lib/vidcore_lite/__init__.py)
  File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/__init__.py", line 63, in core_select_lib
    fromlist=[modulename], level=0)
  File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
    from kivy.lib.vidcore_lite import bcm, egl

sdl2 - RuntimeError: b''
  File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/__init__.py", line 71, in core_select_lib
    cls = cls()
  File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/window/window_sdl2.py", line 152, in __init__
    super(WindowSDL, self).__init__()
  File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/window/__init__.py", line 981, in __init__
    self.create_window()
  File "/home/pi/.local/lib/python3.7/site-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 110, 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 "/home/pi/.local/lib/python3.7/site-packages/kivy/core/__init__.py", line 63, in core_select_lib
    fromlist=[modulename], level=0)

[CRITICAL] [App         ] Unable to get a Window, abort.

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Kivy app not output to HDMI

Tue Mar 10, 2020 10:14 am

Maybe do a

Code: Select all

export DISPLAY=:0.0
before starting the program.. ( but I dont really think that is the issue...

Focus on these line, see if you can run it with debug logging as suggested.

Code: Select all

INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[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

SHART
Posts: 4
Joined: Sun Mar 08, 2020 7:54 pm

Re: Kivy app not output to HDMI

Wed Mar 11, 2020 4:35 am

Thanks Topguy and everyone,
I'm ok for Desktop Version with

Code: Select all

export DISPLAY=:0.0


and have you solution for CLI Version ?

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Kivy app not output to HDMI

Wed Mar 11, 2020 12:15 pm

I asked if Xwindows was running ? And you answered "yes."
Then I'm assuming that HDMI is showing the desktop at the moment you are trying to start Kivy. And then DISPLAY have to be defined regardless of how you start it.

Return to “Python”