At some point in the past, cable boxes were simple things that just changed channel, now they have a whole host of different states like on demand that can really confuse mythtv.
I've set up channel 109 (which is On Demand Preview on the Virgin box) to put the box into on-demand mode, giving mythtv a way of knowing the cable box is doing something other than displaying one of the conventional channels. It relies on users using channel 109 to switch to On-Demand mode, so isn't perfect, but it seems to work.
Getting out of most of the other states the box could be in can be done by sending the TV then Select buttons, and whilst it'll kick users off of on demand without warning, it means that mythtv gets to record what it wants.
[code lang="bash"]
#!/bin/bash
REMOTE_NAME="ntl-vm"
DELAY="0.05" # Set to 1 to watch what's going on, otherwise choose smallest vaue that works reliably
# Set either/both of thiese to echo for debuggig purposes
LOG="/usr/bin/logger -t \"chan_ch_ntl\""
IRSEND=irsend
function send {
$IRSEND SEND_ONCE $REMOTE_NAME $1
sleep $DELAY
}
#Pick the correct transmitter
/usr/bin/irsend SET_TRANSMITTERS 1
case "$1" in
109) # Substitute the on-demand preview channel for the On-Demand State
$LOG "Put box in On-Demand mode"
send "On_Demand"
;;
"") # Complain at empty channel
$LOG "I can't change to a null channel"
;;
*) # Otherwise we should have a channel
# Force box into TV mode, this works in *most* cases
send "TV"
send "Select"
#Send each digit individually
for digit in $(echo $1 | sed -e 's/./& /g'); do
echo $digit
send $digit
done
send "Select"
;;
esac
[/code]





Add new comment