Posts by ashi

    rozpruwacz

    I tried compiing meson-demux from your tree and put it into .config/kernel-overlays while blacklisting meson_demux, also loaded the compiled dtb from your tree, used the built KERNEL from your tree but I did not even see that r912.ko was build, very weird.


    EDIT: got it working, dont know why I had to put CONFIG_MEDIA_TUNER_R912=m in linux.aarch64.conf also

    And then copied r912.ko and avl6862.ko to the box in my overlay.

    So I booted a fully build u-boot image from your tree + dtb

    and put the compiled r912.ko + avl6862.ko + meson-demux.ko into my overlay. That works :)

    Confirmed working claude driver! :)

    chewitt

    Comparing LibreELEC:master...ashimokawa:mecool-kii-pro · LibreELEC/LibreELEC.tv
    Just enough OS for KODI. Contribute to LibreELEC/LibreELEC.tv development by creating an account on GitHub.
    github.com

    This contains my 3 patches

    dvb-0040-WIP-media-tuners-add-Rafael-Micro-R912-driver.patch
    dvb-0041-WIP-media-meson-demux-add-avl6862-r912-frontend-for-.patch
    dvb-0042-WIP-arm64-dts-amlogic-add-DVB-support-to-MECOOL-KII-.patch

    I know you sort (and re-sort) them differently, let my know if anything needs to be done from my side to make this mergable, I did not open a PR yet because I assume you will have your own policy which I did not meet yet.

    Feel also free to just pick and rename the patches or do what you like with it.

    I really would like to have this upstreamed.

    :)

    Some success on the MECOOL KII Pro.

    I wanted dvb-s2 and seemingly got DVB-T2 (not confirmed). If I can confirm anything working, even if only dvb-t2 I will push it somewhere and create clean patches on top of LibreELEC master

    EDIT: Figured out how to switch to DVB-S2, it actually works!! Whohoo!

    I will put this in a proper branch with the neccessary patches this weekend, monday at latest. Then do a PR

    Code
    [   15.216294] amlogic-dvb-demux c1105800.dvb-demux: demod reset complete (fec-reset GPIO) 
    [   15.216341] amlogic-dvb-demux c1105800.dvb-demux: using i2c adapter Meson I2C adapter (bus 0) 
    [   15.216356] amlogic-dvb-demux c1105800.dvb-demux: attaching DVB-T/T2/C frontend (AVL6862 + R912) 
    [   15.218660] i2c i2c-0: avl6862: found AVL6862 family_id=0x68624955 
    [   15.218706] i2c i2c-0: Load avl6862 firmware patch for DVB-T/T2 size=70044 
    [   22.546253] i2c i2c-0: avl6862 patch ver 2.0 build 24098 
    [   22.649938] i2c i2c-0: r912: Rafael R912 successfully attached! 
    [   22.649980] amlogic-dvb-demux c1105800.dvb-demux: DVB: registering adapter 0 frontend 0 (Availink AVL6762)... 
    [   22.650637] amlogic-dvb-demux c1105800.dvb-demux: frontend 0 registered: mecool,avl6862-r912 

    ashi At the moment the demux driver is an ugly port of even uglier Amlogic vendor code with support limited to the ~3 devices that myself and rozpruwacz have (and I have WP2 with DVB-S/DVB-T modules). Some work on a clean rewrite of the driver has started, but needs to be revived and moved forwards. The goal is to make all the drivers modular so technical implementations of demod/tuner/demux can described entirely within device-tree without relying on a single/monolithic driver with baked-in known combos of chips, which is how the vendor kernel works-ish. It's probably not a quick task happening in the next few weeks.

    For the sake of asking, what chips are in the Mecool box and can you point me at a device-tree file?

    chewitt

    Thanks again for pointing that out. I looked at the code and I understand how the tuner/demod combination selection works in meson-demux/aml_dvb.c and after importing r912 into the kernel tree. my plan was to do somthing like

    Well... it turned out that I was unable to find out how I should initialize the structures, how to find out which i2c address I need, GPIOS, clocks, etc etc.

    dts and code from coreelec/crazycat drivers/amlogic vendor kernel, patches etc did not help me much. It is a crazy maze of layers and in the end I gave up finding the parameters that are needed to wire that up.

    chewitt

    Thank you for reviving my Wetek Play 2 with full DVB-T2 support, it works even better than the vendor kernel used by CoreELEC used to work. Very cool :) And nice to be back on LibreELEC finally.

    I could not really read from the forum whether DVB support is limited to a specific set of devices like the Wetek Play 2 or if more DVB boxes work (for example in my case the MECOOL KII Pro with triple tuner, which also got ditched from coreelec).

    Would that work on that box also?

    While this happens the kernel log is spammed with messages like these:

    [ 1527.156627@1] audio data unaligned: pos=235, n=1024, align=8
    [ 1527.156649@1] audio data unaligned: pos=363, n=1024, align=8
    [ 1527.156819@0] audio data unaligned: pos=491, n=680, align=8
    [ 1527.164257@1] audio data unaligned: pos=619, n=1024, align=8
    [ 1527.164424@1] audio data unaligned: pos=747, n=1024, align=8
    [ 1527.164449@1] audio data unaligned: pos=875, n=552, align=8
    [ 1527.174246@1] audio data unaligned: pos=1003, n=1024, align=8
    [ 1527.174282@1] audio data unaligned: pos=1131, n=1024, align=8
    [ 1527.174318@1] audio data unaligned: pos=1259, n=1024, align=8
    [ 1527.174334@1] audio data unaligned: pos=1387, n=232, align=8
    [ 1527.184465@1] audio data unaligned: pos=1515, n=1024, align=8
    [ 1527.184502@1] audio data unaligned: pos=1643, n=1024, align=8
    [ 1527.184543@1] audio data unaligned: pos=1771, n=1024, align=8
    [ 1527.184561@1] audio data unaligned: pos=1899, n=40, align=8

    EDIT:

    The debug output comes from:

    linux-amlogic/aml_i2s.c at amlogic-3.10.y · LibreELEC/linux-amlogic · GitHub

    in

    aml_i2s_copy_playback()

    When playing Videos or Live TV, audio starts having a "hissing noise" after a few seconds, changing the audio track on Live TV makes it sound normal for a few seconds again but then falls back to the "hissing noise".

    Playing around with all possible audio output options did not help, passthrough seems to be unavailable.

    LibreELEC 8.2.x did not have that problem.