External Channel Changer

If you are using just the tuner without a cable box or satellite box, you won't need an external channel change script. Elsewise, read on.

Serial Channel Changer

If your cable box includes a "High Speed Data Port" or "Serial Port", you may be able to control all of your channel changes through this port. This is preferable over an IR transmitter because it's much more reliable. Call up your cable company and find out if the port is activated. If it isn't, ask them if they can activate it for your "Tivo". Much easier then trying to explain myth Smile :)

Sky satellite boxes in UK/Ireland and Foxtel IQ boxes in Australia have an RS232 port, but it is not possible to change channel using them, see 'USB Channel Changer' below for an alternative.

If it is activated, you will need a straight through serial cable. These can be obtained from Radio Shack or Ebay easily. Note: This is NOT a null modem cable. A null modem cable swaps several pins making it useless for this purpose.

Enable your serial port in your BIOS. You will need a copy of the serial channel changer binary from the mythtv sources.

Build from source

Fetch the source from http://centerclick.org/programs/dct-channel/

  • $ sudo aptitude install build-essential
    $ tar xjvf dct-channel.tar.bz2
    $ cd dct-channel
    $ make

Test it

Place this binary in /usr/local/bin. Test it quickly by running channel. If your serial port isn't the first port, you will have to experiment with the command line switches.

  • $ channel

Executing without any arguments should return the current channel number.

After you verify that it works, you will need to add it to your myth configuration. From mythtv-setup, choose the tuner you have configured. For the external channel change script, add:

  • $ channel

as well as any paramaters that you determined you needed for other ports. (Make sure the user that runs mythtv-backend is part of the dialout group)

IR Transmitter Channel Changer

Setup LIRC

The general lirc setup page will describe how to setup a lirc transmitter device:

Setup the channel Change Script

  • Once you have finished configuring lirc, you will need to download a copy of the IR channel changing perl script. You can fetch it at:

http://www.mythtv.org/wiki/Change-channel-lirc.pl

  • Modify this script to change the 5th line to match the name of your remote per /etc/lirc/lircd.conf
    • $ nano change-channel-lirc.pl
  • Make sure that your /etc/lirc/lircd.conf has the numeric buttons set as numerals not words
  • Make the script executable and copy it to /usr/local/bin
    • $ sudo chmod +x change-channel-lirc.pl
      $ sudo cp change-channel-lirc.pl /usr/local/bin
  • When configuring your tuner in mythtv-setup, be sure to set the external channel change script to  change-channel-lirc.pl .

Alternative Channel Change Script

  • If you have any problems using the perl script mentioned above, you can create a simple bash script to change the channel:
    • $ gedit change-channel-lirc.sh
  • Try copying the following script into the newly created file "change-channel-lirc.sh":
    •  #!/bin/sh
      REMOTE_NAME=dish
      irsend --device=/dev/lircd SEND_ONCE $REMOTE_NAME select
      sleep 0.5
      for digit in $(echo $1 | sed -e 's/./& /g'); do
      irsend --device=/dev/lircd SEND_ONCE $REMOTE_NAME $digit
      sleep 0.5
      done
      irsend --device=/dev/lircd SEND_ONCE $REMOTE_NAME select 
  • Modify the 2nd line to match the name of your remote per /etc/lirc/lircd.conf This script sends the "select" signal before and after sending the channel number signals. This is useful for Dish Network receivers that go into "screen saver" mode after a period of inactivity. The first "select" signal wakes the Dish Network receiver from screen saver mode. If it is not in screen saver mode, the "select" signal has no effect. Just delete the 3rd line if you don't want to send the select signal at the start. You may also want to try adjusting the sleep time between signals (the 4th and 7th lines) to see what works best.
  • Make sure that your /etc/lirc/lircd.conf has the numeric buttons set as numerals not words
  • Make the script executable and copy it to /usr/local/bin
    • $ sudo chmod +x change-channel-lirc.sh
      $ sudo cp change-channel-lirc.sh /usr/local/bin
  • When configuring your tuner in mythtv-setup, be sure to set the external channel change script to  change-channel-lirc.sh .

  • If you are using a newer MCE remote (or any IR receiver that has more than one transmitter), you will need to add a command to the beginning of the script. I have not gotten the perl script to work for this purpose, I needed to use a shell script.

$ sudo gedit /usr/local/bin/change-channel-lirc.sh

 #!/bin/sh
REMOTE_NAME=dish
irsend SET_TRANSMITTERS 1 #this is the plug on the left when looking at the back of IR receiver, 2 is the other one
irsend --device=/dev/lircd SEND_ONCE $REMOTE_NAME select
sleep 0.5
for digit in $(echo $1 | sed -e 's/./& /g'); do
irsend --device=/dev/lircd SEND_ONCE $REMOTE_NAME $digit
sleep 0.5
done
irsend --device=/dev/lircd SEND_ONCE $REMOTE_NAME select 

Firewire Channel Changer

NOTE: The 6200.ch changer is included in the Ubuntu MythTV packages and is no longer needed for the Motorola 62xx STBs.

If your cable box has a firewire port, it can be used both for capture as well as for changing channels. A small c app is provided in the contrib directory of the mythtv sources. Precompiled binaries are available below; however, for Motorola boxes other than the DCT6200, such as the DCH3200 or the DCT3412, you need to use the newest version of the channel changer which is currently available from the MythTV SVN branch as of 1/08.

Precompiled Binaries

Here are precompiled binaries for i386 and AMD64:

6200ch-i386

6200ch-amd64

Note, you will need to install libraw1394 and libavc1394 for this binary to work.

  • $ sudo aptitude install libraw1394-8 libavc1394-0

Compile from Source

If you have a different architecture, then you will need to gather the mythtv-sources and compile the binary yourself.

  • $ apt-get source mythtv
    $ sudo aptitude install libraw1394-dev libavc1394-dev build-essential libraw1394-8 libavc1394-0
    $ cd mythtv-0.20/contrib/channel_changers
    $ cc -o 6200ch 6200ch.c -lrom1394 -lavc1394 -lraw1394

Test It

Place this binary in /usr/local/bin. The binary by default will use port 0 and node 1. If this isn't the case for you, you will have to provide extra switches to the 6200ch binary.

Test the binary by executing the binary with a channel number.

  • $ 6200ch 55

Verify that the cable box correctly switched channels.

After you verify that it works, you will need to add it to your myth configuration. From mythtv-setup, choose the tuner you have configured. For the external channel change script, add:

  • $ 6200ch

as well as any parameters that you determined you needed for other ports.

USB Channel Changer

For Sky/Sky+/SkyHD/Foxtel IQ it is possible to change the channel using their RF2 input port, see http://www.heenan.me.uk/control-sky-from-pc/background.html or http://www.dusky-control.com/.


CategoryVideo

MythTV_External_Channel_Changer (last edited 2011-07-18 17:01:21 by rrcs-24-153-203-178)