Kimplul / hid-tmff2

Linux kernel module for Thrustmaster T300RS, T248 and (experimental) TX, T128 and TS-XW wheels
GNU General Public License v3.0
203 stars 20 forks source link

No FFB for me #5

Closed spocthier83 closed 3 years ago

spocthier83 commented 4 years ago

Hello! I was about to sell my T300RS when I found this project.

I have successfully built and installed both modules in my Linux Mint 20. But, unfortunately, I have no FFB in any game (Assetto Corsa Competizione, Wrekfest, ...).

In other hand, Oversteer software finds successfully the plugged T300RS with theses modules.

What are the requirements to make FFB work?

$ uname -a
Linux spocthier-PC 5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

And the last firmware is installed (v31).

I don't know what to say more to help for debugging.

Thx for this!

Kimplul commented 4 years ago

Heyo, I'm guessing you've unplugged and plugged the wheel back in and possibly restarted your computer?

The wheel's FFB for some godawful reason initializes itself when a certain USBHID request is sent out. On Linux, this request isn't necessarily always sent out because of some driver/device data caching, I believe, so a reboot is usually needed. Windows seems to work somewhat differently, so I guess Thrustmaster didn't think of making the wheel initialize in a sane way.

spocthier83 commented 4 years ago

Indeed, I have rebooted my computer many times since installation. I followed the instructions of course.

In addition, I had to generate certificates (private and public keys) to sign modules in kernel and find the file System.map beforehand to install modules.

Is there a little tool to test FFB directly (i.e. without game)?

Kimplul commented 4 years ago

Yeah, fftest, should be in the the package joystick. You use it with the command fftest /dev/input/by-id/usb-Thrustmaster_Thrustmaster_T300RS_Racing_wheel-event-joystick.

Effects 0-3 are currently supported, the last two I haven't really figured out yet. EDIT: Yes I have. I forgot that the last two effects don't have a direction associated with them, and the Windows driver sets the strength of such forces to zero, so I do too. Maybe I should change it, don't quite frankly know.

Right, sort of interesting, I have the newest firmware and I recompiled the module from GitHub. Works on my machine™.

Anycase, could you paste the output in dmesg you get when plugging the wheel in? Also, please include the output of cat /sys/kernel/debug/hid/0003\:044F\:B66E.0005/rdesc You'll probably need superuser privileges.

In addition to that, could you explain in detail what the steps you took to compile the kernel were?

For Ubuntu, which you seem to be running, the whole process for me was

spocthier83 commented 4 years ago

Thx for your help.

1) Unfortunately, nothing happens (no FFB) using fftest :

$ fftest /dev/input/by-id/usb-Thrustmaster_Thrustmaster_T300RS_Racing_wheel-event-joystick 
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/by-id/usb-Thrustmaster_Thrustmaster_T300RS_Racing_wheel-event-joystick opened
Features:
  * Absolute axes: X, Y, Z, RZ, Hat 0 X, Hat 0 Y, 
    [27 00 03 00 00 00 00 00 ]
  * Relative axes: 
    [00 00 ]
  * Force feedback effects types: Constant, Periodic, Ramp, Spring, Friction, Damper, Rumble, Inertia, Gain, Autocenter, 
    Force feedback periodic effects: Square, Triangle, Sine, Saw up, Saw down, 
    [00 00 00 00 00 00 00 00 00 00 FF 1F 03 00 00 00 ]
  * Number of simultaneous effects: 16

Setting master gain to 75% ... OK
Uploading effect #0 (Periodic sinusoidal) ... OK (id 0)
Uploading effect #1 (Constant) ... OK (id 1)
Uploading effect #2 (Spring) ... OK (id 2)
Uploading effect #3 (Damper) ... OK (id 3)
Uploading effect #4 (Strong rumble, with heavy motor) ... OK (id 4)
Uploading effect #5 (Weak rumble, with light motor) ... OK (id 5)
Enter effect number, -1 to exit
0
Now Playing: Sine vibration
Enter effect number, -1 to exit
1
Now Playing: Constant Force
Enter effect number, -1 to exit
3
Now Playing: Damping Condition
Enter effect number, -1 to exit

2) The output of /sys/kernel/debug/hid/0003:044F:B66E.000A/rdesc is : 0003:044F:B66E.000A_rdesc.log Note that the file name you describe is not exactly the same as mine.

3) Endly, how I have to built and install your software :

Thx a lot for your help!

Kimplul commented 4 years ago

Are you using SELinux or something similar? You shouldn't have to generate certs or anything like that to insert a kernel module. That being said, certs shouldn't affect the behaviour of the module in any way, so it might be a red herring.

Thanks for the rdesc, yeah, sorry, the path can be a bit different, I should've mentioned that. Could you still show the output of dmesg when you insert the wheel?

Also, just to be on the safe side, you do have your wheel set to ps3?

berarma commented 4 years ago

$ sudo openssl req -verify -new -nodes -utf8 -sha512 -days 36500 -batch -x509 -config ~/x509.genkey -outform PEM -out /usr/src/linux-headers-5.4.0-47-generic/certs/signing_key.x509 -keyout /usr/src/linux-headers-5.4.0-47-generic/certs/signing_key.pem $ sudo cp /boot/System.map-5.4.0-47-generic /usr/src/linux-headers-5.4.0-47-generic/System.map

These steps shouldn't be required. You may see a warning about the module not being signed but that's not an issue as far as I know. That message can be ignored.

The complete output of the commands you run could help on the diagnosing. Running script mycommands will write all your following console output to a file named mycommands until you type exit. Attaching this file would provide us with all that is happening in the process of building and installing the module.

The dmesg output after the module is loaded and the device connected has useful information too.

spocthier83 commented 4 years ago

I use Linux Mint 20 "out of box", I don't know if it is a SELinux. Maybe yes. But I agree with you signing module or not shouldn't be the problem. But I was thinking it was necessary at this moment because it doesn't work. In the other hand, I have now no warning at installation. It's a good thing.

Here are my commands and the output : commands.log There is nothing crazy.

And dmesg output with T300RS plugged : dmesg.log

Hope it will help.

And yes, it is on PS3 side.

Kimplul commented 4 years ago

Very strange. I just downloaded Mint to test it out and everything works just fine ootb. I did get the same warnings that you also got, but they were just warnings, and I could load the driver just fine. In addition, there's nothing weird or abnormal with the logs you've provided, at least as far as I can see.

I'm just going to fire off some suggestions that may or may not have anything to do with the issue.

spocthier83 commented 4 years ago

The wheel works well under Windows. The forces tests are very good. T300RS Control Panel

As you recommend, I have tried other USB plug too without improvement.

Maybe a difference : I don't plug any pedals to the wheel directly because I use an external controller for my old G25 pedals and shifter (which is not actually connected during my tests).

My T300RS is the only thing I miss from my former Windows life.

Kimplul commented 4 years ago

The wheel should work with or without pedals just fine, at least it has for me.

Has everything else worked like it should? Can you set the wheel's rotation, the wheel is frictionless when opened in oversteer, but autocentering comes on when you close oversteer?

Kimplul commented 4 years ago

Quick update, I bought Wreckfest to test out and that game does actually somehow manage to nullify the FFB, even in other games. I'll try to figure this out as soon as possible. I don't know if this is the whole issue or even related, but on the surface it seems like it.

EDIT: Maybe a false alarm, after a quick reboot I can't for the life of me recreate it. It might be that this is a really specific bug, in which case it might be really difficult to track down.

EDIT 2: So far I've encountered some strange behaviour, but maybe the weirdest was that F1 2018 wouldn't work reliably. I found out that I could sometimes fix this by going into settings and choosing my wheel as the preferred input, even though it already was. I added a pcapng of the traffic, packet 8751 is when I entered the options menu and packet 9378 is when I exited the menu, and when the wheel started functioning again. I'll have to try to figure out what exactly happened between those packets. This seems to also have caused the weirdness in Wreckfest, as it would work just fine when I hadn't run F1 2018 beforehand. https://github.com/Kimplul/hid-tmff2/blob/pcaps/random_silence.pcapng

If anyone figures something out, please let me know.

Kimplul commented 4 years ago

Okay, I pushed a fix for F1 2018 to the branch ramp, here https://github.com/Kimplul/hid-tmff2/tree/ramp

Now F1 works like it should as does Wreckfest, at least on my machine. I still have no clue if this is even related to your original issue, but what the hey, a bugfix is better than nothing. Give the branch a try and I'll keep my fingers crossed.

spocthier83 commented 4 years ago

Has everything else worked like it should? Can you set the wheel's rotation, the wheel is frictionless when opened in oversteer, but autocentering comes on when you close oversteer?

To reply to this, when I first plug the wheel (after a fresh boot) :

If I plug and (re)boot computer the wheel :

And the wheel works like a charm under Windows.

I have built/reinstalled both modules without signing them, but it is exactly the same situation. You are right : signing module or not doesn't change anything.

I really want to thank you for your support.

Kimplul commented 4 years ago

Right, thanks for your patience. When the wheel goes "hard", it usually means that the wheel has crashed. It happened to me a couple of times when I was testing my wheel in games, but never when plugging it in, so I'm unfamiliar with this issue.

You could always try https://github.com/scarburato/hid-tminit, which is supposed to be a more generic Thrustmaster initialization module that @scarburato wrote a little while back. It just replaces the init that I wrote for this module. It's installed the same way this module is, just write make and sudo make install. If the wheel crashes during initialization, it could be an issue with my init, and this more generic init might make the wheel initialize like it should. A shot in the dark, but I'm sort of at my wits' end here.

As I've probably mentioned several times, everything works just fine on my end, and I can't for the life of me replicate your issues, so I have no real idea what the issue could be. Without your setup and possibly your wheel, debugging becomes incredibly hard and tedious, if not impossible.

spocthier83 commented 4 years ago

Hello,

I give up for now. I have no much time to spent to go deeper. Maybe some feedback from others users may help later.

I thank you for your help and to work on such a kind of project.

Kimplul commented 4 years ago

I understand. Thank you for your patience.

Kimplul commented 3 years ago

Hey, do you still have your wheel? We fixed an issue that migth've been messing up your wheel too.

spocthier83 commented 3 years ago

Guy, you rock! It works like a charm! It's awesome to feel my T300RS again.

Now, i can sell my G29 little toy.

Kimplul commented 3 years ago

Glad it works. Obviously thanks to @dafteran4, @berarma and @scarburato as well.