View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 7 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: HDHomeRun testing tools
PostPosted: Tue Apr 17, 2007 11:58 am 
Offline
Joined: Tue Aug 16, 2005 11:50 am
Posts: 181
Location: Douglasville, GA
I wrote this for my own purposes because setting up Comcast Digital is a very manual process. I just though I'd share in case anyone else finds this useful.

Give me suggestions and I will modify this first post so it is easy to find.

Code:

echo "
hdtest_funcs by Richard Bronosky

This file is intenteded to be sourced from a Linux command line.  It defines
some functions that I found to be quite useful in setting up my HDHOMERUN and
finding qam signals from my cable provider.  I define most (but not all) of
the values I thought you may need to tweak as variables.  You can override
them right here from the command line, or edit the script."

# If it is not located in your PATH, you will have to alter the following line
export HDHR_CONFIG="hdhomerun_config";
export IP="$(ifconfig|awk '/inet addr:/ {sub(".*:","",$2); print $2;exit}')"
# If you have only one HDHR on you network, you can use FFFFFFFF as a wildcard
export HDHR_ID="10101C26";
export HDHR_BASEPATH="/tmp";
export HDHR_SCANFILE="$HDHR_BASEPATH/channel_scan.txt";
export HDHR_CHANNELFILE="$HDHR_BASEPATH/channel_scan_filtered.txt";

hdscan(){
   $HDHR_CONFIG $HDHR_ID scan /tuner1 $HDHR_SCANFILE
}
echo "
Defined function, hdscan, which takes no arguments and populates the file
$HDHR_SCANFILE with the raw output of doing a scan."

hdfilterscan(){
   awk '
      BEGIN {
         encrypted=0
         nodata=0
         named=0
         unnamed=0
      }
      /^SCANNING/ {
         scan=$0;
         frequency=$2;
      }
      /^LOCK: none/ {next;}
      /^PROGRAM: none/ {next;}
      /^PROGRAM: internet/ {next;}
      /^LOCK:/ {lock=$0;}
      /^PROGRAM:/ {
         if($0 ~ /encrypted/){
            encrypted=encrypted+1;
            next;
         }
         if($0 ~ /(no data)/){
            nodata=nodata+1;
            next;
         }
         if(scan!=0){
            print scan lock;
            scan=0;
         }
         program=$2
         sub(":","",program)
         if($0 ~ /^PROGRAM: [0-9]+: [0-9.]+ [a-zA-Z]/){
            named=named+1;
            unname=0
         }else{
            unnamed=unnamed+1;
         }
         print $0;
         print "    hdtune " frequency " " program;
      }
      END {
         print "###########################"
         print "#     Named Programs:" named
         print "#   UnNamed Programs:" unnamed
         print "# Encrypted Programs:" encrypted
         print "# \"no data\" Programs:" nodata
         print "###########################"
      }
   ' $HDHR_SCANFILE | tee $HDHR_CHANNELFILE
}
echo "
Defined function, hdfilterscan, which takes no arguments and filters the raw
scan file into a more useful file, $HDHR_CHANNELFILE."

hdtune()  {
   $HDHR_CONFIG $HDHR_ID set /tuner0/channel "qam:$1"
   sleep 2s
   $HDHR_CONFIG $HDHR_ID get /tuner0/streaminfo
   if [ -n "$2" ]; then
      $HDHR_CONFIG $HDHR_ID set /tuner0/program $2
   fi
}
echo "
Defined function, hdtune, which takes (1)channel fequency and optionally
(2)program number as arguments.  It will tune the HDHR making it ready to
test."

hdtest() {
   vlc --key-quit=Esc udp://@:1234 &
   sleep 6
   $HDHR_CONFIG $HDHR_ID set /tuner0/target $IP:1234
}
echo "
Defined function, hdtest, which takes no arguments and launches vlc then
targets $IP after a few seconds.  (It tries to wait for vlc to
get ready.)"


To use this, you just save the code above to a text file and source it from a bash shell. It will define several functions and give you an explanation. (What I am about to explain is shown in a transcript below.) First run "hdscan" to create a scan file to work with. (This takes a while.) Then run "hdfilterscan|more" which will out put only the frequencies and channels you care about. It follows each program it finds with an indented line that is meant to copy and paste. (triple-click, middle-click) Like so " hdtune 699000000 10" Then you run "hdtest" to launch vlc and target it. you can leave vlc open, and rerun "hdfilterscan|more" and copy paste the next one you want to try, like so " hdtune 699000000 30" . Of course all of this is made much easier by using at least two "windows" in Gnu Screen, but I guess you could have multiple xterms open too.

Code:
sh-3.1$ hdscan
SCANNING: 55750000 (us-hrc:2)
LOCK: none (ss=97 snq=0 seq=0)
SCANNING: 57000000 (us-bcast:2, us-cable:2, us-irc:2)
LOCK: (ntsc) (ss=100 snq=0 seq=0)
# ... long process...
sh-3.1$ hdfilterscan|more
SCANNING: 111000000 (us-cable:98, us-irc:98)LOCK: qam256 (ss=97 snq=70 seq=100)
PROGRAM: 3: 2.1 WSB HD
    hdtune 111000000 3
PROGRAM: 10: 17.1 WTBS HD
    hdtune 111000000 10
SCANNING: 525000000 (us-cable:74, us-irc:74)LOCK: qam256 (ss=93 snq=90 seq=100)
PROGRAM: 200: 0.0
    hdtune 525000000 10
# ...lots of similar text...
sh-3.1$     hdtune 111000000 3
3: 2.1 WSB HD
8: 0.0 (encrypted)
10: 17.1 WTBS HD

sh-3.1$ hdtest
[1] 8626
VLC media player 0.8.6a Janus
libdvbpsi error (PSI decoder): TS discontinuity (received 3, expected 0) for PID 0
libdvbpsi error (PSI decoder): TS discontinuity (received 3, expected 0) for PID 48
[00000337] a52 decoder: A/52 channels:2 samplerate:48000 bitrate:384000
sh-3.1$     hdtune 111000000 10
libdvbpsi error (PSI decoder): TS discontinuity (received 10, expected 12) for PID 48
libdvbpsi error (PMT decoder): invalid section (table_id == 0xc0)
libdvbpsi error (PSI decoder): TS discontinuity (received 9, expected 12) for PID 0
libdvbpsi error (PMT decoder): invalid section (table_id == 0xc1)
libdvbpsi error (PSI decoder): TS discontinuity (received 9, expected 0) for PID 160
libdvbpsi error (PMT decoder): invalid section (table_id == 0xc0)
libdvbpsi error (PSI decoder): TS discontinuity (received 8, expected 0) for PID 128
libdvbpsi error (PMT decoder): invalid section (table_id == 0x41)
libdvbpsi error (PMT decoder): invalid section (table_id == 0xc0)
libdvbpsi error (PMT decoder): invalid section (table_id == 0xc1)
libdvbpsi error (PMT decoder): invalid section (table_id == 0xc0)
3: 2.1 WSB HD
8: 0.0 (encrypted)
10: 17.1 WTBS HD

libdvbpsi error (PSI decoder): TS discontinuity (received 12, expected 0) for PID 0
libdvbpsi error (PSI decoder): TS discontinuity (received 12, expected 2) for PID 160


All those errors are from vlc, they can be piped to /dev/null if they frighten you.

Code:
hdtest >/dev/null 2>&1

_________________
LOL! "...amazingly, incredibly, spectacularly bad." -tjc


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 1:41 pm 
Offline
Joined: Thu Sep 07, 2006 11:20 am
Posts: 389
I am also using a HDHomeRun with KnoppMyth. So far, everything is OK.

Just wondering if you have tried Nick's Ubuntu packages with quick tune? And if so, what differences did you find?
http://www.silicondust.com/forum/viewforum.php?f=21

Or are you running/testing strictly with KnoppMyth? I'm considering giving it a shot after Feisty is released. If you are running SVN MythTV, you might as well be running a brand new distro :wink: (plus Feisty is reported to make the MythTV install a little easier).

-Nathan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 1:47 pm 
Offline
Site Admin
Joined: Fri Sep 19, 2003 6:37 pm
Posts: 2657
Location: Whittier, Ca
There is no way installing Fiesty and MythTV is easier than KnoppMyth. If you want SVN MythTV, nothing is stopping you from installing it on KnoppMyth. Most of the deps are alreay. I say most before of the changes in SVN.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 2:16 pm 
Offline
Joined: Thu Sep 07, 2006 11:20 am
Posts: 389
cecil wrote:
There is no way installing Fiesty and MythTV is easier than KnoppMyth. If you want SVN MythTV, nothing is stopping you from installing it on KnoppMyth. Most of the deps are alreay. I say most before of the changes in SVN.

Good point. I was running SVN on KnoppMyth to support the HDHomeRun before 0.20 was released. It was a long build process and destroyed the KnoppMyth menu, but it worked fine.

I was just curious about SiliconDust's packages and the SVN snapshot they chose to support the HDHomeRun. No disrespect intended.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 8:20 pm 
Offline
Joined: Tue Aug 16, 2005 11:50 am
Posts: 181
Location: Douglasville, GA
nharris wrote:
I am also using a HDHomeRun with KnoppMyth. So far, everything is OK.


Just wondering if you have tried Nick's Ubuntu packages with quick tune? And if so, what differences did you find?
http://www.silicondust.com/forum/viewforum.php?f=21
[/quote]

What is quick tune? The link you provided went to a forum, not a thread. I saw the thread you started, but that indicated that there was nothing but a MythTV SVN build. What am I missing? New features in the latest MythTV? If so, I have not seen them. I am a KnoppMyth faithful. ;-)

nharris wrote:
Or are you running/testing strictly with KnoppMyth? I'm considering giving it a shot after Feisty is released. If you are running SVN MythTV, you might as well be running a brand new distro :wink: (plus Feisty is reported to make the MythTV install a little easier).

-Nathan


My first experience with Linux outside of a data center was KnoppMyth. That has encouraged me to give up my PowerBook and have my employer issue me a ThinkPad T60 (There are lots, the one with all Intel, no ATI) Which I dual boot Ubuntu and Fedora, sharing the same /home partition and user folder. Try doing that with a Mac or Windows!?!?

So how about the script? Useful? Majorly screwed?

_________________
LOL! "...amazingly, incredibly, spectacularly bad." -tjc


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 6:04 am 
Offline
Joined: Thu Sep 07, 2006 11:20 am
Posts: 389
RichardBronosky wrote:
What is quick tune? The link you provided went to a forum, not a thread. I saw the thread you started, but that indicated that there was nothing but a MythTV SVN build. What am I missing? New features in the latest MythTV? If so, I have not seen them. I am a KnoppMyth faithful. ;-)


http://www.silicondust.com/forum/viewtopic.php?t=2572

Unfortunately, the old posting where I asked why he was building his own packages is gone (expired?). It discussed the quick tune feature, but not in detail. That's why I'm looking for someone else who may have tried it out. I'm guessing it may be more important to QAM users than OTA, but I'm not sure. If it was important enough for Nick to build custom packages, I am also wondering why it's not backported into 0.20-fixes. But this post probably belongs on the HDHomeRun forum, not here.

RichardBronosky wrote:
So how about the script? Useful? Majorly screwed?

Sorry, I'm using OTA not cable. I can't test QAM stuff.

-Nathan


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 18, 2007 7:00 am 
Offline
Joined: Tue Aug 16, 2005 11:50 am
Posts: 181
Location: Douglasville, GA
nharris wrote:
But this post probably belongs on the HDHomeRun forum, not here.


I posted it there first. http://www.silicondust.com/forum/viewtopic.php?p=19400#19400

_________________
LOL! "...amazingly, incredibly, spectacularly bad." -tjc


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu