Tevii DVB-S2 662

Edit: I made some edit to make the process easier and fix kernel headers rather then kernel source

Below a very ugly way to get this working… There are issues on both OSMC headers and the Tevii source which make things a bit complex.

media_build expects to have the kernel source (or at least headers) in /lib/modules/3.18.10-1-osmc/build

The first issue is that the headers are installed in cd /usr/src/rbp2-headers-3.18.10-1-osmc, so to fix this you do

sudo ln -s /usr/src/rbp2-headers-3.18.10-1-osmc /lib/modules/3.18.10-1-osmc/build

This should work in theory now, but the headers appears to be incomplete and you will get an error reffering to mach file not found…

./arch/arm/include/asm/barrier.h:41:27: fatal error: mach/barriers.h: No such file or directory

Including arch/arm/mach-bcm2709 in the headers should fix this… Ideally Sam should fix this in the header generation…

So let’s download the kernel source

set – $(cat /proc/cmdline) && for x in “$@”; do case “$x” in osmcdev=*) sudo apt-get update && sudo apt-get install -y “${x#osmcdev=}-source-$(uname -r)”; ;; esac; done

unpack them

sudo tar -xjvf /usr/src/rbp2-source-3.18.10-1-osmc.tar.bz2

and add the missing files…

sudo cp -r /usr/src/rbp2-source-3.18.10-1-osmc/arch/arm/mach-bcm2709/include/mach/ /usr/src/rbp2-headers-3.18.10-1-osmc/include/.

At this point, the environment should be ready and the compilation should work, however there seem to be a couple of issue with Tevii’s code.

You will first get an error on v4l/compat.h … (add the line with a +)

vi v4l/compat.h

#ifdef NEED_SMP_MB_AFTER_ATOMIC
+#ifndef smp_mb__after_atomic
#define smp_mb__after_atomic smp_mb__after_clear_bit
+#endif
#endif

And then
vi v4l/cxd2820r_core.c

static void cxd2820r_release(struct dvb_frontend *fe)              
{                                                 
        struct cxd2820r_priv *priv = fe->demodulator_priv;
        int uninitialized_var(ret); /* silence compiler warning */
        dev_dbg(&priv->i2c->dev, "%s\n", __func__);
#ifdef CONFIG_GPIOLIB
        /* remove GPIOs */
+/*                        
        if (priv->gpio_chip.label) {
                ret = gpiochip_remove(&priv->gpio_chip);
                if (ret) 
                        dev_err(&priv->i2c->dev, "%s: gpiochip_remove() " \
                                        "failed=%d\n", KBUILD_MODNAME, ret);
        }
+*/                       
#endif
        kfree(priv);
        return;               
} 

(note here a better fix would be to undefine CONFIG_GPIOLIB, I just wanted to fix the compile error. I have no idea if the device is going to use cxd2820r… If it doesn’t then this is irrelevant).

At this point it should complete without error and you can continue to follow Tevii’s instructions.

Edit 2:
I forgot. The above works on a rbp2. For rbp1 you should just need to change the paths (rbp2->rbp1).

I dont have a Vero so can’t tell if it has the same header issue…

Edit 3:
Check How to Obtain, Build and Install V4L-DVB Device Drivers - LinuxTVWiki and install the missing requirements.