igorinov / linux-winwing

Linux kernel module for Winwing throttle
GNU General Public License v2.0
6 stars 0 forks source link

Request: Orion 2 F15E Grip #2

Open tsoulard opened 4 weeks ago

tsoulard commented 4 weeks ago

I see in #1 that the module doesn't support the F15EX grip however i'm wondering if it supports or could be made to support the F15E as i'm currently looking at buying the orion 2 with the grip. Looking at the specs it has 28 buttons https://uk.winwingsim.com/view/goods-details.html?id=476 excluding any axis.

The only concern with that is if you include the rotary buttons and don't instead map them as a virtual axis you'll jump over?

Thanks!

igorinov commented 3 weeks ago

If we map only the buttons that don't read as axes, they will fit:

    28 → 25
    29 → 26
    32 → 27
    33 → 28
    34 → 29
    35 → 32
    50 → 12
    51 → 13
    52 → 14
    53 → 15
    54 → 16
    55 → 17
    56 → 18
    57 → 19
    58 → 20
    59 → 21
tsoulard commented 3 weeks ago

That makes sense in terms of mapping the buttons that aren't readable as axis, looking at it that way these are the buttons/switch numbers we'd want to include? Looks like the numbers you've listed are just the hat switches?

Taken from page 7 of this winwing manual

/* Right grip */
3
4
5
6
7
8
9
10
11
22
23
24
28
29
32
33
34
35
/* Left grip*/
50
51
52
53
54
55
56
57
58
59

assuming those numbers are correct what would be needed to get that working? as i suspect it's more than just adding the HID device ID?

igorinov commented 3 weeks ago

I only included button numbers that need to be remapped. Just pushed a commit that adds remapping support. If you buy Orion2 with the 15E grip, please let me know the USB vendor/device ID.

tsoulard commented 3 weeks ago

That's amazing thank you! I'll let you know if and when i order it and update here with the device ID once it arrives. Will the module be installable if the module is already included in my kernel version?

igorinov commented 3 weeks ago

Linux kernel 6.10 already includes an earlier version of this module. Building and installing this project would replace existing kernel module, unless the module name is changed in make files.

tsoulard commented 2 weeks ago

All ordered, will update this comment with device IDs and will test locally as well once it arrives.

tsoulard commented 2 weeks ago

So it arrived today here's an output of lsusb

Bus 001 Device 003: ID 4098:bd65 Winwing WINWING Orion Throttle Base II + F15EX HANDLE L + F15 HANDLE R

I did then try to modify the code and add the correct line and install the module which has seemingly worked but i believe the make file needs to be made aware of the existing hid-winwing module from the mainline kernel.

What I've done

hid-winwing.c

static const struct hid_device_id winwing_devices[] = {
    { HID_USB_DEVICE(0x4098, 0xbe62) },  /* TGRIP-18 */
    { HID_USB_DEVICE(0x4098, 0xbe68) },  /* TGRIP-16EX */
    { HID_USB_DEVICE(0x4098, 0xbd65), .driver_data = WW_F15E },
    {}
};

Then ran

$ make
$ make install

Same issue after running the commands manually so i checked the hid folder and can see that there are now two hid-winwing files

-rw-r--r--. 1 root root 500912 Sep  3 13:25 hid-winwing.ko
-rw-r--r--. 1 root root   4080 Aug 19 01:00 hid-winwing.ko.xz

The only way i could get it to work was by renaming the hid-winwing.ko.xz file and then restarting i can only assume this is because the .xz file takes priority.

and finally a hex dump of the report descriptor just in case it's needed

hexdump -C /sys/bus/hid/devices/0003:4098:BD65.001A/report_descriptor
00000000  05 01 09 04 a1 01 85 01  05 09 19 01 29 80 15 00  |............)...|
00000010  25 01 35 00 45 01 75 01  95 80 81 02 05 01 09 30  |%.5.E.u........0|
00000020  15 00 27 ff 0f 00 00 35  00 47 ff 0f 00 00 75 10  |..'....5.G....u.|
00000030  95 01 81 02 05 01 09 31  15 00 27 ff 0f 00 00 35  |.......1..'....5|
00000040  00 47 ff 0f 00 00 75 10  95 01 81 02 05 01 09 32  |.G....u........2|
00000050  15 00 27 ff 0f 00 00 35  00 47 ff 0f 00 00 75 10  |..'....5.G....u.|
00000060  95 01 81 02 05 01 09 33  15 00 27 ff ff 00 00 35  |.......3..'....5|
00000070  00 47 ff ff 00 00 75 10  95 01 81 02 05 01 09 34  |.G....u........4|
00000080  15 00 27 ff ff 00 00 35  00 47 ff ff 00 00 75 10  |..'....5.G....u.|
00000090  95 01 81 02 05 01 09 35  15 00 27 ff 0f 00 00 35  |.......5..'....5|
000000a0  00 47 ff 0f 00 00 75 10  95 01 81 02 05 01 09 36  |.G....u........6|
000000b0  15 00 27 ff ff 00 00 35  00 47 ff ff 00 00 75 10  |..'....5.G....u.|
000000c0  95 01 81 02 05 01 09 37  15 00 27 ff ff 00 00 35  |.......7..'....5|
000000d0  00 47 ff ff 00 00 75 10  95 01 81 02 85 02 06 ff  |.G....u.........|
000000e0  00 09 01 15 00 26 ff 00  35 00 46 ff 00 75 08 95  |.....&..5.F..u..|
000000f0  0d 81 02 09 02 91 02 c0                           |........|
000000f8
igorinov commented 2 weeks ago

Thank you for posting. The report descriptor looks different from TGRIP-18 and TGRIP-16EX, it shows 128 buttons instead of 111.

tsoulard commented 2 weeks ago

That's odd could there be a firmware difference causing it? I know the base is up to date but the grips aren't.

igorinov commented 2 weeks ago

Not sure why that happens, but I have added a fix for that.

tsoulard commented 2 weeks ago

Just a heads up, i tested the latest commits it seems like it doesn't work with changes from the report descriptor fix

I'm not entirely sure why but i can say the module wasn't being loaded correctly at startup and sudo modprobe hid-winwing wouldn't work either the only way i could get this version to work was to do sudo insmod hid-winwing.ko from the repo directory. which obviously did not persist after a restart.

igorinov commented 1 week ago

Does it work if the module name is different?

tsoulard commented 1 week ago

I haven't tested with a different module name, but I don't have any duplicate modules in the modules folder as I renamed the included hid-winwing module as it was causing problems originally. I can test with a different name if you like or any combinations should that be helpful!

But the old version from this repo is working just fine to be clear.