We use a set-top-box as the video source for mythtv. And while this works perfectly fine, we have to manually make sure the right channel is set for what mythtv wants to record. This can turn out to being a pain at time, especially when multiple things are planned to be recorded on different channels. So I went and ordered a IR transmitter from irblaster.info to give mythtv the possibility to change channels itself.
Since a bunch of the infos I found online were a bit out dated, here are a few tips for anyone using current versions of the software (I’ve got mythtv-backend 0.22 and lirc 0.8.4a running on a mythbuntu based system when I wrote this)
Hardware is easy to set up, just plug it into a free serial port.
1st we will head over to http://lirc.sourceforge.net/remotes/ and grab the file for our reciever set-top-box if we don’t already have them.
Then go edit /etc/lirc/hardware.conf and add the transmitter settings, these were mine:
| Bash | | copy code | | ? |
| 1 | TRANSMITTER="Skymaster_XL10" |
| 2 | TRANSMITTER_MODULES="lirc_dev lirc_serial" |
| 3 | TRANSMITTER_DRIVER="" |
| 4 | TRANSMITTER_DEVICE="/dev/lirc1" |
| 5 | TRANSMITTER_LIRCD_CONF="skymaster/XL10" |
| 6 | TRANSMITTER_LIRCD_ARGS="" |
now include the reciever settings to /etc/lirc/lircd.conf
I edited my /etc/init.d/lirc to execute the following line before starting the daemon (was needed to ensure the lirc_serial module can be loaded):
| Bash | | copy code | | ? |
| 1 | /bin/setserial /dev/ttyS0 uart none |
Restart lircd and you can then start testing if transmitting codes work with irsend works. here is a little wrapper script I wrote around irsend for mythtv to use. You may have to twiddle around with the sleeps and change the $Remote to your reciever. If the sleeps are too long (-> the script takes to long to finish switching channels), then mythtv will timeout and not display live tv.
| Bash | | copy code | | ? |
| 01 | #!/bin/bash |
| 02 | |
| 03 | Remote="Skymaster_XL10" |
| 04 | |
| 05 | send="irsend -d /dev/lircd1 SEND_ONCE" |
| 06 | |
| 07 | if [[ "$(echo $1|grep -c "^[0-9]")" = "0" ]] |
| 08 | then # non-numeric command |
| 09 | $send $Remote $1 |
| 10 | else # numeric |
| 11 | for digit in $(echo $1 | sed -e 's/./& /g'); do |
| 12 | $send $Remote $digit |
| 13 | sleep 1.5 |
| 14 | done |
| 15 | fi |
| 16 | sleep 2 |
If everything is working fine, then go ahead and tell mythtv to use the script to change channels. This is done in the tuner card setup of mythtv-backend (mythtv-setup).
Related posts:
- Mythtv + Wii Remote + ScummVM + Google Earth Yesterday and today I went and got my Wii controller...
- Bash scripting, traps and sleep Today I ran into any old problem: you have a...
- Reboot Script for Linksys WAP200 access points Since the Linksys WAP200 has a tendency to hang and...
- rrdtool tricks / tips There are various different ways to generate rrdtool images. And...
Related posts brought to you by Yet Another Related Posts Plugin.



No Comments on "Mythtv and IR Blaster"