Claudio-Sjo / HID_linux_xbmc_driver

GNU General Public License v3.0
4 stars 3 forks source link

learning fails: Cannot Open device with code -1 #2

Open KampfCaspar opened 9 years ago

KampfCaspar commented 9 years ago

As of 4e60834a, if I try to learn (as root), hid_mapper fails starting with the mentioned error... I even killed all X to ensure there is no weird 'bindings'.

Claudio-Sjo commented 9 years ago

Have you tried to list devices before? Can you find your HID device in the list?

KampfCaspar commented 9 years ago

I connected a Mele F10-Pro. The device is listed (03e7:0d01):

# ./hid_mapper --list-devices
Looking for Manufacturer : (null)
Looking for Product : (null)
Found HID device at /dev/hidraw0
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw1
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw2
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw3
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw4
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw5

but cannot be opened:

# ./hid_mapper --learn --lookup-id --manufacturer '03e7' --product '0d01'
Looking for Manufacturer : 03e7
Looking for Product : 0d01
Found HID device at /dev/hidraw0
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw1
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw2
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw3
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device at /dev/hidraw4
--- Vendor = 058F312D81A Modiotek USB Headset
--- manufacturer = 03e7, device = 0d01
Found HID device
Opened HID interface on /dev/hidraw0
Opened HID interface on /dev/hidraw1
Opened HID interface on /dev/hidraw2
Opened HID interface on /dev/hidraw3
Cannot Open device  with code -1
Unable to open HID device

Is there some sort of verbose mode to get more details about the error?

Claudio-Sjo commented 9 years ago

Hi, I see the problem. Your device has nothing to do with an HID device, it's a complex set of devices sharing the same Device Identifier. The driver is intented for Infrared Receiver that appear to be HID (keyboard + mouse extender) rather than IR. Your device shows itself as an Headset, and appears as 5 devices, including a microphone. If I had such device, I could probably modify the driver in order to recognize which of those 5 is an HID, and make it work, but since I haven't, you either fix the driver yourself (I can help a little, if you wish), or look for another driver.

Sorry.

slumpz commented 9 years ago

Basically the tool can't open hidraw4 device, so we can skip it.

Patch hid.c, add this:

if (strcmp(entry->d_name,"hidraw4")==0) {
   continue;
}

After // New patch in function lookup_hid_product.

Claudio-Sjo commented 9 years ago

Rather than implementing such ugly hack, if you have the chance to test the driver with that HW, I'd suggest to chmod 777 /dev/hidraw3 first and see what happens.