Kimplul / hid-tmff2

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

T128P to be added? #67

Closed Nighthawk604 closed 3 weeks ago

Nighthawk604 commented 1 year ago

I've gone through your instructions about capturing packets etc.

I'm willing to work onthisbut I'm not sure how to analyze this.

Kimplul commented 4 months ago

I pushed https://github.com/Kimplul/hid-tminit/commit/70867d3807b4f56b41966b95c7d642e17c691378, pretty sure I just forgot to include linux/module.h. I'm somewhat surprised it compiled on my machine, though you seem to have an older set of kernel headers so maybe some header I do include was changed between our versions and now includes it implicitly? Not sure, but it shouldn't matter that much.

GGTNT commented 4 months ago

Hey, I just retested the driver with your modifications but I still have errors. I don't know if there is something I'm doing wrong but it's not working 😅. I followed the instructions in @doghog125's post

Here is everything I did: https://pastebin.com/K1Bt7tKe

Kimplul commented 4 months ago

Nothing wrong with how you're doing things, apparently there's just some difference between Mint and Debian wrt. include handling, I spun up a Mint VM and I was able to reproduce. I just added the missing #include statements in https://github.com/Kimplul/hid-tminit/commit/17d6cad0b508417193ebf4d23f67c845487e9932.

Just out of interest, I had a look at the include file dependencies and apparently slab.h (which is where kzalloc() and friends are declared) does actually get included in my version of Debian via a pretty sprawly tree of #includes, so I was previously relying on undocumented behaviour on accident. Sorry, oversight on my part. Kind of obvious in hindsight, but should work now.

b0ggyb33 commented 4 months ago

Hi,

Just found this repo and it looks like great work! Something I don't understand is that at the moment when I plug my wheel in using standard kernel drivers, the device is recognised in dmesg/lsusb and the wheel spins. Oversteer doesn't recognise it though. Does this mean I need to use this driver instead of the default one?

Kimplul commented 3 months ago

Hi @b0ggyb33, the in-kernel Thrustmaster drivers just handle basic button inputs and nothing else. For force feedback, range setting, and so on, you will need to use this driver, yes.

b0ggyb33 commented 3 months ago

Thanks for clearing that up!

b0ggyb33 commented 3 months ago

Hi, I've followed the steps here and hit the same issue as @GGTNT . I have 17d6cad checked out, but I get the same behaviour. Using Mint 21.2 btw.

Kimplul commented 3 months ago

I seem to have Mint 21.3 on my VM. Could you post the error message?

b0ggyb33 commented 3 months ago

Maybe I should upgrade then...

Error is the same:

modprobe: FATAL: Module usb-tminit not found in directory /lib/modules/5.15.0-105-generic

Kimplul commented 3 months ago

Oh, right, that's a different error actually. The errors I was fixing were compilation errors due to #include being different, so I assume your modules compiled just fine. When I split the modules, I had to rename them so they're (at least for) now of the form usb-tminit-new and hid-tminit-new.

Technically speaking running modprobe isn't actually necessary, and I must've glossed over it while reading through the previous install instructions. Sorry, my bad.

GGTNT commented 3 months ago

Hey, thanks for your edits and please forgive me for the time without a response. It works on my pc, but I have a few questions. Do you know why force feedback is very weak (or sometimes non-existent) on some games with the same settings as Windows? Also, for some reason that is still unclear, my steering wheel does a bit of anything on native games like ets2 (it turns when I go straight for example); Do you know if it's a problem with the driver or it's a problem with the game?

Kimplul commented 3 months ago

Do you know if it's a problem with the driver or it's a problem with the game?

Can't really say I do. It could very well be the driver, or it could be related to Proton if you're running through that, or even a shoddy port to Linux if you're playing native games. Arguably the best way to figure things like this out would be to have a number of different wheels from different manufacturers and cross-compare, but I'm not aware of any such efforts.

Please feel free to open up issues for each game you experience issues with, maybe we can crowd-source our way to a fix :)

doghog125 commented 3 months ago

Hello again! I'm trying to play Need for Speed Hot Pursuit Remastered with my t128 wheel, and have hit a problem. This game essentially has the untouched wheel code from the game it's remastering, and behaves wrong if you do not have pedals combined. All well and good until I go into Oversteer and... the option's greyed out to combine pedals? Any help would be greatly appreciated! Using the newest versions of the drivers

Kimplul commented 3 months ago

I mentioned this earlier, but let's try to keep this thread just for getting the T128 working. I'm almost ready to close this thread, just have to point this driver to the updated tminit module and then T128 support would be 'official'. Any other issues you encounter with the wheel, please open up new issues. It makes life easier for anyone else having the same issue, and helps me keep track of things :)

Henry-Hiles commented 1 month ago

I mentioned this earlier, but let's try to keep this thread just for getting the T128 working. I'm almost ready to close this thread, just have to point this driver to the updated tminit module and then T128 support would be 'official'. Any other issues you encounter with the wheel, please open up new issues. It makes life easier for anyone else having the same issue, and helps me keep track of things :)

Is this now "officially" working? :)

Kimplul commented 1 month ago

Is this now "officially" working? :)

I guess technically not yet, I still haven't merged the module into main.

Initially I was a bit scared and wanted to wait a bit to see if anyone popped up with issues I missed, and then I promptly forgot about it. Since no issues have been raised in the meantime, I guess things "unofficially" work and I should do the merge sooner rather than later. Thanks for the ping.

Henry-Hiles commented 1 month ago

Is this now "officially" working? :)

I guess technically not yet, I still haven't merged the module into main.

Initially I was a bit scared and wanted to wait a bit to see if anyone popped up with issues I missed, and then I promptly forgot about it. Since no issues have been raised in the meantime, I guess things "unofficially" work and I should do the merge sooner rather than later. Thanks for the ping.

Oh great, thanks! I was thinking of buying this wheel and wanted to make sure it was supported. Just so I dont buy the wrong one, is it just T128P that works? Does the Xbox version not function?

Kimplul commented 1 month ago

Based on the 'subthread' that started with https://github.com/Kimplul/hid-tmff2/issues/67#issuecomment-1891170887

Testing on my t128x [...]

the Xbox versions seems to also work.

Henry-Hiles commented 1 month ago

Based on the 'subthread' that started with #67 (comment)

Testing on my t128x [...]

the Xbox versions seems to also work.

Thank you! One more thing, any idea if this works with Trackmania (from steam)? It would be amazing if anybody could test for me, the first few levels are free and I'd really appreciate it, I dont want to buy it and then not br able to use it ❤️

GGTNT commented 1 month ago

Based on the 'subthread' that started with #67 (comment)

Testing on my t128x [...]

the Xbox versions seems to also work.

Thank you! One more thing, any idea if this works with Trackmania (from steam)? It would be amazing if anybody could test for me, the first few levels are free and I'd really appreciate it, I dont want to buy it and then not br able to use it ❤️

Yes, I can try for you tonight if you want 👍

Henry-Hiles commented 1 month ago

Yes, I can try for you tonight if you want 👍

Thank you so much, I can really appreciate it!

GGTNT commented 1 month ago

Yes, I can try for you tonight if you want 👍

Thank you so much, I can really appreciate it!

Hey, so I tried it and overall it works. I noticed 2 things a bit weird, the force feedback is not very present (like on many games) and also for an unknown reason, it puts question marks on the configuration (but it still recognizes the keys ¯_(ツ)_/¯).

I played a small game that you can watch here. (It's the first time I launch the game so I suck lol) settings image

Henry-Hiles commented 1 month ago

Yes, I can try for you tonight if you want 👍

Thank you so much, I can really appreciate it!

Hey, so I tried it and overall it works. I noticed 2 things a bit weird, the force feedback is not very present (like on many games) and also for an unknown reason, it puts question marks on the configuration (but it still recognizes the keys ¯(ツ)/¯).

I played a small game that you can watch here. (It's the first time I launch the game so I suck lol) settings image

Amazing, thank you so much! I wasn't even aware trackmania supported force feedback at all. I do appreciate it, tysm!!!

Henry-Hiles commented 3 weeks ago

So I wanted to try this out on nix (I bought the wheel for this), and I can override the source of hid-tmff2, which is currently:

  src = fetchFromGitHub {
    owner = "Kimplul";
    repo = "hid-tmff2";
    rev = "ca168637fbfb085ebc9ade0c47fa0653dac5d25b";
    hash = "sha256-Nm5m5xjwJGy+ia4nTkvPZynIxUj6MVGGbSNmIcIpziM=";
    fetchSubmodules = true;
  };

And I wasn't quite sure how to do it. Is there a fork of this which I use?

Henry-Hiles commented 3 weeks ago

Am I good to use https://github.com/Kimplul/hid-tmff2/commit/0c7a48d8b3c4e487370c1e1d90eae3cc9feab1b7?

Henry-Hiles commented 3 weeks ago

That looks rather outdated to me actually, unless I'm wrong.

Henry-Hiles commented 3 weeks ago

EDIT: Now only this is needed (until pkg is updated):

    boot.extraModulePackages = [
    (pkgs.linuxKernel.packages.linux_zen.hid-tmff2.overrideAttrs
      (prev: {
        src = pkgs.fetchFromGitHub {
          owner = "Kimplul";
          repo = "hid-tmff2";
          rev = "cc4226299569b5a1402c0b937c6b3a2e0f246af4";
          hash = "sha256-Hv6eLbf5K9qGhweKHHf7IpZaCFsLMCvC0vxBapQOSpQ=";
          fetchSubmodules = true;
        };
      }))
  ];
Kimplul commented 3 weeks ago

Alright, I merged the t128 branch. I would appreciate it if someone still went ahead and made sure that everything still works in the master branch, though I don't expect any breakage. Remember to run git submodule update --init --recursive and all that to get the changes to hid-tminit as well.

Henry-Hiles commented 3 weeks ago

Why not push the submodule update to master too? Otherwise it won't work by default, unless I misunderstand

Kimplul commented 3 weeks ago

Why not push the submodule update to master too? Otherwise it won't work by default, unless I misunderstand

Sorry, I don't entirely understand this question. The submodule deps/hid-tminit points to the usb branch in https://github.com/Kimplul/hid-tminit/tree/usb, and if you're reusing a repository you cloned some time ago you'll have to update the submodules as well, that's just how git works as far as I understand it.

A clean clone should automatically pull in the correct submodule. I tried it out locally and seemed to work.

Henry-Hiles commented 3 weeks ago

Why not push the submodule update to master too? Otherwise it won't work by default, unless I misunderstand

Sorry, I don't entirely understand this question. The submodule deps/hid-tminit points to the usb branch in https://github.com/Kimplul/hid-tminit/tree/usb, and if you you're reusing a repository you cloned some time ago you'll have to update the submodules as well, that's just how git works as far as I understand it.

A clean clone should automatically pull in the correct submodule. I tried it out locally and seemed to work.

Oh perfect, I thought you were saying you merged that branch without updating the submodule. Ill check the main branch rn!

Henry-Hiles commented 3 weeks ago

Installed fine, rebooting to test...

Henry-Hiles commented 3 weeks ago

It works perfectly!!

Kimplul commented 3 weeks ago

Great! Thanks for checking.

I'll be closing this issue then. As always, please feel free to open up new issues for any problems you encounter.