Feature #1921

Android port of Tvheadend as native (NDK) application?

Added by Magnus Hedlund almost 6 years ago. Updated almost 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Are any developer(s) working on a port of Tvheadend PVR backend that will run nativly on Android OS?

Working with for example with Geniatech PT115 USB DVB or Geniatech ATV1220 Android box:

As the goal being to have the DVB TV tuner server backend part that is TVheadend running on same Android box as XBMC, (with Android OS and not linux), so I posted the same question on XBMC forum too

This other thread on Tvheadend's own forum mention that someone did an Android port about a year ago but it was then never put up as a patch upstream to mainline Tvheadend? And quote below from last post in that thread does have a link to that Android port of Tvheadend with source code on GitHub

" I too would like tvheadend to run un such box, but it seems hard. I have found a guy called Mikrohard that has made a port that he says should work with XBMC, I have however not got it to work

Here's his forks and sources:

And his service script that should be run within XBMC:

The original posts comes from the xda forums:

I have no good knowleadge of linux/android/cross-compiling but I do think some guys around this forum might find this useful. "



Updated by Magnus Hedlund almost 6 years ago

Just to clarify, this feature request is specifically for running Tvbackend as native application in the background on Android OS.

Yes I know that you can run Linux on ARM based boxes, but that is not what this feature request is asking for here.

V4L DVB drivers from can be used the with Android kernel/firmware, some developer tips andcode can be found on these pages

There are already other closed source DVB apps for Android out there

There are several USB DVB TV-tuners that are compatible with Android, and several Android boxes come with integrated TV-tuner.


Remember that Android is actually using a version of the Linux kernel, so it is not impossible to port Tvbackend to Android


Updated by Adam Sutton almost 6 years ago

I've been watching the related thread. But didn't bother to pipe up just yet. I can categorically say that no active (by which I mostly mean me) developer is interested in doing this. Not because its not interesting (and it's certainly not an unreasonable or impossible task), but simply because I have enough work bug fixing an improving for the more common user base.

That being said, I don't have a problem with FRs being submitted that I know no existing developer is interested in working on. If Mikrohard has started the work, then he'd definitely be the person I badger first. I've no idea how far he got with this.

And I'm more than happy to include patches, as long as they don't break existing user base, for other platforms. As I've been doing for BSD from decke.

Anyway just my 2 cents...



Updated by Magnus Hedlund almost 6 years ago

OK good to know, thanks for the update. Hope that other developers might be interested and submits a patch then.


Updated by Magnus Hedlund almost 6 years ago

FYI; I sent a mail to Jernej Fijačko (a.k.a. Mikrohard) in regards to submitting upstream patch for and got this reply:


In my previous job we were working on an XBMC based Android IPTV STB. And the tvheadend port was done as part of that project.

There were several reasons why I didn't do a pull request at that time:
1.) It was tested only on IPTV / multicast
2.) The build script depended on the XBMC build system (not the android NDK)
3.) It depended on XBMC shared libraries

When the project was shut down (and I got a new job at another company) I open sourced the project in hope that someone would pick it up and continue. And well... as you could see for yourself there were others that compiled tvheadend for android with my patches and the Android NDK. And they also got DVB running with some custom compiled kernel modules. But all that was still done with the one year old tvheadend codebase without any improvements in the actual tvheadend code. And now one year after tvheadend has progressed quite a bit I suppose it would require some time to get it compile for Android. I admit that it would be a nice challenge... but as I don't have a single Android device for testing and no real interest in its usage I am afraid it won't happen any time soon.

Jernej "


Updated by Magnus Hedlund over 5 years ago

MinGyoon Woo posted this configure script and patch in the forum


I have been build the TVHeandend for Android based on ODROID U3 using NDK.

Here is configure script for build TVHeadend, and attached file is the patch file for GIT master of TVHeadend(2014/04/28).

PKG_CONFIG_PATH=$PREBUILT/sysroot/usr/lib/pkgconfig ./configure \
--disable-avahi \
--disable-v4l \
--disable-libav \
--enable-bundle \
--enable-android \
--arch=armeabi-v7a \
--cc=$PREBUILT/bin/arm-linux-androideabi-gcc \

You also need to build the zlib and openssl before build the TVHeadend.



Updated by Magnus Hedlund about 5 years ago

Also checkout this patch for TVHeadend alternative linuxdvb backend support

Markus Rechberger wrote:


since our devices have been around for quite some time and seem to work well with tvheadend, why not interface our devices directly?

It would also be one step forward in supporting DVB devices directly on MacOSX

Here's the patch for the linuxdvb abstraction:

just about nearly everything remains the same, additionally some plugin directory might be introduced?



Updated by Magnus Hedlund almost 5 years ago

I would like to bump this Android port request because of WeTek which have a new ARM-based Android media player with integrated TV-tuner hardware, and what makes this WeTek Play box better for development is that it supports both Android and Linux, plus WeTek are sponsors of Kodi and OpenELEC

The reason for this resuest is again that it would be extremely nice to have both Kodi and Tvheadend server running simultaneously as Android apps on the same Android box under Android OS. I really want to be able run Android apps such the Netflix app and games, and IMHO it is a pain to have to use external servers or devices just to get Live TV and PVR inside Kodi on Android.

Are there any news on a native source port of Tvheadned for Android?


Updated by Magnus Hedlund almost 5 years ago

FreakTab forum member taki have now successfully ported Tvheadend server to Android with the NDK (Android Native Development Kit), and tested on Rockchip RK3288 SoC

ndk r9c
platform 17
openssl 1.0.2 beta
libiconv 1.1.4
ffmpeg 2.3
support transcode stream (may be work with vpu of rk3288)

your device must be root

copy data to data
copy sytem to system
if you have your rom support init.d. reboot your device
open terminal
mkdir /dev/dvb
mkdir /data/data/.hts
mkdir /data/data/.hts/imagecache
mkdir /dev/dvb/adapter0
ln -s /dev/dvb0.frontend0 /dev/dvb/adapter0/frontend0
ln -s /dev/dvb0.demux0 /dev/dvb/adapter0/demux0
ln -s /dev/dvb0.dvr0 /dev/dvb/adapter0/dvr0
ln -s /dev/dvb0.dvr0 /dev/dvb/adapter0/dvr0.ts
ln -s /dev/dvb0/ca0 /dev/dvb/adapter0/ca0
mkdir /dev/dvb/adapter1
ln -s /dev/dvb1.frontend0 /dev/dvb/adapter1/frontend0
ln -s /dev/dvb1.demux0 /dev/dvb/adapter1/demux0
ln -s /dev/dvb1.dvr0 /dev/dvb/adapter1/dvr0
ln -s /dev/dvb1.dvr0 /dev/dvb/adapter1/dvr0.ts
ln -s /dev/dvb1/ca0 /dev/dvb/adapter1/ca0
chmod 777 /data/data/.hts
chmod 777 /data/data/.hts/imagecache
chmod 777 /data/dvb*
chmod 777 /data/dvb/tvheadend
./data/dvb/tvheadend -C -c /data/data/.hts

later open browser write url

if you look setup screen that is work

other hand if you have dvb-t-s stick need driver modules. modified init.d script line 7-12 (may be add new line needed modules)
for example
insmod /system/lib/modules/xxxxxxx.ko
insmod /system/lib/modules/xxxxxxxxx.ko
insmod /system/lib/modules/xxxxxxxxx.ko
insmod /system/lib/modules/xxxxxx.ko
insmod /system/lib/modules/xxxxxxx.ko
insmod /system/lib/modules/xxxxxxxxxx.ko
if I learn to compilie kernel of rk3288. I make



Updated by Magnus Hedlund almost 5 years ago

Read news about this here

Another FreakTab forum member named Sam321 have also successfully ported Tvheadend server to Android with the NDK (Android Native Development Kit), and tested on Rockchip RK3188 SoC, see here



Updated by Magnus Hedlund almost 5 years ago

Source code patch with changes is posted here

Here are instructions about setup, toolchain, and build environment for cross compiling Tvheadend for Android using Ubuntu Linux to compile:

To compile you first need to find your device kernel source (like device) based Allwinner 31s device. later cross compile with your kernel source. you make step by step this

android tvheadend compile
Thursday, June 27, 2013, 17:52 - Android
Posted by Administrator
build standalone toolchain from Android NDK

tar -xjv android-ndk-r8e-linux-x86_64.tar.bz2
run this script ( )


export ANDROID_NDK=android-ndk-r8e
export ANDROID_NDK_TOOLCHAIN_ROOT=android-toolchain-14
$ANDROID_NDK/build/tools/ \
--system=linux-x86_64 \
--toolchain=arm-linux-androideabi-4.4.3 \
--platform=android-14 \
remove "--system=linux-x86_64" for 32 Bit Linux

build openssl for android

git clone
cd openssl-android
cd ..
link missing header and copy libs into android toolchain

ln -s ../../../../../rockchip-rk30xx-mk808/include/linux/dvb android-toolchain-14/sysroot/usr/include/linux/dvb
ln -s ../../../../openssl-android/include/openssl android-toolchain-14/sysroot/usr/include/openssl
cp openssl-android/libs/armeabi/ android-toolchain-14/lib
cp openssl-android/libs/armeabi/ android-toolchain-14/lib
build tvheadend for android

cd tvheadend-tvheadend-android
./configure --disable-avahi \
--disable-libav \
--enable-bundle \
--enable-android \
--arch=armeabi-v7a \
--cc=../android-toolchain-14/bin/arm-linux-androideabi-gcc \
adb push build.linux/tvheadend /data/dvb
adb push ../android-toolchain-14/lib/ /data/dvb
adb push ../android-toolchain-14/lib/ /data/dvb
adb shell
[email protected]:/data/dvb # ./tvheadend -C
Because of bad signal i applied and modified a patch for tvheadend git master

git clone
cd tvheadend
git checkout e343bfdcca877d4a19a2d86d1713fb0f46ab0b50
patch -p1 <tvheadend-android.patch


Updated by Magnus Hedlund almost 5 years ago

Wow! It's starting to move fast now with more progress new on this port today, with WeTek developer Christian Troy today also having released a port of Tvheadend server for Android

He have also released an experimental firmware image for their Amlogic based WeTek Play, a build based on Android 5,0 (Lollipop) which includes Tvheadend server and Kodi.


Updated by Magnus Hedlund almost 4 years ago

Any news on a native (NDK) Android port of Tvheadend? Is this something that Tvheadend devs plans?

Will we see an official build that can run on Android OS together with Kodi at the same time?

Also available in: Atom PDF