PC [guide] How To Use Raildriver On Linux

Discussion in 'TSW General Discussion' started by KonTux, Mar 15, 2025.

  1. KonTux

    KonTux New Member

    Joined:
    Feb 12, 2023
    Messages:
    2
    Likes Received:
    1
    Hi there,

    I finally got Train Sim World to detect my RailDriver(-clone) while running the game on Linux through Proton so I thought I would share it.

    The RailDriver isn't just any game controller which Proton would easily support but it is a generic USB HID device which can be accessed using a special library provided by PIE (the RailDriver's manufacturer). This is the reason why the game won't find the device out of the box.

    1. HIDRAW Permissions
    First, we must make sure that we, as a user, have the permission to access the RailDriver through the HIDRAW interface which is usually not the case by default. To do this, go to /etc/udev/rules.d to create a new file and call it something like 90-raildriver.rules. Then open it as root and put

    Code:
    # Maybe useful for linux USB stuff
    SUBSYSTEM=="usb", ATTRS{idVendor}=="05f3", MODE="0666"
    KERNEL=="hidraw*", ATTRS{idVendor}=="05f3", MODE="0666", TAG+="uaccess"
    
    in it.

    To apply these rules, plug in the RailDriver again (reboot should not be necessary afaik).

    Before continuing, I would recommend you to test whether Wine processes can now find the device. To do this, go to https://github.com/piengineering/PI-Engineering-SDK/tree/main/XBM-24 Module/C++ x64/Release and download both the executable and the DLL and put them into the same directory. Then execute the executable using Wine and click "Enumerate" in the GUI. If you see your RailDriver pop up in the list below, your device was detected :)

    2. Configuring Proton
    Now we need to tell Proton how to deal with this specific USB device. By default, it probably tries to do some controller mapping magic or just ignores it altogether.

    I found an explanation here: https://github.com/ValveSoftware/Proton/issues/4579#issuecomment-2525676237

    First, you set the game's launch options to
    Code:
    PROTON_ENABLE_HIDRAW="0x05f3/0x00d2" %command%
    where 0x05f3 is PIE's vendor ID and 0x00d2 is the RailDriver's product ID.

    This should tell Proton to not do any of its magic to this particular device but to expose it to the windows application as a HID device.

    Lastly, apparently, you need to force Proton to regenerate the system.reg of the Wine prefix located at <steam dir>/steamapps/compatdata/<game id>/pfx/ (note that 2362300 is TSW 4's id, not sure what this is for other TSWs). To do this, rename the old file so you have it as a backup. Launching the game now will fail. You need to set the game's proton version to another version (i.e. go from Proton Experimental -> Proton Hotfix or vice versa). Launching the game with a different Proton installation seems to regenerate this file. Then you can switch back to your preferred Proton version. This registry change can surely be done differently but it worked.

    Now you can fire up the game and you should see that your RailDriver was detected! Have fun!

    raildriver_linux.png

    I hope this was helpful. It shows that Proton can do what we want it to without too much hacking, we just need to tell it to (and give it permission to).

    If you have questions/problems, feel free to post them so we can discuss them :)
     
    Last edited: Mar 15, 2025
    • Like Like x 1
    • Helpful Helpful x 1
  2. fa397bio

    fa397bio New Member

    Joined:
    Apr 14, 2025
    Messages:
    1
    Likes Received:
    0
    Hello,

    How nice you got it to work on Linux, despite that its said that it is impossible. Sadly I'm not as successful.

    I'm stuck at the point where it should be verfied, that the RailDriver gets detected. The Pi. Engineering Tool doesn't detect the Raildriver, despite it being plugged in and the HIDRAW file having exactely the same name, created and saved with sudo and the exact same content as in the post. Not only did I plug it out and then in, I've also rebooted my system but no luck:(

    Is there perhaps something, that I should look into, or what do you think could be a potential solution?
     

Share This Page