Compiling TBS TV tuner open source drivers

When compiling according to the instructions at https://github.com/ljalves/linux_media/wiki/Installating, it fails when not able to find a kernel config file:

ubuntu@tegra-ubuntu:~/media_build$ make
make -C /home/ubuntu/media_build/v4l 
make[1]: Entering directory `/home/ubuntu/media_build/v4l'
Updating/Creating .config
make[2]: Entering directory `/home/ubuntu/media_build/linux'
Syncing with dir ../../media
Patches for 3.10.40-grinch-21.3.4 already applied.
make[2]: Leaving directory `/home/ubuntu/media_build/linux'
Preparing to compile for kernel version 3.10.40
File not found: /lib/modules/3.10.40-grinch-21.3.4/build/.config at ./scripts/make_kconfig.pl line 33, <IN> line 4.
make[1]: *** No rule to make target `.myconfig', needed by `config-compat.h'.  Stop.
make[1]: Leaving directory `/home/ubuntu/media_build/v4l'
make: *** [all] Error 2

What does ‘patches for 3.10.40-grinch-21.3.4 already applied’ mean? patches from where?

I’m not at my Jetson at the moment, but it looks like it is expected that you’d have the optional Grinch kernel installed…it’s looking for a module directory with “LOCALVERSION” of “-grinch-21.3.4”. Installing this optional kernel would mean that the modules would exist at:

/lib/modules/3.10.40-grinch-21.3.4

Have you installed this optional kernel? If not, it seems the configuration of the software in your media_build directory is expecting Grinch. What is the output of:

uname -a

?

Linux tegra-ubuntu 3.10.40-grinch-21.3.4 #1 SMP PREEMPT Fri May 1 10:41:09 UTC 2015 armv7l armv7l armv7l GNU/Linux

I installed grinch using this method: https://github.com/jetsonhacks/installGrinch

Where would the optional kernels for 21.3.4 be found?

here is ls /lib/modules/-grinch-/

ubuntu@tegra-ubuntu:~/media_build$ ls /lib/modules/3.10.40-grinch-21.3.4/
build          modules.alias.bin    modules.dep.bin  modules.symbols
extra          modules.builtin      modules.devname  modules.symbols.bin
kernel         modules.builtin.bin  modules.order    source
modules.alias  modules.dep          modules.softdep

Grinch itself is the optional kernel. The output shown above indicates Grinch is installed and running. It seems whatever you are building is trying to add a patch which your Grinch kernel already has…this in itself is not a problem (it’s basically checking to find out if it needs to do this…it doesn’t, so the step doesn’t do anything other than check).

The .config file needs to be updated with the current kernel configuration which is actually running, placed in the kernel source top level directory. A compressed version of what you need is in /proc/config.gz (e.g., cd to the directory where you want your .config, then “zcat /proc/config.gz > .config”). This file will need one edit to be an exact match to your existing kernel…this edit helps it find the module directory. Based on what I see above, CONFIG_LOCALVERSION needs to be set to “-grinch-21.3.4”. E.G.:

CONFIG_LOCALVERSION="-grinch-21.3.4"

See if adding that file with that edit does the job.

You’ll probably want to move this to the Nano forum since this is for the older 32-bit TK1. See:
https://forums.developer.nvidia.com/c/agx-autonomous-machines/jetson-embedded-systems/jetson-nano/76

Btw, if this is a UVC driver, then you won’t need to add this. After moving to the Nano forum you will probably also want to include log output during USB insert. Run “dmesg --follow”, and then see what prints as you connect the USB to the device. You’ll also want to include the output of “lsusb” when USB is connected. Preferably, since testing if this is already supported without a special driver, with a system that does not have any modifications.

PS: I did see some of that hardware requires firmware as well, but I did not see if this was true for your specific device. You may want to confirm if firmware is or isn’t required.

Can you post this to the Nano forum instead with a new topic? See:
https://forums.developer.nvidia.com/c/agx-autonomous-machines/jetson-embedded-systems/jetson-nano/76

Include that information. FYI, it looks like the tuner is this entry:
Bus 001 Device 006: ID 734c:5521 TBS Technologies China

This means you could get a verbose lsusb showing just this device under that ID:
sudo lsusb -d 734c:5521 -vvv

When you post in the Nano forum, please include the above verbose lsusb output. The TK1 is more or less a legacy product from 32-bit days, whereas a Nano is 64-bit and actively developed. You might not get views for the topic in this forum.