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

[core] demo's not working rpi4 kernel 5.10 #1509

Closed
jamieS95 opened this issue Jan 3, 2021 · 11 comments
Closed

[core] demo's not working rpi4 kernel 5.10 #1509

jamieS95 opened this issue Jan 3, 2021 · 11 comments

Comments

@jamieS95
Copy link

jamieS95 commented Jan 3, 2021

demo's not working rpi4 kernel 5.10 with newest mesa from the repo and kms enabled

INFO: Initializing raylib 3.5
INFO: DISPLAY: No graphic card set, trying card1
INFO: DISPLAY: Selected DRM connector mode 800x600 (800x600p@60)
INFO: DISPLAY: Upscaling required: Screen size (800x450) smaller than display size (800x600)
INFO: DISPLAY: Device initialized successfully
INFO: > Display size: 800 x 600
INFO: > Render size: 800 x 600
INFO: > Screen size: 800 x 450
INFO: > Viewport offsets: 0, 150
INFO: GL: OpenGL device information:
INFO: > Vendor: Broadcom
INFO: > Renderer: V3D 4.2
INFO: > Version: OpenGL ES 3.1 Mesa 21.0.0-devel (git-9ef2c44ce6)
INFO: > GLSL: OpenGL ES GLSL ES 3.10
INFO: GL: Supported extensions count: 88
INFO: GL: VAO extension detected, VAO functions initialized successfully
INFO: GL: NPOT textures extension detected, full NPOT textures supported
INFO: GL: DXT compressed textures supported
INFO: GL: ETC1 compressed textures supported
INFO: TEXTURE: [ID 1] Texture created successfully (1x1 - 1 mipmaps)
INFO: TEXTURE: [ID 1] Default texture loaded successfully
INFO: SHADER: [ID 1] Compiled successfully
INFO: SHADER: [ID 2] Compiled successfully
INFO: SHADER: [ID 3] Program loaded successfully
INFO: SHADER: [ID 3] Default shader loaded successfully
INFO: RLGL: Internal vertex buffers initialized successfully in RAM (CPU)
INFO: RLGL: Render batch vertex buffers loaded successfully
INFO: RLGL: Default state initialized successfully
INFO: TEXTURE: [ID 2] Texture created successfully (128x128 - 1 mipmaps)
INFO: FONT: Default font loaded successfully
INFO: RPI: Opening input device: /dev/input/event2 (mouse )
INFO: RPI: Opening input device: /dev/input/event0 (keyboard )
WARNING: RPI: Failed to open Gamepad device, no gamepad available
WARNING: RPI: Failed to change keyboard mode (SSH keyboard?)
INFO: TIMER: Target time per frame: 16.667 milliseconds
ERROR: DISPLAY: drmModeSetCrtc() failed with result: -13

@raysan5
Copy link
Owner

raysan5 commented Jan 3, 2021

Ouch... Maybe @KernelKinetic could take a look?

@ghost
Copy link

ghost commented Jan 4, 2021

Since drmModeSetCrtc() applies the settings to the screen controller and -13 looks like -ENOACCES maybe there is just something wrong with some access rights and a quick sudo ... test should work to run the demonstration examples again, @jamieS95?

@AudioMorphology
Copy link
Contributor

I have seen this too, when compiling for PLATFORM_DRM and running within a Terminal session on the Pi desktop - seems the app isn't able to set Crtc as it's not Master. Presumably the desktop is already master. Running as sudo makes no difference - I tried patching core.c to call drmSetMaster(3); prior to drmModeSetCrtc() but that didn't fix it.

@jamieS95 Set the Pi to boot to Command Line rather than desktop, and re-run the compiled example from there - you'll probably find it runs fine. That's what I'm doing at present until I find a fix.

@raysan5
Copy link
Owner

raysan5 commented Jan 4, 2021

@AudioMorphology Oh, yeah, you are right, I also found the same issue... actually PLATFORM_DRM is expected to run with no desktop, to run raylib on desktop, then compile it for PLATFORM_DESKTOP.

EDIT: As a side note, previous PLATFORM_RPI implementation (using videocore libraries) allowed getting the screen as master even on desktop...

@jamieS95
Copy link
Author

jamieS95 commented Jan 4, 2021

@raysan5
would having the api like this have any benefit?

https://github.com/raysan5/raylib/wiki/Working-on-Raspberry-Pi
*maybe some changes for opengl 2.0, open gl es, drm...

//native without windowing system (use from command line)
make PLATFORM=PLATFORM_NATIVE
//x11 windowing system (use from desktop)
make PLATFORM=PLATFORM_WINDOWED

@raysan5
Copy link
Owner

raysan5 commented Jan 4, 2021

@jamieS95 Actually, PLATFORM_DESKTOP is correct, it does not have to be WINDOWED...

About PLATFORM_NATIVE, maybe it could be reviewed in a future but no plans for now.

Does it work with the proposed solutions?

@jamieS95
Copy link
Author

jamieS95 commented Jan 4, 2021

booting to cli solved issue. thank you

@jamieS95 jamieS95 closed this as completed Jan 4, 2021
@colesnicov
Copy link

So. I've just installed freshely on my Raspberry PI 2B an Raspberry OS Lite + openbox + xfce4-panel. And I did try to compile sources successfuly. Trying to compile examples and I have got #3487 (comment) error.

When I tried raylib 3 years ago, it didn't work with RPI 2B (I still have the same one :D), but now it does.

So I want to ask:

  • if I want to run raylib under openbox, do I have to compile like this: make PLATFORM=PLATFORM_DESKTOP?
  • I have to specify the opengl version, something like GRAPHICS=GRAPHICS_API_OPENGL_21?

Maybe it should be mentioned in the wiki that DRM can only be started from the CLI and can cause such an error: ERROR: DISPLAY: drmModeSetCrtc() failed with result: -13

Thank you.

@raysan5
Copy link
Owner

raysan5 commented Apr 30, 2024

Hi! RaspberryPi drivers have changed a lot in the last few years. Glad to know it works as expected with latest update.

About your questions:

if I want to run raylib under openbox, do I have to compile like this: make PLATFORM=PLATFORM_DESKTOP?

I'm afraid I don't know, I never used openbox. It should be tested.

I have to specify the opengl version, something like GRAPHICS=GRAPHICS_API_OPENGL_21?

Yes, PLATFORM_DESKTOP requires OpenGL 2.1 and PLATFORM_DRM requires OpenGL ES 2.0.

Maybe it should be mentioned in the wiki that DRM can only be started from the CLI and can cause such an error: ERROR: DISPLAY: drmModeSetCrtc() failed with result: -13

The Wiki is open to everyone for editing, feel free to add that info on Raspberry Pi section.

@colesnicov
Copy link

I have to specify the opengl version, something like GRAPHICS=GRAPHICS_API_OPENGL_21?

Yes, PLATFORM_DESKTOP requires OpenGL 2.1 and PLATFORM_DRM requires OpenGL ES 2.0.

However, as I can see on the dependencies page on the wiki (https://github.com/raysan5/raylib/wiki/raylib-dependencies) , it requires X11 in the DESKTOP configuration and that already contradicts what I tried with OS LITE + OPENBOX..

@colesnicov
Copy link

colesnicov commented Apr 30, 2024

The Wiki is open to everyone for editing, feel free to add that info on Raspberry Pi section.

Succeess.

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

No branches or pull requests

4 participants