Posts by taki

    Based on the information from rozpruwacz, I think I managed to get the hardware PID filter working. The software filter is already running. From what I understand, many DVB players prefer the DVR line. I’m not sure, but Amlogic’s own player checks the DMX line. It’s a pretty complicated topic, though. The driver now shows the interrupt names as well. There are no segfaults. Now I just need to check if the second DMX line is working. I also added some code to see if the reset and power GPIOs are being probed by the driver. This way, we can determine whether the new device’s GPIO pins are being connected by the driver. There’s a section in the driver that outputs a lot of debug messages. These will be minimized once the driver matures. There are two key issues and approaches here.

    1-It seems highly unlikely that 90% of the demodulators and tuners used in Mainline Amlogic boxes will be accepted by Mainline, or that someone will take the time to fix and integrate the drivers according to Mainline standards. Therefore, it makes more sense to use the drivers that work on our devices as add-ons; otherwise, we’d have to constantly write new patches for the main kernel, which is updated with every build.

    2-There are latency and waiting issues on the I2C bus caused by the demod/tuner connection in Amlogic hardware. Even if the driver works, it may fail on the next boot and work on the one after that. This is related to the hardware’s frontend architecture and requires very fine-tuning.

    While I was at it, I added nim_socket. Maybe Engima 2 compilers will be needed in the future. There are no upsides to libreelec.

    ibreELEC:~ # uname -a
    Linux LibreELEC 6.19.0 #1 SMP Fri Mar 13 02:03:55 +03 2026 aarch64 GNU/Linux
    LibreELEC:~ # cat /proc/bus/nim_sockets
    NIM Socket 0:
        Type: DVB-T2
        Name: Availink avl6862
        Frontend_Device: 0
        I2C_Device: 3
        Has_Outputs: yes
        Mode 0: DVB-S
        Mode 1: DVB-T
        Mode 2: DVB-C
        Internally_Connectable: 0

    For testing, I tried kernel 5.15 on coreelec. I scanned dvbv5 channels on both frontends at the same time. I searched with ts0 avl6762demod +mxl 608 tuner GIC-0 55 Edge, ts1 avl6261 demo and av2018 GIC-0 37 Edge. bingo demux irq data increasing. Now it's time to focus on the mainline driver. The hardware was working.

    :)CoreELEC:~ # cat /proc/interrupts | grep -E "dmx|dvr"
    40: 360 0 0 0 GIC-0 55 Edge dmx irq
    41: 45 0 0 0 GIC-0 37 Edge dmx irq
    42: 0 0 0 0 GIC-0 53 Edge dmx irq
    43: 0 0 0 0 GIC-0 51 Edge dvr irq
    44: 0 0 0 0 GIC-0 57 Edge dvr irq
    CoreELEC:~ # cat /proc/interrupts | grep -E "dmx|dvr"
    40: 375 0 0 0 GIC-0 55 Edge dmx irq
    41: 57 0 0 0 GIC-0 37 Edge dmx irq
    42: 0 0 0 0 GIC-0 53 Edge dmx irq
    43: 0 0 0 0 GIC-0 51 Edge dvr irq
    44: 0 0 0 0 GIC-0 57 Edge dvr irq
    CoreELEC:~ # cat /proc/interrupts | grep -E "dmx|dvr"
    40: 485 0 0 0 GIC-0 55 Edge dmx irq
    41: 203 0 0 0 GIC-0 37 Edge dmx irq
    42: 0 0 0 0 GIC-0 53 Edge dmx irq
    43: 0 0 0 0 GIC-0 51 Edge dvr irq
    44: 0 0 0 0 GIC-0 57 Edge dvr irq
    CoreELEC:~ # cat /proc/interrupts | grep -E "dmx|dvr"
    40: 485 0 0 0 GIC-0 55 Edge dmx irq
    41: 350 0 0 0 GIC-0 37 Edge dmx irq
    42: 0 0 0 0 GIC-0 53 Edge dmx irq
    43: 0 0 0 0 GIC-0 51 Edge dvr irq
    44: 0 0 0 0 GIC-0 57 Edge dvr irq
    CoreELEC:~ #

    taki it might be a bug that I found when porting vendor driver to mainline.
    In aml_dmx.c You will find sunch code:

    Change 1<<(NEW_PDTS_READY) to 0<<(NEW_PDTS_READY) and check if it helps.
    For some reason this NEW_PDTS_READY interrupt source triggers at a very high rate and the kernel disables it. Disabling this interrupt is only a workaround but I don't know how to fix that better. And by looking at the code this interrupt source is not relevant.

    The other thing is that when using tvheadend I also have no dmx_irqs (only dvr_irqs).
    But when using dvbv5-zap (dvbv5-zap -c dvb_channel.conf -r "Some channel") I get dmx_irqs:

    Code
    48: 308 0 0 0 GICv2 55 Edge dmx irq
    49: 0 0 0 0 GICv2 37 Edge dmx irq
    50: 0 0 0 0 GICv2 53 Edge dmx irq
    51: 638 0 0 0 GICv2 51 Edge dvr irq
    52: 0 0 0 0 GICv2 57 Edge dvr irq

    I will try.

    # Terminal 1 — dvbv5-zap
    dvbv5-zap -c /storage/.kodi/addons/service.tvheadend43/dvb-scan/dvb-s/Turksat-4A-42.0E \
    -r "TRT 1" &

    # (lock + scan)
    sleep 10

    # Terminal 2 — IRQ
    cat /proc/interrupts | grep -E "dmx|dvr"
    sleep 5
    cat /proc/interrupts | grep -E "dmx|dvr"

    If the DMX IRQ is increasing → the HW section filter is also working in SM1, and TVHeadend is preferring the DVR path.

    Amlogic 5.15 kernel hw demux driver for s905x3 - HW section filter doesn't work in hardware on SM1, using DVR+SW path based on IRQs dmx irq (40/41/42) = 0NEVER fires dvr irq (43/44) = increasing ← Only AsyncFIFO is working.

    To detect the reset power, i2c pin and active ts pins of the dvb driver, first connect to the android own software with adb and cat /sys/kernel/debug/pinctrl/*/pinmux-pins
    Get the device information with cat /sys/kernel/debug/pinctrl/*/pinmux-functions and edit the mainline dts accordingly. You may need to shut down some nodes or redirect them to the correct pin due to pin conflict. I gave the driver as an addon. Copy the AVL6862 folder under LibreELEC.tv/packages/linux-driver-addons/dvb/ and add PROJECT=Amlogic DEVICE=AMLGX ARCH=aarch64 ./scripts/create_addon AVL6862 compile. Of course, if the dts is not correct, the driver probe will not occur. Maybe you can take it one step further.good luck

    sample dts

    yaml

    Of course, I didn't write the driver from scratch. I’m not a professional programmer or developer; I’m doing this as a hobby. You likely know coding much better than I do. That said, I’m not completely clueless about Linux and C++; it would be impossible to create a driver of this complexity without at least some understanding. My goal isn't to upstream anything; it’s simply to enable DVB streaming since USB tuner prices have become so expensive.

    Using the sti driver (from the Google Git kernel common) as a reference, I used DeepSeek to generate the backbone and developed the driver step-by-step by fixing numerous bugs. One of the biggest problems is that most of the demos and tuners used by amlogic devices are not available in the mainline kernel. While testing the driver, it was not possible to know whether the presence or absence of signal was due to the dvb driver or the frontend. Sometimes fake signal and i2c error etc. It was like looking for a needle in a haystack. Honestly, this could be a PhD thesis topic: creating a functional kernel module in a complex structure using guided AI. I conducted many tests, including address verification via devmem, etc.

    The final piece of the puzzle is AML_MEM_REQ_EN_SW—everything works with it. However, it fails with AML_MEM_REQ_EN_HW. The software driver works perfectly on the S905X3 because that’s the device I have for testing. I can't guarantee it will work for chips newer than the S905X3 without the hardware on hand, but I believe rozpruacz can make it happen. I actually got into this because of the 'S905X4 built-in DVB' topic on the CoreELEC forum. He helped me a lot; without his guidance, I probably wouldn't have started this.

    I had stepped away from Linux development for quite a while. To continue, I prepared this as a LibreELEC addon (similar to the avl6862 addon in CoreELEC) without touching the mainline kernel. The advantage is that you can add patches and compile easily without messing with Kconfig, etc. Plus, you can send the newly compiled driver and DTB to the device over the network for testing.

    I also have an old S905 Mecool K2 Pro. There are minor differences; it has demod and tuner signal lock, but it needs small offset corrections compared to the S905 for the TS (Transport Stream) to flow. In short, I’m currently working on the HW demux and will share it as soon as possible. Here, architecture comes into play again: whether the demod/tuner will connect directly or via the DTS driver. There are specific wait times for the Amlogic hardware to become active.

    Hi everyone,

    I’ve managed to get the Amlogic mainline DVB driver working using software PID filtering. Currently, on the SM1 (S905X3 mecool K5 and magicsee c500 pro), it successfully detects and operates all Amlogic DVB modules and frontends using a single dmx0 driver. I have developed this according to modern kernel architecture. No high cpu usages. but libreelec vdec mpeg2 does not decode mpeg4 hw accelerations. software based decoding mpeg2 ok. But the video quality is not very good. It has nothing to do with the dvb driver anyway. But it streams perfectly to devices on the network.

    However, I haven't been able to get dmx1 and dmx2 working yet, as I haven't identified the correct offsets. Once those are functional and stable, I intend to share the full driver with the community. It works flawlessly on single-frontend devices and is compatible with the upstream mainline kernel.

    I have also drafted a new driver version for hardware PID filtering based on the vendor kernel architecture. If I can get the HW PID filter operational, I will share that as well. I believe this version serves as a solid starting point for further development."

    The last option (20190916)

    Same Problems

    tvheadend htsp client the dependency on kodi.binary.global.gui version

    Even though it was not possible to test Driver TBS, Not even a tuner was detected on Tvheadend. (tests done with 3 drivers)

    lsusb, dmesg.txt

    Code
    dvb-usb: found a 'TBS 5520se USB2.0' in cold state, will try to load a firmware
    [   13.388144] usb 1-1.4.1: Direct firmware load for dvb-usb-tbsqbox-id5521.fw failed with error -2
    [   13.388150] dvb-usb: did not find the firmware file 'dvb-usb-tbsqbox-id5521.fw' (status -2). You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware
    Code
    you have to add firmware folder dvb-usb-tbsqbox-id5521.fw

    dvb-firmware/dvb-usb-tbsqbox-id5521.fw at master · CoreELEC/dvb-firmware · GitHub

    as a user I appreciate all your efforts. always the development of competition is born if it is done honestly. Without libreelec would not be coreelec. Why write coreelec users to write their own forum where they will write blank articles. In the end all opensouce

    why are you dealing with this empty debate. Who wants to use the course of the device. amlogic kernel same, patches same, kodi same. Therefore we will comment on coreelec and write to the corresponding forum. It is wrong to compare the two versions.

    everthing inside sdcard img. first write img to sdcard. after look fat partition

    reconfigure uenv.ini

    dtb_name=/dtb/meson-gxl-s905d-ki-pro.dtb

    and

    extlinux.conf LABEL LibreELEC LINUX /KERNEL FDT /dtb/meson-gxl-s905d-ki-pro.dtb

    after inserd sdcard to your device.

    unplug

    push tootpick hole

    plug

    wait 5-10 second

    look libreelec logo