tbsdtv / linux_media

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

Compilation fails on Raspberry Pi 5.15.32-v7+ #287

Open LukeLR opened 2 years ago

LukeLR commented 2 years ago

Hi everyone, I've successfully compiled the drivers for my TBS-5580 on Arch Linux, but I'm failing to do so on Raspbian for two days straight now. I've followed the instructions in the wiki:

git clone https://github.com/tbsdtv/media_build.git
git clone --depth=1 https://github.com/tbsdtv/linux_media.git -b latest ./media
cd media_build
make dir DIR=../media
make allyesconfig
make -j4
sudo make install

However, the make -j4 step fails with:

ERROR: modpost: "saa7146_pgtable_free" [/home/pi/git/media_build/v4l/saa7146_vv.ko] undefined!
ERROR: modpost: "saa7146_pgtable_alloc" [/home/pi/git/media_build/v4l/saa7146_vv.ko] undefined!
ERROR: modpost: "saa7146_pgtable_build_single" [/home/pi/git/media_build/v4l/saa7146_vv.ko] undefined!
ERROR: modpost: "__aeabi_ldivmod" [/home/pi/git/media_build/v4l/mn88436.ko] undefined!
ERROR: modpost: "__aeabi_uldivmod" [/home/pi/git/media_build/v4l/mn88436.ko] undefined!

What I've tried so far:

When commenting all occurences of saa7146_vv.ko and mn88436.ko in v4l/Makefile.media, build succeeds, but loading the module fails:

sudo insmod /lib/modules/5.15.32-v7+/updates/extra/media/usb/dvb-usb/dvb-usb-tbs5580.ko
insmod: ERROR: could not insert module /lib/modules/5.15.32-v7+/updates/extra/media/usb/dvb-usb/dvb-usb-tbs5580.ko: Unknown symbol in module

make menuconfig, as suggested in #220 fails with

/lib/modules/5.15.32-v7+/build/scripts/kconfig/mconf ./Kconfig
Kconfig.kern:502: syntax error
Kconfig.kern:501: unknown statement "option"

Any ideas on how to compile the drivers on Raspberry Pi?

Thanks a lot in advance!

Kitoko86 commented 1 year ago

Kconfig.kern:501: unknown statement "option"

You can remove the "option" statement at line 658 in the file make_kconfig.pl and run make menuconfig again.

LukeLR commented 1 year ago

Thanks, that helped. Now I get a terminal UI called "V4L/DVB menu" with a couple of selection options. Under Multimedia support -> Media device types I can select Digital TV, and Multimedia support -> Media drivers -> Media USB Adapters there is an option TurboSight TBS5580 CI support. Saving this file to the default name of .config and running make -j4 and sudo make install afterwards however installs just one module:

Installing kernel modules under /lib/modules/5.19.12-arch1-1/updates/extra/media/:
    pci/cx88/: cx8802.ko 

Even when enabling all possible options in all submenus, only this one module gets installed. So maybe the .config file needs to be saved under a different name?

LukeLR commented 1 year ago

Apparently, the .config file gets saved in the v4l subdirectory. However, it seems it's only read when saved to the main directory (media_build). When doing so, more kernel modules get build, but now I get

ERROR: modpost: "saa7146_pgtable_free" [/home/pi/git/media_build/v4l/saa7146_vv.ko] undefined!
ERROR: modpost: "saa7146_pgtable_alloc" [/home/pi/git/media_build/v4l/saa7146_vv.ko] undefined!
ERROR: modpost: "saa7146_pgtable_build_single" [/home/pi/git/media_build/v4l/saa7146_vv.ko] undefined!
ERROR: modpost: "__aeabi_ldivmod" [/home/pi/git/media_build/v4l/mn88436.ko] undefined!
ERROR: modpost: "__aeabi_uldivmod" [/home/pi/git/media_build/v4l/mn88436.ko] undefined!

again. Any ideas?

LukeLR commented 1 year ago

I followed the instructions in #260 and the documentation linked by the user, and now compilation finishes with:

./scripts/rmmod.pl check
found 511 modules

Sounds reasonable, sudo make install also installs a lot of modules. However, loading the module still fails with:

pi@mediapi:~/git/media_build $ sudo modprobe -v dvb-usb-tbs5580
insmod /lib/modules/5.15.61-v7+/updates/extra/media/dvb-core/dvb-core.ko 
modprobe: ERROR: could not insert 'dvb_usb_tbs5580': Invalid argument

The kernel buffer shows:

[54224.806155] dvb_core: loading out-of-tree module taints kernel.
[54224.808591] dvb_core: disagrees about version of symbol media_devnode_remove
[54224.808601] dvb_core: Unknown symbol media_devnode_remove (err -22)
[54224.808670] dvb_core: disagrees about version of symbol vb2_core_queue_init
[54224.808679] dvb_core: Unknown symbol vb2_core_queue_init (err -22)
[54224.808740] dvb_core: disagrees about version of symbol vb2_core_reqbufs
[54224.808749] dvb_core: Unknown symbol vb2_core_reqbufs (err -22)
[54224.808786] dvb_core: disagrees about version of symbol vb2_core_expbuf
[54224.808795] dvb_core: Unknown symbol vb2_core_expbuf (err -22)
[54224.808940] dvb_core: disagrees about version of symbol media_create_intf_link
[54224.808949] dvb_core: Unknown symbol media_create_intf_link (err -22)
[54224.808976] dvb_core: disagrees about version of symbol media_create_pad_links
[54224.808985] dvb_core: Unknown symbol media_create_pad_links (err -22)
[54224.809016] dvb_core: disagrees about version of symbol media_create_pad_link
[54224.809025] dvb_core: Unknown symbol media_create_pad_link (err -22)
[54224.809117] dvb_core: disagrees about version of symbol media_device_register_entity
[54224.809126] dvb_core: Unknown symbol media_device_register_entity (err -22)
[54224.809182] dvb_core: disagrees about version of symbol vb2_core_queue_release
[54224.809191] dvb_core: Unknown symbol vb2_core_queue_release (err -22)
[54224.809276] dvb_core: disagrees about version of symbol vb2_buffer_done
[54224.809285] dvb_core: Unknown symbol vb2_buffer_done (err -22)
[54224.809312] dvb_core: disagrees about version of symbol vb2_plane_vaddr
[54224.809321] dvb_core: Unknown symbol vb2_plane_vaddr (err -22)
[54224.809348] dvb_core: disagrees about version of symbol media_entity_pads_init
[54224.809357] dvb_core: Unknown symbol media_entity_pads_init (err -22)
[54224.809409] dvb_core: disagrees about version of symbol vb2_vmalloc_memops
[54224.809417] dvb_core: Unknown symbol vb2_vmalloc_memops (err -22)
[54224.809451] dvb_core: disagrees about version of symbol vb2_core_poll
[54224.809460] dvb_core: Unknown symbol vb2_core_poll (err -22)
[54224.809496] dvb_core: disagrees about version of symbol vb2_core_streamon
[54224.809505] dvb_core: Unknown symbol vb2_core_streamon (err -22)
[54224.809547] dvb_core: disagrees about version of symbol media_get_pad_index
[54224.809556] dvb_core: Unknown symbol media_get_pad_index (err -22)
[54224.809624] dvb_core: disagrees about version of symbol vb2_core_querybuf
[54224.809633] dvb_core: Unknown symbol vb2_core_querybuf (err -22)
[54224.809653] dvb_core: disagrees about version of symbol vb2_core_qbuf
[54224.809662] dvb_core: Unknown symbol vb2_core_qbuf (err -22)
[54224.809690] dvb_core: disagrees about version of symbol media_devnode_create
[54224.809699] dvb_core: Unknown symbol media_devnode_create (err -22)
[54224.809720] dvb_core: disagrees about version of symbol vb2_mmap
[54224.809729] dvb_core: Unknown symbol vb2_mmap (err -22)
[54224.809755] dvb_core: disagrees about version of symbol media_device_unregister_entity
[54224.809764] dvb_core: Unknown symbol media_device_unregister_entity (err -22)
[54224.809785] dvb_core: disagrees about version of symbol vb2_core_dqbuf
[54224.809793] dvb_core: Unknown symbol vb2_core_dqbuf (err -22)
[54224.809834] dvb_core: disagrees about version of symbol vb2_core_streamoff
[54224.809843] dvb_core: Unknown symbol vb2_core_streamoff (err -22)

Any ideas? It can't be that hard to get this device running under Linux, what am I missing?