DVB-S2 Tuner AVL6211 support on S905/S905H/S905D

Android DVB-S2.pdf (1.8 MB)

S905D.dts.txt (47.9 KB)

coreelecdvb.dts.txt (59.6 KB)

coreelecdvb_ser.dts.txt (59.6 KB)

After installing CoreELEC 21.3 with gxl_p231_2g_dvb.dtb as dtb.img everything seems working except for some freezes/crashes and dvb tuner which is not detected by default, after trying many things like different dtbs gxl_p231_2g_dvb_ser.dtb, different CoreELEC builds 9.2.8, 20.5, the only builds that get dvb tuner detected by default are builds 9.x.x but they only include driver for AVL6862.
Back to CoreELEC 21.3 :

CoreELEC:~ # dmesg | grep -i dvb
[    0.000000@0]d CoreELEC dt-id: gxl_p231_2g_dvb
CoreELEC:~ # ls /dev/dvb/
ls: /dev/dvb/: No such file or directory

So installed CoreELEC Module Drivers then DVB drivers from the latest kernel, rebooted this time :

CoreELEC:~ # dmesg | grep -i dvb
[    0.000000@0]d CoreELEC dt-id: gxl_p231_2g_dvb
[    7.002147@3]- kernel-overlays-setup: processing conf /storage/.cache/kernel-overlays/50-driver.dvb.dvb-latest.conf
[    7.045959@0]- kernel-overlays-setup: added modules from /storage/.kodi/addons/driver.dvb.dvb-latest//kernel-overlay/lib/modules/4.9.269
[   14.701412@3]- dvb_meson: no symbol version for amports_switch_gate
[   14.711019@3]- dvb_meson dvb: Found i2c-1 adapter: Meson I2C adapter
[   14.711027@3]- dvb_meson dvb: ts0: parallel
[   14.711314@3]- dvb_meson dvb: ts0_control: 0x0
[   14.711430@3]- dvb_meson dvb: dev_name=dvb
[   15.950570@2]- dvb_meson dvb: DVB demod detection for i2c-1 (Meson I2C adapter)…
[   17.164616@1]- dvb_meson dvb: Checking for Availink AVL6862 DVB-S2/T2/C demod …
[   17.164734@0]- i2c i2c-1: dvb_meson: i2c wr failed=-6 len=3
[   17.164807@0]- i2c i2c-1: dvb_meson: i2c rd failed=-6 len=4
[   17.164874@0]- i2c i2c-1: dvb_meson: i2c wr failed=-6 len=3
[   17.164935@0]- i2c i2c-1: dvb_meson: i2c rd failed=-6 len=4
[   17.164941@0]- i2c i2c-1: dvb_meson: attach failed reading id
[   17.164950@0]- dvb_meson dvb: Failed to find AVL6862 demod!
[   18.380579@1]- dvb_meson dvb: Checking for AVL6211 DVB-S/S2 demod …
[   18.380996@0]- i2c i2c-1: AVL6211+AV2011 DVB-S/S2 successfully attached
[   18.381010@0]- dvb_meson dvb: Total DVB modules found: 1
[   18.394152@0]- dvbdev: DVB: registering new adapter (dvb_meson)
[   18.403883@2]- dvb_meson dvb: DVB: registering adapter 0 frontend 0 (Availink AVL6211+AV2011 DVB-S/S2)…
[   18.404369@2]- Meson DVB frontend(s) registered successfully.
CoreELEC:~ # ls /dev/dvb/
adapter0

After installing Tvheadend Server 4.3 DVB tuner is detected but couldn’t get any signal, tried some DVB Tools commands :

CoreELEC:~ # dvb-fe-tool -a 0 --femon (0x00) (0x00) (0x00) ^CERROR FE_SET_VOLTAGE: Operation not permitted

After trying to manually decompile android box dtb.img to a dts which I got from a zip update file and decompiling dtb.img from CoreELEC to try to match them but knowing that different kernel and different mapping used on both so couldn’t find a way to actually achieve this.

In the attached files the box hardware layout, the decompiled files of both CoreELEC gxl_p231_2g_dvb.dts, CoreELEC gxl_p231_2g_dvb_ser.dts and original_android.dts, I’ve tried everything I can think of DTS editing, DTB conversions, comparing Android and CoreELEC trees, testing older CoreELEC builds, and cross-checking board variants (gxl_p212, etc.). But the tuner (AVL6211) still isn’t detected properly.

If someone with deeper knowledge of Amlogic DVBS/DVBS-2 drivers, DTBs, or CoreELEC kernel quirks can step in, your help could solve this once and for all.

Thanks in advance to anyone who can take a look.

1 Like

try this

dvb-fe-tool -a 0 --voltage=13

dvb-fe-tool -a 0 --voltage=18

CoreELEC:~ # dvb-fe-tool -a 0 --set-voltage 13
dvb-fe-tool: unrecognized option ā€˜ā€“set-voltage’
Try dvb-fe-tool --help' or dvb-fe-tool --usage’ for more information.
Usage: dvb-fe-tool [OPTION…]

CoreELEC:~ #  dvb-fe-tool -a 0 --verbose
Found dvb demux device: dvb0.demux0
path: /dev/dvb/adapter0/demux0
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.demux0
bus addr: platform:dvb
Found dvb demux device: dvb0.demux1
path: /dev/dvb/adapter0/demux1
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.demux1
bus addr: platform:dvb
Found dvb demux device: dvb0.demux2
path: /dev/dvb/adapter0/demux2
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.demux2
bus addr: platform:dvb
Found dvb dvr device: dvb0.dvr0
path: /dev/dvb/adapter0/dvr0
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.dvr0
bus addr: platform:dvb
Found dvb dvr device: dvb0.dvr1
path: /dev/dvb/adapter0/dvr1
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.dvr1
bus addr: platform:dvb
Found dvb dvr device: dvb0.dvr2
path: /dev/dvb/adapter0/dvr2
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.dvr2
bus addr: platform:dvb
Found dvb frontend device: dvb0.frontend0
path: /dev/dvb/adapter0/frontend0
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.frontend0
bus addr: platform:dvb
Found dvb net device: dvb0.net0
path: /dev/dvb/adapter0/net0
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.net0
bus addr: platform:dvb
Found dvb net device: dvb0.net1
path: /dev/dvb/adapter0/net1
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.net1
bus addr: platform:dvb
Found dvb net device: dvb0.net2
path: /dev/dvb/adapter0/net2
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.net2
bus addr: platform:dvb
Selected dvb frontend device: dvb0.frontend0
path: /dev/dvb/adapter0/frontend0
sysfs path: /sys/devices/platform/dvb/dvb/dvb0.frontend0
bus addr: platform:dvb
Device Availink AVL6211+AV2011 DVB-S/S2 (/dev/dvb/adapter0/frontend0) capabilities:
CAN_2G_MODULATION
CAN_FEC_1_2
CAN_FEC_2_3
CAN_FEC_3_4
CAN_FEC_4_5
CAN_FEC_5_6
CAN_FEC_6_7
CAN_FEC_7_8
CAN_FEC_8_9
CAN_FEC_AUTO
CAN_INVERSION_AUTO
CAN_QPSK
CAN_RECOVER
DVB API Version 5.11, Current v5 delivery system: DVBS2
Supported delivery systems:
DVBS
[DVBS2]
Frequency range for the current standard:
From:             950 MHz
To:              2.15 GHz
Symbol rate ranges for the current standard:
From:             800 kBauds
To:              50.0 MBauds
SEC: set voltage to OFF
ERROR    FE_SET_VOLTAGE: Operation not permitted

After digging further I think the problem is in tuner’s LNB controller AV2011, there is no hardware path to voltage, because DTB don’t enables the AV2011 chip but am not sure.

It’s most likely not a hardware issue, but a driver wrapper error. But you can measure the LNB output voltage with a meter. If you find 13 or 18 volts, the fault is definitely with the driver. If the frontend works with the old CoreElec 9.2 kernel 3.14, there’s a bug in the new driver.

I’m no expert, but your device appears to have a dual tuner on Android DTS. So, there are two AVL6211s. I need a photo of the demod and tuner on the motherboard, along with a full dmesg. Try the following for the correct configuration for 4.9.

add nodes coreelec dts

/ {
    dvb {
        compatible = "amlogic, dvb";
        dev_name = "dvb";
        ts0 = "serial";
        ts0_control = <0x800>;
        ts0_invert = <0x00>;
        ts1 = "serial";
        ts1_control = <0x800>;
        ts1_invert = <0x00>;

        pinctrl-names = "s_ts0", "s_ts1";
        pinctrl-0 = <&tsin_a_pins>;
        pinctrl-1 = <&tsin_b_pins>;

        resets = <&clkc CLKC_RESET_DEMUX>,
                 <&clkc CLKC_RESET_ASYNC_FIFO>,
                 <&clkc CLKC_RESET_AHB_ARB0>,
                 <&clkc CLKC_RESET_PARSER_TOP>;
        reset-names = "demux", "asyncfifo", "ahbarb0", "uparsertop";
    };

    dvbfe {
        compatible = "amlogic, dvbfe";
        dev_name = "dvbfe";

        /* Frontend 0 */
        dtv_demod0 = "Avl6211";
        dtv_demod0_i2c_bus = <&i2c2>;
        dtv_demod0_i2c_addr = <0x0c>;
        dtv_demod0_reset_gpio = <&gpio GPIOX_12 GPIO_ACTIVE_LOW>;

        fe0_dtv_demod = <0>;
        fe0_ts = <0>;
        fe0_dev = <0>;

        /* Frontend 1 */
        dtv_demod1 = "Avl6211";
        dtv_demod1_i2c_bus = <&i2c3>;
        dtv_demod1_i2c_addr = <0x0c>;
        dtv_demod1_reset_gpio = <&gpio GPIOX_3 GPIO_ACTIVE_LOW>;

        fe1_dtv_demod = <1>;
        fe1_ts = <1>;
        fe1_dev = <1>;
    };
};

&i2c2 {
    status = "okay";
    clock-frequency = <100000>;
};

&i2c3 {
    status = "okay";
    clock-frequency = <100000>;
};

&pinctrl {
    tsin_a_pins: tsin_a {
        mux {
            groups = "tsin_a";
            function = "tsin_a";
        };
    };

    tsin_b_pins: tsin_b {
        mux {
            groups = "tsin_b";
            function = "tsin_b";
        };
    };

Getting syntax error when trying to compile the dts file after editing, error on line resets = <&clkc CLKC_RESET_DEMUX>,I think it has to be in the same instructions set that CoreELEC used for kernel 4.9.

Full dmesg attached (using gxl_p231_2g_dvb_ser.dtb and crazy cat drivers).

Full dmesg.txt (111.7 KB)

demotulator ok but tuner ?

if android dts is true. i2c-2 or i2c3

dvb {
compatible = ā€œamlogic, dvbā€;
dev_name = ā€œdvbā€;
ts0 = ā€œserialā€;
ts0_control = <0x800>;
ts0_invert = <0x00>;
ts1 = ā€œserialā€;
ts1_control = <0x800>;
ts1_invert = <0x00>;
pinctrl-names = ā€œs_ts0\0s_ts1ā€;
pinctrl-0 = <0x72>;
pinctrl-1 = <0x73>;
resets = <0x08 0x24 0x08 0x10 0x08 0x3d 0x08 0x39>;
reset-names = ā€œdemux\0asyncfifo\0ahbarb0\0uparsertopā€;
};

dvbfe {
	compatible = "amlogic, dvbfe";
	dev_id = <0x01>;
	dev_name = "dvbfe";
	dtv_demod0 = "Avl6211";
	dtv_demod0_i2c_adap_id = <0x02>;
	dtv_demod0_i2c_addr = <0x0c>;
	dtv_demod0_reset_value = <0x00>;
	dtv_demod0_reset_gpio = <0x18 0x3c 0x00>;
	fe0_dtv_demod = <0x00>;
	fe0_ts = <0x00>;
	fe0_dev = <0x00>;
	dtv_demod1 = "Avl6211";
	dtv_demod1_i2c_adap_id = <0x03>;
	dtv_demod1_i2c_addr = <0x0c>;
	dtv_demod1_reset_value = <0x00>;
	dtv_demod1_reset_gpio = <0x18 0x0c 0x00>;
	fe1_dtv_demod = <0x01>;
	fe1_ts = <0x01>;
	fe1_dev = <0x01>;
};

smartcard {
	compatible = "amlogic,smartcard";
	irq_trigger_type = "GPIO_IRQ_LOW";
	reset_pin-gpios = <0x18 0x46 0x00>;
	detect_pin-gpios = <0x18 0x45 0x00>;
	enable_pin-gpios = <0x18 0x42 0x00>;
	interrupts = <0x00 0x45 0x04>;
	smc0_clock_source = <0x00>;
	smc0_irq = <0x45>;
	smc0_det_invert = <0x00>;
	smc0_5v3v_level = <0x00>;
	smc_need_enable_pin = "yes";
	enable_level = <0x00>;
	smc0_clk_pinmux_reg = <0x30>;
	smc0_clk_pinmux_bit = <0x80>;
	smc0_clk_oen_reg = <0x200f>;
	smc0_clk_out_reg = <0x2010>;
	smc0_clk_bit = <0x2000>;
	smc0_clk_oebit = <0x2000000>;
	smc0_clk_oubit = <0x1000000>;
	pinctrl-names = "default";
	pinctrl-0 = <0x74>;
	resets = <0x08 0x0b>;
	reset-names = "smartcard";
	status = "okay";
};

The tuner works in the orginal android box os but not on CoreELEC, after editing the dtb file like above, the dvb tuner is no longer detected

CoreELEC:~ # ls /dev/dvb/
ls: /dev/dvb/: No such file or directory

Tried to include the dvbfe inside dvb same result, maybe 0x800 in CoreELEC doesn’t map the same as 0x800 in android box os.
Tried another box with S905H but it only works with CoreELEC non ng builds like 9.2.8 kernel 3.14.29, the problem is that box also has DVB-S2 tuner AVL6211 but CoreELEC 9.x.x only include driver for avl6862, for the first box S905D the CoreELEC ng build 9.2.8 kernel 4.9 dvb tuner is detected by default from first boot but also wrong driver.

S905H.dts.txt (41.7 KB)

I decided to boot into the original OS and extract the DTB just to be sure. It turns out that it’s not the same DTB that was included with the update ZIP file.
Really sorry about the confusion.
Here is the exact S905D DTB pulled directly from the OS, also updated the file in the first post and S905H.dts it turns out dtb files from the update images are not the same as the one directly loaded into the os.

S905D.dts.txt (47.9 KB)