HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Marvell Kirkwood based
barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Sat Oct 08, 2016 3:51 pm

Description:
Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, ISDB-T, IPTV, SAT>IP and HDHomeRun as input sources.
Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming.
Multiple EPG sources are supported (over-the-air DVB and ATSC including OpenTV DVB extensions, XMLTV, PyXML).
The Analog video (V4L) is supported directly up to version 3.4.
In recent version, the pipe:// source (in IPTV network) might be used to obtain the MPEG-TS stream generated by ffmpeg/libav from a V4L device.
Tvheadend is ​free software and is licensed under the GNU General Public License v3. More info about tvheadend is on homepage.

Prerequisites: FFP 0.7-arm, updated slacker sites (repositories) with Uli's uwsiteloader.sh script.

1. Stop tvheadend service, if it is running:

Code: Select all

sh /ffp/start/tvheadend.sh stop
2. Additional step in case of upgrade. If you are upgrading from previous tvheadend 3.** version, I would advise to start everything from the scratch and remove old tvheadend settings directory:

Code: Select all

[ -d /ffp/etc/tvheadend ] && rm -rf /ffp/etc/tvheadend
3. Install/upgrade tvheadend with required dependent packages together:

Code: Select all

slacker -UuiA br2:{tvheadend,eudev,kmod,ffmpeg2/,dvb-apps,libiconv,openssl,uClibc-solibs,uriparser,v4l-dvb,v4l-utils,expat} uli:{zlib,dbus-1} s:{bzip2,tar}
4. Start udev daemon first:

Code: Select all

sh /ffp/start/udevd.sh start
5. Attach your DVB-USB dongle and make sure that it is initialized by checking devices nodes (demux,dvr,frontend, net) created by udev:

Code: Select all

ls -la /dev/dvb/adapter*
crw-rw---- 1 root video 212, 0 Oct 8 13:47 demux0
crw-rw---- 1 root video 212, 1 Oct 8 13:47 dvr0
crw-rw---- 1 root video 212, 3 Oct 8 13:47 frontend0
crw-rw---- 1 root video 212, 2 Oct 8 13:47 net0
If the dongle has several tuners, then it will list several adapters. Device nodes are accessible to root and members of video group by default. If you don't see adapter in your program, then most likely it is permission issue. That program should run as restricted system user, which belongs to video group.

6. Next step is to run tvheadend daemon itself:

Code: Select all

sh /ffp/start/tvheadend.sh start
On first tvheadend service run, you will see the following output:
******** Information ********
To control tvheadend service, access the Web UI at http://192.168.0.3:9981
The Web UI administrator user name is: tvheadend
The Web UI administrator password is: 0qPiQObY
Password is unique and generated on first tvheadend daemon service run.
Starting tvheadend...done! [ OK ]
7. Login to Web UI. Go to menu Configution>DVB inputs>Tv adapters, select and enable all available dvb adapter(s):
tvheadend.png
For further configuration refer to user guide in wiki of Tvheadend.

8. If you are satisfied with result, then enable udev and tvheadend daemon services on NAS start up:

Code: Select all

chmod 755 /ffp/start/udevd.sh
chmod 755 /ffp/start/tvheadend.sh
That's it. Enjoy playing with new toy.
You do not have the required permissions to view the files attached to this post.

barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Sat Oct 08, 2016 6:09 pm

Tutorial is finished :)
Everyone interested can test it.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by MrDini » Sat Oct 08, 2016 6:18 pm

Hi!

Unfortunatelly, I Can't test it, because I don't have any DVB tuner and my ISP (Telekom) only allows the stock decoder to decode the TV broadcast... But I am thinking about a change for some purposes... And when I will change the ISP, I will try it, thanks for the tutorial! :)

The tvheadend doesn't eats a lot of CPU while streaming a HD stream for ~7 devices?

Which DVB-T dongle do You offer?

Thanks!
Thanks nas-central the lot of help! :)

barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Sat Oct 08, 2016 7:37 pm

my ISP (Telekom) only allows the stock decoder to decode the TV broadcast
Their own TV broadcast yes, but I can't believe that you can't view not owned by them.
The tvheadend doesn't eats a lot of CPU while streaming a HD stream for ~7 devices?
Don't know. I am not using my dongle with NAS. Actually, I used it almost twice times: with laptop on vacation, when was no TV available. Second time I used it about six months ago with TVheadend on NAS to test IPTV stream. Tvheadend is written in C, so it should be light, I think, but keep in the mind that NAS CPU is not racing machine engine.
Which DVB-T dongle do You offer?
None :) I can't you offer as I don't sell them :)
The list of supported by 2.6.31.8 kernel and v4l-dvb package modules is":

Code: Select all

ls -1 /ffp/lib/modules/2.6.31.8/updates/usb/dvb-usb
dvb-usb.ko
dvb-usb-a800.ko
dvb-usb-af9005.ko
dvb-usb-af9005-remote.ko
dvb-usb-az6027.ko
dvb-usb-cinergyT2.ko
dvb-usb-cxusb.ko
dvb-usb-dib0700.ko
dvb-usb-dibusb-common.ko
dvb-usb-dibusb-mb.ko
dvb-usb-dibusb-mc.ko
dvb-usb-digitv.ko
dvb-usb-dtt200u.ko
dvb-usb-dtv5100.ko
dvb-usb-dw2102.ko
dvb-usb-friio.ko
dvb-usb-gp8psk.ko
dvb-usb-m920x.ko
dvb-usb-nova-t-usb2.ko
dvb-usb-opera.ko
dvb-usb-pctv452e.ko
dvb-usb-rtl2832.ko
dvb-usb-technisat-usb2.ko
dvb-usb-ttusb2.ko
dvb-usb-umt-010.ko
dvb-usb-vp702x.ko
dvb-usb-vp7045.ko
and

Code: Select all

ls -1 /ffp/lib/modules/2.6.31.8/updates/usb/dvb-usb-v2
dvb-usb-af9015.ko
dvb-usb-af9035.ko
dvb-usb-anysee.ko
dvb-usb-au6610.ko
dvb-usb-az6007.ko
dvb-usb-ce6230.ko
dvb-usb-ec168.ko
dvb-usb-gl861.ko
dvb-usb-lmedm04.ko
dvb-usb-mxl111sf.ko
dvb_usb_v2.ko
mxl111sf-demod.ko
mxl111sf-tuner.ko
Supported by exact driver dongles (usb:vVIDpPID) are:

Code: Select all

modinfo /ffp/lib/modules/2.6.31.8/updates/usb/dvb-usb-v2/dvb-usb-af9035.ko
filename: /ffp/lib/modules/2.6.31.8/updates/usb/dvb-usb-v2/dvb-usb-af9035.ko
firmware: dvb-usb-it9135-02.fw
firmware: dvb-usb-it9135-01.fw
firmware: dvb-usb-af9035-02.fw
license: GPL
description: Afatech AF9035 driver
author: Antti Palosaari <crope@iki.fi>
alias: usb:v2040pF900d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0413p6A05d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0CCDp0099d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1B80pE410d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1B80pE411d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1B80pE409d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CAp0335d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CAp4835d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CAp3835d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CAp2835d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CAp1835d*dc*dsc*dp*ic*isc*ip*
alias: usb:v048Dp9006d*dc*dsc*dp*ic*isc*ip*
alias: usb:v048Dp9005d*dc*dsc*dp*ic*isc*ip*
alias: usb:v048Dp9135d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0CCDp00AAd*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1779d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CAp0825d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CApA867d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CAp1867d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CApB835d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07CApA835d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0CCDp0093d*dc*dsc*dp*ic*isc*ip*
alias: usb:v15A4p1003d*dc*dsc*dp*ic*isc*ip*
alias: usb:v15A4p1002d*dc*dsc*dp*ic*isc*ip*
alias: usb:v15A4p1001d*dc*dsc*dp*ic*isc*ip*
alias: usb:v15A4p1000d*dc*dsc*dp*ic*isc*ip*
alias: usb:v15A4p9035d*dc*dsc*dp*ic*isc*ip*
depends: dvb_usb_v2,rc-core
vermagic: 2.6.31.8 mod_unload ARMv5
parm: adapter_nr:DVB adapter numbers (array of short)
The way to check, when VID PID is known:

Code: Select all

grep -i $(echo "1f4d:d803" | tr ':' 'p') /ffp/lib/modules/$(uname -r)/modules.alias
This one is mine:

Code: Select all

lsusb.py -Uic 
1-1.3 0781:540e 00 2.00 480MBit/s 200mA 1IFs (SanDisk Corporation Cruzer Contour 0000183FA770A1FC)
1-1.3:1.0 (IF) 08:06:50 2EPs (Mass Storage:SCSI:Bulk-Only) usb-storage host2 (sdb)
1-1.2 1f4d:c803 00 2.00 480MBit/s 500mA 2IFs (Realtek RTL2838UHIDIR 00000001)
1-1.2:1.0 (IF) ff:ff:ff 1EPs (Vendor Specific) dvb_usb_rtl2832u

1-1.2:1.1 (IF) ff:ff:ff 0EPs (Vendor Specific)

Code: Select all

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 003: ID 0781:540e SanDisk Corp. Cruzer Contour Flash Drive
Bus 001 Device 007: ID 1f4d:c803 G-Tek Electronics Group
Manufacturer model:LIFEVIEW Not Only TV LV5T USB Deluxe. Remote control not working.
One more thing. Main driver can be present, but tuner might be unsupported. In that case dongle will not work.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by MrDini » Sat Oct 08, 2016 7:56 pm

Their own TV broadcast yes, but I can't believe that you can't view not owned by them.
There is no cable TV where I leave now, So the only way (excluding iptv) is the satellite TV subscription is the only way to watch TV. I already asked at a Telekom forum about connect the antenna to a DVB-C tuner and buy a card reader for user auth, but they (the forum members) told me, with my subscription, there is no way to do this, only the stock decoder Can display the TV... Because the card and the signal is encrypted...

And with a simple DVB-T tuner I Can only access 7 free Hun. channel, which isn't really interesting...

BTW: Thanks for the informations, I bookmarked Your post and I will keep in memory, which dongle drivers are supported. I am also thinking on a realtek chipset, because all of my realtek devices works nice. :)
Thanks nas-central the lot of help! :)

barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Sat Oct 08, 2016 8:57 pm

I can't say for sure, that my realtek dongle works with DVB-T on NAS, because I tested only iptv. TV cable is too far from NAS and if I will connect it, I will not be able to control it, because of network cable lack. Driver is old, buggy (if remote control enabled-command line becomes sluggish) and it not builds with v4l-dvb due to old kernel. I incorporated this driver into mine v4l-dvb package manually.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by MrDini » Sat Oct 08, 2016 9:21 pm

You Can use a wireless dongle for controlling the nas! ;) :D

Only this realtek tuner is supported and for the other tuners, there is no linux driver and fw available? Really exciting...
Thanks nas-central the lot of help! :)

barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Sun Oct 09, 2016 8:15 am

I would use wireless dongle, if I would have it. Unfortunately I don't have.
There is a lot realtek drivers sources on net, even official ones, but they will not build due to old kernel. Only two of them builds: one is very old and buggy, the second one is a newer version 2.2.2. and less buggy, which is integrated current v4l-dvb package. This is a achievement, even for me. It wasn't realtek drivers for 2.6.31.8 before, which included newer tuners like Rafael Micro R820T and is used on my dongle.

barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Mon Oct 10, 2016 4:48 pm

Stephenc82 wrote:Yeah I had changed the permission of udev.sh.
Tvheadend doesn't seem all that stable and streaming or recording crashes it. Maybe I need to start again.
Maybe log can give more info.
Enable logging in /ffp/etc/tvheadend.conf:
TVH_LOGFILE="/ffp/etc/tvheadend/tvheadend.log
Restart service after changes.

Where is your storage dir set:

Code: Select all

grep -r storage /ffp/etc/tvheadend/dvr/config
What tells dmesg right after crash?

Code: Select all

/bin/dmesg | tail -n10

Stephenc82
Posts: 17
Joined: Sun Oct 25, 2015 1:53 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by Stephenc82 » Mon Oct 10, 2016 6:18 pm

http://pastebin.com/VEFvdDyZ
Dmesg after crash.

Log it's on my dropbox
https://www.dropbox.com/s/z2tvpre6x55b7 ... d.log?dl=0

The dir for recordings is

Code: Select all

root@NSA320:~# grep -r storage /ffp/etc/tvheadend/dvr/config
/ffp/etc/tvheadend/dvr/config/d30d121221f2d111894b83125ea45e
83:     "storage": "/mnt/HD_a2/video",
root@NSA320:~#

barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Mon Oct 10, 2016 7:47 pm

One more output is interesting:

Code: Select all

ls -ld /mnt/HD_a2/video
Retry with different firmware. Download it first:

Code: Select all

wget http://palosaari.fi/linux/v4l-dvb/firmware/IT9135/12.10.04.1/IT9135v2_3.42.3.3_3.29.3.3/95f5bfba12a88567d74856bec2ef0916/dvb-usb-it9135-02.fw -O /ffp/lib/firmware/dvb-usb-it9135-02.fw
Then redo test with udev daemon running:
1. Unload modules:

Code: Select all

modprobe -r dvb_usb_af9035
2. Unplug dongle.
3. Clear dmesg buffer:

Code: Select all

/bin/dmesg -c > /dev/null
4. Attach dongle. Wait a bit.
5. Paste dmesg output here.
6. Restart tvheadend service.
7. Check tvheadend recording or anything else.

Stephenc82
Posts: 17
Joined: Sun Oct 25, 2015 1:53 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by Stephenc82 » Tue Oct 11, 2016 9:49 pm

Finally got it all working. Turns out I wasn't waiting long enough for the dongle to initialize. Reinstalled tvheadend and working like a dream streaming and recording.

Thank you barmalej2. For all your hard work.

barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Wed Oct 12, 2016 10:14 am

Somehow I don't believe in miracles. Which firmware version you are using right now? Can you paste dmesg output after attaching dongle>?

marker
Posts: 1
Joined: Sun Oct 02, 2016 2:00 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by marker » Sat Nov 05, 2016 3:00 pm

I succesfully installed TVHeadened according this nice tutorial. 3 weeks experiences.
NSA325v2, firmware 4.81, 2HDDs, FFP 0.7, RTL2832 usb dongle with R820T (0bda:2832) using bulk little antenna only.
29 Muxes/109Channels (SD/HD) streaming to my LAN.
NAS CPU ~35% when 4 devices open same channel (because 1 tuner only).
Devices: 2x eth PCs (W7+Ubuntu14.04), 2x WiFi tablets (both Android) - KODI with TVHeadend Addon on all clients.
EPG working on all clients.
Recording working, record is write to NAS, setting of recording works only through webadmin/any browser of HTS TVHeadend options (not from KODI Addon - but I wasn´t struggle).
Records are visible and ready to play in KODI Addon.

About 4 manual restarts of TVHeaded on FFP and ~3 times unplug/plug dongle to NSA325 during first week.
About 10 days stable working with no restart/reset now. But during this period it was streaming 5-7 times only, usually short kids cartoons up to 45min. And made 4 morning/night records (50min MKV 1.3GB, 112min 2.3GB res720x576 bitrate3116kb/s).

So many thx barmalej2, really GREAT job.

barmalej2
Posts: 2388
Joined: Sun Apr 29, 2012 5:24 pm

Re: HOWTO: Install/upgrade Tvheadend on FFP0.7-arm

Post by barmalej2 » Sat Nov 05, 2016 4:16 pm

You are welcome.

Post Reply