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

Open
#1,652 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux, raspberry-pi, shell

Research direction

Start by running sh rebuild.sh from /opt/vc/src/hello_pi on the reported Raspberry Pi 3B+ and Bullseye setup. Inspect Makefile.include, the hello_fft makefile, and the hello_video and hello_videocube examples alongside the reported linker and runtime output. Done means all examples build and the two video programs display video without exiting silently.

Written by the indexing model from the issue text.

Description

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 -D__STDC_CONSTANT_MACROS -D__STDC_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 to glBufferSubData'
/usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_GetFramebufferAttachmentParameteriv' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_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 to glxx_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 to glxx_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 to glxx_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 to glxx_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 to glxx_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 to glintAttribPointer'
/usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glxx_client_GenerateMipmap' /usr/bin/ld: /opt/vc/lib//libbrcmEGL.so: undefined reference to glPointSizePointerOES'
/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 to gl11_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 to glxx_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 to glxx_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 to glDiscardFramebufferEXT'
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 to dlopen'
/usr/bin/ld: gpu_fft_base.c:(.text+0x70): undefined reference to dlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0x88): undefined reference to dlsym'
/usr/bin/ld: gpu_fft_base.c:(.text+0xa0): undefined reference to dlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0x128): undefined reference to dlclose'
/usr/bin/ld: /tmp/ccrBbFiQ.o: in function twiddles_base_16': gpu_fft_twiddles.c:(.text+0x84): undefined reference to cos'
/usr/bin/ld: gpu_fft_twiddles.c:(.text+0x100): undefined reference to sin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in function twiddles_base_32':
gpu_fft_twiddles.c:(.text+0x1a4): undefined reference to cos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x1e8): undefined reference to sin'
/usr/bin/ld: /tmp/ccrBbFiQ.o: in function twiddles_base_64': gpu_fft_twiddles.c:(.text+0x290): undefined reference to cos'
/usr/bin/ld: gpu_fft_twiddles.c:(.text+0x2cc): undefined reference to sin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in function twiddles_step_16':
gpu_fft_twiddles.c:(.text+0x37c): undefined reference to sin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x38c): undefined reference to pow'
/usr/bin/ld: gpu_fft_twiddles.c:(.text+0x3cc): undefined reference to sin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in function twiddles_step_32':
gpu_fft_twiddles.c:(.text+0x450): undefined reference to sin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x460): undefined reference to pow'
/usr/bin/ld: gpu_fft_twiddles.c:(.text+0x484): undefined reference to sin' /usr/bin/ld: /tmp/ccrBbFiQ.o: in function twiddles_step_64':
gpu_fft_twiddles.c:(.text+0x51c): undefined reference to sin' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x52c): undefined reference to pow'
/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 function gpu_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 to dlsym'
/usr/bin/ld: gpu_fft_base.c:(.text+0x88): undefined reference to dlsym' /usr/bin/ld: gpu_fft_base.c:(.text+0xa0): undefined reference to dlsym'
/usr/bin/ld: gpu_fft_base.c:(.text+0x128): undefined reference to dlclose' /usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_base_16':
gpu_fft_twiddles.c:(.text+0x84): undefined reference to cos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x100): undefined reference to sin'
/usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_base_32': gpu_fft_twiddles.c:(.text+0x1a4): undefined reference to cos'
/usr/bin/ld: gpu_fft_twiddles.c:(.text+0x1e8): undefined reference to sin' /usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_base_64':
gpu_fft_twiddles.c:(.text+0x290): undefined reference to cos' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x2cc): undefined reference to sin'
/usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_step_16': gpu_fft_twiddles.c:(.text+0x37c): undefined reference to sin'
/usr/bin/ld: gpu_fft_twiddles.c:(.text+0x38c): undefined reference to pow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x3cc): undefined reference to sin'
/usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_step_32': gpu_fft_twiddles.c:(.text+0x450): undefined reference to sin'
/usr/bin/ld: gpu_fft_twiddles.c:(.text+0x460): undefined reference to pow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x484): undefined reference to sin'
/usr/bin/ld: /tmp/ccADw2NK.o: in function twiddles_step_64': gpu_fft_twiddles.c:(.text+0x51c): undefined reference to sin'
/usr/bin/ld: gpu_fft_twiddles.c:(.text+0x52c): undefined reference to pow' /usr/bin/ld: gpu_fft_twiddles.c:(.text+0x550): undefined reference to sin'
/usr/bin/ld: /tmp/ccSodvhL.o: in function main': hello_fft.c:(.text+0x408): undefined reference to cos'
/usr/bin/ld: hello_fft.c:(.text+0x418): undefined reference to pow' /usr/bin/ld: hello_fft.c:(.text+0x454): undefined reference to pow'
/usr/bin/ld: hello_fft.c:(.text+0x47c): undefined reference to pow' /usr/bin/ld: hello_fft.c:(.text+0x4dc): undefined reference to sqrt'
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.

  • Runtime error
    Since build for hello_video and hello_videocube had passed, I thought to run those.
    When I ran
    ./hello_video.bin test.h264

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

  • Which firmware version (vcgencmd version)? Oct 29 2021 10:49:08
    Copyright (c) 2012 Broadcom
    version b8a114e5a9877e91ca8f26d1a5ce904b2ad3cf13 (clean) (release) (start)
  • Which kernel version (uname -a)? Linux raspberrypi 5.10.63-v7+ #1459 SMP Wed Oct 6 16:41:10 BST 2021 armv7l GNU/Linux
Dominant language
No language data
Stars
5.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/firmware

All issues in raspberrypi/firmware

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.