Page 1 of 1

OpenGL ES using GBM/DRM without root

Posted: Thu Aug 29, 2019 3:24 pm
by ksharindam
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 ?

Re: OpenGL ES using GBM/DRM without root

Posted: Thu Aug 29, 2019 3:39 pm
by dom
Did you check this thread?
https://www.raspberrypi.org/forums/view ... 7#p1499181

The example code there runs without root.

Re: OpenGL ES using GBM/DRM without root

Posted: Thu Aug 29, 2019 4:13 pm
by ksharindam
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

Re: OpenGL ES using GBM/DRM without root

Posted: Thu Aug 29, 2019 4:35 pm
by 6by9
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.

Re: OpenGL ES using GBM/DRM without root

Posted: Thu Aug 29, 2019 4:42 pm
by ksharindam
Yes. You are right. I am using X.
Thanks.