Linux - HOW-TO watch Live TV in XBMC for Linux with Tvheadend, the easy way!

  Thread Rating:
  • 16 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Pyromaniac Offline
Donor
Posts: 157
Joined: Mar 2012
Reputation: 1
Location: Germany
Post: #991
maybe a problem with the permissions of /dev/dvb/adapter* ?
find quote
Balthazar Offline
Member
Posts: 95
Joined: Oct 2010
Reputation: 0
Location: Salina, KS
Post: #992
Can you elaborate?

This is what mine are set at:

bob@mediaserver:~$ ls -l /dev/dvb/adapter0/
total 0
crw-rw----+ 1 root video 212, 0 Aug 4 01:08 demux0
crw-rw----+ 1 root video 212, 1 Aug 4 01:08 dvr0
crw-rw----+ 1 root video 212, 2 Aug 4 01:08 frontend0
(This post was last modified: 2012-08-04 16:51 by Balthazar.)
find quote
Pyromaniac Offline
Donor
Posts: 157
Joined: Mar 2012
Reputation: 1
Location: Germany
Post: #993
hm, maybe "you" are not in the "video"-group? try this command:

"sudo chmod o+rw /dev/dvb/* -R"

this will grand "others" (everyone) the rights to read and write to the device. after that, restart tvheadend and see if the adapter appears in the list.

edit: if it works, as far as I know, the best way would be to add your accound (the account TVHeadend uses) to the group "video"
HowTo: http://www.cyberciti.biz/faq/howto-linux...-to-group/
(This post was last modified: 2012-08-04 18:05 by Pyromaniac.)
find quote
Balthazar Offline
Member
Posts: 95
Joined: Oct 2010
Reputation: 0
Location: Salina, KS
Post: #994
No joy. Did:

sudo chmod o+rw /dev/dvb/* -R
sudo adduser bob video
reboot

bob@mediaserver:~$ ls -l /dev/dvb/adapter*
/dev/dvb/adapter0:
total 0
crw-rw----+ 1 root video 212, 0 Aug 4 11:17 demux0
crw-rw----+ 1 root video 212, 1 Aug 4 11:17 dvr0
crw-rw----+ 1 root video 212, 2 Aug 4 11:17 frontend0

/dev/dvb/adapter1:
total 0
crw-rw----+ 1 root video 212, 3 Aug 4 11:17 demux0
crw-rw----+ 1 root video 212, 4 Aug 4 11:17 dvr0
crw-rw----+ 1 root video 212, 5 Aug 4 11:17 frontend0

Still nothing in dropdown list.
find quote
Pyromaniac Offline
Donor
Posts: 157
Joined: Mar 2012
Reputation: 1
Location: Germany
Post: #995
ok...hm...

after this command:

sudo chmod o+rw /dev/dvb/* -R

the permissions should look like this:

/dev/dvb/adapter*:
total 0
crw-rw--rw+ 1 root video 212, 0 Aug 4 11:17 demux0
crw-rw--rw+ 1 root video 212, 1 Aug 4 11:17 dvr0
crw-rw--rw+ 1 root video 212, 2 Aug 4 11:17 frontend0

but after every reboot, they are set to "the usual "crw-rw----" automatically

you could try this: edit /etc/rc.local and add on the "end of the file"* "sudo chmod o+rw /dev/dvb/* -R"

this will set the permissions to "everyone" to set and "read" the dvb-c/s/t signal


*: end of file: has to end with: exit 0
so, the last command has to be before the "exit 0" command
find quote
Balthazar Offline
Member
Posts: 95
Joined: Oct 2010
Reputation: 0
Location: Salina, KS
Post: #996
(2012-08-05 02:15)Pyromaniac Wrote:  ok...hm...

after this command:

sudo chmod o+rw /dev/dvb/* -R

the permissions should look like this:

/dev/dvb/adapter*:
total 0
crw-rw--rw+ 1 root video 212, 0 Aug 4 11:17 demux0
crw-rw--rw+ 1 root video 212, 1 Aug 4 11:17 dvr0
crw-rw--rw+ 1 root video 212, 2 Aug 4 11:17 frontend0

but after every reboot, they are set to "the usual "crw-rw----" automatically

you could try this: edit /etc/rc.local and add on the "end of the file"* "sudo chmod o+rw /dev/dvb/* -R"

this will set the permissions to "everyone" to set and "read" the dvb-c/s/t signal


*: end of file: has to end with: exit 0
so, the last command has to be before the "exit 0" command

That didn't work. Permissions were reset after I logged in. I also tried making a simple shell script and putting it in /etc/init.d

Code:
#! /bin/sh

#set permissions for tvheadend /dev/dvb tuners

sudo chmod o+rw /dev/dvb/* -R
exit 0

but that didn't work either. I can execute sudo chmod o+rw /dev/dvb/* -R and the permissions change, but the tvheadend interface doesn't work, I'm guessing because the service was started before the permissions were properly set. I also tried this script

Code:
#!/bin/bash
sudo chmod o+rw /dev/dvb/* -R
service dvbhdhomerun-utils start
while [ ! -d /dev/dvb ]
do
        sleep 1
done
service tvheadend start

but that didn't work either. Confused FWIW I'm using an ATSC hdhomerun, in case that makes any difference, but I don't think it does at this point. I haven't gotten far enough along for that to be an issue!
(This post was last modified: 2012-08-06 05:13 by Balthazar.)
find quote
Pyromaniac Offline
Donor
Posts: 157
Joined: Mar 2012
Reputation: 1
Location: Germany
Post: #997
(2012-08-06 05:11)Balthazar Wrote:  but that didn't work either. I can execute sudo chmod o+rw /dev/dvb/* -R and the permissions change, but the tvheadend interface doesn't work, I'm guessing because the service was started before the permissions were properly set. I also tried this script

if TVHeadend started before you changed the permission, then this will have no effekt to the already running TVHeadend.

the last idea that I have is this:

start you htpc, then change the permissions: sudo chmod o+rw /dev/dvb/* -R
get the PID of the running tvheadend: pidof tvheadend (this will output a number which you set in the next command)
kill the runnning TVHeadend with the pid-number from the command above: sudo kill PIDNUMBER
restart tvheadend: tvheadend
now look again at the tvheadend-GUI (be sure to really reload the page, otherwise you'll see cached options --> no tv-card)

if this will not work, I'm out of ideas Sad
(This post was last modified: 2012-08-06 16:28 by Pyromaniac.)
find quote
Balthazar Offline
Member
Posts: 95
Joined: Oct 2010
Reputation: 0
Location: Salina, KS
Post: #998
OK, getting closer Pyromaniac! Your suggestion to stop tvheadend, change permissions and restart tvheadend worked! Going off of that I modified my start-up script to look like this:

Code:
#!/bin/bash
service dvbhdhomerun-utils start
while [ ! -d /dev/dvb ]
do
        sleep 1
done
sudo chmod o+rw /dev/dvb/* -R &
service tvheadend start

After reboot permissions are set correctly:

Code:
bob@mediaserver:~$ ls -l /dev/dvb/adapter*
/dev/dvb/adapter0:
total 0
crw-rw-rw-+ 1 root video 212, 0 Aug  6 18:35 demux0
crw-rw-rw-+ 1 root video 212, 1 Aug  6 18:35 dvr0
crw-rw-rw-+ 1 root video 212, 2 Aug  6 18:35 frontend0

/dev/dvb/adapter1:
total 0
crw-rw-rw-+ 1 root video 212, 3 Aug  6 18:35 demux0
crw-rw-rw-+ 1 root video 212, 4 Aug  6 18:35 dvr0
crw-rw-rw-+ 1 root video 212, 5 Aug  6 18:35 frontend0

Only one problem, I still can't find my adapter in the drop down menu!Confused

Stopping the service and restarting it in the terminal I can see tvheadend can see my adapters:

Code:
bob@mediaserver:~$ tvheadend
[INFO]:dvb: Found adapter /dev/dvb/adapter0 (HDHomeRun ATSC) via PCI
[INFO]:dvb: Found adapter /dev/dvb/adapter1 (HDHomeRun ATSC) via PCI
[INFO]:v4l: /dev/video0: uvcvideo UVC Camera (046d:0809) usb-0000:00:1a.0-1.4 capabilities: 0x04000001
[INFO]:v4l: /dev/video0: Input #0: Camera 1 (Camera), audio:0x0, tuner:0, standard:0000000000000000,
[INFO]:v4l: /dev/video0: Format #0: YUV 4:2:2 (YUYV) [YUYV]
[INFO]:v4l: /dev/video0: Format #1: MJPEG [MJPG] (compressed)
[WARNING]:v4l: /dev/video0: Device does not have a tuner, device skipped
[INFO]:dvr: Creating new configuration ''
[WARNING]:dvr: Output directory for video recording is not yet configured for DVR configuration "". Defaulting to to "/home/bob/Videos". This can be changed from the web user interface.
[INFO]:CSA: Using SSE2 128bit parallel descrambling
[NOTICE]:START: HTS Tvheadend version 2.12 started, running as PID:5476 UID:1000 GID:1000, settings located in '/home/bob/.hts/tvheadend'
[INFO]:AVAHI: Service 'Tvheadend' successfully established.
[ERROR]:HTTP: 127.0.0.1: /comet/poll -- 401

At least I feel like we're making progress....
find quote
Pyromaniac Offline
Donor
Posts: 157
Joined: Mar 2012
Reputation: 1
Location: Germany
Post: #999
Hm, TVHeadend says "[WARNING]:v4l: /dev/video0: Device does not have a tuner, device skipped", so it seems like you can't use your HDHomeRun at the moment, but not because of the permissions.
But I think thats the reason you can't seen your device in the drop down menu.

Can you tell me what this HDHomeRun-Device is? Searching with google tells me it is an TV-receiver-over-Ethernet? But your log tells me "via PCI". What kind of device is it?
find quote
Begall Offline
Senior Member
Posts: 172
Joined: Dec 2011
Reputation: 6
Post: #1000
dev/video0 is a camera connected via USB, I don't think it's relevant. You should probably try getting tvheadend from either the latest git source or using the Pulse Eight version and seeing if that changes anything, as the 2.12 version you have there is nearly 2 years old.
find quote
c-shadow Offline
Junior Member
Posts: 20
Joined: Sep 2009
Reputation: 0
Post: #1001
I recently upgraded tvheadend from pulse eight PPA and noticed the option to save the TV stream as .TS is missing.... again. Original 2.12 version from tvheadend site was only doing MKV container, then some more recent versions from pulse had the option to stream to TS and now again only MKV. Is there any other source for tvheadend binary with this option?
find quote
bilbonvidia Offline
Fan
Posts: 461
Joined: Jun 2011
Reputation: 2
Location: Britain
Post: #1002
https://github.com/tvheadend/tvheadend

If you build this it does,

Not sure but maybe these debs have the option too:
https://www.lonelycoder.com/redmine/proj...i/download
(This post was last modified: 2012-08-29 16:01 by bilbonvidia.)
find quote
SofaKng Offline
Donor
Posts: 388
Joined: Mar 2005
Reputation: 0
Post: #1003
Yeah, the option is called "Pass-through" (in the Git version).
find quote
cowfodder Offline
Fan
Posts: 388
Joined: Jan 2010
Reputation: 2
Post: #1004
(2012-08-04 14:56)Balthazar Wrote:  Having some trouble setting this up with my hdhomerun. Here is what I have so far (Ubuntu 12.04)

I have all of the software installed ( hdhomerun-config hdhomerun-config-gui dvbhdhomerun-dkms dvbhdhomerun-utils)
Script installed to start dvbhdhomerun-utils and tvheadend from this thread.
I can access the web interface at http://localhost:9981/extjs.html.
Output of hdhomerun_config discover returns "hdhomerun device 101899F3 found at 192.168.2.5"
/etc/hdhomerun config file is setup like this:

[101899F3-0]
tuner_type=ATSC

[101899F3-1]
tuner_type=ATSC

I think everything is correct, but when I go to the web interface to select my tuner the drop down menu is blank. Am I missing something?


Try
Code:
sudo service tvheadend stop
sudo service dvbhdhomerun-utils start
sudo service tvheadend start

I just ran into a lot of issues getting the same thing setup, and it basically came down to the dvbhdhomerun-utils not starting before tvheadend. I did use the script from the thread you linked eventually, but only after I got everything else working. I also ran into and error with getting the echo command to load the driver at boot. My system would not allow this command as sudo, so I had to su and use the root account to do it. It does work, eventually.


*edit* I'm assuming you've also looked at this guide.

[Image: watched-clearlogo.jpg]
(This post was last modified: 2012-09-05 18:42 by cowfodder.)
find quote
bas.t Offline
Senior Member
Posts: 111
Joined: Dec 2010
Reputation: 0
Location: Baflo, The Netherlands
Post: #1005
@dushmaniac:

EPG issue

Using todays master of tvheadend and your master branch, the epg does not show in the right order and has several channel labels mixed up.
Your Eden -pvr branch + tvheadend's master branch don't have this issue.

Maybe you can fix this.
Thanks in advance.

Never mind, I just noticed that pvr is in main now. I have build that one and all is well.
(This post was last modified: 2012-09-13 16:31 by bas.t.)
find quote
Post Reply