Archive for August, 2005
Final update All new update Update I’ve uploaded a slightly newer patch/package correcting two bugs. The first is not to reset the IR chip if you try and send an invalid code (by messing with lircd.conf!) since this clearly isn’t necessary. The second is a stack overrun bug spotted by Pascal Brisset, which could have had nasty consequences. I guess since I’ve not seen it the way I use lirc it’s only sending one code at a time to the driver. btw, this stuff is in my SVN repository, under trunk/3rdparty/lirc, if you want to do development on it. The old stuff There does exist a sort of solution for this: ivtvctl provides an ioctl that resets the IR chip on the card. Some people have this running every minute from a cron script, whilst that’s not a great solution it is a workable one. My issue with that is if you reset the IR chip, you have to send the boot block again to the IR blaster, so if I’d adopted the cron script I wouldn’t be able to change channel any more. So after all that, I’ve adopted a delightful solution — detecting when the IR chip has locked up (i.e. stopped responding to i2c traffic), and resetting it in the driver. It’s messy, but it works, and as I do it in the driver, I can transparently retry IR blaster sends, which saves me from recording the wrong channel. Anyway, that was a bit long, so here’s a changelog: - Split the code out into a new lirc driver, lirc_pvr150. Here’s the updated HOWTO for this version: 1. Get the pre-patched lirc 0.7.2 (or just the patch should you prefer).
Choose: then:
3. Note that this step is no longer necessary with ivtv >= 0.4.0 (the current stable release series), which is recommended — the export symbol patch was included. Skip right on to step 5 if you’ve grabbed the latest stable release, or go to 3a if you are having ‘remote stops responding’ issues (doesn’t seem to affect everyone). #include “ivtv-gpio.h” near the top of the file after the rest of the #include lines, and EXPORT_SYMBOL(ivtv_reset_ir_gpio); right at the bottom of the file where all the other EXPORT_SYMBOL lines are. All this does is export that symbol for use by other modules, it does not change the functionality of the driver in any way. If you have trouble with this then drop me a line and I will create a patch for the version of ivtv you want to use.
4. Unload & reload the new ivtv driver. If lucky, 5. IR blaster only: Now you need the ‘firmware’. This is Note that the entire firmware is kept in memory (currently 200K) so this makes the driver quite large. 6. Check everything is working so far:
Check the syslog output. This should report something like: Aug 28 02:09:11 soapbox kernel: lirc_pvr150: chip found with RX and TX This means that the driver has detected and initialised the IR blaster hardware — if you don’t see that then let me know. 7. You need to configure lircd, and find out which codeset you are going to be using. The easiest way is to start 8. Start lircd. Note: if you are using a static /dev, you may need to make a device for lirc. If unsure, once you have verified that the module has been loaded ok, run
9. You can now check if the remote is working using
10. Next, for the ir blaster you need to work out which codeset to use, this is the tricky bit. For this I have You need to stick the IR blaster on the IR receiver of box that you intend to control, being quite careful to position If you can’t get this to work: a) My software doesn’t work properly 11. Once you know which codeset you want you can go and delete all of the rest from lircd.conf. They are named “XXX_key” 12. To get mythtv to work, configure a channel change script for your device. There’s one That’s it, good luck!
I have updated the patch with the following changes: - Use schedule_timeout not mdelay as mdelay is a busy loop. This fixes high CPU usage during IR sending. As a consequence of the second point, I recommend that you fiddle with the ‘gap’ parameter in lircd.conf. The gap parameter is in microseconds. For my particular cable box, I’ve found that 1/3s (~333,333us) works well. The minimum time is until the chip is ready to send, this works out roughly at about 50-200ms. The minimum delay is fixed at 50ms (avoids wasting CPU; go hack the code if you want to change this), and the maximum wait is 1s.
NOTE: This page has been superseded. Please see this post which has a newer patch & scripts. I have a basic driver that appears to make this work, based on I2C captures from the Hauppauge windows software. I will say Here’s a basic HOWTO: 1. Get lirc-0.7.2-pre2 or your favourite version
Choose ‘TV card’, ‘Hauppauge TV card’, save quit then 4. Now you need the ‘firmware’. This is 5. Check everything is working so far:
Check the syslog output. This should report something like: Aug 7 23:10:52 soapbox kernel: lirc_i2c: chip found @ 0×70 (Hauppauge IR TX (PVR1 This means that the driver has detected and initialised the IR blaster hardware — if you don’t see that then let me know. 6. You need to configure lircd, and find out which codeset you are going to be using. The easiest way is to start 7. Start lircd. You need two of them as one device is created for the receiver and one for the sender, I use:
You need to check in /dev or syslog to see which “lircN” files were created for which device. The IR blaster will 8. Next you need to work out which codeset to use, this is the tricky bit. For this I have You need to stick the IR blaster on the IR receiver of box that you intend to control, being quite careful to position If you can’t get this to work: a) My software doesn’t work properly 9. Once you know which codeset you want you can go and delete all of the rest from lircd.conf. They are named “XXX_key” 10. To get mythtv to work, configure a channel change script for your device. There’s one That’s it, good luck! |