[EXPERIMENTAL] CyanogenMOD for WeTek Play with Kodi Live TV

ChristianTroy
ChristianTroy
DeveloperPosts: 1,906 in CyanogenMOD
image



Release notes

This build includes a totally new kernel and Amlogic code based on their latest SDK, and I took the chance to get rid of Amlogic DVB drivers and use those from WeTek Play's OpenELEC build; by doing this I am able to run DVBAPI apps like Tvheadend.
Kodi Live TV support under Android was one of the most requested features, this experimental build allows you to run Kitkat (CyanogenMOD 11) or Lollipop (CyanogenMOD 12 or Android TV) and Kodi Live TV (WeTek Theater is no longer supported with the provided drivers).

The new 3.10 kernel brings OMX support as well (Android libstagefright media decoding), while Amlogic's prebuilt libraries work very good on KitKat they don't work at all with Lollipop.
Just to be sure to have a good media experience use Kodi, at the end of the post you will find latest stable official Kodi packed in a flashable zip and in the second post you will find a link to a modified version that should give a better experience on the WeTek device.

Now I will give you some details on how to configure Tvheadend, if you already know what to do you can skip this section.

Tvheadend will run automatically at boot and you can access to it from a web browser (even from a different device, you are not forced to do it from the box) at http://wetek_ip_address:9981

From this WebUI click "Configuration" -> "DVB Inputs" -> "Networks" and add a new Network according to the type of tuner you have (for example I created a DVB-S network called "Hotbird" and assigned the E13.0 pre-defined muxes, just pay attention that they are not bleeding edge updated so if you don't find a channel you might have to insert manually the transponder by looking at frequencies on sites like kingofsat or lyngsat).

After that go to "TV Adapters", click the link with a folder icon showing your adapter's name (if you're running the dual DVB-S2 tuner you will see two of them, #1 is the input closer to the edge of the box, while #0 the one closer to the rear usb ports), and click "Enabled", configure the eventual parameters (DiseqC, Unicable, etc.) and save the settings.
Go to the option right under the adapter name, assign it to the network that you have created and configure the eventual parameters.

Now go back to "Networks", after a couple of minutes you should see the "Scan Q length" lowering its value, when in reaches 0 everything has been scanned and you can proceed mapping the channels from "Services" section.

For further instructions, here you can find a tutorial to show you how to configure the DVB-T/C tuner, and here one for the DVB-S tuner.

Before leaving the configuration go to "Recordings" and set a "Recording System Path" pointing it to your external storage (on my roms it will be "/storage/sdcard1" for the MicroSD, "/storage/usbdisk0" for the lower rear usb port, "/storage/usbdisk1" for the upper rear usb port and "/storage/usbdisk2" for the side usb port).
Not doing that will drive Kodi's Tvheadend client plugin crazy trying to determine the available space for recordings.

Now you can launch Kodi, go to its settings, enable Live TV and select the "Tvheadend backend".

Remember that this is still something EXPERIMENTAL

Like the other Lollipop buils, remember, this is not a bug, but a consequence of the switch to art from dalvik: first boot, updates and apps installation will take longer; this happens because art compiles the apk and does not work like dalvik that was using a just-in-time approach (so expect almost 10 minutes for the first boot and future upgrades)


First install instructions

* As really first thing get this CWM recovery, unrar it and copy "recovery.img" to a MicroSD.
* Power off your device and unplug the AC power cord.
* Get the latest available ROM and GAPPS version from the links below and copy them to a MicroSD card.
* Now insert the MicroSD card in your STB.
* Plug the AC power cord while you keep pressed the little reset pinhole (located on the bottom of the device) for 10 seconds (just count slowly to ten and it will be good).
* Once the device has booted to recovery perform a factory reset and flash the ROM's zip for first followed by the GAPPS zip.
* Reboot and enjoy CyanogenMOD.



Update instructions

* If you're coming from the "regular", not "experimental" builds, please follow the "First install instructions"
* Get the latest available ROM and GAPPS version from the links below and copy them to a MicroSD card.
* Now insert the MicroSD card in your STB.
* Enable "Developer options" following this tutorial and from it enable the "Reboot to recovery" option.
* Bring up power menu by keeping pressed the power button on the STB for a couple of seconds (or pushing F4 if you have a keyboard plugged in) and select "Reboot -> recovery".
* Once the device has booted to recovery flash the ROM's zip for first followed by the GAPPS zip.
* Reboot and enjoy your updated CyanogenMOD.



Downloads

The suggested version is CM11 (Android 4.4.4)

* ROM (CM12) 2015-03-20
* GAPPS 2015-01-07 (LITE)

* ROM (Android TV) 2015-03-20
* GAPPS (Android TV) 2015-01-30

* ROM (CM11) 2015-08-09 - Real 1080p output (r1)
* GAPPS 2014-06-06 (LITE)
«13456733

Comments

  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Misc tips

    * If you wanna start Kodi at boot go to "Developer options" and enable the last entry called "Start Kodi at boot"
    * There are some keyboard shortcuts: F1 (Home), F2 (Menu), F3 (App switch) and F4 (Power menu) and some CEC remote shortcuts: Red (Power off the device), Green (Home), Yellow (Menu) and Blue (Search).
    * By enabling "Google remote support" in "Other" section of "Network" configuration you will be able to control your device from your Android smartphone / tablet by using this app on it.
    * When an app forces the portrait orientation, the default behavior is to simulate a portrait / phone-like UI adding black bars to the sides (an example is Antutu when it runs the benchmark, or Box.com). If you prefer to have a landscape stretched UI flash this zip. To revert to the default behavior flash this one instead.
    Note that the setting will persist even if you upgrade the ROM so you have to flash that zip only once.
    * Once you have configured your ***** reader, set-up Tvheadend this way.


    Real 1080p output (optional zip for CM11)

    On Android Amlogic MX SOC uses a 1280x720 framebuffer coupled with a scaler to do the up/down scaling.
    They did it for a good reason, 720p resolution has half the pixels of the 1080p one so the UI will be snappier and 3D performance will be better but if you don't care about that and you just wanna the best image quality (I noticed the scaler gives me a weird motion when watching sports) you can flash that optional zip.
    Once flashed if you wanna change resolution go to Android Display settings, set your resolution and reboot the device (this step is required because some stuff has to be set at boot because Android is not meant to change resolution while it's running).
    I didn't do it for Lollipop builds because it runs already slower than Kitkat, adding this mod might be too much :)

    Since you have this option (WeTek Play is the only MX device that allows you to do that) I would give it a try, if you have a good TV set you will clearly see the difference.



    Kodi 15.1 WeTek_mod_v1

    This is a Kodi build that includes some patches not included upstream that will improve (hopefully) your overall experience.

    Since it's been signed with different keys respect those from Kodi build server you won't be able to install it over the older Kodi but you'll have to uninstall it.
    Take a backup of /sdcard/Android/data/org.xbmc.kodi folder before uninstalling or Android will delete it and you'll lose your configuration; restore it after installing the new APK.

    Download

    You can use OE's /sdcard/Android/data/org.xbmc.kodi/files/.kodi/userdata/advancedsettings.xml file
    <?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <advancedsettings>

    <network>
    <cachemembuffersize>20971520</cachemembuffersize>
    </network>

    <samba>
    <clienttimeout>30</clienttimeout>
    </samba>

    <network>
    <readbufferfactor>4.0</readbufferfactor>
    </network>

    <pvr>
    <minvideocachelevel>5</minvideocachelevel>
    <minaudiocachelevel>20</minaudiocachelevel>
    </pvr>
    </advancedsettings>


    or (this is what I'm using)
    <?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <advancedsettings>
    <network>
    <buffermode>1</buffermode>
    <cachemembuffersize>31457280</cachemembuffersize>
    <readbufferfactor>10</readbufferfactor>
    </network>
    <gui>
    <algorithmdirtyregions>0</algorithmdirtyregions>
    </gui>
    </advancedsettings>



    External disk spindown for WeTek Play

    Flash this zip from recovery, once booted to android use a root capable file explorer (like Solid Explorer for example) and edit "/system/etc/spindown.conf" to fit your needs.

    The default configuration is set-up to spin down "sda" disk after 3600 seconds (60 minutes) using sg3-tools.

    You don't need to flash the zip again if you do a rom update because I've added the addon.d backup script.

    Note: your drive have to ne able to be set to sleep using "sg_start --stop /dev/block/$disk", I've tried it with 3 drives, 2 WDs and 1 Seagate and it worked.


    Debian chroot

    As very first thing you have to set-up a MicroSD card with two primary partitions, the first one must be formatted in FAT32, the second one can be left unformatted because the "sdcardfiles" zip will format it (I suggest you to give at least 1GB of space to the secondary partition).
    After that grab the two zips: wetek-debian-chroot-sdcardfiles.zip and wetek-debian-chroot-systemfiles-rc1.zip and copy them (together with CWM's recovery.img) to the FAT32 partition of the MicroSD (the primary one).
    Boot to recovery and flash the two zips (the order doesn't matter).

    How to actually use it:

    The "systemfiles" zip will add an helper file that I called "debian-chroot", together with the init.d script it will set up the chroot at boot and run the configured services (as a template the /system/xbin/debian-chroot file includes the execution of dropbear daemon, so you can use it as starting point for your own stuff).
    To access Debian you can just type as root from terminal emulator / serial console / adb over network "debian-chroot chroot", othwerise you can access using an SSH client to the configured Dropbear SSH server that is listening on port 2222.
    There are two default users: 'root' (pwd: wetek) and a regular user 'wetek' (pwd: wetek), both can be used to access to the ssh server.
  • tdw197
    tdw197
    Senior Member Posts: 356
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Holy crap! Great work, will dl now and get testing.
  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Thank you :)
    If it has positive feedbacks I can upgrade the "playatv" (the Android TV build) device with this new kernel/code :)
  • tdw197
    tdw197
    Senior Member Posts: 356
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Not having much luck so far; can't get passed the welcome screen. The air mouse goes round crazily and trying to select language using normal remote doesn't work. I can go up and down, but ok does nothing.
  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    you have to let it settle, at first boot it will lag like a crazy specially if you flashed the kodi zip as well. As I've said many times, art is a lot cpu hungry. Just let it do the first install things for ten minutes not touching the device in thenwizard screen and start configuring it when all the background things are completed.
    Art is too much for the MX :D

    in case it still seem unresponsive after 10 minutes unplug it and replug it to ac, there's a very rare issue in kernel 3.10 where randomly at boot input devices are screwed up. Can't track it down to see what might cause it but it happened 3 times over almost 100 boots (it could happen in recovery as well btw)
  • Harley
    Harley
    Member Posts: 58
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Awesome! And so soon after this news about similar Tvheadend support for Rockchip users of Kodi

    http://www.cnx-software.com/2015/01/28/ ... ip-rk3288/


    Are you planning on submitting the required code changes of Tvheadend upstream to tvheadend.org?

    https://tvheadend.org

    Would be very cool if this Android version of Tvheadend could make it into their mainline version!


    Please also update feature request thread viewtopic.php?f=22&t=129
  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    I used the arm openelec version of tvh, not touched a single line of tvh code, actuslly it's using the tvh binary from the zip for openelec present in this forum (the testing version for wetek play)
  • tdw197
    tdw197
    Senior Member Posts: 356
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live
    tdw197 said:
    Not having much luck so far; can't get passed the welcome screen. The air mouse goes round crazily and trying to select language using normal remote doesn't work. I can go up and down, but ok does nothing.
    .

    I've left it for over an hour now and it's still the same. Try a couple of reboots too. Might try reflecting and see if that works.
  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    It sounds like a bad flash, did you use the linked cwm recovery? It's different from the one from cwm thread. Without logs I can't say anything, in these days I flashed it almost 40 times without problems.
    Try to format system and the last entry (data and sdcard) from cwm mounts and storage menu, after that flash only the rom's zip and boot it. If it works flash gapps.
    Try a wired keyboard as well, I tested the airmouse just to see of it was working but have done pretty much everything with mouse/keyboard anyway it should work, was working here
  • tdw197
    tdw197
    Senior Member Posts: 356
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Yeah, I used the cwm from the playatv thread, I assume it's the same.

    Will redownload, format and flash using a new sd card.
  • Harley
    Harley
    Member Posts: 58
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Are you only working on a Tvheadend port for Android or are you also looking at VDR server and others as well?

    http://kodi.wiki/view/VDR

    So the MuMuDVB, another great PVR backend for Linux, which is unfortunately missing a client addon for Kodi

    viewtopic.php?f=22&t=309

    Sorry to ask here, just very excited by this and would like for all upstreams PVR backends to support Android!
  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live
    tdw197 said:
    Yeah, I used the cwm from the playatv thread, I assume it's the same.

    Will redownload, format and flash using a new sd card.
    No it's different, this thread has a direct download to a cwm rar with "kernel3.10.33" in its name.

    @Harley
    I might give a try to vdr, mumudvb i used it three years ago with a rk2918 device and playing the streamed http using mx player :)
    afaik mumudvb is like vdr-streamdev, it doesn't send channel info, epg, etc, so it's almost useless for a tv box
  • negge
    negge
    Junior Member Posts: 5
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    If anyone has problems getting stuck after selecting the Android language etc, just reboot and do it again and it will work. It happened to me when I flashed the CM12 ATV build.
  • Harley
    Harley
    Member Posts: 58
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live
    ChristianTroy said:
    I used the arm openelec version of tvh, not touched a single line of tvh code, actuslly it's using the tvh binary from the zip for openelec present in this forum (the testing version for wetek play)
    What(?!), do you mean that you have not cross-compiled Tvheadend software build using the Android NDK (Native Development)?

    Cross-compiling Tvheadend with Android NDK http://www.holik.at/index.php?m=06&y=13 ... 627-175237
    Previous source code patch: http://www.holik.at/tvheadend-android.patch
    FreakTab developers reproduction http://www.freaktab.com/showthread.php? ... post142882

    That is, are you saying that you are just using an Linux binary of Tvheaded and not an a ported version as Android apk app?
  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Exactly since the kernel is built with the same armhf toolchain. It works like a charm btw, the only different thing would be havng it linked against bionic (android libc) instead of openelec's. They both are Linux though, think of this tvheadend like a very restricted openelec chroot
  • aoxvita
    aoxvita
    Member Posts: 35
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Thanks christiantroy

    I test this on my wetek play and it works!! many thanks, I can keep my netflix app in Android and still enjoy tvheadend + kodi for live tv under android.
  • tdw197
    tdw197
    Senior Member Posts: 356
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Got it working in the end using a mouse and keyboard, airmouse and wetek remote still not working, but that's ok.
  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    The remote works as expected here :shock:
  • Jose
    Jose
    Member Posts: 85
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Hi,

    Here are my impressions about KODI working in this ROM with this particular addon.

    Working with a DVB-C/T tuner

    1 - Very fast channel scan, faster then with WETEK.play OpenElec version.
    2 - For the first time I got all the channels from my Cablecom Swiss connection.
    3 - Fast, very fast channel switch.
    4 - No apparent image flicker or blank in SD channels so far
    5 - Small image flicker from time to time in HD channels
    5 - No sound problems so far

    So, all in all, I would say that this is, for the moment, the best ROM to have Live TV and Android together.

    Many thanks and congratulations to Christian Troy.

    José
  • ChristianTroy
    ChristianTroy
    Developer Posts: 1,906
    Re: [EXPERIMENTAL] CM12 for WeTek Play with Kodi & TVH Live

    Thank you very much, most of the congrats have to be shared with the two guys working on the dvb drivers for openelec build ;)

    I'm trying to debug the random black screen channel thing that happens on OpenELEC as well. Here there's what I've found:

    - It happens even on my S805 device, so it's something of the amplayer library/kernel.
    - It happens only with H264 channels
    - It's totally random
    - I almost understood what's going on but I can't fix it, I'm not that cool I guess :ugeek:
    - TVH used as HTTP streamers has no troubles, with the Play connected by eth cable I can stream like a champ to my PC using mplayer, vlc or kodi vdpau
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions

© Copyright 2014 - Creative Dreams | Powered by Vanilla
All times are UTC