raspberrypi / firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5.18k stars 1.68k forks source link

Videcore libs not working to render video Raspberry Pi 3B+ #1652

Open hemantbaxi opened 2 years ago

hemantbaxi commented 2 years ago

Describe the bug I have installed latest Raspbian Full version (bullseye) on Raspberry Pi 3B+.

I was trying to install RPiPlay. That works for audio but failed to render the video. It uses OpenMAX. So, I thought I should first try running examples from vc hello_pi itself and found those are also failing for video.

I have copied /opt/vc directory from this repository to the Raspberry. I have same issue with both stable and master branch.

To reproduce cd /opt/vc/src/hello_pi sh rebuild.sh

Expected behaviour Build should pass for all the examples. hello_video should show some video hello_videocube show show again some video.

Actual behaviour

  1. Build Problem When I try to build hello_pi using sh rebuild.sh. I got following error first.

make[1]: Entering directory '/opt/vc/src/hello_pi/hello_font' cc -DSTANDALONE -DSTDC_CONSTANT_MACROS -DSTDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -Wno-psabi -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I./ -I/opt/vc/src/hello_pi/libs/ilclient -I/opt/vc/src/hello_pi/libs/vgfont -I/opt/vc/src/hello_pi/libs/revision -g -c main.c -o main.o -Wno-deprecated-declarations cc -o hello_font.bin -Wl,--whole-archive main.o -lvgfont -lfreetype -lz -lrevision -L/opt/vc/lib/ -lbrcmGLESv2 -lbrcmEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -lm -L/opt/vc/src/hello_pi/libs/ilclient -L/opt/vc/src/hello_pi/libs/vgfont -L/opt/vc/src/hello_pi/libs/revision -Wl,--no-whole-archive -rdynamic /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_buffer_info_set' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglBufferSubData' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_GetFramebufferAttachmentParameteriv' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglxx_client_state_free' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_DeleteRenderbuffers' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglxx_set_error' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_GenFramebuffers' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglxx_set_error_api' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_BindRenderbuffer' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglxx_client_FramebufferTexture2D' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_GenRenderbuffers' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglxx_client_DeleteFramebuffers' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_GetRenderbufferParameteriv' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglxx_client_RenderbufferStorage' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_IsFramebuffer' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglintAttribPointer' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_GenerateMipmap' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglPointSizePointerOES' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to gl20_client_state_init' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference togl11_client_state_init' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_FramebufferRenderbuffer' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglxx_client_IsRenderbuffer' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_buffer_info_get' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglxx_client_BindFramebuffer' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_CheckFramebufferStatus' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference toglDiscardFramebufferEXT' collect2: error: ld returned 1 exit status make[1]: [../Makefile.include:19: hello_font.bin] Error 1 rm main.o make[1]: Leaving directory '/opt/vc/src/hello_pi/hello_font' make: [Makefile:18: apps] Error 2

I fixed this error by adding -lEGL and -lGLESv2 to Makefile.include LDFLAGS. However, it now stopped at following error.

make[1]: Entering directory '/opt/vc/src/hello_pi/hello_fft' gcc -o hello_fft.bin -lrt -lm -ldl mailbox.c gpu_fft.c gpu_fft_base.c gpu_fft_twiddles.c gpu_fft_shaders.c hello_fft.c gcc -o hello_fft_2d.bin -lrt -lm -ldl mailbox.c gpu_fft.c gpu_fft_base.c gpu_fft_twiddles.c gpu_fft_shaders.c hello_fft_2d.c gpu_fft_trans.c hello_fft_2d.c: In function ‘main’: hello_fft_2d.c:48:25: warning: implicit declaration of function ‘mbox_open’ [-Wimplicit-function-declaration] 48 | int x, y, ret, mb = mbox_open(); | ^~~~~ hello_fft_2d.c:109:5: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration] 109 | usleep(1); / yield to OS / t[0] = Microseconds(); | ^~ /usr/bin/ld: /tmp/cckfdVvT.o: in function gpu_fft_get_host_info': gpu_fft_base.c:(.text+0x48): undefined reference todlopen' /usr/bin/ld: gpu_fft_base.c:(.text+0x70): undefined reference to dlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0x88): undefined reference todlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0xa0): undefined reference to dlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0x128): undefined reference todlclose' /usr/bin/ld: /tmp/ccrBbFiQ.o: in function twiddles_base_16': gpu_fft_twiddles.c:(.text+0x84): undefined reference tocos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x100): undefined reference to sin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in functiontwiddles_base_32': gpu_fft_twiddles.c:(.text+0x1a4): undefined reference to cos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x1e8): undefined reference tosin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in function twiddles_base_64': gpu_fft_twiddles.c:(.text+0x290): undefined reference tocos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x2cc): undefined reference to sin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in functiontwiddles_step_16': gpu_fft_twiddles.c:(.text+0x37c): undefined reference to sin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x38c): undefined reference topow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x3cc): undefined reference to sin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in functiontwiddles_step_32': gpu_fft_twiddles.c:(.text+0x450): undefined reference to sin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x460): undefined reference topow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x484): undefined reference to sin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in functiontwiddles_step_64': gpu_fft_twiddles.c:(.text+0x51c): undefined reference to sin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x52c): undefined reference topow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x550): undefined reference to sin' collect2: error: ld returned 1 exit status make[1]: *** [makefile:33: hello_fft_2d.bin] Error 1 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: /tmp/ccwsyeZM.o: in functiongpu_fft_get_host_info': gpu_fft_base.c:(.text+0x48): undefined reference to dlopen' /usr/bin/ld: gpu_fft_base.c:(.text+0x70): undefined reference todlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0x88): undefined reference to dlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0xa0): undefined reference todlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0x128): undefined reference to dlclose' /usr/bin/ld: /tmp/ccADw2NK.o: in functiontwiddles_base_16': gpu_fft_twiddles.c:(.text+0x84): undefined reference to cos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x100): undefined reference tosin' /usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_base_32': gpu_fft_twiddles.c:(.text+0x1a4): undefined reference tocos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x1e8): undefined reference to sin' /usr/bin/ld: /tmp/ccADw2NK.o: in functiontwiddles_base_64': gpu_fft_twiddles.c:(.text+0x290): undefined reference to cos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x2cc): undefined reference tosin' /usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_step_16': gpu_fft_twiddles.c:(.text+0x37c): undefined reference tosin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x38c): undefined reference to pow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x3cc): undefined reference tosin' /usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_step_32': gpu_fft_twiddles.c:(.text+0x450): undefined reference tosin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x460): undefined reference to pow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x484): undefined reference tosin' /usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_step_64': gpu_fft_twiddles.c:(.text+0x51c): undefined reference tosin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x52c): undefined reference to pow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x550): undefined reference tosin' /usr/bin/ld: /tmp/ccSodvhL.o: in function main': hello_fft.c:(.text+0x408): undefined reference tocos' /usr/bin/ld: hello_fft.c:(.text+0x418): undefined reference to pow' /usr/bin/ld: hello_fft.c:(.text+0x454): undefined reference topow' /usr/bin/ld: hello_fft.c:(.text+0x47c): undefined reference to pow' /usr/bin/ld: hello_fft.c:(.text+0x4dc): undefined reference tosqrt' collect2: error: ld returned 1 exit status make[1]: [makefile:30: hello_fft.bin] Error 1 make[1]: Leaving directory '/opt/vc/src/hello_pi/hello_fft' make: [Makefile:25: apps] Error 2

These are standard calls and the required flags for the same are there in hello_fft makefile i.e. -ldl -lm . So, I wonder where it is failing.

It didn't show any video, didn't show any error and then existed in few seconds without showing any message.

Same happened when I tried ./hello_videocube.

System

pi@raspberrypi:~ $ cat /etc/rpi-issue Raspberry Pi reference 2021-10-30 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 288b21fc27e128ea6b330777aca68e0061ebf4fe, stage5

popcornmix commented 2 years ago

OpenMAX is not supported on Bullseye. There are standard linux methods for achieving similar behaviour (v4l2/mesa/drm).

This repo (and the rpi-update tool) still supports buster, so it's useful keeping the files present here, but they won't be installed by default on a new bullseye image.