I have two different IR blasters running the DC50X under Myth. One using the MCE transmitter and one using the Iguana transmitter. I use the lircd config file shown on this page with the MCE transmitter because it works with the system-default version of LIRC that comes pre-installed on Mythbuntu 9.04. Since the Iguana transmitter required that I build LIRC anyway, I built 0.8.6 and thought I would try the config file at: http://mythtv.org/pipermail/mythtv-users/2010-January/278281.html (which uses XMP, which only works under 0.8.6 and greater). That works too.
I'd test everything at each step of the way. Mostly, this is a house of cards and the slightest mistake causes it to break with nary a peep as to what went wrong. Testing each step will give you a clue. The last step should be to verify that the channel changer script fires the IR blasters. With the MCE blaster you can see it with the naked eye. For the Iguana blaster, I used the trick of observing it through a digital camera viewfinder. Once that works, you can tape the blaster and the DTA's remote receiver into a homemade optocoupler with some black tape. A tube roughly the size of the receiver and about 3/4" long with something stuffed in the other end to hold the IR blaster works great.
Here's my shell script for sending channel changes to the IR transmitter. Uses the config info in hardware.conf and will work with any transmitter (1-4). Also, I like to use names for my remote buttons so it translates (1 -> One, 2 -> Two, etc.):
#! /bin/sh
# Shell script used to send channel change commands to a set top box (STB)
# or digital transport adapter (DTA) via LIRC.
#
# This script is commonly used by applications such as Myth TV to change
# the channels on a STB/DTA when the STB/DTA must be used to convert the
# channels that a subscriber can see to a single channel (e.g. when
# digital channels are to be viewed by the application on channel 3 with
# an analog decoder card).
#
# The application invokes this script and passes the channel number to it
# as the first parameter. This script deconstructs the channel number and
# decides what command sequence the STB/DTA's remote would have to send in
# order to change to that channel (typically its the channel number,
# followed by the Enter button). It sends the channel change commands to
# the STB/DTA through the IR blaster that was started by lircd. The
# information necessary to do this is obtained from the lircd config file
# /etc/lirc/hardware.conf.
#
# If you need to send commands to a different IR emitter than number 1,
# you can alias this script and use the aliases to send to any emitter
# from 1 thru 4. You must set up the aliases as follows:
#
# ln -s IRChangeChannel IR1ChangeChannel
# ln -s IRChangeChannel IR2ChangeChannel
# ln -s IRChangeChannel IR3ChangeChannel
# ln -s IRChangeChannel IR4ChangeChannel
#
# You can then send commands to the alternate emitters as follows:
#
# /path/to/scripts/IR1ChangeChannel 12
# /path/to/scripts/IR2ChangeChannel 22
# .
# .
# .
#
# Because of the nature of the way that the program name is determined,
# you must use some kind of path prefix on the name (i.e. at the very
# least, use "./IR3ChangeChannel 44").
#
# Note that, unless you are using stereo emitters on the IguanaIR, the two
# emitters on the stick are IR1 and IR3 (two and four are *not* used).
# Where we load irsend from (depends whether this is a system install or a
# local build).
#ew LOAD_PATH=/usr/bin
LOAD_PATH=/usr/local/bin
test -f ${LOAD_PATH}/irsend || exit 0
# The user can symlink to this program to use an emitter other than 1. We
# figure this out from our invoking program name.
Emitter=0
ProgName=`echo $0 | sed -r s:.+/\([^/]+\)$:\\\1:`
if [ ! -n "$ProgName" ] || [ "$ProgName" = "IRChangeChannel" ]; then
Emitter=1
else
case "$ProgName" in
IR1ChangeChannel)
Emitter=1
;;
IR2ChangeChannel)
Emitter=2
;;
IR3ChangeChannel)
Emitter=3
;;
IR4ChangeChannel)
Emitter=4
;;
*)
Emitter=1
esac
fi
# Let's get the config file that was used to start lircd with. It will
# tell us what remote we're using (hopefully).
if [ -f /etc/lirc/hardware.conf ]; then
. /etc/lirc/hardware.conf
fi
# We need a remote name.
if [ -z "$TRANSMITTER" ] || [ "$TRANSMITTER" = "none" ]; then
exit 0
fi
# If there's a transmitter device or driver defined, the lirc init script
# started a second copy of lircd.
if [ ! -z "$TRANSMITTER_DEVICE" ] \
|| [ ! -z "$TRANSMITTER_DRIVER" ]; then
DevArgs="--device=/dev/lircd1"
else
DevArgs="--device=/dev/lircd"
fi
# Select the appropriate IR emitter on the device.
${LOAD_PATH}/irsend $DevArgs set_transmitters $Emitter
# Send the channel number.
for Digit in $(echo $1 | sed -e 's/./& /g'); do
case "$Digit" in
1)
Key="One"
;;
2)
Key="Two"
;;
3)
Key="Three"
;;
4)
Key="Four"
;;
5)
Key="Five"
;;
6)
Key="Six"
;;
7)
Key="Seven"
;;
8)
Key="Eight"
;;
9)
Key="Nine"
;;
*)
Key="Zero"
esac
Misc Thoughts About The DC50X
I have two different IR blasters running the DC50X under Myth. One using the MCE transmitter and one using the Iguana transmitter. I use the lircd config file shown on this page with the MCE transmitter because it works with the system-default version of LIRC that comes pre-installed on Mythbuntu 9.04. Since the Iguana transmitter required that I build LIRC anyway, I built 0.8.6 and thought I would try the config file at: http://mythtv.org/pipermail/mythtv-users/2010-January/278281.html (which uses XMP, which only works under 0.8.6 and greater). That works too.
I'd test everything at each step of the way. Mostly, this is a house of cards and the slightest mistake causes it to break with nary a peep as to what went wrong. Testing each step will give you a clue. The last step should be to verify that the channel changer script fires the IR blasters. With the MCE blaster you can see it with the naked eye. For the Iguana blaster, I used the trick of observing it through a digital camera viewfinder. Once that works, you can tape the blaster and the DTA's remote receiver into a homemade optocoupler with some black tape. A tube roughly the size of the receiver and about 3/4" long with something stuffed in the other end to hold the IR blaster works great.
Here's my shell script for sending channel changes to the IR transmitter. Uses the config info in hardware.conf and will work with any transmitter (1-4). Also, I like to use names for my remote buttons so it translates (1 -> One, 2 -> Two, etc.):
#! /bin/sh
# Shell script used to send channel change commands to a set top box (STB)
# or digital transport adapter (DTA) via LIRC.
#
# This script is commonly used by applications such as Myth TV to change
# the channels on a STB/DTA when the STB/DTA must be used to convert the
# channels that a subscriber can see to a single channel (e.g. when
# digital channels are to be viewed by the application on channel 3 with
# an analog decoder card).
#
# The application invokes this script and passes the channel number to it
# as the first parameter. This script deconstructs the channel number and
# decides what command sequence the STB/DTA's remote would have to send in
# order to change to that channel (typically its the channel number,
# followed by the Enter button). It sends the channel change commands to
# the STB/DTA through the IR blaster that was started by lircd. The
# information necessary to do this is obtained from the lircd config file
# /etc/lirc/hardware.conf.
#
# If you need to send commands to a different IR emitter than number 1,
# you can alias this script and use the aliases to send to any emitter
# from 1 thru 4. You must set up the aliases as follows:
#
# ln -s IRChangeChannel IR1ChangeChannel
# ln -s IRChangeChannel IR2ChangeChannel
# ln -s IRChangeChannel IR3ChangeChannel
# ln -s IRChangeChannel IR4ChangeChannel
#
# You can then send commands to the alternate emitters as follows:
#
# /path/to/scripts/IR1ChangeChannel 12
# /path/to/scripts/IR2ChangeChannel 22
# .
# .
# .
#
# Because of the nature of the way that the program name is determined,
# you must use some kind of path prefix on the name (i.e. at the very
# least, use "./IR3ChangeChannel 44").
#
# Note that, unless you are using stereo emitters on the IguanaIR, the two
# emitters on the stick are IR1 and IR3 (two and four are *not* used).
##########################################################################
# Where we load irsend from (depends whether this is a system install or a
# local build).
#ew LOAD_PATH=/usr/bin
LOAD_PATH=/usr/local/bin
test -f ${LOAD_PATH}/irsend || exit 0
# The user can symlink to this program to use an emitter other than 1. We
# figure this out from our invoking program name.
Emitter=0
ProgName=`echo $0 | sed -r s:.+/\([^/]+\)$:\\\1:`
if [ ! -n "$ProgName" ] || [ "$ProgName" = "IRChangeChannel" ]; then
Emitter=1
else
case "$ProgName" in
IR1ChangeChannel)
Emitter=1
;;
IR2ChangeChannel)
Emitter=2
;;
IR3ChangeChannel)
Emitter=3
;;
IR4ChangeChannel)
Emitter=4
;;
*)
Emitter=1
esac
fi
# Let's get the config file that was used to start lircd with. It will
# tell us what remote we're using (hopefully).
if [ -f /etc/lirc/hardware.conf ]; then
. /etc/lirc/hardware.conf
fi
# We need a remote name.
if [ -z "$TRANSMITTER" ] || [ "$TRANSMITTER" = "none" ]; then
exit 0
fi
# If there's a transmitter device or driver defined, the lirc init script
# started a second copy of lircd.
if [ ! -z "$TRANSMITTER_DEVICE" ] \
|| [ ! -z "$TRANSMITTER_DRIVER" ]; then
DevArgs="--device=/dev/lircd1"
else
DevArgs="--device=/dev/lircd"
fi
# Select the appropriate IR emitter on the device.
${LOAD_PATH}/irsend $DevArgs set_transmitters $Emitter
# Send the channel number.
for Digit in $(echo $1 | sed -e 's/./& /g'); do
case "$Digit" in
1)
Key="One"
;;
2)
Key="Two"
;;
3)
Key="Three"
;;
4)
Key="Four"
;;
5)
Key="Five"
;;
6)
Key="Six"
;;
7)
Key="Seven"
;;
8)
Key="Eight"
;;
9)
Key="Nine"
;;
*)
Key="Zero"
esac
${LOAD_PATH}/irsend $DevArgs send_once $TRANSMITTER $Key
sleep 0.5
done
# Send the enter key.
${LOAD_PATH}/irsend --device=/dev/lircd SEND_ONCE $TRANSMITTER Enter