Ticket #29 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

i2c patch to address PVR-150 IR chip issues

Reported by: mark@npsl.co.uk Assigned to: hverkuil
Priority: normal Milestone:
Component: Developer TODOs Version: ivtv 0.4.x
Severity: normal Keywords: IR, PVR-150, i2c, --reset-ir
Cc:

Description (Last modified by hverkuil)

The attached patch implements the same bit banging algorithm (AFAICT) as the hauppauge windows driver. It is against SVN 2736.

This seems to help the issue where the remote stops responding to the LIRC driver. It would be helpful if anyone who has this problem could give it a whirl and let me know if it improves things. If anyone else would like to give it a go it would be useful to know if it breaks other things.

I'm currently using the IR receiver/blaster driver that I wrote, and as part of that I hacked something in to reset the IR chip when i2c transfers fail or return unexpected values. In situations where I was able to get this to happen reasonably frequently beforehand (every 5-10 minutes) I can no longer do so.

The patch adds a module parameter to ivtv: newi2c (default 1). If 0, this will use i2c-algo-bit as before. It also exports ivtv_reset_ir_gpio. That's not necessary for the standard lirc_i2c but the IR blaster driver I wrote binds to it and I haven't bothered to remove it from the patch as yet.

As a bonus, this seems to use about 1/2 the CPU of i2c-algo-bit (observed when polling the PVR-150 IR chip with lirc). I expect that's just due to less udelaying (instead of that, typically the SCL/SDA registers are polled to see when the outputs have actually been set).

The main motivation was that the hauppauge windows (beta - 2.2.23123) driver lists 'I2C fixes (IR blaster)' in its release notes. Comparing the two drivers, there certainly are big differences in the I2C code. The older driver has something much more like i2c-algo-bit, with udelay equivalents whereas the newer one is approximately as attached.

One note: make sure that you unload cx25840 before reloading ivtv. cx25840 assumes that the underlying i2c algorithm is i2c-algo-bit, and tries to change the udelay value when loading firmware. I simply added a line that checks if algo_data is non-NULL, which is enough to distinguish i2c-algo-bit from "i2c-algo-hauppauge". If you miss that, you'll get an Oops with a NULL pointer deference in cx25840.

Mark

Attachments

i2c.patch (12.4 kB) - added by mark@npsl.co.uk on 10/04/05 07:42:15.
The patch
reset_ir_export.patch (0.5 kB) - added by mark@npsl.co.uk on 10/04/05 09:58:26.
Patch that exports ivtv_reset_ir_gpio (for IR blaster driver that likes resetting the IR chip)
i2c-0.4.0.patch (12.0 kB) - added by mark@npsl.co.uk on 11/11/05 12:24:31.
Patch against 0.4.0
i2c-0.5.0.patch (12.1 kB) - added by mark@npsl.co.uk on 11/11/05 12:25:16.
Patch against ivtv 0.5.0 (SVN 2885)

Change History

10/04/05 07:42:15 changed by mark@npsl.co.uk

  • attachment i2c.patch added.

The patch

10/04/05 09:58:26 changed by mark@npsl.co.uk

  • attachment reset_ir_export.patch added.

Patch that exports ivtv_reset_ir_gpio (for IR blaster driver that likes resetting the IR chip)

10/08/05 09:32:27 changed by ivtv@chrisheller.org

I was having problems with a new PVR-150 and the ivtvctl --reset-ir was doing the trick, so I tried pulling the latest ivtv stuff (0.3.9 revision 2767).

It took a cold reboot to get things working properly. The card was recognized properly initially and was recording, but lirc_i2c was not finding what it needed. But, it's working for me now - 30 minutes in and no issues yet.

10/08/05 21:45:25 changed by mark@npsl.co.uk

Thanks for trying this. Could you let me know how you get on with it?

11/11/05 12:24:31 changed by mark@npsl.co.uk

  • attachment i2c-0.4.0.patch added.

Patch against 0.4.0

11/11/05 12:25:16 changed by mark@npsl.co.uk

  • attachment i2c-0.5.0.patch added.

Patch against ivtv 0.5.0 (SVN 2885)

11/26/05 17:22:34 changed by hverkuil

  • owner changed from anonymous to hverkuil.
  • status changed from new to assigned.
  • version changed from 0.3.x to ivtv 0.4.x.
  • description changed.
  • milestone set to Release 0.4.1.

12/07/05 21:35:26 changed by jweir77@gmail.com

Hello,

Thank you for the effort to address this issue, it's certainly frustrating! I tried your patch against the 0.4.0 driver release and continued to have the same problem. I am currently trying SVN build 3029 of the 0.4 branch, and the problem persists. I have not applied any patches to this source. Everything works from a cold boot of the machine, but the IR stuff will lock up within a few minutes. My first question, do I need to patch my SVN source? If so, what patch should I use? (I may have been confused in thinking that this SVN build already has your new source) Secondly, if things really are still broken on my end, what sort of information could I send you to assist with your debugging? I'm happy to pass on anything you'd fine helpful.

Thanks again, Jim

12/11/05 00:43:36 changed by ed3120@yahoo.com

I applied the patch, but I keep getting the follwoing error: lirc_pvr150: Unknown symbol ivtv_reset_ir_gpio

12/19/05 13:22:21 changed by hverkuil

  • milestone changed from Release 0.4.1 to Release 0.4.2.

01/15/06 19:21:52 changed by hverkuil

  • status changed from assigned to closed.
  • resolution set to fixed.

Committed the patch with some extra code from Mark to fix msp3400 support. Thanks to Mark Weaver for fixing the IR blaster support!

01/22/07 12:21:28 changed by hverkuil

  • milestone changed from Release 0.4.2 to Release 0.10.0.

Milestone Release 0.4.2 deleted

07/26/07 11:45:40 changed by hverkuil

  • milestone deleted.

Milestone Release 0.10.0 deleted