User avatar
ksharindam
Posts: 151
Joined: Sat Jan 09, 2016 4:16 pm

OpenGL ES using GBM/DRM without root

Thu Aug 29, 2019 3:24 pm

rpi video output in mpv player uses mmal video output and OpenGL ES for osd.
But the legacy opengl es code does not work in RPi 4 . SO I want to replace the dispmanX specific code.

There is an example, kmscube which I can not use, because
  • It requires root, and I dont want to give a media player root access.
    It does not work for me.
Is there any working example of opengl es code using GBM/DRM ?
Is it possible to do without root ?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5398
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: OpenGL ES using GBM/DRM without root

Thu Aug 29, 2019 3:39 pm

Did you check this thread?
https://www.raspberrypi.org/forums/view ... 7#p1499181

The example code there runs without root.

User avatar
ksharindam
Posts: 151
Joined: Sat Jan 09, 2016 4:16 pm

Re: OpenGL ES using GBM/DRM without root

Thu Aug 29, 2019 4:13 pm

Yes, I already checked that thread.
But that also does not work.
Running without root gives the following errors...

Code: Select all

failed to export dumb buffer: Permission denied
Failed to create scanout resource
failed to export dumb buffer: Permission denied
Failed to create scanout resource
Segmentation fault
Running with root does not show error. But also does not display anything.
Not even a black screen. Program starts , waits for a sec and the exits

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7885
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: OpenGL ES using GBM/DRM without root

Thu Aug 29, 2019 4:35 pm

A quick compile and run, and the example works fine.

At a guess you are running from within X. Trying to run it from X does indeed give me the errors you report.
Note the title comment on the example
Trying to get OpenGL ES screen on RPi4 without X
DRM supports a single client at a time. If X is running then it is the one true client, and anything else will be told permission denied. This is expected.
If you wish to run within X then you need to look at composing via EGL, not via GBM/DRM.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
ksharindam
Posts: 151
Joined: Sat Jan 09, 2016 4:16 pm

Re: OpenGL ES using GBM/DRM without root

Thu Aug 29, 2019 4:42 pm

Yes. You are right. I am using X.
Thanks.

Return to “OpenGLES”