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

RPI4: failed to add service - already in use? #10

Closed
alanbork opened this issue Jun 21, 2020 · 4 comments
Closed

RPI4: failed to add service - already in use? #10

alanbork opened this issue Jun 21, 2020 · 4 comments

Comments

@alanbork
Copy link

I also get the

failed to add service - already in use?

message, every time. Your troubleshooting suggestion:

"Failed to add service - already in use?

As mentioned in this issue, you have to remove both vc4-kms-v3d and vc4-fkms-v3d from R-Pi config."

seems to be in direct contradiction to enabling DRM which is necessary for the Pi4 to work using your code, isn't it? Am I missing something?

@matusnovak
Copy link
Owner

matusnovak commented Jun 21, 2020

Hi @alanbork

That issue:

you have to remove both vc4-kms-v3d and vc4-fkms-v3d from R-Pi config

Is mostly relevant to Raspberry Pi 1, 2, and 3 and to the code in triangle.c. The OpenGL drivers have changed in Raspberry Pi 4 and you should use triangle_rpi4.c which is based on DRM/GBM libraries. Are you using the triangle_rpi4.c sample code or the previous one?

You may also have more luck with these two:

You may also be facing the same issue as here at the bottom: #3

@alanbork
Copy link
Author

Yes, triangle_rpi4.c. So what is the proper contents of config.txt in that case?

@matusnovak
Copy link
Owner

Just double checked it now. You don't have to remove vc4-fkms-v3d from the config.

This is my /boot/config.txt I have used to test it.

hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=81
hdmi_drive=2

dtparam=audio=on

[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
# empty

System info (uname -a). I have used the latest Raspberry Pi OS 32-bit Lite.

Linux raspberrypi 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux

This is how I have tested it.

$ sudo apt-get update
$ sudo apt-get install libegl1-mesa-dev libgbm-dev libgles2-mesa-dev libdrm-dev
$ wget https://raw.githubusercontent.com/matusnovak/rpi-opengl-without-x/master/triangle_rpi4.c
$ gcc -o triangle_rpi4 triangle_rpi4.c -ldrm -lgbm -lEGL -lGLESv2 -I/usr/include/libdrm -I/usr/include/GLES2
$ ./triangle_rpi4 

This is the output (and a file triangle.raw is created).

resolution: 1360x768
Initialized EGL version: 1.4
GL Viewport size: 1360x768

This is a ldd output of the compiled binary. Make sure it doesn't link to the EGL libraries from /opt/vc/lib because they are VideoCore related which do not work on Raspberry Pi 4.

 $ ldd ./triangle_rpi4
        linux-vdso.so.1 (0xbea94000)
        /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6ec2000)
        libdrm.so.2 => /usr/lib/arm-linux-gnueabihf/libdrm.so.2 (0xb6ea3000)
        libgbm.so.1 => /usr/lib/arm-linux-gnueabihf/libgbm.so.1 (0xb6e87000)
        libEGL.so.1 => /usr/lib/arm-linux-gnueabihf/libEGL.so.1 (0xb6e68000)
        libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 (0xb6e49000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6cfb000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6c79000)
        /lib/ld-linux-armhf.so.3 (0xb6ed7000)
        libwayland-server.so.0 => /usr/lib/arm-linux-gnueabihf/libwayland-server.so.0 (0xb6c5c000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6c49000)
        libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb6c08000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6bde000)
        libGLdispatch.so.0 => /usr/lib/arm-linux-gnueabihf/libGLdispatch.so.0 (0xb6b5f000)
        libffi.so.6 => /usr/lib/arm-linux-gnueabihf/libffi.so.6 (0xb6b47000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6b30000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6b03000)

@matusnovak
Copy link
Owner

Closing for inactivity

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

2 participants