lagurus
Posts: 49
Joined: Wed Aug 07, 2013 8:02 am

raspistill on RPI4 - failed to add service

Thu Apr 16, 2020 9:19 am

Hi all,
when is started following:

Code: Select all

raspistill --gl --glscene sobel
it return only

Code: Select all

* failed to add service - already in use?
Configuration: RPI 4 4GB running Raspbian Buster.

For older model (PI,PI2B,PI3B) it works.

Any chance to get it work again?
Thanks.

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

Re: raspistill on RPI4 - failed to add service

Thu Apr 16, 2020 2:56 pm

lagurus wrote:
Thu Apr 16, 2020 9:19 am
Any chance to get it work again?
Not without significant reworking.
The Pi4 has the next generation of the 3D core, and the firmware doesn't know how to drive it. You need to use the desktop Mesa GL stack instead of the firmware GLES driver.
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.

lagurus
Posts: 49
Joined: Wed Aug 07, 2013 8:02 am

Re: raspistill on RPI4 - failed to add service

Fri Apr 17, 2020 4:47 pm

Not without significant reworking.
The Pi4 has the next generation of the 3D core, and the firmware doesn't know how to drive it. You need to use the desktop Mesa GL stack instead of the firmware GLES driver.
Any chance to make it oneself?
Is enough to modify raspicam tree - e.g. files like RapiTex.c and RaspiTexUtil.h?
Or is needed to change also something deeper - e.g. in firmware?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26673
Joined: Sat Jul 30, 2011 7:41 pm

Re: raspistill on RPI4 - failed to add service

Fri Apr 17, 2020 4:52 pm

lagurus wrote:
Fri Apr 17, 2020 4:47 pm
Not without significant reworking.
The Pi4 has the next generation of the 3D core, and the firmware doesn't know how to drive it. You need to use the desktop Mesa GL stack instead of the firmware GLES driver.
Any chance to make it oneself?
Is enough to modify raspicam tree - e.g. files like RapiTex.c and RaspiTexUtil.h?
Or is needed to change also something deeper - e.g. in firmware?
You would need to rework the raspicam code to use the Mesa GL stack instead of the current mechanism which uses the firmware 3D. I am no expert on this, I suspect it's feasible, but I have no idea how to do it. Probably not a huge amount of work for someone who is familiar with the Mesa, but not trivial.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

lagurus
Posts: 49
Joined: Wed Aug 07, 2013 8:02 am

Re: raspistill on RPI4 - failed to add service

Fri Jul 17, 2020 10:03 am

Resurrecting old post.

Finally I had time and tried to modify my code.
It seems that error message:

Code: Select all

* failed to add service - already in use?
is gone.

I am using Mesa GL. For creation is used DRM/GBM stuff (beacuse I am headless).
Also was needed to link program with GLESv2,EGL instead of brcmGLESv2,brcmEGL

Some functions are not defined in MESA EGL and need to be added dynamically using eglGetProcAddress e.g.:

eglCreateImageKHR
eglDestroyImageKHR
glEGLImageTargetTexture2DOES


But now receive EGL error 0x300c in function raspitexutil_do_update_texture during calling of
eglCreateImageKHR
. Error 0x300c = EGL_BAD_PARAMETER.

I have noticed that function eglCreateImageKHR was originally defined in egl_khr_image_client.c which I think is used when
is program linked against brcmEGL. But MESA EGL hasn't it defined it in such way and don't know anything about:

EGL_IMAGE_BRCM_MULTIMEDIA,EGL_IMAGE_BRCM_MULTIMEDIA_Y,EGL_IMAGE_BRCM_MULTIMEDIA_U,EGL_IMAGE_BRCM_MULTIMEDIA_V

Some tips how to solve this issue?
How to add support to PI4? I have used it on PI1/2/3 for fast image processing using shaders.

Thank you.

Return to “Camera board”