Hi All,
I have a mecool KT1 box which has builtin DVB-T2 input. I want to make it working under CoreElec. The DVB input consist of AVL6762 + MXL608 frontend which have drivers in the kernel so theoretically it is doable.
For GXL platform I would use the amlogic,dvb driver from media_tree_aml, but I see that in SC2 family device trees amlogix,dvb-external driver is used.
So I’m wondering which one to use ?
Another thing is that I cannot boot the box with NE kernel, it crashes. With NG kernel it crashes while booting from SD but does work when booting from USB. On NG the AMLOGIC_DVB_EXTERNAL is disabled while on NE it is enabled. So should I first manage to boot the box with NE kernel and then try to use dvb-external driver ? Any tips are welcome 
When you would have read forum you can find Mecool is not supported.

I’m very confused …
@Portisch it seems like You intentionally don’t want anybody to run CoreElec on unsuported devices … I can perfectly understand that You don’t want to share Your knowledge with others, but marking the post written in “Unsupported” forum category as “Solved” saying that it is unsupported is beyond my understanding.
What you don’t understand when it’s solved for CoreELEC because it’s just not supported?
I don’t think someone can help you as the dev written the code for DVB is gone for years…
As I understand the description of this forum category it is allowed to have discussion about unsupported hardware which, as You stated, mecool is not supported by CoreELEC. So saying that it is unsupported is not even close to solving the problem. I know it is unsupported because I read the forum (despite You saing I’m not) and that is why I posted it here.
Now, that is some usefull information and thank You for that. So I guess that is why I see some device trees with explicit DVB support for older devices and not for newer ?
Greetings,
Because the person who worked on this, compiled it, and had the knowledge disappeared six years ago.
Since then, the internal DVB tuners haven’t been working properly.
Best regards…
Ok, so I assume that the dvb-extern driver that is in main amlogic kernel is not the option. Will try the one from media_tree_aml. Does anyone have knowledge whether DVB hardware in SC2 SOC is similar to GXL SOC ?
I’ve got it working ! at least for kernel 4.9. if I got my box running under 5.4 will try make it work also.
I used original drivers from amlogic kernel insteand of media_tree_aml. The media_tree_aml contains demux driver that is used for older devices (up to sm1 I believe). For sc2 (and up ?) the original amlogic kernel has (almost) fully working drive (I just needed to fix some minor issues). The big problem was to integrate the demux driver with frontend chip drivers (demod and tuner). So I solverd that by copying required demod + tuner driver code from media_tree_aml into the kernel. The result may be found here, and the CoreELEC branch with the same changes applied as kernel patch here
@Portisch if You are interested in merging those changes into CoreELEC I could work on it a little bit more but we would need to decide how to do that. I see two options:
- do it as I did by copying the sources of demod/tuner drivers into linux-amlogic repo
- moving the whole sc2 demux driver into media_tree_aml and adapting it to the dvb-core sources version since they are different than in linux-amlogic tree and are not compatible (a lot more work)
Please let me know.
Nice job!
Yes, option 2 would be the correct way.
Does it just not work ootb when install crazycat or dvb-latest addon from repo?
Maybe it does in combination of your DTS?
well, I tryied that but stopped before I created any dts for testing. I retrieved device tree from stock android and I was trying to align my dts with dvb-latest driver and android device tree. The dvb-latest driver require irq configuration, clocks configuration etc. which are not present in stock android device tree and also the driver from amlogic-4.9 kernel do not use any interrupts
. so I figured out that the hardware on sc2 is totally different and not supported by dvb-latest driver. Also if You look at the device trees that are in amlogic-4.9 kernel, the socs up to sm1 use “amlogic, dvb-demux” compatible driver and sc2 use “amlogic sc2, dvb-demux” compatible driver. So thats why I did not even try to boot the box with dvb-latest driver.
I’ll try to move sc2 demux drivr to dvb-latest and see how it goes.
SC2 was the end of 4.9, NG and never fully implemented. Best is use CE-NO.
I tried with NE first and dvb seems to work but I cant be sure since there is some problem with hdmi output (scrambled and disappearing).
On NO my box boots fine and I could start developing changes but … Now the drivers and dts are in separate package. No matter what I do I cannot make changes to dts be applied to resulting dtb. For NG and NO I was just modifying whathever was in the linux package build dir, then remove linux package stamp and trigger build with scripts/build linux. On NO the same approach do not work (at least for dtb). What is the proper way of developing changes to kernel in CE-NO ?
For NO the new place is GitHub - CoreELEC/common_drivers .
Linux is almost untouched
1 Like
@Portisch I have something that works on NO. I see that media_tree_aml repo for 5.15 no longer contains dvb-core implementation. Thanks to tha adapting it to SC2 soc was much easier.
I made two PRs: common_drivers and media_tree_aml. Waiting for comments. PR for common_drivers has 3 commits. They should not be squashed. Each one may be a separate PR if this is more prefferable.
First I want to focus on 5.15, other branches are on hold…
There do no dvb add-ons for 5.15 exist at all anymore. Last dvb changes are directly committed to Linux branch like these:
what do You mean by that ? there is AVL6862 add-on that uses GitHub - CoreELEC/media_tree_aml repo and branch AVL6862 for which I made a PR.
But sure, I can move those drivers to linux repo.
The dvb addons use such GitHub - CoreELEC/media_tree_aml repos. But on CE-22 there are no media_tree_* exist anymore. The dvb stuff is now directly included in linux repo as the newer kernel remove the need of external dvb addons at all.
So this in CE-22 is an oversight and should be removed ?
no, you are right.
This is a very old package got included for such devices what I found in history.
A big diff was Khadas VIM2 used serial while MeCool use parallel connection.
This is what I found in a short search in history back to 2018…
So I am not sure how to handle this at all that no other, old, working system break down by these changes. We can not test it by ourself.
I checked a bit your code changes and I think they look ok.
There are a lot of items what must be changed before merge.
Like the struct does now hold a struct of config and not anymore a pointer *config to it.
Is it really need? Because when continue use *config the patch is already reduced about half size.
And some more changes like for DT are need to be changed as well.
I send you a infite to CE Mattermost so we more easily can communicate the changes.