[mythtv-users] Need Help: HD-PVR IR Blaster [SOLVED....SORT OF]

Martin Lynch martin.lynch.toronto at gmail.com
Wed Jan 5 03:53:06 UTC 2011

>>> >  However if I replace:
>>> >
>>> >    name 0_26_KEY_0
>>> >      1703936
>>> >
>>> >  with
>>> >
>>> >    name 0_26_KEY_0
>>> >      2149187584
>>> >
>>> >  it fails ("2149187584" is the code corresponding to "name
>>> 1_26_KEY_0"):
>> Perhaps it is worth noting that 2149187584 is 0x801A0000 in hex, which
>> if stored as a signed number is -1703936 or so.  Perhaps something in
>> the code doesn't like negative numbers.
> Well, that's fascinating! If that's the case, would it have different
> implications on a 64 bit machine vs a 32 bit (ie is the decision made
> in the programming to make it either a 32 bit signed integer or a 64
> bit signed integer? Or is that automatically accounted for?)?
> Jarod: can you possibly shed some light on this? ie what happens to
> these numbers/are they converted/etc?
In case anyone is following this thread (and so it ends up on the 
record), here's how this played out:

Try as I might, I was unable to get the HD-PVR's IR Blaster to work. 
Michael Lynch very kindly sent me all his configuration files which were 
known to work, however upon inserting Michael's lircd.conf file to 
/etc/lirc, once again my system refused to recognize any lircd.conf 
which contained blaster codes with 10 digits - as soon as a single 10 
digit code was included anywhere, $irsend LIST "" "" would report nothing.

I began to suspect it was either a kernel issue or a 64 bit vs 32 bit 
issue, so I tested both: I went through the compile/copy files/etc 
procedure on 2.6.31-11-rt and also 2.6.32-27-generic; neither worked 
once the 10 digit codes were introduced. I also went through the 
procedure on a 32 bit laptop: likewise everything went swimmingly until 
a 10 digit code was introduced, then nothing.

I sent a private email to Jarod and posted my question above and signed 
up to the LIRC mailing list, none of which elicited any response, so 
having wasted a good 3 weeks on this, I gave up.

I instead bought a USB-UIRT IR receiver/blaster. The unit was around $60 
with tax. After perhaps another 8 hours of monkeying around with that, 
and attempting various lircd.conf and hardware.conf modifications, I 
finally got it working. I also reworked the channel changing script 
originally created by Daniel Kristjansson such that it will work for a 
Bell 9241 STB (which is identical to a Dish Network VIP612, both of 
which are made by Echostar). Lastly, I played around for quite some time 
to figure out the proper codes for this remote/STB via trial and error - 
I literally tried every code in steps of 100 and documented what the 
different frequencies do (if anything) in case anyone else needs this 
(because the remote that comes with this box uses IR for everything 
_except_ the STB, which uses RF, therefore I couldn't simply capture the 
codes via irw or irrecord. Luckily the box will accept an IR signal. Had 
it not, I think it may well have found itself hurtling down 32 stories 
in free fall...). You can find the codes in my lircd.conf file below - 
lots of them are pretty useless in a MythTV setup, but there they are 

So, for all who may follow, here's my lircd.conf, my hardware.conf and 
my modified channel changing script (I've left some of the original 
stuff in the script and simply commented it out, in case it turns out 
useful to someone). Note that it is still sub-optimal, because one of 
the LIRC instances is running conflicting instructions on which device 
to use (it simultaneously reports "--device=/dev/lircd1" and "-d 
/dev/ttyUSB0") but I'm so utterly fed up spending my time on LIRC and 
ruing the day my firewire box left me that, since this works perfectly 
for me, I have zero intention of further monkeying with it. When I see 
the letters L-I-R-C these days my blood begins to boil and I have a 
distinctly better understanding of the mechanics involved when people 
lose it and go on homicidal rampages...LIRC is a ridiculous bunch of 
smoke and mirrors and voodoo and incantations, none of which, it seems, 
is documented in detail or firmly understood by _anyone_ (or certainly 
not by anyone willing to share the magic spells).

Please note too that, under the subject line, "HD-PVR Priming Script" I 
posted another (unresolved) question about unfreezing my constantly 
freezing HD-PVR. Well, as it turns out, since abandoning LIRC 
(grrrrr...) for the USB-UIRT, the HD-PVR has worked flawlessly - I've 
been recording virtually all day every day and the HD-PVR has captured 
every show. The channel changes via the USB-UIRT have worked flawlessly 
with my amended channel change script and the box has yet to freeze. 
That's great, because I was about to modify a power bar to allow control 
of it via a USB cable such that I could interrupt the power and thereby 
reset the HD-PVR. Now I can go back to enjoying, rather than struggling 
with, MythTV!

Thanks, sincerely, to Michael and Mark for their kind efforts to help me 
out - very much appreciated!


begin remote

   name dish
   bits           16
   flags SPACE_ENC
   eps            30
   aeps          100

   header        400  6100
   one           400  1700
   zero          400  2800
   ptrail        400
   gap          6200
   min_repeat      4
   toggle_bit      0

   frequency    40000

       begin codes
           power                    0x0000000000000800
           0                        0x0000000000004400
           1                        0x0000000000001000
           2                        0x0000000000001400
           3                        0x0000000000001800
           4                        0x0000000000002000
           5                        0x0000000000002400
           6                        0x0000000000002800
           7                        0x0000000000003000
           8                        0x0000000000003400
           9                        0x0000000000003800
           cancel                   0x0000000000004800
       menu             0x0000000000005000
       view_live_tv           0x0000000000005800
       right               0x0000000000006000
       up                   0x0000000000006800
       left               0x0000000000007000
       down               0x0000000000007800
       pause               0x0000000000008000
       unknown           0x0000000000008400
       page_up           0x0000000000008800
       system_info           0x0000000000009000
       format           0x0000000000009400
       search           0x0000000000009800
       select           0x0000000000004000
       end codes

end remote



# /etc/lirc/hardware.conf
#Chosen IR Transmitter

#Chosen Remote Control

#Enable lircd

#Don't start lircmd even if there seems to be a good config file

#Try to load appropriate kernel modules

# Default configuration files for your hardware if any

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"


channel change script for Bell 9241/Dish Net VIP612 - make sure you make 
the file executable; place in /usr/local/bin, then point to it in the 
mythtv-setup screen (I think it's under 4. Inputs? My backend is very 
busy now so cannot check):


# This script is provided without any warranty of fitness to whoever
# wishes to use it. It has been used by me for many months with the
# VIP211 receivers. -- Daniel Kristjansson (March 20th, 2008)
# Additional modifications by Martin Lynch to enable use with
# Bell 9241 and Dish Network VIP612. It will likely work with
# other VIP STBs too (Jan 2, 2011).

# If you have a separate IR reciever you will want to give it "/dev/lircd"
# and use something like "/dev/lircd1" for the transmitter.
# If the tranmitter is on a remote LIRC server, use the ip/hostname:port
# with -a to address it.

DEVICE="-d /dev/lircd"
#DEVICE="-d /dev/lircd1"
#DEVICE="-a hostname:port"

# Use dish1, dish2 .. dish16 depending on which id you are using
# Every dish receiver can be assigned a different remote code, so
# that you can have multiple receivers in one room, and controlled
# by the same LIRC transmitter.


# This is the command passed in from MythTV.


# First, leave sleep mode..
# Note: I have commented this out as it did not function correctly and
# appears unnecessary - ML
#sleep 0.3

case $cmd in
     # make sure we leave any encrypted channel..

     # Note: this IR send slows down MythTV LiveTV, if you want faster
     # channel changing in LiveTV remove it. However if someone ever
     # changes to a channel you don't get, either with this script or
     # manually, you need this "up" to leave that channel.

# I likewise commented this out - encrypted channels do not pose a
# problem for a component connection (they certainly do for firewire!) ML

  #   sleep 0.3

     for digit in $(echo $1 | sed -e 's/./& /g'); do
         irsend $DEVICE SEND_ONCE $REMOTE_NAME $digit
         # If things work OK with sleep 1, try this for faster channel 
         #sleep 0.15

# I commented out the sleep 0.15 as channel changes did not work
# only the first digit made it through. Increased to 1 second. ML
     sleep 1.0

     # Send a select so that this channel change takes immediately.


         irsend $DEVICE SEND_ONCE $REMOTE_NAME $cmd


Kind regards,


More information about the mythtv-users mailing list