Kodi Community Forum
HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: PVR & Live TV Support (https://forum.kodi.tv/forumdisplay.php?fid=167)
+---- Forum: Tvheadend (https://forum.kodi.tv/forumdisplay.php?fid=168)
+---- Thread: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS (/showthread.php?tid=141981)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - pepeEL - 2014-01-15

But i want to install TVHeadend on Debian CHroot on DS713+. Not install as package SPK in DSM software...


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - pepeEL - 2014-01-15

(2013-12-23, 15:15)schumi2004 Wrote: @pepeEL
It's really easy.

Follow instructions to setup spksrc from readme
I'm using a Ubuntu virtual machine (for example in Virtualbox), Debian is better.

git clone https://github.com/SynoCommunity/spksrc.git

sudo aptitude install build-essential debootstrap python-pip automake libgmp3-dev libltdl-dev libunistring-dev libffi-dev ncurses-dev imagemagick libssl-dev pkg-config zlib1g-dev gettext git curl subversion check bjam intltool gperf flex bison xmlto php5 expect libgc-dev mercurial cython
sudo pip install -U pip

# Enter dir
cd spksrc

#Create new branch (so development stays clean)
git checkout -b tvheadend

Then modify the files like this
~/spksrc/cross/tvheadend/Makefile
~/spksrc/spk/tvheadend/Makefile

Remove file
~/spksrc/cross/tvheadend/digest

#Start compiling
make ARCH=88f6281 tvheadend

88f6281 is for my Synology ARM type DS211
Find yours here https://github.com/SynoCommunity/spksrc/wiki/Architecture-per-Synology-model
713+ would be cedarview

make ARCH=cedarview tvheadend

And wait

After a period of time it trows a few errors
At that point delete line 268~269 in file
~/spksrc/spk/tvheadend/work-88f6281/tvheadend-git9c1616df6b/support/configure.inc

Redo make
make ARCH=88f6281 tvheadend

And you will find your package in dir
~/spksrc/packages

I try this metod and i have a problem after delete line 268-269 i have an error:
piotrek@piotrek-UL30JT:~/spksrc$ make ARCH=cedarview tvheadend
cd spk/tvheadend/ && env make
make[1]: Wejście do katalogu `/home/piotrek/spksrc/spk/tvheadend'
===> Processing dependencies of tvheadend
make[2]: Wejście do katalogu `/home/piotrek/spksrc/cross/busybox'
make[2]: Nie ma nic do zrobienia w `default'.
make[2]: Opuszczenie katalogu `/home/piotrek/spksrc/cross/busybox'
make[2]: Wejście do katalogu `/home/piotrek/spksrc/cross/tvheadend'
===> Compiling for tvheadend
make[3]: Wejście do katalogu `/home/piotrek/spksrc/spk/tvheadend/work-cedarview/tvheadend-git9c1617df6b'
CC src/input/mpegts/mpegts_mux.o
src/input/mpegts/mpegts_mux.c: In function 'mpegts_mux_stop':
src/input/mpegts/mpegts_mux.c:557: error: expected expression before 'else'
src/input/mpegts/mpegts_mux.c: In function 'mpegts_mux_initial_scan_link':
src/input/mpegts/mpegts_mux.c:611: error: expected expression before 'else'
make[3]: *** [/home/piotrek/spksrc/spk/tvheadend/work-cedarview/tvheadend-git9c1617df6b/build.linux/src/input/mpegts/mpegts_mux.o] Błąd 1
make[3]: Opuszczenie katalogu `/home/piotrek/spksrc/spk/tvheadend/work-cedarview/tvheadend-git9c1617df6b'
make[2]: *** [compile_target] Błąd 2
make[2]: Opuszczenie katalogu `/home/piotrek/spksrc/cross/tvheadend'
make[1]: *** [depend_target] Błąd 2
make[1]: Opuszczenie katalogu `/home/piotrek/spksrc/spk/tvheadend'
make: *** [tvheadend] Błąd 2
piotrek@piotrek-UL30JT:~/spksrc$ cd
piotrek@piotrek-UL30JT:~$ sudo apt-get install mpegts
Czytanie list pakietów... Gotowe
Budowanie drzewa zależności
Odczyt informacji o stanie... Gotowe
E: Nie udało się odnaleźć pakietu mpegts
piotrek@piotrek-UL30JT:~$





Can you help me please...


Tell me how i can check git version which i write to make file ? Which numer is from web site...??

(2014-01-15, 00:45)aisman Wrote: i think not. Cause cedarview have glibc and gcc more oldest then arm. If you already have DC -- you can try to install testing gcc, and build tvh. When you will be success - I'll tel you about deb. But I don't think you need deb, you need only to build tvheadend, all other is simple.

I try build file.deb on my DS213 with ARM... I do with this manual:
https://tvheadend.org/projects/tvheadend/wiki/Building

https://tvheadend.org/projects/tvheadend/wiki/Packaging

and after
Code:
./Autobuild.sh -t precise-i386
i build file.deb but my file have about 3MB but you from this site 3.9.277 have more 4MB.[/code] Why ?


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - aisman - 2014-01-15

1. Create user in DC
2. Build and install tvh as user ( you can see "hts" folder in /home/user)
3. Copy two files called "tvheadend" from your arm DC (1. from /etc/default 2. from /etc/init.d) and put its to the same places.
4. Change tvh-user in /etc/default/tvheadend to your user.
You need have runapps.sh and S99deboan.sh.

Or onstall tvh from repo.


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - pepeEL - 2014-01-15

(2014-01-15, 21:41)aisman Wrote: 1. Create user in DC
2. Build and install tvh as user ( you can see "hts" folder in /home/user)
3. Copy two files called "tvheadend" from your arm DC (1. from /etc/default 2. from /etc/init.d) and put its to the same places.
4. Change tvh-user in /etc/default/tvheadend to your user.
You need have runapps.sh and S99deboan.sh.

Or onstall tvh from repo.

1. How create user ? Why i dont use user named root ? This user afetr go to Debian CHROOT from condole DSM.
How i can create user name: hts ?

2. As is in this manual:
Building¶
Prerequisites
Before you can build Tvheadend you will need several packages installed on your development machine.

The specific details will vary between distributions so we only cover the major ones here.

Debian/Ubuntu
$ sudo aptitude install build-essential git pkg-config libssl-dev bzip2 wget
Optional:

$ sudo aptitude install libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev

Get Source
Next you must obtain the source code, this is hosted on github.

To clone the repository simple run the command:

$ git clone https://github.com/tvheadend/tvheadend.git
Configuring
TVHeadend comes with a configuration script that allows you to enable/disable optional components and set install paths, etc.

Most people will be fine with the defaults and can run:

$ ./configure
However for more advanced options, please run the following:

$ ./configure --help
And then re-run configure with the required options, i.e.:

$ ./configure --disable-dvbscan
Compiling
To compile Tvheadend run:

$ make

4.
You need have runapps.sh and S99deboan.sh.

I can use from my ARM ?


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - aisman - 2014-01-15

Why you don't read what about I'm posting here? #126


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - pepeEL - 2014-01-15

Im sorry
I am beginner and learn it Smile
Tell me... I must add user with no password ?

Next step from post #126 with shh and etc i cant do this ?
Code:
change port 22 in file /etc/ssh/sshd_config to 2222 (for example)

Code:
/etc/init.d/ssh start
Don't forget to add this line to your script runapps.sh

Go directly to Debian by ssh!

How i must go directly to Debian by SSH ?


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - aisman - 2014-01-15

sudo apt-get install openssh-server

Change port to 2222 in file /etc/ssh/sshd

How are you going to sino via ssh? Its the same. Change port to 2222 in ssh-client. login: your-new-user. pass: pass-of- user. You must set password of your user when you adding user.


Add to file runapps this line: (before sleep 40)

/etc/init.d/ssh start


reboot machine.


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - pepeEL - 2014-01-16

What is the reason to set ssh port in debian?? I can input to debian from console DSM... by
Code:
chroot /volume1/@appstore/debian-chroot/var/chroottarget /bin/bash

On my DS213 with debian chroot and TVHeadend 3.9 i havent set ssh port for debian... Why ?


Where i must type password from user i add to run TVHeadend as this user ?


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - aisman - 2014-01-16

On my DS213 with debian chroot and TVHeadend 3.9 i havent set ssh port for debian... Why ?

because you installed it from deb

Don't work as root if its not necessary.

apt-get install sudo

adduser pepeEL

set password for pepeEL

adduser pepeEL sudo


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - pepeEL - 2014-01-17

(2014-01-15, 21:36)pepeEL Wrote:
(2013-12-23, 15:15)schumi2004 Wrote: @pepeEL
It's really easy.

Follow instructions to setup spksrc from readme
I'm using a Ubuntu virtual machine (for example in Virtualbox), Debian is better.

git clone https://github.com/SynoCommunity/spksrc.git

sudo aptitude install build-essential debootstrap python-pip automake libgmp3-dev libltdl-dev libunistring-dev libffi-dev ncurses-dev imagemagick libssl-dev pkg-config zlib1g-dev gettext git curl subversion check bjam intltool gperf flex bison xmlto php5 expect libgc-dev mercurial cython
sudo pip install -U pip

# Enter dir
cd spksrc

#Create new branch (so development stays clean)
git checkout -b tvheadend

Then modify the files like this
~/spksrc/cross/tvheadend/Makefile
~/spksrc/spk/tvheadend/Makefile

Remove file
~/spksrc/cross/tvheadend/digest

#Start compiling
make ARCH=88f6281 tvheadend

88f6281 is for my Synology ARM type DS211
Find yours here https://github.com/SynoCommunity/spksrc/wiki/Architecture-per-Synology-model
713+ would be cedarview

make ARCH=cedarview tvheadend

And wait

After a period of time it trows a few errors
At that point delete line 268~269 in file
~/spksrc/spk/tvheadend/work-88f6281/tvheadend-git9c1616df6b/support/configure.inc

Redo make
make ARCH=88f6281 tvheadend

And you will find your package in dir
~/spksrc/packages

I try this metod and i have a problem after delete line 268-269 i have an error:
piotrek@piotrek-UL30JT:~/spksrc$ make ARCH=cedarview tvheadend
cd spk/tvheadend/ && env make
make[1]: Wejście do katalogu `/home/piotrek/spksrc/spk/tvheadend'
===> Processing dependencies of tvheadend
make[2]: Wejście do katalogu `/home/piotrek/spksrc/cross/busybox'
make[2]: Nie ma nic do zrobienia w `default'.
make[2]: Opuszczenie katalogu `/home/piotrek/spksrc/cross/busybox'
make[2]: Wejście do katalogu `/home/piotrek/spksrc/cross/tvheadend'
===> Compiling for tvheadend
make[3]: Wejście do katalogu `/home/piotrek/spksrc/spk/tvheadend/work-cedarview/tvheadend-git9c1617df6b'
CC src/input/mpegts/mpegts_mux.o
src/input/mpegts/mpegts_mux.c: In function 'mpegts_mux_stop':
src/input/mpegts/mpegts_mux.c:557: error: expected expression before 'else'
src/input/mpegts/mpegts_mux.c: In function 'mpegts_mux_initial_scan_link':
src/input/mpegts/mpegts_mux.c:611: error: expected expression before 'else'
make[3]: *** [/home/piotrek/spksrc/spk/tvheadend/work-cedarview/tvheadend-git9c1617df6b/build.linux/src/input/mpegts/mpegts_mux.o] Błąd 1
make[3]: Opuszczenie katalogu `/home/piotrek/spksrc/spk/tvheadend/work-cedarview/tvheadend-git9c1617df6b'
make[2]: *** [compile_target] Błąd 2
make[2]: Opuszczenie katalogu `/home/piotrek/spksrc/cross/tvheadend'
make[1]: *** [depend_target] Błąd 2
make[1]: Opuszczenie katalogu `/home/piotrek/spksrc/spk/tvheadend'
make: *** [tvheadend] Błąd 2
piotrek@piotrek-UL30JT:~/spksrc$ cd
piotrek@piotrek-UL30JT:~$ sudo apt-get install mpegts
Czytanie list pakietów... Gotowe
Budowanie drzewa zależności
Odczyt informacji o stanie... Gotowe
E: Nie udało się odnaleźć pakietu mpegts
piotrek@piotrek-UL30JT:~$





Can you help me please...


Tell me how i can check git version which i write to make file ? Which numer is from web site...??

(2014-01-15, 00:45)aisman Wrote: i think not. Cause cedarview have glibc and gcc more oldest then arm. If you already have DC -- you can try to install testing gcc, and build tvh. When you will be success - I'll tel you about deb. But I don't think you need deb, you need only to build tvheadend, all other is simple.

I try build file.deb on my DS213 with ARM... I do with this manual:
https://tvheadend.org/projects/tvheadend/wiki/Building

https://tvheadend.org/projects/tvheadend/wiki/Packaging

and after
Code:
./Autobuild.sh -t precise-i386
i build file.deb but my file have about 3MB but you from this site 3.9.277 have more 4MB.[/code] Why ?

@aisman can you help me with them...?


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - aisman - 2014-01-17

where exactly need my help?


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - pepeEL - 2014-01-17

when compiling .... because I can not compile on my laptop.

I have done according to the description shumi2004 to compile the SynoCommunity and does not work. Up is my mistake ...


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - aisman - 2014-01-17

Ok, but I want you to understand what you're doing, rather than simply copy-paste commands, unfortunately, I do not have much time to teach people the basics of Linux and Shell, for it has Google.

1. Make shure your virtual machine is 32 bit, not 86-64!
2. Create on your NAS a folder with anonimous ftp access.
3. Go to VM.

Code:
git clone https://github.com/tvheadend/tvheadend

Code:
git clone https://github.com/SynoCommunity/spksrc.git

if not previously done:
Code:
sudo apt-get install build-essential debootstrap python-pip automake libgmp3-dev libltdl-dev libunistring-dev libffi-dev ncurses-dev imagemagick libssl-dev pkg-config zlib1g-dev gettext git curl subversion check intltool gperf flex bison xmlto php5 expect libgc-dev mercurial cython lzip
Code:
sudo pip install -U pip

rename tvheadend folder:
Code:
mv tvheadend tvheadend-master
Code:
cd tvheadend-master
Code:
nano support/configure.inc
go to line 268 - remove 268 & 269 it (ctrl+K two times)
ctrl+O ; enter; ctrl+X

go to parrent
Code:
cd ../
Code:
tar -czvf tvheadend-master.tar.gz tvheadend-master

go via samba to VM and copy tvheadend-master.tar.gz
go via samba to your anonimous ftp-folder on NAS and put tvheadend-master.tar.gz in this place.

go to spksrc/cross/tvheadend
See my Makefile (note: curl) and do depending on your address on the NAS:

Code:
PKG_NAME = tvheadend
PKG_VERS = master
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = ftp://192.168.1.4/tvheadend
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

DEPENDS = cross/curl cross/openssl

HOMEPAGE = https://www.lonelycoder.com/tvheadend/
COMMENT  = Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S$
LICENSE  =

GNU_CONFIGURE = 1
CONFIGURE_ARGS = --disable-avahi --release
INSTALL_TARGET = myInstall

include ../../mk/spksrc.cross-cc.mk


.PHONY: myInstall
myInstall:
        $(RUN) make install DESTDIR=$(INSTALL_DIR)

delete digets-file

go to spksrc/spk/tvheadend
edit the Makefile. Yor file loocking as:

(if you know the current version - place instead 3.9.368)

Code:
SPK_NAME = tvheadend
SPK_VERS = 3.9.368
SPK_REV = intel
SPK_ICON = src/tvheadend.png
DSM_UI_DIR = app

DEPENDS = cross/busybox cross/$(SPK_NAME)

MAINTAINER = pepeEL
DESCRIPTION = Tvheadend is a TV streaming server for Linux supporting DVB-S, DV$
DESCRIPTION_FRE = Tvheadend est un serveur de streaming pour linux gérant les s$
ADMIN_PORT = 9981
RELOAD_UI = yes
DISPLAY_NAME = Tvheadend
CHANGELOG = "Update to version 3.9.368"

HOMEPAGE = https://www.lonelycoder.com/tvheadend/
LICENSE  =

WIZARDS_DIR = src/wizard/

INSTALLER_SCRIPT = src/installer.sh
SSS_SCRIPT       = src/dsm-control.sh
ADDITIONAL_SCRIPTS =

INSTALL_PREFIX = /usr/local/$(SPK_NAME)

POST_STRIP_TARGET = tvheadend_extra_install

BUSYBOX_CONFIG = usrmng
ENV += BUSYBOX_CONFIG="$(BUSYBOX_CONFIG)"

include ../../mk/spksrc.spk.mk

.PHONY: tvheadend_extra_install
tvheadend_extra_install:
        install -m 755 -d $(STAGING_DIR)/var
        install -m 755 -d $(STAGING_DIR)/app
        install -m 644 src/app/config $(STAGING_DIR)/app/config
        install -m 755 src/app/tvheadend.cgi.pl $(STAGING_DIR)/app/tvheadend.cgi
        install -m 755 -d $(STAGING_DIR)/var/accesscontrol
        install -m 700 src/accesscontrol.json $(STAGING_DIR)/var/accesscontrol/1
        install -m 755 -d $(STAGING_DIR)/app/images
        for size in 16 24 32 48 ; \
        do \
            convert $(SPK_ICON) -thumbnail $${size}x$${size} \
                    $(STAGING_DIR)/app/images/$(SPK_NAME)-$${size}.png ; \
        done



If you set Polish on NAS, you may create file install_uifile_pl and put it to spksrc/spk/tvheadend/src/wizard :

Code:
[{
    "step_title": "Ustawienia podstawowe",
    "items": [{
        "type": "textfield",
        "desc": "Określ nazwę administratora. Domyślnie: admin",
        "subitems": [{
            "key": "wizard_username",
            "desc": "Nazwa"
        }]
    }, {
        "type": "password",
        "desc": "Ustawić hasło roota. domyślnie: admin",
        "subitems": [{
            "key": "wizard_password",
            "desc": "Hasło"
        }]
    }]
}]

Code:
cd
Code:
cd spksrc/spk/tvheadend
Code:
make -j8 arch-cedarview

you will find spk in /spksrc/packages. Make shure tvheadend spk and tvheadend on DC will not work at the same time,
port 9981 will be a busy one of them.


RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - aisman - 2014-01-17

But you know, with the intel you have a much easier way. If you installed the DS, then there is no problem to put it from repository. In my experience, it works much better than spk. The fact, cedarview library is weaker than the arm. Therefore it is better to run tvheadend from DC. Take the time to install DC, to create a user there, and then:

Code:
sudo apt-get install curl
Code:
curl http://apt.tvheadend.org/repo.gpg.key | sudo apt-key add -

Code:
sudo nano /etc/apt/sources.list

add this line in the end of file:
Code:
deb http://apt.tvheadend.org/unstable wheezy main

Code:
sudo apt-get update

Code:
sudo apt-get install tvheadend



RE: HOW-TO Compile Tvheadend & HDHomerun on Synology NAS - pepeEL - 2014-01-18

After i done as you describe in post #178 at the end i have a bug and spk not create...

Code:
CC              src/webui/webui_api.o
CC              src/muxer.o
CC              src/muxer/muxer_pass.o
CC              src/muxer/muxer_tvh.o
CC              src/muxer/tvh/ebml.o
CC              src/muxer/tvh/mkmux.o
CC              src/input/mpegts/mpegts_input.o
CC              src/input/mpegts/mpegts_network.o
CC              src/input/mpegts/mpegts_mux.o
src/input/mpegts/mpegts_mux.c: In function 'mpegts_mux_stop':
src/input/mpegts/mpegts_mux.c:557: error: expected expression before 'else'
src/input/mpegts/mpegts_mux.c: In function 'mpegts_mux_initial_scan_link':
src/input/mpegts/mpegts_mux.c:611: error: expected expression before 'else'
make[3]: *** [/home/piotrek/spksrc/spk/tvheadend/work-cedarview/tvheadend-master/build.linux/src/input/mpegts/mpegts_mux.o] Błąd 1
make[3]: Opuszczenie katalogu `/home/piotrek/spksrc/spk/tvheadend/work-cedarview/tvheadend-master'
make[2]: *** [compile_target] Błąd 2
make[2]: Opuszczenie katalogu `/home/piotrek/spksrc/cross/tvheadend'
make[1]: *** [depend_target] Błąd 2
make[1]: Opuszczenie katalogu `/home/piotrek/spksrc/spk/tvheadend'
make: [arch-cedarview] Błąd 2 (zignorowany)
piotrek@piotrek-UL30JT:~/spksrc/spk/tvheadend$


You think that Synology with CPU ARM is better than Synology with CPU Intel Atom(cedarview) ?