-
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. |
I am so glad to see this wheel being worked on. It's the last thing I have been waiting for in order to make the transition to Linux full time. Is it working well yet ? Also fantastic work guys. Reading through the thread makes me realise I really should of taken up the offer to study Computers and do the Systems Analyst Course when I was offered 40 years ago. |
Hello again, I must admit I kind of forgot about this for a while, just got a bit buried under other things on my TODO list. I gave the provided patches a quick lookover, seems mostly fine but I did notice that in one comment the wheel's range is indicated to be 900 degrees, but the I also had a look at the provided USB captures, and I spotted packet number 123, seems very similar to packets that are used by the T300RS to switch modes so I added initial mode switching functionality for testing. Don't have a wheel myself so no real idea if this works or not, and I would appreciate it if somebody could check out the branch and let me know. Please be careful, preferably run this driver in a virtual machine or something as a kernel crash could (theoretically) corrupt hard drives etc. I'm not expecting anything to happen, but best to be safe. Mode switching happens by writing something to the EDIT: Just as an example, |
Well that was quick. Not my field but I am always willing to try, so will make a VM and have a go later. Fingers crossed. (someone will beat me to it) Ha ha Thanks very much for all you are doing. |
Nice, probably it was me as I misremembered the max angle. |
Yep, in
The attached patches include code in |
Cool to see it's still moving out there, had no time lastly to follow but i'll try to find some to test last advances, especially mode switching.
For the mode switch if i understood correctly what it written on Thrustmaster's site it's presence depend on wheel installed, As you can see the option appear on the lower end of the windows. Speaking of buttons and dials attributions Thrustmaster give the mapping on it's website for most common wheels, if one need to correct mapping/attribution for a particular wheel it might be a useful help |
Took time to quick test TS-PC branch last evening. Firstly good news my system haven't been screwed ;-) To be noted during the wheel startup "dmesg" shows a message
and the wheel starts in standard mode On standard mode "dmesg" TS-PC as product name, with B689 ID, but shows TS-XW for force feedback, maybe just a typo somewhere. Once switched to advanced mode the ID logically change to B696 so works well but this time "dmesg" shows T248 for force feedback line In Oversteer the range shows 900 instead of 1080, all buttons and dials works perfectly, with correct assignation and more important independently and that's exactly what i was looking for Maybe i will have time this evening to dig in the source and try to find remaining problems but this is promising, thanks Kimplul |
Glad to hear my guess was correct. Mode switching is primarily intended to be used via Oversteer, there's a 'Compatibility mode' dropdown. At the moment the driver isn't advertising the advanced mode so I believe the dropdown should be empty. That should be added at some point, see
That's 'normal', Thrustmaster wheels have a very agressive initialization that breaks the USB protocol, so the USB packet that causes the initialization can sometimes be returned with an error code. The returned error seems to sometimes vary a bit, see https://github.com/Kimplul/hid-tminit/blob/17d6cad0b508417193ebf4d23f67c845487e9932/tminit.c#L144.
That one's on me, your patches didn't apply cleanly so I went through and applied the chunks semi-manually, I must've missed that one. Pushed a commit fixing it, thanks for pointing it out.
|
Just tested the last commit ingame and it's working fine in advanced mode (not tested in standard mode but there's no reason it won't work fine also) The combined axles thing must be related to Oversteer as it's working fine ingame with all 3 pedals separated, maybe a bug in the custom build i use, have to check that also but it's not my main priority for now In advanced mode it's still showing as 900° wheel, maybe the driver takes the value given for the T300RS alternate mode by default cause it can't find a specific section for the TSPC. As for the duplicate ID between many wheels and bases it's far beyond my skills so i'm afraid i won't be of any help with that. |
Hi, thanks for keeping this moving along. I tried to do some work on this earlier this year and ran into issues with the buttons at the time and it fell off my radar. I tested this latest commit in a series of games tonight and am delighted to say that all of the buttons and axes seemed to work fine. I was able to add the wheel to Oversteer @Potajito 's branch, and control the FFB and other settings. I only have the base rim and the 599XX Evo rim, which don't use the Advanced buttons, so I was not able to test beyond the standard 13 or so buttons. Games tested: Assetto Corsa via Content Manager, Assetto Corsa Competizione, Le Mans Ultimate (game itself crashes on loading into a circuit, but the calibration and settings recognized the wheel fine), and Automobilista 2. I can't recall from Windows, but I generally did have to re-map which axis was the throttle, brake, and clutch - but they remapped fine and I was off to the races, so to speak. Just wanted to give my testing feedback. Thanks for the work on this! 🐎 |
This is great news, thanks to ALL for getting this working. Thanks again guys. If I have any problems I will come here to pick your brains |
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: