tbsdtv / linux_media

TBS linux open source drivers
https://github.com/tbsdtv/linux_media/wiki
Other
174 stars 81 forks source link

Building on Pi 4 CM4 GCC13 #353

Closed SonnyWalkman closed 3 months ago

SonnyWalkman commented 5 months ago

Hello, I've tried many attempts to build the TBS driver v4l tree on the Pi CM4 running either 24.04LTS Ubuntu server headless and raspberrian arm64 bookworm. Same deal.

solo6x10 seems the issue when compiling, crashes out if build. Don't know much about skipping past it?

Is there dpkg available?

Error I get below.

........ compilation ..........

CC [M] /home/dvb/media_build/v4l/solo6x10-enc.o CC [M] /home/dvb/media_build/v4l/solo6x10-v4l2-enc.o gcc-13: fatal error: Killed signal terminated program cc1 compilation terminated. make[4]: [scripts/Makefile.build:243: /home/dvb/media_build/v4l/solo6x10-core.o] Error 1 make[4]: Waiting for unfinished jobs.... gcc-13: fatal error: Killed signal terminated program cc1 compilation terminated. make[4]: [scripts/Makefile.build:243: /home/dvb/media_build/v4l/solo6x10-p2m.o] Error 1 gcc-13: fatal error: Killed signal terminated program cc1 compilation terminated. make[4]: [scripts/Makefile.build:243: /home/dvb/media_build/v4l/solo6x10-enc.o] Error 1 make[3]: [/usr/src/linux-headers-6.8.0-1004-raspi/Makefile:1926: /home/dvb/media_build/v4l] Error 2 make[2]: [Makefile:240: __sub-make] Error 2 make[2]: Leaving directory '/usr/src/linux-headers-6.8.0-1004-raspi' make[1]: [Makefile:53: default] Error 2 make[1]: Leaving directory '/home/dvb/media_build/v4l' make: [Makefile:26: all] Error 2

SonnyWalkman commented 5 months ago

Is there a method to just compile the TBS drivers (TBS-6522H) without a full line-up of cards? Much easier and don't have to spend hours on the build process.

If so, how do you set the parameters?

crazycat69 commented 5 months ago

make menuconfig

SonnyWalkman commented 5 months ago

make menuconfig

Wish it was that simple.Unfortunately make menuconfig doesn't work

SonnyWalkman commented 5 months ago

I've contacted Jack at TBS. He's advised building for arm64 doesn't work and offered a working arm32 image.

Unfortunately, I'm using the newer TBS-6522H multisystem quad card and drivers aren't in the tbs package?

He's offered to get it sorted for my card so hopefully I'll get it all working on raspberry pi4.

Having drivers working on arm64 should be the goal since arm32 phases out to arm64..

What's involved in converting sources to 64 bit?

If arm64 was not supported, why did the build script let me build 75% before crashing?? I suspect bad code? Lots of warnings on unused variables littered on c sources.

Think the build is safe with amd64 but not arm64?

Better yet, could we have a tbs cards only build which has drivers for the tbs series.

All the other 600 so dvb cards I don't care about. What is you take on a TBS only build environment using more modern tools like Meson and select what you need with build options like used with the Gstreamer framework? Make and package tools with Perl scripts to do the funky checks possibly unsupported in future.

crazycat69 commented 5 months ago

arm64 supported, but you have some compiler issue (maybe too many CPU cores used for make ?)

SonnyWalkman commented 5 months ago

Hi @crazycat69

Tried using make with one processor.

Slow, slow and ended in tears with the same error. Obviously something not right with the code.

Tried using gcc 12 and gcc 13. Both pulled the same error.

Not sure where to go from here?

crazycat69 commented 5 months ago

Some internal compiler error, present in ubuntu 24.04 beta for x86_64 (resolved in release build) https://github.com/tbsdtv/linux_media/issues/344

try disable CONFIG_VIDEO_SOLO6X10 in v4l/.config:

CONFIG_VIDEO_SOLO6X10 n

SonnyWalkman commented 5 months ago

Hi again @crazycat69

Thanks for the tip. I've commented out #CONFIG_VIDEO_SOLO6X10 and successfully compiled the lot.

Big thankyou..

Now, leveraging on a bit of knowledge with the .config file, if i'm wanting to compile the TBS card drivers no other, What other dependencies do I need in the build? Could I simply comment most of the drivers except tbs in v4l/.config? I'm assuming there'll need some base drives which I don't know which one's I require for a working system?
image

crazycat69 commented 5 months ago

better use make menuconfig (require ncurces lib) or make config (interactive console config) Disable RC and CEC support, Cameras and video grabbers, Analog TV, AM/FM receivers, SDR, Paltform specific drivers and unused USB, PCI media devices.

SonnyWalkman commented 5 months ago

Thanks @crazycat69

I needed to add dtoverlay=pcie-32bit-dma to the config.txt file.

I'll install ncurces and try your make menuconfig to select my single tbsec3p plus the others I see in lsmod.

Below is a view of info from last /dev/dvb command.

image

sunsettrack4 commented 4 months ago

Hi @crazycat69

Tried using make with one processor.

Slow, slow and ended in tears with the same error. Obviously something not right with the code.

Tried using gcc 12 and gcc 13. Both pulled the same error.

Not sure where to go from here?

Alternative solution: Just use a larger swap file (4096 MB): https://pimylifeup.com/raspberry-pi-swap-file/ and one processor