View Issue Details

IDProjectCategoryView StatusLast Update
0005780CentOS-6CentOS-6-Pluspublic2012-07-09 23:57
ReporterAlex Timm 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformMythTV systemOScentos.plus.x86_64OS Version2.6.32-220.17.1.
Product Version6.2 
Target VersionFixed in Version6.3 
Summary0005780: USB HID Device, HOLTEK USB Keyboard does not talk to the hid-lg in-kernel module to get all remote key presses
DescriptionCannot access remote control buttons. This section of hid-lg.c shows the buttons needed:

static int lg_ultrax_remote_mapping(struct hid_input *hi,
        struct hid_usage *usage, unsigned long **bit, int *max)
{
    if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
        return 0;

    set_bit(EV_REP, hi->input->evbit);
    switch (usage->hid & HID_USAGE) {
    /* Reported on Logitech Ultra X Media Remote */
    case 0x004: lg_map_key_clear(KEY_AGAIN); break;
    case 0x00d: lg_map_key_clear(KEY_HOME); break;
    case 0x024: lg_map_key_clear(KEY_SHUFFLE); break;
    case 0x025: lg_map_key_clear(KEY_TV); break;
    case 0x026: lg_map_key_clear(KEY_MENU); break;
    case 0x031: lg_map_key_clear(KEY_AUDIO); break;
    case 0x032: lg_map_key_clear(KEY_TEXT); break;
    case 0x033: lg_map_key_clear(KEY_LAST); break;
    case 0x047: lg_map_key_clear(KEY_MP3); break;
    case 0x048: lg_map_key_clear(KEY_DVD); break;
    case 0x049: lg_map_key_clear(KEY_MEDIA); break;
    case 0x04a: lg_map_key_clear(KEY_VIDEO); break;
    case 0x04b: lg_map_key_clear(KEY_ANGLE); break;
    case 0x04c: lg_map_key_clear(KEY_LANGUAGE); break;
    case 0x04d: lg_map_key_clear(KEY_SUBTITLE); break;
    case 0x051: lg_map_key_clear(KEY_RED); break;
    case 0x052: lg_map_key_clear(KEY_CLOSE); break;

    default:
        return 0;
    }
    return 1;
}
Config shows it is enabled:
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32-220.17.1.el6.centos.plus.x86_64
# Wed May 16 05:16:29 2012
#

****snip
ONFIG_HID_SUPPORT=y
CONFIG_HID=y
CONFIG_HIDRAW=y

#
# USB Input Devices
#
CONFIG_USB_HID=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y

#
# Special HID drivers
#
CONFIG_HID_A4TECH=y
CONFIG_HID_APPLE=y
CONFIG_HID_BELKIN=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=y
# CONFIG_DRAGONRISE_FF is not set
CONFIG_HID_EZKEY=y
CONFIG_HID_KYE=y
CONFIG_HID_GYRATION=y
CONFIG_HID_TWINHAN=y
CONFIG_HID_KENSINGTON=y
CONFIG_HID_LOGITECH=y # This line
# CONFIG_LOGITECH_FF is not set
# CONFIG_LOGIRUMBLEPAD2_FF is not set

****snip

This is the makefile: (hid-logitech-objs := hid-lg.o) line doesn't look right

#
# Makefile for the HID driver
#
hid-objs := hid-core.o hid-input.o

ifdef CONFIG_DEBUG_FS
    hid-objs += hid-debug.o
endif

obj-$(CONFIG_HID) += hid.o

hid-$(CONFIG_HIDRAW) += hidraw.o

hid-logitech-objs := hid-lg.o
ifdef CONFIG_LOGITECH_FF
    hid-logitech-objs += hid-lgff.o
endif
ifdef CONFIG_LOGIRUMBLEPAD2_FF
    hid-logitech-objs += hid-lg2ff.o
endif

obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
obj-$(CONFIG_HID_APPLE) += hid-apple.o
obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
obj-$(CONFIG_HID_DRAGONRISE) += hid-drff.o
obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o
obj-$(CONFIG_HID_KYE) += hid-kye.o
obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o
obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o
obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o
obj-$(CONFIG_HID_NTRIG) += hid-ntrig.o
obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o
obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o
obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o
obj-$(CONFIG_HID_SONY) += hid-sony.o
obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o
obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o
obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o
obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o
obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o
obj-$(CONFIG_HID_ZEROPLUS) += hid-zpff.o
obj-$(CONFIG_HID_WACOM) += hid-wacom.o

obj-$(CONFIG_USB_HID) += usbhid/
obj-$(CONFIG_USB_MOUSE) += usbhid/
obj-$(CONFIG_USB_KBD) += usbhid/

TagsNo tags attached.

Activities

toracat

toracat

2012-06-17 16:27

manager   ~0015277

Can you elaborate on your comment "(hid-logitech-objs := hid-lg.o) line doesn't look right" ? Would you propose a fix/patch ?
Alex Timm

Alex Timm

2012-06-17 17:31

reporter   ~0015278

I'm not a programmer, but that line is the only one that looks different. If it's valid I don't know why lg_ultrax_remote_mapping is not in the kernel.
Alex Timm

Alex Timm

2012-06-17 18:00

reporter   ~0015279

After looking at drivers/hid kconfig has config HID_LOGITECH and there is no logitech.c to make logitech.o, so maybe this line should be changed:
    obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o
to
    obj-$(CONFIG_HID_LOGITECH) += hid-lg.o
and
    hid-logitech-objs := hid-lg.o
should be removed
and the 2 ifdef sections be moved to after the CONFIG_HID_LOGITECH statment
Alex Timm

Alex Timm

2012-06-18 17:24

reporter   ~0015283

Nope, that fix didn't work.
toracat

toracat

2012-06-18 17:42

manager   ~0015284

I don't see any obvious errors in the code. Is this something unique to your hardware? Can you tell us what the device is? The info will hep us hunt for possible bugs / solutions.

Also, for testing purposes, you may want to give ELRepo's kernel-ml a try:

http://elrepo.org/tiki/kernel-ml

The current version is kernel 3.4.2. You can check to see whether the latest stable kernel from kernel.org works. kernel-ml would not interfere with the distro kernel on your system and you can safely remove it after the testing.
Alex Timm

Alex Timm

2012-06-18 22:19

reporter   ~0015285

It's a generic HID remote keyboard reciever built into my pc case.
There was no documentation for the reciever. At the time I got it
I didn't use it because I was using the reciever built into my
hdhomerun atsc tuner. That died and I got the built in reciever
working with help from http://www.mythtv.org/wiki/Snapstream_firefly_mini

When I was running Centos 5 the remote control buttons worked. In
Centos5 the scancodes were part of driver/usb/input/hid-input.c and
worked with the stock centoplus5 kernel. In Centos6 it looks like
they split logitech out to its own source.

Now that I upgraded my mythtv installation to Centos6, I would really
like those buttons back.

cat /proc/bus/usb/devices
T: Bus=02 Lev=01 Prnt=01 Port=07 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=1233 ProdID=e009 Rev= 1.00
S: Manufacturer=HOLTEK
S: Product=USB Keyboard
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=01 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=10ms
I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid
E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=10ms

If you need any other info please ask. I believe I configured my kernel correctly. make gconfig and kconfig has the option for logitech, but make menuconfig does not.
toracat

toracat

2012-06-18 22:55

manager   ~0015286

Now that you mention that it was working fine with CentOS-5, I looked at the C5 config file. The only option that has "Logitech" in its name is "LOGITECH_FF":

Logitech WingMan *3D support (LOGITECH_FF)

Say Y here if you have one of these devices:
- Logitech WingMan Cordless RumblePad
- Logitech WingMan Force 3D
and if you want to enable force feedback for them.
Note: if you say N here, this device will still be supported, but without
force feedback.

This option is enabled in C5. Now, in CentOS-6, the corresponding option is NOT enabled. You can find it in menuconfig by going through:

Device Drivers -> HID Devices -> Special HID drivers -> Logitech

Then enable [ ] Logitech force feedback support
Alex Timm

Alex Timm

2012-06-19 00:34

reporter   ~0015287

ok, I found it in menuconfig. Must have used the wrong enter key. I don't need the RumblePad or the Force 3D joystick, just the first Logitech (hid-lg.c) which from what I've seen is enabled.
Tryed elrepo and getting firmware conflicts and not willing to remove Centosplus's firmware and risk not being able to get it back.
Going to try 1 more compile with putting the scancodes in hid-input.c to verify if they are the correct scancodes. But this is not a long term fix, because I would have to recomple after every kernel release. And I still haven't figured out how to make nvidia-kmod or v4l's kmod.
toracat

toracat

2012-06-19 07:36

manager   ~0015288

> Going to try 1 more compile with putting the scancodes in hid-input.c
> to verify if they are the correct scancodes. But this is not a long term fix,
> because I would have to recomple after every kernel release.

If you find a fix and submit a patch, that could be applied to the centosplus kernel. This way, you would not have to recompile yourself.
Alex Timm

Alex Timm

2012-06-20 23:26

reporter  

patch (1,726 bytes)
CentOS-6 patch: Allow non-LogiTech remote to work with a generic wireless
keyboard reciever that sends LogiTech scancodes.

CentOSplus bug: 0005780
Submitted by: Alex Timm <alextimm@msn.com>

LIRCD and devinput driver connected to the HOLTEK USB Keyboard remote reciever,
connected on /dev/input/eventx, was not reading the scancodes that should be
found in drivers/hid/lg.c.  The following patch adds the scan codes to 
hid-input.c as they were in centos/centosplus 5.

--- drivers/hid/hid-input.c.distro	2009-12-02 21:51:21.000000000 -0600
+++ drivers/hid/hid-input.c	2012-06-20 15:20:04.000000000 -0500
@@ -473,7 +473,28 @@ static void hidinput_configure_usage(str
 		goto ignore;
 
 	case HID_UP_LOGIVENDOR:
-		goto ignore;
+		set_bit(EV_REP, input->evbit);
+		switch(usage->hid & HID_USAGE) {
+		case 0x004: map_key_clear(KEY_AGAIN);		break;
+		case 0x00d: map_key_clear(KEY_HOME);		break;
+		case 0x024: map_key_clear(KEY_SHUFFLE);		break;
+		case 0x025: map_key_clear(KEY_TV);		break;
+		case 0x026: map_key_clear(KEY_MENU);		break;
+		case 0x031: map_key_clear(KEY_AUDIO);		break;
+		case 0x032: map_key_clear(KEY_TEXT);		break;
+		case 0x033: map_key_clear(KEY_LAST);		break;
+		case 0x047: map_key_clear(KEY_MP3);		break;
+		case 0x048: map_key_clear(KEY_DVD);		break;
+		case 0x049: map_key_clear(KEY_MEDIA);		break;
+		case 0x04a: map_key_clear(KEY_VIDEO);		break;
+		case 0x04b: map_key_clear(KEY_ANGLE);		break;
+		case 0x04c: map_key_clear(KEY_LANGUAGE);	break;
+		case 0x04d: map_key_clear(KEY_SUBTITLE);	break;
+		case 0x051: map_key_clear(KEY_RED);		break;
+		case 0x052: map_key_clear(KEY_CLOSE);		break;
+		default:    goto ignore;
+		}
+		break;
 	
 	case HID_UP_PID:
 		switch (usage->hid & HID_USAGE) {
patch (1,726 bytes)
Alex Timm

Alex Timm

2012-06-20 23:39

reporter   ~0015294

I got it to work. I attached the patch file. I still have no idea why it doesn't work from hid-lg.c, unless because it is not a logitech branded device, hid-lg.c ignores it, or the kernel just sees it as a keyboard/mouse and never talks to hid-lg.c.

Could you give me a heads up if/when this patch takes effect?

Thank you for your time.
toracat

toracat

2012-06-21 00:19

manager   ~0015296

I will try to build a test cplus kernel with your patch using the latest 6.2 kernel. If all is well, that will be added to the cplus 6.3 GA kernel I just started working on.
toracat

toracat

2012-06-21 09:01

manager   ~0015299

Alex,

Not really the latest but the plus kernel 2.6.32-220.17.1 with your patch applied is now available for you to test:

http://people.centos.org/toracat/kernel/6/plus/2.6.32-220.17.1.1.bug5780.el6.centos.plus/

Please note that they are not signed.
Alex Timm

Alex Timm

2012-06-21 16:29

reporter   ~0015302

When I try to install that I get:

[mythtv@mythtv kernel-bugfix]$ sudo rpm -ivh kernel*bug*
Preparing... ########################################### [100%]
    file /usr/include/linux/pci_regs.h from install of kernel-headers-2.6.32-220.17.1.1.bug5780.el6.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.32-220.17.1.el6.centos.plus.x86_64

When I try to remove kernel-headers-2.6.32-220.17.1.el6.centos.plus.x86_64 it want to remove a bunch of other packages.

What do I do?
toracat

toracat

2012-06-21 16:32

manager   ~0015303

Please try running 'yum' instead of 'rpm' (yes, it can install from local files). This will take care of the 'install' versus 'update' issue.
toracat

toracat

2012-06-21 16:38

manager   ~0015304

Either that or you can choose NOT to install kernel-headers.
Alex Timm

Alex Timm

2012-06-21 17:29

reporter   ~0015306

ok, used yum and it updated headers and firmware. Is it ok to leave them installed when booted into kernel-2.6.32-220.17.1.el6.centos.plus.x86_64.

The patch worked, the commands came through nice and clear in IRW under init3. No nvidia kmdl so no desktop.
toracat

toracat

2012-06-21 17:45

manager   ~0015307

Last edited: 2012-06-21 17:46

View 2 revisions

It should be fine to leave them (headers and firmware) there.

With your feedback, I am now including the patch in the upcoming CentOS 6.3 kernel. It will stay in future releases.

I strongly suggest you file a bug report / enhancement request at http://bugzilla.redhat.com so that this gets added upstream. They may or may not take it, but it won't hurt to ask.

Alex Timm

Alex Timm

2012-06-21 18:03

reporter   ~0015308

Already done. They haven't posted anything though.

832718 https://bugzilla.redhat.com/show_bug.cgi?id=832718
toracat

toracat

2012-06-22 18:26

manager   ~0015315

Alex,

I have added your patch to the cplus kernel for CentOS 6.3. You can find a test version here:

http://centos.toracat.org/kernel/centos6/centosplus-testing/6.3/

( kernel-2.6.32-279.el6.centos.plus )

Not official, not signed, as before. But I'd appreciate your feedback if you can test.
Alex Timm

Alex Timm

2012-06-22 20:24

reporter   ~0015316

Looks good, all of the buttons worked in init3 irw.

Any idea when 6.3 is coming out? I noticed 2.6.32-220.23.1 came out today.
toracat

toracat

2012-06-22 20:30

manager   ~0015318

Good to confirm the patch is working in the 6.3 kernel as well.

You can follow the progress of CentOS 6.3 build at :

http://qaweb.dev.centos.org/qa/

Hopefully, release of the cplus kernel will follow shortly after the release of 6.3 (or even at the same time).
Alex Timm

Alex Timm

2012-06-23 18:14

reporter   ~0015328

We should probably change the summary, because hid-lg.c is in the kernel, to something like:
USB HID Device, HOLTEK USB Keyboard does not talk to the hid-lg in-kernel module to get all remote key presses.
toracat

toracat

2012-06-23 19:39

manager   ~0015329

Yes, I was thinking the same. Done.
toracat

toracat

2012-07-09 23:57

manager   ~0015382

CentOS 6.3 was released today. The centosplus kernel was released at the same time. Closing the ticket as 'resolved'.

Issue History

Date Modified Username Field Change
2012-06-16 18:10 Alex Timm New Issue
2012-06-17 16:27 toracat Note Added: 0015277
2012-06-17 16:28 toracat Status new => feedback
2012-06-17 17:31 Alex Timm Note Added: 0015278
2012-06-17 17:31 Alex Timm Status feedback => assigned
2012-06-17 18:00 Alex Timm Note Added: 0015279
2012-06-18 17:24 Alex Timm Note Added: 0015283
2012-06-18 17:42 toracat Note Added: 0015284
2012-06-18 22:19 Alex Timm Note Added: 0015285
2012-06-18 22:55 toracat Note Added: 0015286
2012-06-19 00:34 Alex Timm Note Added: 0015287
2012-06-19 07:36 toracat Note Added: 0015288
2012-06-20 23:26 Alex Timm File Added: patch
2012-06-20 23:39 Alex Timm Note Added: 0015294
2012-06-21 00:19 toracat Note Added: 0015296
2012-06-21 00:20 toracat Category kernel => CentOS-6-Plus
2012-06-21 09:01 toracat Note Added: 0015299
2012-06-21 16:29 Alex Timm Note Added: 0015302
2012-06-21 16:32 toracat Note Added: 0015303
2012-06-21 16:38 toracat Note Added: 0015304
2012-06-21 17:29 Alex Timm Note Added: 0015306
2012-06-21 17:45 toracat Note Added: 0015307
2012-06-21 17:46 toracat Note Edited: 0015307 View Revisions
2012-06-21 18:03 Alex Timm Note Added: 0015308
2012-06-22 18:26 toracat Note Added: 0015315
2012-06-22 20:24 Alex Timm Note Added: 0015316
2012-06-22 20:30 toracat Note Added: 0015318
2012-06-23 18:14 Alex Timm Note Added: 0015328
2012-06-23 19:39 toracat Note Added: 0015329
2012-06-23 19:39 toracat Summary hid-lg.c not in kernel => USB HID Device, HOLTEK USB Keyboard does not talk to the hid-lg in-kernel module to get all remote key presses
2012-07-09 23:57 toracat Note Added: 0015382
2012-07-09 23:57 toracat Status assigned => resolved
2012-07-09 23:57 toracat Resolution open => fixed
2012-07-09 23:57 toracat Fixed in Version => 6.3