Forums » Tutorial and setups »
TVHeadend, hdhomerun configured, muxed, but no Video
Added by Steven Grey almost 12 years ago
If this is has been talked about before and I just missed the thread please just direct me there.
I am trying to setup an hdhomerun configured for ATSC to work with tvheadend. My problem is that it appears everything is working, but I cannot receive a video signal through tvheadend. Everything was setup according to the instructions at the thread https://www.lonelycoder.com/redmine/boards/14/topics/3368 . What is strange is that it appears that tvheadend is talking to the hdhomerun as I can see it scanning through the channels when inspecting via the hdhomerun-gui. I can also associate all the muxes with physical channels. However when its time to watch tv a pop up browser window shows using what looks like a vlc plugin and nothing happens. I get a response in the debug window:
Dec 22 11:12:35 HTTP: 127.0.0.1: /stream/channelid/2 -- 401
Dec 22 11:12:35 HTTP: 127.0.0.1: / -- 401
The Vlc window remains black and there is no video. I feel like I am so close...
Setup:dvbhdhomerun version 0.0.13-1
tvheadend 3.2.18~g40a8920~precise
Ubuntu 12.04 (Precise) with kernel 3.2.0-35-generic
For the time being I am manually starting in the following order when i boot:userhdhomerun -f
service dvbhdhomerun-utils
service tvheadend
So...what am I missing? Is it some userpermissions? I am stumped.
Thanks for the help and Happy Holidays
Replies (5)
RE: TVHeadend, hdhomerun configured, muxed, but no Video - Added by Mark Kirkpatrick almost 12 years ago
I was playing with a similar situation, I did use git clones and NO packages, I get tired of chasing distribution issues before I even know if it will work. But I have working TV in xbmc with my HDHomerun dual tuner.
Plenty of work left to do to improve the support of HDHomerun, No scan , Channels mapping is very tedious, then map again to EPG. Right now I have many mismatched EPG data to channels due to program numbers not listing low to high when adding in custom. I was considering just building out the configs under <user>.hts/tvheadend to line everything up correctly.
I notices that you have userhdhomerun -f starting then dvbhdhomerun-utils , I do not have the upstart service packaging but there are only kernel modules and the userhdhomerun so I believe that dvbhdhomerun-utils actually starts userhdhomerun. For my testing I have:more /etc/modules
- /etc/modules: kernel modules to load at boot time. #
- This file contains the names of kernel modules that should be loaded
- at boot time, one per line. Lines beginning with "#" are ignored.
dvb_hdhomerun
( Note this is to load the kernel dvb_* modules to "talk to the hardware " )
more /etc/dvbhdhomerun
[1015C1F0-0]
tuner_type=ATSC
use_full_name=true
[1015C1F0-1]
tuner_type=ATSC
use_full_name=true
- rc.local #
- This script is executed at the end of each multiuser runlevel.
- Make sure that the script will "exit 0" on success or any other
- value on error. #
- In order to enable or disable this script just change the execution
- bits. #
- By default this script does nothing.
/bin/plymouth --quit
.... some in home stuff
/usr/local/bin/userhdhomerun -f > /var/log/dvbhdhomerun_stdout.log 2> /var/log/dvbhdhomerun_stderr.log
/usr/local/bin/tvheadend -f -u root -g video -s -C -w 9981 -e 9982
more /etc/rc.local
#!/bin/sh -e
exit 0
( to start the core services outside of upstart )
I have a "media" user that everything will run under ie. xbmc and added that user to tvheadend access and to the video group (/etc/group). I did run into a very wierd situation where tvheadend started with NO listener ports so no web access, lsof showed NO OPEN SOCKETS on the tvheadend process and no errors about it.
See a "normal" list below the broken one had no (LISTEN) entries:
mediacenter .hts # lsof p 2637>192.168.0.10:53102 (ESTABLISHED)
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
tvheadend 2637 root cwd DIR 8,5 4096 128 /
tvheadend 2637 root rtd DIR 8,5 4096 128 /
tvheadend 2637 root txt REG 8,5 2933068 1075644231 /usr/local/bin/tvheadend
tvheadend 2637 root mem REG 8,5 52120 1073887168 /lib/x86_64-linux-gnu/libnss_files-2.15.so
tvheadend 2637 root mem REG 8,5 47680 1073887172 /lib/x86_64-linux-gnu/libnss_nis-2.15.so
tvheadend 2637 root mem REG 8,5 97248 1073887162 /lib/x86_64-linux-gnu/libnsl-2.15.so
tvheadend 2637 root mem REG 8,5 35680 1073887164 /lib/x86_64-linux-gnu/libnss_compat-2.15.so
tvheadend 2637 root mem REG 8,5 276392 1075187237 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8
tvheadend 2637 root mem REG 8,5 1802936 1073887115 /lib/x86_64-linux-gnu/libc-2.15.so
tvheadend 2637 root mem REG 8,5 1022320 1073887149 /lib/x86_64-linux-gnu/libm-2.15.so
tvheadend 2637 root mem REG 8,5 135366 1073887197 /lib/x86_64-linux-gnu/libpthread-2.15.so
tvheadend 2637 root mem REG 8,5 14768 1073887128 /lib/x86_64-linux-gnu/libdl-2.15.so
tvheadend 2637 root mem REG 8,5 31752 1073887205 /lib/x86_64-linux-gnu/librt-2.15.so
tvheadend 2637 root mem REG 8,5 68416 2150704145 /usr/lib/x86_64-linux-gnu/libavahi-client.so.3.2.9
tvheadend 2637 root mem REG 8,5 47856 2150704147 /usr/lib/x86_64-linux-gnu/libavahi-common.so.3.5.3
tvheadend 2637 root mem REG 8,5 92720 1073887230 /lib/x86_64-linux-gnu/libz.so.1.2.3.4
tvheadend 2637 root mem REG 8,5 1852792 1075615874 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
tvheadend 2637 root mem REG 8,5 149280 1073887095 /lib/x86_64-linux-gnu/ld-2.15.so
tvheadend 2637 root 0u CHR 1,3 0t0 1029 /dev/null
tvheadend 2637 root 1u CHR 1,3 0t0 1029 /dev/null
tvheadend 2637 root 2u CHR 1,3 0t0 1029 /dev/null
tvheadend 2637 root 3r REG 8,5 2933068 1075644231 /usr/local/bin/tvheadend
tvheadend 2637 root 4u unix 0xffff8800cbdfee80 0t0 13249 socket
tvheadend 2637 root 5u 0000 0,9 0 6821 anon_inode
tvheadend 2637 root 7u IPv4 13252 0t0 TCP *:9981 (LISTEN)
tvheadend 2637 root 8u unix 0xffff8800cbdfeb40 0t0 13272 /root/.hts/tvheadend/epggrab/xmltv.sock
tvheadend 2637 root 9u IPv4 13273 0t0 TCP *:9982 (LISTEN)
tvheadend 2637 root 10r FIFO 0,8 0t0 16546 pipe
tvheadend 2637 root 12w FIFO 0,8 0t0 16546 pipe
tvheadend 2637 root 13u unix 0xffff8800b8cb5e40 0t0 16547 socket
tvheadend 2637 root 18u IPv4 3457090 0t0 TCP mediacenter.myhome.org:9981
I assume some security blocking maybe but a reboot cleared it up.
Lastly, I enabled the external xmltv unix domain socket to feed my existing EPG data. I had to manually map the EPGname from the xml files to each channel in the gui this is a PITA since the display is inconsistent based on what the broadcast sends. The feed worked pretty good however:
cat xmltv.xml | tv_sort --by-channel | socat - UNIX-CONNECT:/root/.hts/tvheadend/epggrab/xmltv.sock
tvheadend is listening on that socket from the webui field ( NOTE: The directory epggrab had to be made manually before it worked right ! )
I have this in a cron.daily job to update each night from way back to my mythtv set up.
PS. The bizarre formatting is all the forum web code auto choosing -- badly.
RE: TVHeadend, hdhomerun configured, muxed, but no Video - Added by Mark Kirkpatrick almost 12 years ago
Here is a script I made ( hacked someone else's to do what I wanted ) to easily produce a channel config from your local broadcast using the hdhomerun config tools and parsing them. It makes a file called us-MI-local that I copied into the /usr/local/share/tvheadend .... find all the us-* and drop it in with them then you can pick it tv adapters-> general-> add DVB network by location.
#!/usr/bin/perl
#- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. #
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details. #
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
use warnings;
use strict;
$|=1; #disable output buffer
- Find hdhr_config
my $hdhr_config = '/usr/local/bin/hdhomerun_config_gui';
if (! -e $hdhr_config) {
print "ERROR: hdhomerun_config must be in your path\n";
exit 1;
}
- Make the output directory
if(! -d "HDHR_chans") {
print "Making $ENV{PWD}/HDHR_chans directory...\n";
print "\t(look in here for the strm files)...\n";
mkdir ("HDHR_chans");
}
chomp(my $device = `$hdhr_config discover`);
$device =~ /device (.*) found/;
$device = $1;
print "Device found at: $device\n";
my $tuner = '1';
print "Scanning for channels using tuner$tuner...\n";
#my @scan_out = `$hdhr_config $device scan /tuner1`;
#SCANNING: 195000000 (us-bcast:10)
#LOCK: 8vsb (ss=100 snq=86 seq=100)
#TSID: 0x0605
#PROGRAM 3: 10.1 WILX-DT
#PROGRAM 4: 10.2 WILX-WX
open SETC ,">us-MI-local";
if (open(SCANR, "$hdhr_config $device scan /tuner$tuner |")) {
my $chan = '';
my $chantxt = '';
my $sig = '';
while (my $line = <SCANR> {
chomp($line);
# Look for the start of a channel (like 51)
if ($line =~ m/SCANNING:\s+([0-9]+)\s+(\S+)/) {
$chan = $1;
$chantxt = $2;
}
if ($line =~ m/LOCK.*:\s+(\S+)/) {
$sig = $1;
if ( $sig ne 'none' ) {
print "Found channel $chan - $chantxt\n";
print SETC "A $chan $sig\n";
}
}
- Look for the program number (like 7.1)
if ($line =~ m/PROGRAM.*:\s([0-9]+.[0-9]+)\s(.*)/) {
my $prog = $1;
my $cname = $2;
$cname =~ s/\s/_/; # $cname =~ s/\(|\)/_/;
print "Found Program $prog-$cname on channel $chan\n";
}
# print $line;
}
}
flush SETC;
close SETC;
print "Done.\n";
exit 0;
RE: TVHeadend, hdhomerun configured, muxed, but no Video - Added by Steven Grey almost 12 years ago
I dont fully understand why I am needing the scripts. I think I have everything installed. i have channels detected, I have them muxes found and mapped to services. I have services mapped to EPG. yes it is tedious, but I think I have that. My etc/dvbhdhomerun is correctly setup for ATSC as the tuner type. It is just when its time for TVheadend to display video...it just doesn't.
Maybe I am not fully understanding what I am ready. Thanks for the help, I do appreciate it.
RE: TVHeadend, hdhomerun configured, muxed, but no Video - Added by Mark Kirkpatrick almost 12 years ago
You probably don't but since most of the threads I have read are manual I thought I would post it up for anyone who might want it.
I mentioned XBMC because the web interface does not produce video either for me. The play links don't work but I do see the userhdhomerun working when I click on a play link so it's the pass thru to the configured player that seems broken. But on my system the XBMC pvr plugin worked fine.
I installed the latest version of VLC ( With the mozilla pluging ) then using firefox with the VLC plugin enabled I was able to play from the webui !
RE: TVHeadend, hdhomerun configured, muxed, but no Video - Added by Steven Grey almost 12 years ago
Success! My intuition was correct. I had a file permission setup wrong. It just took me a while to figure out it was the adapters not tvheadend. I changed the owner and group of the /dev/dvb adapters from group root and owner root. Changing them to owner hts and group video solved the problem for the most part. Now XBMC can pick up the video feed and can cycle through channels. The vlc plugin in the browser still doesn't work, but since the end goal is to have it working with xbmc I will let it go.
I just want to say this is a nice project and I really hope you guys have continued success. It really is a more elegant solution than myth. Its a little rough around the edges but it will get there.
Thanks for the help