matusnovak / rpi-opengl-without-x

Raspberry Pi OpenGL ES 2 without an X server (using EGL)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

* failed to add service - already in use?

cnlohr opened this issue · comments

I'm sure it's something with my configuration, but I'm doing my darnedest to figure out what's going on here. If I try to compile my own OGLES-without-X stuff or use this example, this error is all I get when the executable runs. Any ideas of where to go or how to figure things out from here?

* failed to add service - already in use?

I suspect that something in the background has taken over the EGL. Are you running your Raspberry Pi in headless mode (no desktop, no GUI, no screen, only the terminal)? If you are in desktop mode, try headless, that way the EGL will be available only to you.

Also worth to note, (I might be wrong about this) the Raspberry Pi uses proprietary Open GL drivers (the mesa libraries). If you use the open source ones, the EGL only works with X11 present (you have to be in desktop mode). I would recommend trying to compile and run this on a blank new Raspbian installation.

Also, have a look at this post: https://stackoverflow.com/questions/40490113/eglfs-on-raspberry2-failed-to-add-service-already-in-use and mainly the first comment by the OP:

I finally managed to solve the problem. The eglfs_brcm backend of Qt is using the vchiq device, which is the video core device. That's the same device the vc4-kms-v3d overlay uses when you activate hw-acceleration in your config.txt within /boot. Therefore the mentioned device is already grabbed and you can't use it anymore. The solution is to comment the appropriate line in your config.txt: # dtoverlay=vc4-kms-v3d and your eglfs will work as i described above. Please correct me, if sth is not formulated correctly. I hope i can save you time and grey hairs with that solution.

I'm not entirely sure what the difference is between the two. X11 is definitely not running, I am sure of that much.

But it turns out that link is it! If I remove all references to vc4-kms-v3d and vc4-fkms-v3d in my config, your examples seem to work.

Thank you!

I just want to add that I had this error because my video memory was too small. I replaced gpu_mem=16 with gpu_mem=256 in my /boot/config.txt to fix it.