-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thrustmaster TS-PC (TS Racer) support #65
Comments
Supported, probably yes, but how much work that would take is hard to say. Unfortunately thrustmaster wheels Did you already read https://github.com/Kimplul/hid-tmff2/wiki#how-to-add-in-support-for-a-new-t-series-wheel? |
I am going to try and get the USB traces for this... just struggling to find some free time to do it! |
I also have a TS-PC would love to give a hand. |
@Potajito thanks for showing interest. As far as I'm aware, no USB packet captures have been made, so the general outline in #65 (comment) still applies. Please read through https://github.com/Kimplul/hid-tmff2/wiki#how-to-add-in-support-for-a-new-t-series-wheel and if you feel up for, try doing some captured and seeing if you can find some patterns in the data. |
Could do with some guidance when capturing. It just seems to be a stream of URB_INTERRUPT and URB_CONTROL packets. It did come back with some data on unplug/replug but not sure which bits would be the initialization value. DEVICE DESCRIPTOR https://drive.google.com/file/d/13odXGOEfqU_Wfi7NfChZVsW5YsEGFQTp/view?usp=share_link Not sure where I'd start trying to work out any sort of values for force feedback values. I think I need to find a tutorial for FEdit1... |
Sure, thanks for the capture. Just to start off with, the initial wheel state is with In this case, it seems to be packet number 151, and from this we can see that the Then we need to find another packet with the wheel's IDs. The wheel sends a packet to the computer, which should contain a number of bytes, two of which we're mainly interested in: one for the base model and one for the steering wheel attachment. These correspond to Anycase, looking at the data in packet 68, we see that the response data is
With my T300, for some reason I also had to send out a number of other packets, see but other wheels don't seem to require this so I would expect that the TS-PC doesn't either.
If you find one, let me know, not aware of any. Probably the biggest individual hurdle is the fact that you have to set the direction of the effect, the default of 'straight up' effectively translates to multiplying the force's magnitude by 0, i.e. makes the effect impossible to detect. Try dragging the direction pointer all the way to the right for example, and then go from there. Maybe go for studying just one effect at a time, i.e. press the effect button and drag it to the timeline. Note that the location on the timeline effectively adds a delay, i.e. to immediately feel an effect drag it as far left as possible. Other than that, I guess it's worth keeping in mind that wheels typically have a couple different kinds of packets, ones that upload effects to the device and ones that modify already uploaded effects. Took me a while to figure that one out, but essentially when close the effect modification window, you should see the effect get uploaded with all possible configuration values initialized. After that, if you open up the modification window again and tweak one parameter, you should see a number of packets that each modify only the parameter you've just tweaked. If the packets you capture look like ones in https://github.com/Kimplul/hid-tmff2/blob/master/docs/FFBEFFECTS.md, then it should be fairly straightforward to just add the wheel's USB product ID to the list of supported devices for this driver. Otherwise, you'll have to try and reverse engineer the packets yourself. I encourage playing around with FEdit, it's ultimately not a particularly complicated program, as it more or less one-to-one maps parameters in the GUI to parameters that get sent to the wheel. The interface is just a bit daunting. Feel free to ask questions, I'll try to help as best as I can. |
Hi I have recently switched to Fedora from Windows and have been trying to get my TS-PC RACER to work on Linux. I started playing with FEdit and wireshark on a spare laptop with the wheel connected. At this point I made the quick assumption that the rest of the FFB effects would be the same.
This resulted in the following output
I think something went wrong at the SIGN step, so I'm not sure if the build succeeded or not...
It seems like the kernel module is loaded. When I start Assetto Corsa (via proton-ge) my wheel is not recognised. How should I proceed? I will test some more of the FFB effects in the mean time and compare them to the FFBEFFECTS doc. |
Signing the module is an optional step that has to be done by whoever builds the module. The error messages are pretty scary but generally don't stop the module from functioning. There's a separate kernel configuration parameter that can disable loading unsigned modules, but it tends to not be enabled on major distros. There's a short note about it in the README.
The naming is a bit messy here, Anycase, once the wheel is told which model it is, it restarts itself and reconnects under a new USB id, which you will have to add to Line 721 in 9f79c8e
and Line 618 in 9f79c8e
It's possible that the TS-PC differs in some subtle ways from other wheels supported (different wheel range, init commands, rdesc, whatever), so you might have to add a new subdir in Check out |
The changes I have made to hid-tminit ~/hid-tmff2/deps/hid-tminit$ git diff
diff --git a/hid-tminit.c b/hid-tminit.c
index 266086e..05e35c3 100644
--- a/hid-tminit.c
+++ b/hid-tminit.c
@@ -70,11 +70,12 @@ static const struct tm_wheel_info tm_wheels_infos[] = {
...
{0x02, 0x04, 0x0005, "Thrustmaster T300 Ferrari Alcantara Edition"},
{0x02, 0x06, 0x0005, "Thrustmaster T300RS"},
{0x02, 0x09, 0x0005, "Thrustmaster T300RS (Open Wheel Attachment)"},
- {0x03, 0x06, 0x0006, "Thrustmaster T150RS"}
+ {0x03, 0x06, 0x0006, "Thrustmaster T150RS"},
+ {0x06, 0x09, 0x0009, "Thrustmaster TS-PC"},
//{0x04, 0x07, 0x0001, "Thrustmaster TMX"}
};
-static const uint8_t tm_wheels_infos_length = 7;
+static const uint8_t tm_wheels_infos_length = 8; The changes I have made to hid-tmff2 ~/hid-tmff2$ git diff
--- a/src/hid-tmff2.c
+++ b/src/hid-tmff2.c
@@ -616,6 +616,7 @@ static int tmff2_probe(struct hid_device *hdev, const struct hid_device_id *id)
hid_set_drvdata(tmff2->hdev, tmff2);
switch (tmff2->hdev->product) {
+ case TMTS_PC_RACER_ID:
case TMT300RS_PS3_NORM_ID:
case TMT300RS_PS3_ADV_ID:
case TMT300RS_PS4_NORM_ID:
@@ -727,7 +728,8 @@ static const struct hid_device_id tmff2_devices[] = {
{HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, TMT248_PC_ID)},
/* tx */
{HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, TX_ACTIVE)},
-
+ /* TS-PC RACER */
+ {HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, TMTS_PC_RACER_ID)},
{}
};
MODULE_DEVICE_TABLE(hid, tmff2_devices);
diff --git a/src/hid-tmff2.h b/src/hid-tmff2.h
index 1eb3546..822a598 100644
--- a/src/hid-tmff2.h
+++ b/src/hid-tmff2.h
@@ -111,6 +111,8 @@ int tx_populate_api(struct tmff2_device_entry *tmff2);
#define TX_ACTIVE 0xb669
+#define TMTS_PC_RACER_ID 0xb689
+ After
Seems like the wheel connects as id I'm not even sure where I have confirmed in my USB captures that on the Windows driver it uses the above IDs ( |
Oh right, you'll have to blacklist the in-kernel module:
There's some weird name clash that happens otherwise, meaning the changes you've made haven't actually been run yet.
Here: https://elixir.bootlin.com/linux/latest/source/drivers/hid/hid-thrustmaster.c#L240 Essentially, the wheel sends a response to a init driver query, and the 'actual' wheel ID is in that response. You'd think the USB id was the main ID but nah, that would be too easy. Anyway, you've already added it to the driver as |
We are making progress! It is now complaining about the firmware version being too old. But I have the newest TS PC firmware... I assume this is where I make a subdir for the TS-PC racer, as you mentioned before (start with a copy of the T300RS?)
|
Excellent!
Yep, looks appropriate. Try maybe copying The T248 also doesn't currently have a firmware version check, so less changes to be made. |
I now have the wheel showing up on https://hardwaretester.com/gamepad So we're going in the right direction here, but I'm not sure on how to proceed... 😬 |
Right, here are a couple things to try, off the top of my head
If they don't, the packet format changes slightly depending on some values in the hid-tmff2/src/tmt248/hid-tmt248.c Line 115 in 9f79c8e
hid-tmff2/src/tmt248/hid-tmt248.c Line 113 in 9f79c8e
hid-tmff2/src/tmt248/hid-tmt248.c Line 9 in 9f79c8e
The T300 didn't need them, so this might be something that changes from wheel to wheel. Maybe try checking if you can see anything similar in your Windows captures.
hid-tmff2/src/tmt300rs/hid-tmt300rs.c Line 1421 in 9f79c8e
The T248 needs an extra packet here as well that the T300 didn't need, so the TS-PC might also differ in this regard. Check if you can see any extra packets being sent in Windows when you open a program that connects to the wheel. Good luck, you've just stumbled on the tedious part of reverse engineering :) |
I gave up basically at the same point that @svenliekens did, but, shouldn't this #94 bring also compat to ts-pc, as ts-xw is basically the same wheel base? 🤔 |
@Potajito certainly possible, but you'd have to try it out for yourself. I don't really know what the differences between the TS-PC and TS-XW are, the bases definitely look similar but that hasn't always been a reliable indicator of compatibility. They don't seem to share the same USB PID at least, but you could start out by doing something like
|
Based on the work in Kimplul/hid-tmff2#65
Based on the work of svenliekens in this comment: Kimplul#65 (comment)
Based on the work of svenliekens in this comment: Kimplul#65 (comment)
Based on the work of svenliekens in this comment: Kimplul#65 (comment)
Hello, first of all thank you very much for this project, if we had to wait for Thrustmaster do do anything for us ... well So this is a very good start but there's still some issues to fix :
The problem is my programming skills are limited to following tutos, and using existing files as templates to guess changes to do, so i will need help/direction to follow to investigate more. The only thing i can think of for now is i added a directory for the tspc in /src but i have copied the T248 one as a base, maybe it would have been smarter to start from tsxw as it's almost the same wheel than the tspc edit : just added support for TS_PC to Oversteer and it shows me a perfect steering axis without any unwanted deadzone so this one must be game related |
@BDave95 Certainly sounds like some good process, well done!
It might also be possible that ETS2 uses
Sounds like you might want to capture the device's I don't know if the TS-PC supports attachments, but if it does, make sure it's installed properly. Apparently at least the T300 can sort of half-function with a poor connection: #89 |
Deadzone problem solved in all Steam games i've tested by creating a udev rule, thanks for the link, shame on me as it was mentioned on the front page
For the buttons problem can't be an attachment problem as it works perfectly in Windows Anyway for now the wheel is already usable in acceptable conditions and this is more than i hoped just a week ago so thank you again for starting this project and of course to all previous contributors to this thread. |
Hi! Could you share what you did to get FFB working? Maybe point to a fork of this repo? |
The correct USB ID for the TS-PC is Of course i will share my files, the goal is not to keep it for me but contributing to the driver for anyone, i'll see this weekend to make the diffs and publish them |
Thanks! I finally made it work, here is what I did, in case it can help someone else:
|
Good that you made it working too.
I tried to capture packets from connecting the wheel to it's final initialization with Wireshark to figure how to initialize the wheel in advanced mod but to be honest i don't really understand anything in all this |
Here are my diffs for all files i modified
This one is just a draft and need will need further modifis
|
@n1njak3bab Nothing's been merged into the repository yet, I'm planning on taking a look at this over the weekend. Please do feel free to try and get things running on your end, always good to have more eyes. |
Any chance this wheelbase could be supported?
Should be similar to some of the other bases.
Currently just getting:
[ 308.587876] usb 3-2.3: new full-speed USB device number 10 using xhci_hcd
[ 308.714187] usb 3-2.3: New USB device found, idVendor=044f, idProduct=b65d, bcdDevice= 7.00
[ 308.714189] usb 3-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 308.714191] usb 3-2.3: Product: Thrustmaster FFB Wheel
[ 308.714192] usb 3-2.3: Manufacturer: Thrustmaster
[ 308.814269] input: Thrustmaster Thrustmaster FFB Wheel as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:07:00.3/usb3/3-2/3-2.3/3-2.3:1.0/0003:044F:B65D.0013/input/input30
[ 308.814347] hid-tminit 0003:044F:B65D.0013: input,hidraw17: USB HID v1.00 Gamepad [Thrustmaster Thrustmaster FFB Wheel] on usb-0000:07:00.3-2.3/input0
[ 308.834183] hid-tminit 0003:044F:B65D.0013: Unknown wheel's model id 0x6, unable to proceed further with wheel init
The text was updated successfully, but these errors were encountered: