Project

General

Profile

Any developers working on a Android port of Tvheadend?

Added by Magnus Hedlund almost 6 years ago

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

As in working with for example Android compatible DVB-T2 TV tuner USB adapters like Geniatech PT115 USB DVB
http://www.geniatech.com/pa/pt115m.asp

or Android media players with integrated DVB-T2 TV tuners like WeTek Play, Xtreamer SideWinder4, and Geniatech ATV1220
http://kodi.wiki/view/WeTek_Play
http://www.xtreamer.net/SideWinder4/
http://www.geniatech.com/pa/atv1220.asp
there are also several even cheaper boxes Android media players with integrated TV tuners like
http://www.cnx-software.com/2014/05/22/unboxing-of-hd18t-android-media-player-with-dvb-t2-tuner/
http://www.cnx-software.com/2014/02/14/android-tv-box-with-satellite-dvb-s2-support-sells-for-93/

As the goal here would be to have both the DVB TV tuner server backend part that is TVheadend PVR backend TV tuner server 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
https://github.com/mikrohard/tvheadend

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

Feature request posted here: https://tvheadend.org/issues/1921


Replies (13)

RE: Any devs working on a Android port of Tvheadend? - Added 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 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

RE: Any devs working on a Android port of Tvheadend? - Added by Magnus Hedlund almost 6 years ago

Magnus Hedlund wrote:

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
https://github.com/mikrohard/tvheadend

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

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 "

RE: Any developers working on a Android port of Tvheadend? - Added by MinGyoon Woo over 5 years ago

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

RE: Any developers working on a Android port of Tvheadend? - Added by Magnus Hedlund about 5 years ago

Also checkout this related 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

RE: Any developers working on a Android port of Tvheadend? - Added 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

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?

RE: Any developers working on a Android port of Tvheadend? - Added by D. Photon almost 5 years ago

Look here:

https://www.youtube.com/watch?v=wFDgsT0Kkx0

This ist probably what are you looking for. Kodi and tvheadend simultaneously on a Wetek device. Thanks Openelec.

Regards, photon2000.

RE: Any developers working on a Android port of Tvheadend? - Added by Magnus Hedlund almost 5 years ago

D. Photon wrote:

Look here:

https://www.youtube.com/watch?v=wFDgsT0Kkx0

This ist probably what are you looking for. Kodi and tvheadend simultaneously on a Wetek device. Thanks Openelec.

Regards, photon2000.

No it is not, OpenELEC is Linux, not Android.

RE: Any developers working on a Android port of Tvheadend? - Added 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

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

RE: Any developers working on a Android port of Tvheadend? - Added by Magnus Hedlund almost 5 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
[email protected]:/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

RE: Any developers working on a Android port of Tvheadend? - Added 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

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.

RE: Any developers working on a Android port of Tvheadend? - Added by Magnus Hedlund almost 4 years ago

Any news on a native Android port of Tvheadend? Is this something that Tvheadend devs are planning?

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

RE: Any developers working on a Android port of Tvheadend? - Added by MinGyoon Woo almost 4 years ago

Here are patch and binary for Android.
Currently TVHeadend tree has build option for Android, however it does not work correctly. Current TVHeadend source code has old posix code which are deprecated by Android. Attached patch is solve that issue. I don't have any experience to use GIT request pulling, so I did not submit this code.
Binary one was build for API level 19, it is just for testing.

BTW,
http://www.xbmc4stb.net/viewtopic.php?f=48&t=81
There is a Android set-top box which has dual tuner(one ATSC, one DVB-S2). It also has TVHeadend server as background service.
I have one for beta testing, and it is really awesome, ( but still have some bugs and issues for normal use )

    (1-13/13)