Image of grog
Installing shepherd
Greg's diary
Photo index
Greg's home page
Network link stats
Greg's other links
Copyright information
Groogle
On 8 February 2008 I finally got round to installing shepherd. The following is more a description than a HOWTO, but you might find it useful.

Shepherd's designed for Linux, of course, which makes it more difficult to describe how to fix it, though they have quite a reasonable description, somewhat marred by the use of some of the more stupid HTML constructs:

 

https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20080208/big/load-shepherd.gif
Image title: load shepherd
Dimensions: 436 x 234, 14 kB
Dimensions of original: 436 x 234, 14 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Friday, 8 February 2008:
thumbnails    small images    diary entry

It starts with pulling down the source file, of course. They suggest wget, but it's only one file, so on FreeBSD ftp or fetch work fine. Then I ran into perl hell:

=== grog@dereel (/dev/ttypm) ~/CVR/shepherd 116 -> perl shepherd

ERROR:
Mandatory module 'Algorithm::Diff' not found.

Please see the Wiki at http://svn.whuffy.com/wiki/Installation
for details on how to install this module.
I don't do perl, and just finding the module took some time. This one's in /usr/ports/devel/p5-Algorithm-Diff, but I don't know how many more I needed. Then it dawned on me that I needed to run it on ceeveear anyway, and that runs Linux, so didn't try any further.

Running on Linux wasn't completely plain sailing:

=== mythtv@ceeveear (/dev/pts/2) ~ 11 -> perl /dereel/home/grog/CVR/shepherd/shepherd
shepherd v1.2.37 (linux)

Reading configuration file: /home/mythtv/.shepherd/shepherd.conf
Reading channels file: /home/mythtv/.shepherd/channels.conf
Migrating channel "TENHD" to "TEN HD".
Updating channels file.
Lock failed.
ERROR: Another instance of Shepherd is already running.  Exiting.
There was no other shepherd, so I stopped mythfrontend. That didn't help either.
=== mythtv@ceeveear (/dev/pts/2) ~ 12 -> perl /dereel/home/grog/CVR/shepherd/shepherd
shepherd v1.2.37 (linux)

Reading configuration file: /home/mythtv/.shepherd/shepherd.conf
Reading channels file: /home/mythtv/.shepherd/channels.conf
Checking for channel migrations...
Ignoring unsupported channel for region 81: "TEN HD"
Lock failed.
ERROR: Another instance of Shepherd is already running.  Exiting.

About the only interesting difference there was the way it handled TEN HD. So I tried strace, which showed me:

flock(3, LOCK_EX|LOCK_NB)               = -1 ENOLCK (No locks available)
write(1, "Lock failed.\n", 13)          = 13
write(1, "ERROR: Another instance of Sheph"..., 65) = 65
ENOLCK? Why are no locks available? Well, it was returned from a call to flock, so what does the man page say?
=== mythtv@ceeveear (/dev/pts/2) ~ 70 -> man 2 flock
No manual entry for flock in section 2

How I love Linux! Why does Debian install every byte separately? The FreeBSD man page doesn't mention ENOLOCK, so went back to find what file it was trying to lock. That has to be a return from open, so searched backward for the regular expression open.*= 3 and found:

open("/dereel/home/grog/CVR/shepherd/shepherd", O_RDONLY|O_LARGEFILE) = 3

/dereel/home is the /home directory on dereel, the machine I first tried it on. So it's an NFS locking issue and an error message that jumps to conclusions. Copied shepherd to the local directory and it worked. Some of the output was interesting. It's quite verbose, so I've abbreviated it here.

Configuring.

Step 1: Region Selection

Select your region:
 (126) ACT
...
 ( 98) VIC: Western Victoria
...
 (102) WA: Regional
Enter region code:
 [67,90,63,71,102,78,107,79,93,88,106,82,126,74,85,95,83,75,94,108,114,184,69,81,98,101,66,73,86
 (default=94)] 98

Step 2: Channel Selection

Shepherd offers two methods of channel selection: Guided and Advanced.
Guided is easier; Advanced allows manual entering of XMLTV IDs.

Would you like Guided channel selection? [yes,no (default=yes)] n

Your region has 11 Free to Air channels:
 ABC, ABC2, SBS, SBS News, 7HD, TEN HD, Imparja, WIN, Prime, TEN, Seven.
I've never heard of Imparja. I suppose I should examine it.
Each channel you want guide data for needs a unique XMLTV ID.  You can type
in an ID of your choice, or press ENTER to accept the suggested [default],
or type in "n" to skip this channel.

Free to Air Channels:
( 1/11) "ABC" (new)
        Looks like MythTV channel #-: "ABC" (ABC)
        [ABC-Vic] ? return
( 2/11) "ABC2" (new)
        Looks like MythTV channel #-: "ABC2" (ABC2)
        [ABC2] ? return
...
( 4/11) "SBS News" (new)
        [sbsnews.free.au] ? SBSWN
( 5/11) "7HD" (new)
        [7hd.free.au] ? 7HD
...
( 9/11) "Prime" (new)
        [prime.free.au] ? Prime-Vic
...
(11/11) "Seven" (new)
        Looks like MythTV channel #-: "Seven" (SEVEN)
        [Prime-Vic] ?
ERROR: You have entered identical XMLTV IDs for Seven and Prime ("Prime-Vic").  Exiting.
Clearly there's a misunderstanding here. I wonder where. From what I see, 7 and Prime are the same channel, and that's what shepherd suggests at the end. OK, try again.
...
Would you like Guided channel selection? [yes,no (default=yes)] return

* Guided Channel Selection *

High Definition TV (HDTV)

If you have a HDTV capable system and are interested in
having Shepherd's postprocessors populate HDTV content
then Shepherd will need to know the XMLTV IDs for the HD
channels also.  HD related SD channels are required.
The new 7HD channel is populated with programs from the first related SD channel.
http://svn.whuffy.com/index.fcgi/wiki/FAQ#MyhighdefinitionHDchannelsaremissingprograms
Do you have High-Definition (HDTV)? [yes,no (default=no)] yes
'TEN HD' is going to be populated from 'TEN'
'7HD' is going to be populated from 'Seven'

Do you have PayTV? [yes,no (default=no)] return

Your MythTV has 27 channels.  Shepherd offers 16 channels of guide
data for VIC: Western Victoria (11 free-to-air, 5 HDTV, 0 Pay-TV).

Please associate each MythTV channel with a Shepherd guide data
channel.

Guide data sources:
( 0) (no guide)                    ( 9) TEN
( 1) 7HD                           (10) TEN HD
( 2) ABC                           (11) WIN
( 3) ABC2                          (12) ABCHD
( 4) Imparja                       (13) ImparjaHD
( 5) Prime                         (14) PrimeHD
( 6) SBS                           (15) SBSHD
( 7) SBS News                      (16) WINHD
( 8) Seven
MythTV channel -: ABC ? 20
Unknown #: 19
Huh? Where did 19 come from? I did a lot of fiddling around before I got to what I think is the correct answer. It all depends on correct interpretation of the prompt:
MythTV channel -: ABC ?

It's not asking for a MythTV channel number: it's trying to present one, and it's asking for the corresponding guide data source. In this case, there isn't a channel number, so the program shows -, but the correct answer is still 2 (ABC). That becomes clearer when we get to the channels that do have a channel number:

MythTV channel 20: ABC HDTV ? 2

Next came the option to reconfigure from an existing grabber. I was using OzTivo, so chose that, and it seemed to work.

Finally got a display of what I had (again somewhat shortened):

VIC: Western Victoria (98).  27 MythTV channels.  16 Shepherd channels.

   #  MythTV Channel                 Shepherd Guide Data
 --------------------------------------------------------
      ABC                            -> ABC
 201  ABC DiG Jazz                   -> -
 200  ABC DiG Radio                  -> -
  20  ABC HDTV                       -> ABC
  22  ABC TV                         -> -
   2  ABC TV Victoria                -> -
      ABC2                           -> ABC2
  55  MyTalk                         -> -
      Nine                           -> -
   6  PRIME Ballarat                 -> Seven
  60  PRIME HD                       -> Seven
  61  PRIME View 1                   -> Seven
  62  PRIME View 2                   -> Seven
  63  PRIME View 3                   -> Seven
      SBS                            -> SBS
  31  SBS 2                          -> -
  30  SBS HD                         -> -
  33  SBS NEWS                       -> -
  38  SBS RADIO 1                    -> -
  39  SBS RADIO 2                    -> -
      SBSWN                          -> -
   5  SC10 Ballarat                  -> -
  50  SC10 HD                        -> -
      Seven                          -> Seven
      Ten                            -> -
  80  WIN TV HD                      -> -
  80  Western Vic                    -> -

Next I had to connect the thing to MythTV, which went surprisingly well, though the thing ran for over an hour pulling down not only programme information, but also IMDB data. At the end of that, I still didn't have data for ABC2 that went beyond Sunday, but to make up for it, the categories of many programmes had been changed, messing up my custom queries. There was also no sign of the IMDB data in MythWeb. Still, on the whole it went better than I had expected. I just wish I could trust multimedia software more.


Greg's home page Greg's diary Greg's photos Copyright

Valid XHTML 1.0!

$Id: shepherd-0.php,v 1.4 2009/02/14 03:34:24 grog Exp $