kitao / pyxel

A retro game engine for Python
MIT License
15.3k stars 847 forks source link

Pyxel 2.0.0 displays only black screen on Raspberry Pi #507

Closed benjaminbellamy closed 7 months ago

benjaminbellamy commented 11 months ago

When running any program, such as 01_hello_pyxel.py, on Raspberry Pi (Raspberry Pi Zero 2 W running 2023-12-11-raspios-bookworm-arm64-lite) it shows only a black screen and the cursor.
No error message is shown.

It works like a charm on the same RPi with pyxel 1.9.18.

See attached screencast.

https://github.com/kitao/pyxel/assets/1984208/ab26b95f-b37a-431d-bfd7-454e99d6e0f4

kitao commented 11 months ago

It seems that OpenGL ES doesn't work but I'm not sure because I don't have a Raspberry Pi environment. Could you check key inputs works or not? You can check it by pressing ESC while an example is running.

And is there any settings to use OpenGL ES 2.0 and its GLES shaders for Raspberry Pi? The difference between Pyxel2 and Pyxel1 is using OpenGL (ES) shaders.

benjaminbellamy commented 11 months ago

Hello @kitao! Key input does work indeed. Regarding OpenGL ES 2.0 I have no idea, I'll have a look.

benjaminbellamy commented 11 months ago

I'm still digging…

The problem probably comes from the distribution I am using (the lite one).

I found this test: Raspberry Pi OpenGL ES 2 without an X server (using EGL)

It fails with card1:

$ ./triangle_rpi4
Unable to get DRM resources
Unable to get EGL display

But it works with card0:

$ ./triangle_rpi4
resolution: 1920x1080
Initialized EGL version: 1.4
GL Viewport size: 1920x1080

output

benjaminbellamy commented 11 months ago

I just tested on a Raspberry Pi 4 running raspios-bookworm-arm64-lite with pyxel-2.0.1 and it works fine.

kitao commented 11 months ago

Thank you for the detailed investigation! I don't have a Raspberry Pi environment, so this is really helpful.

benjaminbellamy commented 11 months ago

I'll try to nail it by running some tests on all possible configurations this week-end. So far it does not work on RPi zero 2 W running Bookworm lite 64 bits but it works without a glitch on RPi 4 running Bookworm lite 64bits.

benjaminbellamy commented 11 months ago

I though the problem came from the lite version but it does not: I could not make it work with the “Raspberry Pi OS with desktop” either (see screenshot below).

2023-12-18-132527

So there is a problem with the Raspberry Pi Zero 2 W that does not occur with the Raspberry Pi 4.

benjaminbellamy commented 11 months ago

I also tried both Raspberry Pi OS Bookworm (Debian 12) and Raspberry Pi OS Bullseye (Debian 11) but got the exact same results.

kitao commented 10 months ago

Could you try Pyxel 2.0.6? I modified OpenGL/GLES-related code. It may improve GLES handling.

benjaminbellamy commented 10 months ago

I will try!

kitao commented 8 months ago

Is there any update on the situation?

kitao commented 7 months ago

Let me close this issue because I already made the code fix and there is no updates.