Help porting Enigma2 to new device

There are 23 replies in this Thread which was already clicked 1,652 times. The last Post () by lme.

  • 1) I do not know where should I place this thread. This was best of I can figure out. Please move to proper section if this is out of place. Thanks.


    I want to know if we have users of Enigma 2 that can help me porting any Enigma2 to a new Android device. What is needed?


    For example, If I build for Linux PC,

    1) I go to github,

    2) clone a repo,

    3) make install

    4) at the end enigma2 run on top of Linux kernel, just as any other Dvb application.


    So if I try to imagine what is needed, then I guess I need kernel sources with drivers for the device.

    I know, Normally on Linux/Android we do not get open sources for drivers. Instead drivers are binary blobs with extra firmware that need to be compiled for a specific kernel.


    I suspect an Enigma 2 will require similar approach.


    2) In general I plan to test by booting from external SDcard. Leaving original Android firmware as it is.


    Boot any useful information on multiboot it is appreciated. For now I am studding using Tasssadar's multirom approach.


    Any help Thanks in advance.

    • Official Post

    I will help where i can, but not i have never personally added a completely new machine as you intend.


    see the openATV readme for basic build instructions:

    GitHub - openatv/enigma2: openatv-gui
    openatv-gui. Contribute to openatv/enigma2 development by creating an account on GitHub.
    github.com


    That would apply to all OE alliance builds, just change

    Code
    MACHINE=zgemmah9combo DISTRO=openatv DISTRO_TYPE=release make enigma2-image
    to
    MACHINE=yourdevice DISTRO=openbh DISTRO_TYPE=release make enigma2-image


    I will assume you dont already have OE alliance support for your device, supported devices are listed in the readme here:

    GitHub - oe-alliance/oe-alliance-core: The openembedded alliance core.
    The openembedded alliance core. Contribute to oe-alliance/oe-alliance-core development by creating an account on GitHub.
    github.com

    So you would have to add your device kernel and dvb drivers here:

    oe-alliance-core/meta-brands at 5.3 · oe-alliance/oe-alliance-core
    The openembedded alliance core. Contribute to oe-alliance/oe-alliance-core development by creating an account on GitHub.
    github.com

    and make the relevant changes to the make file before trying a build.


    Not an easy task, what model are you trying to build for ?

    let us know how you get on.... :thumbs up:

  • @jenseneverest


    Any little help is really appreciated. Just pointing me to a direction is of big help.

    I know, sadly we are all feed always with complete solutions, never teach how to create, adapt or build.

    Now I am no expert neither, my knowledge goes as far as running full Linux Debian inside Android. Now long time ago I did some help my self in Android phone theater. So I am custom on bricking thing and repairing them back. ;)


    In general I have hard time buying from common stores. They do not seems to want to ship to my area. For example world-of-Satellite.co.uk do not want to ship to my area, others as well. That leave me with Chinese models at alliexpr3s. I plan to play myself with GTMedia GTCOMBO. Best reason it is been said it has sensitive tuner. There other hidden advantages.


    Now Been Chinese manufactured device, I expect no help from neither manufacturer nor any mayor enigma team. They seems to exclude each other. So it is more or less to see how far I can get. And sure learn at the process.


    From your post.

    1) You seems to suggest me to start with OpenATV.

    2) You seems to suggest Kernel/drivers are going to be use at OE alliance .


    OE alliance!!! Very interesting I did not expect that. It is NICE to know. I do not have to start with Eningma 2. But instead, with OE alliance. IIt is a very nice hint you have gave me. It should simplify my test process as to just running to a Linux kernel prompt.


    After that I guess I will see if I can tune to a signal. Something like installing Debian dvb-utils package and tuning using

    scan/dvbscan: scanning tool used to generate channel lists

    szap: tuning utilities DVB-S

    dvbsnoop: To record some signal


    And I am very happy for it. See I got some directions. Lets see how far I get.


    So @jenseneverest or to all others. If you guys have more good hint PLEASE let me know. I am very open to suggestions. Will keep looking at this thread for more help.

  • All


    Uff!, my lack of knowledge, brought myself to a contradiction. I am soo sorry if I confuse others. let me explained.


    I did search for oe-alliance click to read


    And I quote

    Quote

    ...Info: OE-Alliance offers the following: Makefile, Linux, driver, tools, common plugins and technical support among the teams....


    I assume that any Enigma2 Team will make use of oe-alliance-core in their own building script. To my surprise is in the opposite. oe-alliance-core make will in fact build a full enigma 2 image. So It is seems now to me that my comets where wrong. The oe-alliance-core make can not build the core it self! without enigma2. In any case I will be studding this anyway. 

    • Official Post

    cayoenrique

    Yes OE alliance was formed by all the teams as a lot of the files are common to all the various team builds, so they maintain a common "core" that all the images share, rather than them each maintaining many more sources.

    Then e2 as maintained by each of the individual team gives each image its own flavour.....(skins, user interface, gui etc etc)


    For me it makes more sense when you compile an image (any stb as a test) and you have all the files/sources on your local ubuntu machine.

    The first build will take a few hours as it downloads and compiles from all the various sources....


    Reading your others posts on the subject, it is clear to me you have skills far greater than mine to do this....

    I already have a GT combo (currently gathering dust) so will be following your progress closely, let me know if/when you have anything to test :thumbs up:

  • jenseneverest

    Changed the title of the thread from “Help poting Enigma2 to new device” to “Help porting Enigma2 to new device”.
  • jenseneverest

    I am a Linux guy. I do most under Linux.


    I have NO experience with Enigma. You then will ask why I am interested in E2?

    E2 requires a lot of maintenance from part of users. This makes Android popular to some user with lack of programing experience. But in reality Androids is even worst OS for a DVB app. Android constantly run out of MEM and CPU. This will create issues to a live app that requires uninterrupted resources. That is why many Androids need to be constantly reset. A general Android rule is to have as much MEM and CPU as you can get on a device. That is the only thing you can do to prevent Android to hangup as it does. Or, the lower Android version the less MEM/CPU you may need.


    I am no expert in Android. But years ago I was involved at www.xda-developers.com. My only current relevant experience is that to overcome Android strict limitations, I do run alongside Debian Linux within the same Android in my phones.


    So I should received my GTcombo in next weeks or month. As I explained in the other thread:

    Quote

    And since I am buying one anyway, I will try to see if I can boot the current kernel ( boot.img/recovery.img ) to a working state , then see if i can "Kexec" to the external SDCard with a custom build enigma2. Just as I do run Debian from Android boot.img/recovery.img on old phones. if I do not get help from GTMEDIA with their official kernel sources then my future plan B will be that. It is just a personal project just to see how far I get.


    While I wait for my GTCOMBO I will try if I can run E2 on another Android box I have MXQ PRO 4K. This has no DVB-S2 tuners but It may serve as a learning tool. I have NO Idea if it is possible. Do not take my word as something that can in fact be certain. There is more like 85% I will fail due to missing something.

  • I will report the following, as it show how Android is not the correct OS for dvb app. It does not have to do with GTMEDIA. It just Android behavior.


    Last night I spent a few hours with my old MXQ PRO 4K. A waist of time due to the Android thing!!!


    This MXQ PRO 4K was given free to me by a member of my family 2 years ago. He got tire of hitting a button to improve free memory. He figure that hitting the button make the device work better. The Idea was to use the device as a Linux computer Armbian. But after leaving the unit on for quite a few hours, it did start working perfectly. So at the end another member of my family ask me to donate the device for her IPTV viewing. The unit for many month work as expected, with its limitations. For last few month My sister stop using it, she is now onto the social media thing.


    So I needed then now a test subject for enigma. I grab the unused thing and guess what!! Yes the thing even did not wanted to boot. So I thought It was broke. After several hours of Internet connection, the device finally got over the boot process and started to install applications!!!


    What who did install those things?


    There is more, but I will stop here. The point is that after some unused time, Android/Google etc decided that for then was more important to do their needs that to allow me to used the device. So I guess the device had to SYNC several gigabytes of data from my device, then maybe update the OS, to finally update the applications installed. Who knows what else Google did tho the poor thing. Mean while I was so upset that I wanted to bang the device to the floor because I needed for my Enigma 2 project!!!


    I am not over my problems, It turns out that there are several versions of this device even with different CPUs. I need to find out what is the correct one so that I can have on hand and ready the correct Firmware. Because most likely I will brick my device several time in my Enigma 2 project!!!


    So what is the point in this post?

    Just to show how s7up1d is Android. And that we can not always blame manufacturers as Android do its spy on us thing. Yes their so call update and SYNC.

  • Well 1rst step in my objective boot from USB or Ext SdCard on a generic Chinese Amlogic Android Box.



    I am so sorry if I have not reported update on my project. I have some personal Issues. Also my GTCOMBO is on trouble and I am not sure when I will be receiving it.

    In general I will try to post at least once a week from what I have.


    Update on boot from USB.

    Here I have good news. Amlogic S905 have a FailSafe recovery that provides just that. We can postpone the Finding/Developing a new multiboot boot-loader.


    I figure just to spent a few days trying to find out what others do. There are many Open Source Substitute OS replacement. Many around Kodi. To name a few:

    Openelect, Freeelect, Armbian, Openwrt, etc.


    So I when to Youtube an pick a candidate.


    MXQ-PRO 4K AMLOGIC S905 SOC - LibreELEC Install Dual Boot SD Card Tutorial-3LZwX1dwQB8

    Code
    https://www.youtube.com/watch?v=3LZwX1dwQB8


    Files I used to test

    Olds, because my MXQPRO4K is an old box.

    My box is constructed over gxbb p201 platform. So that is why I selected: gxbb_p201.dtb

    If you try with other platform you may require different one.



    Code
    https://libreelec.dtech.hu/misc/kszaq-archive/
    https://libreelec.dtech.hu/misc/kszaq-archive/LibreELEC-S905.arm-8.2-8.2.3.1.img.gz
    https://libreelec.dtech.hu/misc/kszaq-archive/device_trees/gxbb_p201.dtb




    And to my surprise all when find. I can reboot to a different OS just by pressing Reset while powering device. Complicated for a day to day use. But Simple as a Test mechanism.


    PLEASE notice I have not wrote any on my own yet, It is old stuff available to download.



    What is Next?

    I am going to see if I can Port this boot method, and make Debian 10 Buster to boot on this device.

  • HEHEHE Look what I found reading here while I was searching for

    "Enigma 2 S905"


    The basic work has been in fact bee done => RE: Enigma2 for KI, KII & KIII


    Quote from mtahirghauri

    1. K1 Plus image is for the box having S905 chip in it.

    2. This image is installed on a micro SD card not on a flash disk. After burning on micro SD card, boot into it using pin method (to know more about the booting method, please use google).

    3. It is new development project and is still in early stage, so please don't expect everything working out of the box.


    I only need to find it sources to have a good start.


    If anyone knows where to point me, I will appreciate.

  • So after hours of reading here an there I decoded to download from this thread RE: Enigma2 for KI, KII & KIII


    In particular

    vitmod 6 backupV3

    backup v3.vitmod.k3pro.img
    www.mediafire.com


    I use my old https://libreelec.dtech.hu/mis…evice_trees/gxbb_p201.dtb


    but renamed as dtb.img as before.


    It did not work as expected. It will try to boot but do not pass. It in fact loop on booting. But Interestingly this firmware contain code that does not require the Reset button to be press!! It will be Nice to learn from it. And I still have hopes that that old enigma OS can still be use as reference.


    What next?

    Will study this new boot process, as it is the default way Amlogic boot into USB .

    I need to set hardware USBtoSerial so that I can get access to Linux Console messages.

    I will try to hack boot process and try to boot into a busybox-sh promt.


    Again if any one knows the creation process done to create this Enigma2 for KI, KII & KIII

    I will deeply apreciate.

    • Official Post

    Again if any one knows the creation process done to create this Enigma2 for KI, KII & KIII

    I will deeply apreciate.

    I looked yesterday for the source..... couldn't find it it..... openvision is not "open" he only shares his e2.....

    I did find this old thread from many years ago..... some of it may be interesting, some links still work


    Enigma2 on Odroid C2 - ODROID

  • I found reading many post like that one myself.


    It is nice to see many stuff to read, but very distracting.

    Every post have potential good information. But as receivers have different platform/modules, most will leave to not working firmware.


    As I said previous post, I will stop reading and trying to start preparing Serial Console so that I can read the errors they produce. Then see how I can boot to a busybox prompt. Then I see if I can make any of those kernel sources to work. Your post show some Ideas.


    Code
    https://linux-meson.com/
    https://linux-meson.com/howto.html
    https://github.com/CoreELEC/linux-amlogic
    https://github.com/LibreELEC/linux-amlogic
    http://openlinux.amlogic.com/mw/index.php?title=Openlinux_SDK
    http://openlinux.amlogic.com/mw/index.php?title=Documentation
    https://github.com/khadas
    https://github.com/Android-Amlogic
    https://github.com/Android-Amlogic/android_device_amlogic
    https://github.com/Android-Amlogic/android_device_amlogic/tree/master/p201


    And many other potential candidates.

    Now as I have good results with Libreelect I may try first

    GitHub - LibreELEC/linux-amlogic: the Linux kernel for Amlogic SoC devices
    the Linux kernel for Amlogic SoC devices. Contribute to LibreELEC/linux-amlogic development by creating an account on GitHub.
    github.com

    and or

    Android-Amlogic
    Android-Amlogic has 6 repositories available. Follow their code on GitHub.
    github.com


    So 1rst I need to so some small repairs to may Laptop then I will move into Amlogic.


    Hopefully I will have some good beginning this week.

  • Learning every day.


    I have to remember to post links of github inside code. If not link is lost and instead we see those images.. Strange for me!!



    PD


    This is weird, 1rst images no link. After my post Images have links.... what a day.

  • 1) I installed “backup v3.vitmod.k3pro.img” in a 8GB old USB I had using, “LibreELEC.USB-SD.Creator.Win32”

    2) I replaced original “dtb.img”, because I have a different platform, NOT K3PRO, instead MXQPRO4K. So I use a generic “gxbb_p201.dtb” and renamed “dtb.img”.

    3) I try to boot but failed to get in to Enigma2. I assume it is wrong kernel ( Boot image ). But I also assume ENIGMA 2 partition should be ok/useful.


    4) knowing that kernel from LibreELEC-S905.arm-8.2-8.2.3.1 works, I then proceeded to get it. From LibreELEC-S905.arm-8.2-8.2.3.1 partition 2, I copied kernel.img and renamed boot.img. Again, as I know this kernel works.

    5) I mounted in PC the USB with v3.vitmod.k3pro, This time I replace boot.img with my librelect one, that I prepare in step 2.


    6) I place the USB in my MXQPRO4K and proceeded to plugin the power. Please notice that we do not need to press Reset button as it uses “aml_autoscript” that takes care of it. NICE.

    7) As expected kernel start booting. But as I have not modified the “init” file it gets to a point where it fail to find “Libreelect” image. Sure the v3.vitmod.k3pro have no “Libreelect” image to mount. So as init fail, it drops me to a #promt. NICE I have a working promt.


    8) I then proceeded to mount (USB second partition) SDA2 and to “chroot” to it, just to finaly execute ENIGMA 2 real Init.


    Code
    CHRDIR=/storage/sda2
    mkdir -p $CHRDIR
    mount --bind /dev $CHRDIR/dev
    mount --bind /proc $CHRDIR/proc
    mount --bind /sys $CHRDIR/sys
    chroot $CHRDIR
    ./linuxrc


    9) SUCCESS, I did run old v3.vitmod.k3pro Enigma2 in my MXQBOX4K. I was force to use a keyboard as my remote control is not for what it was build. Clearly I have no DVB-S reception. My box have no sat tuner.


    Please notice I have spent lotss of time reading here an there. And that in fact I have not change or compile a single line of code. This 1rst step only serve to feel relax knowing that some how, there should be a way to compile E2 for one of this Chinese TV boxes.

    • Official Post

    Wow good job :oncoming fist: You have got a lot working there already!!

    aml_autoscript is indeed very useful, hopefully that can be used on the gt Combo as well?

    I assume your commands are done over serial console.... i will need to look into getting a serial cable for the GT Combo, (i may have something already will need to look)

    Thank you for posting your steps in detail, i have learnt something new today :thumbs up:

  • It may sound strange, but kernel work so good that I do all using HDMI as monitor. But to make it easy I have a usb mouse and a usb keyboard.


    Now PLEASE do not forget I have no GTCOMBO. My test subject is just another Chinese Android TB Box called MXQPRO4K.


    IMPORTANT:

    For GTCOMBO, the stopping problem could be the DVB Tunner. So we need one of three thing to happen.

    * GT Media get nice with us and place at github working Kernel Sources

    * We try to build one of the latest Generic Amlogic Kernel, with the hope that drivers are already up.

    * At a last minute resource, we can try to use GTCOMBO's current Kernel (boot.img). Then we unpack the kernel, make any necessary changes to initramfs, init or even any /etc/init.d files. Then repack. In the hope that Androids own kernel is enough to chroot into Enigma 2.


    What kernel version your GTCOMBO has? In terminal do uname -a.


    Now, I am a Linux guy. In reality at the end I do not need Enigma2. See Enigma 2 is just in fact another Linux Distribution just like Ubuntu. Simple solution for me is using one of the already Linux versions for AMlogic, like: LibreElect, OpenElect, Armbian. But I most likely install at the end my own minimalist build of Debian using bootstrap. On top I will install "tvheadend" and "oscam". In this way I can watch Sat / Terrestrial TV from any of my Android devices or PC in my local LAN.


    I used to do this with a PC and a USB PCSAT. But GTCOMBO will be better as less power consumption will be require.

  • UPss I just realize I miss a step where I mount SDA2. Just in case SDA2 is USB secon partition that holds Enigma 2. So complete it should be like this


    Code
    CHRDIR=/storage/sda2
    mkdir -p $CHRDIR
    mount -t=ext4 /dev/block/sda2 $CHRDIR
    mount --bind /dev $CHRDIR/dev
    mount --bind /proc $CHRDIR/proc
    mount --bind /sys $CHRDIR/sys
    chroot $CHRDIR
    ./linuxrc
  • PLEASE I am not asking you to do anything.


    Before you do anything it is important to backup your Android, I normally used TWRP.

    Now to be honest the very 1rst time, i get to a Linux promt. Then I get a BIG USB or SDCARD. and copy ALL hiden partitions.


    To get all partitions names I do

    Code
    # cat /proc/partitions
    # ls -la /dev/block


    Then I prepare a bash script. Here the one I use with MXQPRO4K


    You need a USB bigger that your flash memory.

    Then in a PC I format this USB ( Empty). I normally use Linux ext4 partitions. As Android do not like to execute bash on FAT32.

    And I place the last bash script on it.


    Boot Android, open a terminal, Yes you need a Terminal APK.

    manually mount the ext4 partition, then execute batch script. Depending on the size of your FLASH it may take long time.

    If you want you can always comment /dev/block/data & /dev/block/cache. As this are not critical. They get empty when you do Factory WIPE/Reset.


    Again, this is for reference. As you seems interested. I am NOT asking you to do anything. dd is a POWERFULL command, just as dangerous!!

    Windows users call "dd" Linux "Disk Destroyer" command!!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!