A681B Linux Driver Build Issues
I see that there is finally a Linux driver available on https://www.mygica.com/support/ for my A681B. I downloaded it and extracted it on a fresh Ubuntu 20.04 server install.
To prep for compiling this, I did the following:
sudo apt install build-essential linux-source libproc-processtable-perl
The make release command outputs the following, consistent with the (outdated) instruction PDF:
eric@tubuntu:~/media_build_u20.04.1_ker5.4.0_lib$ make release
make -C /home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l release
make[1]: Entering directory '/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l'
No version yet, using 5.4.0-66-generic
make[1]: Leaving directory '/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l'
After this, I get the following errors when I try to build the driver using make:
eric@tubuntu:~/media_build_u20.04.1_ker5.4.0_lib$ make
make -C /home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l
make[1]: Entering directory '/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l'
Updating/Creating .config
make[2]: Entering directory '/home/eric/media_build_u20.04.1_ker5.4.0_lib/linux'
Patches for 5.4.0-66-generic already applied.
make[2]: Leaving directory '/home/eric/media_build_u20.04.1_ker5.4.0_lib/linux'
./scripts/make_kconfig.pl /lib/modules/5.4.0-66-generic/build /lib/modules/5.4.0-66-generic/build
Preparing to compile for kernel version 5.4.0
***WARNING:*** You do not have the full kernel sources installed.
This does not prevent you from building the v4l-dvb tree if you have the
kernel headers, but the full kernel source may be required in order to use
make menuconfig / xconfig / qconfig.
If you are experiencing problems building the v4l-dvb tree, please try
building against a vanilla kernel before reporting a bug.
Vanilla kernels are available at http://kernel.org.
On most distros, this will compile a newly downloaded kernel:
cp /boot/config-`uname -r` <your kernel dir>/.config
cd <your kernel dir>
make all modules_install install
Please see your distro's web site for instructions to build a new kernel.
WARNING: This is the V4L/DVB backport tree, with experimental drivers
backported to run on legacy kernels from the development tree at:
http://git.linuxtv.org/media-tree.git.
It is generally safe to use it for testing a new driver or
feature, but its usage on production environments is risky.
Don't use it in production. You've been warned.
CEC_CROS_EC: Requires at least kernel 9.255.255
V4L2_H264: Requires at least kernel 9.255.255
VIDEO_IPU3_CIO2: Requires at least kernel 9.255.255
VIDEO_OMAP3: Requires at least kernel 9.255.255
SND_BT87X: Requires at least kernel 9.255.255
INTEL_ATOMISP: Requires at least kernel 9.255.255
VIDEO_HANTRO: Requires at least kernel 9.255.255
VIDEO_ROCKCHIP_VDEC: Requires at least kernel 9.255.255
VIDEO_IPU3_IMGU: Requires at least kernel 9.255.255
./scripts/make_myconfig.pl
[ ! -f "./config-mycompat.h" ] && echo "/* empty config-mycompat.h */" > "./config-mycompat.h" || true
perl scripts/make_config_compat.pl /lib/modules/5.4.0-66-generic/build ./.myconfig ./config-compat.h
creating symbolic links...
Kernel build directory is /lib/modules/5.4.0-66-generic/build
make -C ../linux apply_patches
make[2]: Entering directory '/home/eric/media_build_u20.04.1_ker5.4.0_lib/linux'
Patches for 5.4.0-66-generic already applied.
make[2]: Leaving directory '/home/eric/media_build_u20.04.1_ker5.4.0_lib/linux'
make -C /lib/modules/5.4.0-66-generic/build M=/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l modules
make[2]: Entering directory '/usr/src/linux-headers-5.4.0-66-generic'
CC [M] /home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/msp3400-driver.o
In file included from <command-line>:
/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/compat.h:1594:19: error: redefinition of 'prandom_u32_max'
1594 | static inline u32 prandom_u32_max(u32 ep_ro)
| ^~~~~~~~~~~~~~~
In file included from ./include/linux/random.h:116,
from /home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/compat.h:1589,
from <command-line>:
./include/linux/prandom.h:76:19: note: previous definition of 'prandom_u32_max' was here
76 | static inline u32 prandom_u32_max(u32 ep_ro)
| ^~~~~~~~~~~~~~~
In file included from <command-line>:
/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/compat.h: In function 'prandom_u32_max':
/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/compat.h:1591:21: error: implicit declaration of function 'random32'; did you mean 'prandom_u32'? [-Werror=implicit-function-declaration]
1591 | #define prandom_u32 random32
| ^~~~~~~~
/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/compat.h:1596:22: note: in expansion of macro 'prandom_u32'
1596 | return (u32)(((u64) prandom_u32() * ep_ro) >> 32);
| ^~~~~~~~~~~
In file included from <command-line>:
/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/compat.h: At top level:
/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/compat.h:2438:19: error: redefinition of 'next_pseudo_random32'
2438 | static inline u32 next_pseudo_random32(u32 seed)
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/random.h:116,
from /home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/compat.h:1589,
from <command-line>:
./include/linux/prandom.h:105:19: note: previous definition of 'next_pseudo_random32' was here
105 | static inline u32 next_pseudo_random32(u32 seed)
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:271: /home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l/msp3400-driver.o] Error 1
make[2]: *** [Makefile:1760: /home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-5.4.0-66-generic'
make[1]: *** [Makefile:53: default] Error 2
make[1]: Leaving directory '/home/eric/media_build_u20.04.1_ker5.4.0_lib/v4l'
make: *** [Makefile:26: all] Error 2
What am I doing wrong here? Any suggestions or help are greatly appreciated!