[ATrpms-users] lirc not working with kernel 2.6.22 and Leadtek Winfast 2000XP

Jeffrey J. Kosowsky atrpms at kosowsky.org
Wed Nov 7 08:24:28 CET 2007


YIPPEE! I finally got lirc working with my LeadTek Winfast2000XP
Deluxe controller on kernel 2.6.22

Key steps were as follows:

1. Patch and recompile the bttv module
   Note: the patch referenced several other places on the net uses
   ir->mask_keycode = 0x0f8 which cause some keys on my (bundled)
   remote not to work and others to show up as duplicate
   keys. Instead, use: ir->mask_keycode = 0x8f8.

   The full patch is:

--- bttv-input.c.orig	2007-07-08 19:32:17.000000000 -0400
+++ bttv-input.c	2007-11-07 01:15:33.000000000 -0500
@@ -70,6 +70,7 @@
 	    (ir->mask_keyup    &&  (0 == (gpio & ir->mask_keyup)))) {
 		ir_input_keydown(ir->dev,&ir->ir,data,data);
 	} else {
+		if (btv->c.type == BTTV_BOARD_WINFAST2000) ir_input_keydown(ir->dev,&ir->ir,data,data);
 		ir_input_nokey(ir->dev,&ir->ir);
 	}
 
@@ -242,7 +243,7 @@
 
 	case BTTV_BOARD_WINFAST2000:
 		ir_codes         = ir_codes_winfast;
-		ir->mask_keycode = 0x1f8;
+		ir->mask_keycode = 0x8f8;
 		break;
 	case BTTV_BOARD_MAGICTVIEW061:
 	case BTTV_BOARD_MAGICTVIEW063:

-----------------------------------------------------
NOTE: to recompile just the bttv kernel module, do the following:
	  Download the kernel source rpm and install it (rpm -Uvh)
	  Then run: rpmbuild -bp --target $(arch) kernel-2.6.spec
	  Patch bttv-input.c (in /usr/src/redhat/BUILD/kernel-2.6.22/linux-2.6.22.i686/drivers/media/video/bt8xx)
	  Then go to /usr/src/redhat/BUILD/kernel-2.6.22/linux-2.6.22.i686
	  and recompile just the bttv module using:
		  make  M=drivers/media/video/bt8xx

2. Then you need to generate a new lircd.conf file since the keycodes
   differ from the old gpio generated one that is included with the
   standard lirc tarball.

   Run: irrecord -H dev/input -d name="bttv IR (card=34)" lircd
   and follow the instructions.

   Note, the lircd.conf that I generated is as follows:

# Please make this file available to others
# by sending it to <lirc at bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.3-CVS(dev/input) on Tue Nov  6 17:04:54 2007
#
# contributed by: Jeff Kosowsky
#
# brand:		LeadTek
# model no. of remote control: Y0400046 (bundled with Winfast 2000XP Deluxe)
# devices being controlled by this remote: LeadTek Winfast 2000XP Deluxe

# brand:             Leadtek
# model:             Y0400052 (bundeled with Winfast PVR2000 TV-card)
#
# Note: Only CH_UP, CH_DOWN, VOL_UP and VOL_DOWN will repeat. This
# seems to be a limitation of the remote control.

begin remote

  name  crap2.conf
  bits           16
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   16
  pre_data       0x8001
  gap          423871
  toggle_bit_mask 0x80010073

      begin codes
          POWER                    0x0074
          MTS                      0x0188
          TV/FM                    0x0182
          VIDEO                    0x0189
          DISPLAY                  0x0166
          CH+                      0x0192
          CH-                      0x0193
          VOL-                     0x0072
          VOL+                     0x0073
          FULLSCREEN               0x0174
          TELETEXT                 0x0184
          SLEEP                    0x008E
          BOSSKEY                  0x0163
          MUTE                     0x0071
          RED                      0x018E
          GREEN                    0x018F
          YELLOW                   0x0190
          BLUE                     0x0191
          1                        0x0002
          2                        0x0003
          3                        0x0004
          4                        0x0005
          5                        0x0006
          6                        0x0007
          7                        0x0008
          8                        0x0009
          9                        0x000A
          0                        0x000B
          .                        0x0034
          FINETUNE+                0x004E
          FINETUNE-                0x004A
          PIP                      0x00E2
          ENTER                    0x001C
          RECALL                   0x0195
          BACK                     0x019C
          PLAY                     0x00A4
          NEXT                     0x0197
          TIMESHIFTING             0x0169
          STOP                     0x0080
          REC                      0x00A7
          SNAPSHOT                 0x00EA
      end codes

end remote

----------------------------------------------------------

Finally, test that it all works by restarting the lircd service and
running irw and then pressing the keys on your remote.

Note: I set /etc/sysconfig/lircd to:
	# Options to lircd
	LIRCD_OPTIONS='-H dev/input --device name="bttv IR (card=34)"'



More information about the atrpms-users mailing list