Project

General

Profile

Feature #1921

Android port of Tvheadend as native (NDK) application?

Added by Magnus Hedlund almost 11 years ago. Updated almost 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
General
Target version:
-
Start date:
2014-01-09
Due date:
% Done:

0%

Estimated time:

Description

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:
http://www.geniatech.com/pa/pt115m.asp
http://www.geniatech.com/pa/atv1220.asp

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 http://forum.xbmc.org/showthread.php?tid=182218

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

https://tvheadend.org/boards/5/topics/7311?r=7346

" 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:

https://github.com/innbox/tvheadend/tree/tvheadend-android

And his service script that should be run within XBMC:

https://github.com/innbox/service.multimedia.tvheadend

The original posts comes from the xda forums:

http://forum.xda-developers.com/showthread.php?t=2171412

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

History

#1

Updated by Magnus Hedlund almost 11 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 linuxtv.org can be used the with Android kernel/firmware, some developer tips andcode can be found on these pages
http://sven.killig.de/android/N1/2.2/usb_host/
http://forum.xda-developers.com/showthread.php?t=871391

There are already other closed source DVB apps for Android out there
https://play.google.com/store/search?q=dvb&c=apps
https://play.google.com/store/search?q=dtv&c=apps

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

Examples:
http://www.geniatech.com/tv-tuner-for-android-tablet.asp
http://www.geniatech.com/pa/atv1220.asp
http://www.pctvsystems.com/Products/ProductsEuropeAsia/DVBTT2products/AndroiDTV/tabid/296/language/en-GB/Default.aspx
http://www.pointofview-online.com/showroom.php?shop_mode=product_detail&product_id=358
http://www.tevii.com/Products_t810_1.asp

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

#3

Updated by Adam Sutton almost 11 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...

Adam

#4

Updated by Magnus Hedlund almost 11 years ago

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

#5

Updated by Magnus Hedlund almost 11 years ago

FYI; I sent a mail to Jernej Fijačko (a.k.a. Mikrohard) in regards to submitting upstream patch for https://github.com/innbox/tvheadend/tree/tvheadend-android and got this reply:

"Hi,

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.

Regards,
Jernej "

#6

Updated by Magnus Hedlund over 10 years ago

MinGyoon Woo posted this configure script and patch in the tvheadend.org forum

https://tvheadend.org/attachments/download/1983/tvheadend-master-android.patch

"Hi,

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).

PREBUILT=~/Works/apps/android-toolchain-14
PLATFORM=$PREBUILT/sysroot/
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 \
--android_toolchain=$PREBUILT

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

Regards,
MinGyoon"

#7

Updated by Magnus Hedlund about 10 years ago

Also checkout this patch for TVHeadend alternative linuxdvb backend support

https://tvheadend.org/issues/2101

Markus Rechberger wrote:

Hi,

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:

http://sundtek.de/support/tvh_file_ops.diff

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

Markus

#8

Updated by Magnus Hedlund almost 10 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

http://kodi.wiki/view/WeTek_Play

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?

#9

Updated by Magnus Hedlund almost 10 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

http://www.freaktab.com/showthread.php?17798-Tvheaden-VDR-enigma2-pc-port-for-rk3288-Android

1-TVHEADEND SERVER OF RK3288
ndk r9c
platform 17
openssl 1.0.2 beta
libiconv 1.1.4
ffmpeg 2.3
#define DVB_API_VERSION 5
#define DVB_API_VERSION_MINOR 10
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
or
open terminal
write
su
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
127.0.0.1:9981

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

Files

http://www25.zippyshare.com/v/20166460/file.html

#10

Updated by Magnus Hedlund almost 10 years ago

Read news about this here

http://www.cnx-software.com/2015/01/28/kodi-dvb-and-pvr-support-for-android-rockchip-rk3288/

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

http://www.freaktab.com/showthread.php?8508-live-TV-for-all-rk3188-using-XBMC-and-tvheadend

and

http://www.freaktab.com/showthread.php?8508-live-TV-for-all-rk3188-using-XBMC-and-tvheadend&p=142882&viewfull=1#post142882

#11

Updated by Magnus Hedlund almost 10 years ago

Source code patch with changes is posted here

http://www.holik.at/tvheadend-android.patch

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

http://www.holik.at/index.php?m=06&y=13&entry=entry130627-175237

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

http://www.holik.at/index.php?m=06&y=13&entry=entry130627-175237

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

http://developer.android.com/sdk/ndk/index.html

cd WORKINGDIR
wget http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2
tar -xjv android-ndk-r8e-linux-x86_64.tar.bz2
run this script ( make-standalone-toolchain.sh )

#!/bin/bash

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

build openssl for android

git clone https://github.com/guardianproject/openssl-android.git
cd openssl-android
../android-ndk-r8e/ndk-build
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/libssl.so android-toolchain-14/lib
cp openssl-android/libs/armeabi/libcrypto.so android-toolchain-14/lib
build tvheadend for android

wget https://github.com/innbox/tvheadend/archive/tvheadend-android.zip
unzip tvheadend-tvheadend-android.zip
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 \
--android_toolchain=../android-toolchain-14
make
adb push build.linux/tvheadend /data/dvb
adb push ../android-toolchain-14/lib/libssl.so /data/dvb
adb push ../android-toolchain-14/lib/libcrypto.so /data/dvb
adb shell
root@android:/data/dvb # ./tvheadend -C
Because of bad signal i applied and modified a patch for tvheadend git master

git clone https://github.com/tvheadend/tvheadend.git
cd tvheadend
git checkout e343bfdcca877d4a19a2d86d1713fb0f46ab0b50
patch -p1 <tvheadend-android.patch

http://www.holik.at/tvheadend-android.patch

#12

Updated by Magnus Hedlund almost 10 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

http://www.wetekforums.com/viewtopic.php?f=13&t=350

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.

#13

Updated by Magnus Hedlund almost 9 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