Skip to content
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

Moza R5 Not detected/No forced feedback #7

Closed
cjhelloletsgo opened this issue Jul 14, 2024 · 17 comments
Closed

Moza R5 Not detected/No forced feedback #7

cjhelloletsgo opened this issue Jul 14, 2024 · 17 comments
Labels
documentation Improvements or additions to documentation moza

Comments

@cjhelloletsgo
Copy link

cjhelloletsgo commented Jul 14, 2024

I am trying to get my Moza R5 working but it is not detected by steam, I think it should be detected since it is on the sdl whitelist now right? I also tried this suggestion in the README

Also, recent updates to SDL created SDL Hint variable to dynamically extend wheel devices list17. You need to just export SDL_JOYSTICK_WHEEL_DEVICES=0x/0x,0x/0x before you launching something.

so for this device: Bus 001 Device 014: ID 346e:0004 Gudsen MOZA R5 Base

I ran this command

 export SDL_JOYSTICK_WHEEL_DEVICES=0x346e/0x0004

with no effect.

If I disable steam input then go into Dirt Rally 2.0 it detects Gudsen MOZA R5 Base but there is no forced feedback.

I also tried with the universal-quirks branch with the same effect.

@spikerguy
Copy link

Can you try to add SDL_JOYSTICK_WHEEL_DEVICES=0x346e/0x0004 %command% in steam game command and launch the game?

If that doesn't help then try to launch control panel for that game
protontricks -c "wine control" 690790 and check if you can see your wheel in dinput or xinput. You have to see it in dinput so you can press override.

@cjhelloletsgo
Copy link
Author

I tried the first command and it was the same.

I haven't used protontricks before but since I am on Ubuntu 24.04 I installed the flatpak version as they recommended.
Then I ran this command

flatpak run com.github.Matoking.protontricks -l

and found the app id that you gave me

DiRT Rally 2.0 (690790)

So i ran this command:

flatpak run com.github.Matoking.protontricks -c "wine control" 690790

which gave me this error:

Traceback (most recent call last):
  File "/app/bin/protontricks", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/app/lib/python3.11/site-packages/protontricks/cli/main.py", line 32, in cli
    main(args)
  File "/app/lib/python3.11/site-packages/protontricks/cli/util.py", line 159, in wrapper
    return cli_func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/protontricks/cli/main.py", line 339, in main
    proton_app = find_proton_app(
                 ^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/protontricks/steam.py", line 848, in find_proton_app
    tool_app = find_steam_compat_tool_app(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/protontricks/steam.py", line 609, in find_steam_compat_tool_app
    appinfo_sections = [
                       ^
  File "/app/lib/python3.11/site-packages/protontricks/steam.py", line 609, in <listcomp>
    appinfo_sections = [
                       ^
  File "/app/lib/python3.11/site-packages/protontricks/steam.py", line 531, in iter_appinfo_sections
    raise SyntaxError(
SyntaxError: Invalid file magic number. The appinfo.vdf version might not be supported by the current version of Protontricks - please check for updates.

It looks like there is a bug causing it Matoking/protontricks#304

But setting the proton version as an environmental variable or using the Steam stable branch rather than beta just gives me this:

pressure-vessel-wrap[9]: E: linkat: No such file or directory
Traceback (most recent call last):
  File "/app/bin/protontricks", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/app/lib/python3.11/site-packages/protontricks/cli/main.py", line 32, in cli
    main(args)
  File "/app/lib/python3.11/site-packages/protontricks/cli/util.py", line 159, in wrapper
    return cli_func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/protontricks/cli/main.py", line 381, in main
    returncode = run_command(
                 ^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/protontricks/util.py", line 516, in run_command
    raise RuntimeError(
RuntimeError: bwrap launcher crashed, returncode: 1 

@Lawstorant
Copy link
Contributor

This is am issue with codemasters games. They need EXPLICIT device mentions in their files, which is completely stupid. Look for "Dirt Rally moza fix" on youtube/steam pages.

@cjhelloletsgo
Copy link
Author

Are you referencing manually inputting the deviceinto the device_defines.xml file like in this reddit post? https://www.reddit.com/r/EASPORTSWRC/comments/17kd4zl/totally_disappointed/

I added it and still nothing

@JacKeTUs
Copy link
Owner

Can you try different game? For example, ETS/ATS? To test if driver works correctly.
Or tests from berarma/ffbtools ?

@Lawstorant
Copy link
Contributor

I own both Dirt Rally and Moza R9. Let me test it myself

@Lawstorant
Copy link
Contributor

Lawstorant commented Jul 15, 2024

After inserting moza lines into XML config, FFB works on my end. The wheelbase is properly detected by the game.
It works in Dirt Rally and Dirt Rally 2.0

And yeah, you NEED to disable steam input with force feedback wheels.

The only snag on my end is that Dirt Rally 2.0 crashes my whole pc on Proton 9.0-2. I need to use the last version of proton-ge 8. Wheel whitelist in SDL shouldn't be necessary is this device will be detected as a joystick. The only thing that you have to change is device type (from joystick to wheel).

Are you sure your FFB level in the wheelbase is not 0%? You can check that with boxlfat

@JacKeTUs
Copy link
Owner

@Lawstorant, can you please share your XML config for Dirt Rally? So we can all use the same config files

@Lawstorant
Copy link
Contributor

Lawstorant commented Jul 15, 2024

For Dirt Rally 1 you don't need to do anything
For Dirt Rally 2 (Moza modifications at the bottom):

<?xml version="1.0" encoding="utf-8"?>
<device_list>
  <!--
    Device configuration file.
    This file is used to define device definitions and their usage in the game.

    To add a new device add a device node with following attributes:
      id -  The hardware id for PC devices is essentially '{PID#VID#-0000-0000-0000-504944564944}' where PID# and VID# is replaced with the Product ID and Vender ID of the device.
            You can get these ID's by looking in Devices & Printers, Properties on the required device, Hardware tab, USB Input Device, Properties. In 'Information' you should see VID_#### and PID_####. 
            Take the hex values proceeding the underscore and replace into the above sample.
            e.g. 
              'Device USB\VID_045E&PID_028E&IG_00\8&3afa0edf&0&00 was configured.'
              {028E045E-0000-0000-0000-504944564944}
      name - The name of the device matching the name used in the action maps.
      priority - The higher the priority the more likely the device is used in automatic selection mode as the steering device over other devices.
      {
        0 - reserved for not_supported devices
        1-5, 99 - reserved for library defaults
        6-98 - pads
        100+ - wheels
      }
      version (Optional) - Hardware version of the device, used in conjunction with action map device versioning
      type (Optional) - The type of device, if set to 'unknown' will use the type returned from the driver, otherwise it will overwrite with the selection.
      {
        wheel
        pad
        joystick
        keyboard
        mouse
        pedal
        shifter
        handbreak
        unknown - Default
        not_supported
      }
  
      ffb (Optional)
      {
        default - Default - Uses the value returned from the drivers
        enabled - Force enables the ffb even if the drivers return disabled.
        disabled - Force disables the ffb even if the drivers return enabled.
      }
      ffb_force (Optional) - 0.66 is the lowest value to enable user to scale back up to 1.
      {
        1.0 - Default
      }
      ffb_friction (Optional)
      {
        1.0 - Default
      }
      ffb_high_pass (Optional)
      {
        0.0 - Default
      }
      default (Optional)
      {
        false - Default
        true - Used only by input library defaults
      }
      collections_max (Optional) -  A collection limit >1 or 0 will allow new devices to be created with the postfix '_col##' to the hardware id.
                                    These devices can be used to extend functionality with additional device id's if the device supports them.
                                    e.g.
                                      <device id="{00050EB7-0000-0000-0000-504944564944}" name="ftec_csl_p1" priority="100" type="wheel" collections_max="2" />
                                    
                                    You can now setup an optional collection id to give the second collection it's own action map.                                    
                                      <device id="{00050EB7-0000-0000-0000-504944564944}_col02" name="ftec_csl_p1_col02" priority="100" type="wheel" ffb="disabled" />
      {
        0 - No collection limit
        1 - Default
        >1
      }

    Unknown devices fallback to default libraries defined below in 'Library Default (fallbacks)' if not manually defined.
    Unsupported devices that are not compatible with the game can be added to the 'Not Supported' list to prevent initialisation.

  -->
  <device id="{038E0EB7-0000-0000-0000-504944564944}" name="ftec_clubsport_v1" priority="100" type="wheel" />
  <device id="{00010EB7-0000-0000-0000-504944564944}" name="ftec_clubsport" version="2" priority="100" type="wheel" />
  <device id="{00040EB7-0000-0000-0000-504944564944}" name="ftec_clubsport" version="3" priority="100" type="wheel" />
  <device id="{0E030EB7-0000-0000-0000-504944564944}" name="ftec_csl" priority="100" type="wheel" />
  <device id="{00050EB7-0000-0000-0000-504944564944}" name="ftec_csl_ps4" priority="100" type="wheel" />
  <device id="{18390EB7-0000-0000-0000-504944564944}" name="ftec_clubsport_pedal" priority="100" type="pedal" />
  <device id="{183B0EB7-0000-0000-0000-504944564944}" name="ftec_clubsport_pedal_v3" version="3" priority="100" type="pedal" />
  <device id="{1A920EB7-0000-0000-0000-504944564944}" name="ftec_clubsport_shifter" priority="100" type="shifter" />
  <device id="{1A930EB7-0000-0000-0000-504944564944}" name="ftec_clubsport_handbrake" priority="100" type="handbrake" />
  <device id="{B65A044F-0000-0000-0000-504944564944}" name="tm_f430" priority="100" type="wheel" official="false" />
  <device id="{B677044F-0000-0000-0000-504944564944}" name="tm_t150" priority="100" type="wheel" />
  <device id="{B66E044F-0000-0000-0000-504944564944}" name="tm_t300_rs" priority="100" type="wheel" />
  <device id="{B689044F-0000-0000-0000-504944564944}" name="tm_ts_pc" priority="100" type="wheel" />
  <device id="{B667044F-0000-0000-0000-504944564944}" name="tm_t80" priority="100" type="wheel" />
  <device id="{B67F044F-0000-0000-0000-504944564944}" name="tm_tmx" priority="100" type="wheel" />
  <device id="{B671044F-0000-0000-0000-504944564944}" name="tm_f458" priority="100" type="wheel" official="false" />
  <device id="{45030738-0000-0000-0000-504944564944}" name="mc_pro_r" priority="100" type="wheel" official="false" />
  <device id="{B65E044F-0000-0000-0000-504944564944}" name="tm_t500_rs" priority="100" type="wheel" />
  <device id="{B662044F-0000-0000-0000-504944564944}" name="tm_t500_rs_f1" priority="100" type="wheel" />
  <device id="{B660044F-0000-0000-0000-504944564944}" name="tm_shifter" priority="100" type="shifter" />
  <device id="{C262046D-0000-0000-0000-504944564944}" name="lg_g920" priority="100" type="wheel" />
  <device id="{C24F046D-0000-0000-0000-504944564944}" name="lg_g29" priority="100" type="wheel" />
  <device id="{10201DD2-0000-0000-0000-504944564944}" name="sim_steering" version="1" priority="100" type="wheel" ffb_force="0.5" />
  <device id="{22301DD2-0000-0000-0000-504944564944}" name="sim_steering" version="2" priority="100" type="wheel" ffb_force="0.5" />
  <device id="{22331DD2-0000-0000-0000-504944564944}" name="sim_steering" version="3" priority="100" type="wheel" ffb_force="0.5" />
  <device id="{804C1FC9-0000-0000-0000-504944564944}" name="simxperience_accuforce_pro" priority="100" type="wheel" />
  <device id="{00110EB7-0000-0000-0000-504944564944}" name="ftec_csr_elite" priority="100" type="wheel" official="false" />
  <device id="{01970EB7-0000-0000-0000-504944564944}" name="ftec_porsche_wheel" priority="100" type="wheel" official="false" />
  <device id="{C294046D-0000-0000-0000-504944564944}" name="lg_driving_force_ex" priority="97" type="wheel" official="false" />
  <device id="{C29A046D-0000-0000-0000-504944564944}" name="lg_driving_force_gt" priority="96" type="wheel" official="false" />
  <device id="{C298046D-0000-0000-0000-504944564944}" name="lg_driving_force_pro" priority="98" type="wheel" ffb_friction="0.15" official="false" />
  <device id="{C216046D-0000-0000-0000-504944564944}" name="lg_dual_action" priority="94" type="pad" official="false" />
  <device id="{C218046D-0000-0000-0000-504944564944}" name="lg_f510" priority="94" type="pad" official="false" />
  <device id="{C219046D-0000-0000-0000-504944564944}" name="lg_f710_and_cordless_rumblepad_2" priority="94" type="pad" official="false" />
  <device id="{C299046D-0000-0000-0000-504944564944}" name="lg_g25" priority="100" type="wheel" />
  <device id="{C29B046D-0000-0000-0000-504944564944}" name="lg_g27" priority="100" type="wheel" />
  <device id="{CA03046D-0000-0000-0000-504944564944}" name="lg_momo_racing" priority="100" type="wheel" ffb_friction="0.15" official="false" />
  <device id="{0034045E-0000-0000-0000-504944564944}" name="ms_sidewinder_ffb" priority="100" type="wheel" ffb="enabled" official="false" />
  <device id="{00030E8F-0000-0000-0000-504944564944}" name="sl_strikefx" priority="94" type="pad" />
  <device id="{910511C0-0000-0000-0000-504944564944}" name="sl_torid" priority="94" type="pad" />
  <device id="{B323044F-0000-0000-0000-504944564944}" name="tm_dual_trigger_3_in_1" priority="94" type="pad" official="false" />
  <device id="{B655044F-0000-0000-0000-504944564944}" name="tm_fgt_3_in_1" priority="100" type="wheel" official="false" />
  <device id="{B653044F-0000-0000-0000-504944564944}" name="tm_rgt_ffb_pro" priority="100" type="wheel" official="false" />
  <device id="{B669044F-0000-0000-0000-504944564944}" name="tm_tx" priority="100" type="wheel" />
  <device id="{00080E8F-0000-0000-0000-504944564944}" name="grid2_pad" priority="100" type="wheel" official="false" />
  <device id="{05C4054C-0000-0000-0000-504944564944}" name="ps4_pad" priority="100" type="pad" />
  <device id="{0BA0054C-0000-0000-0000-504944564944}" name="ps4_pad" priority="100" type="pad" />
  <device id="{B678044F-0000-0000-0000-504944564944}" name="tm_usb_adapter" priority="100" type="pedal" />
  <device id="keyboard" name="keyboard" priority="2" type="keyboard" default="true" />
  <device id="mouse" name="mouse" priority="1" type="mouse" default="true" />
  <device id="xinput_pad" name="xinput_pad" priority="5" type="pad" default="true" />
  <device id="xinput_wheel" name="xinput_wheel" priority="99" type="wheel" ffb_force="10" default="true" />
  <device id="pad_virtual" name="pad_virtual" priority="0" type="pad" default="true" />
  <device id="lib_direct_input" name="lib_direct_input" priority="5" type="unknown" default="true" />
  <device id="lib_direct_input_pad" name="lib_direct_input_pad" priority="5" type="pad" default="true" />
  <device id="lib_direct_input_wheel" name="lib_direct_input_wheel" priority="99" type="wheel" default="true" />
  <device id="{C626046D-0000-0000-0000-504944564944}" name="space_navigator" priority="0" type="not_supported" />
  <device id="{046DBEEF-0000-0000-0000-504944564944}" name="space_navigator_driver" priority="0" type="not_supported" />
  <device id="{B695044F-0000-0000-0000-504944564944}" name="tm_tss_hb" priority="100" type="handbrake" />
  <device id="{B692044F-0000-0000-0000-504944564944}" name="tm_ts_xw" priority="100" type="wheel" />
  <device id="{B684044F-0000-0000-0000-504944564944}" name="tm_t_gt" priority="100" type="wheel" />
  <device id="{B681044F-0000-0000-0000-504944564944}" name="tm_t_gt" priority="100" type="not_supported" />
  <device id="{62040EB7-0000-0000-0000-504944564944}" name="ftec_csl_pedals" priority="100" type="pedal" />
  <device id="{07051532-0000-0000-0000-504944564944}" name="rz_raiju_mobile_pad" priority="94" type="pad" default="true" />
  <device id="{00060EB7-0000-0000-0000-504944564944}" name="ftec_dd_f1_pc" priority="100" type="wheel" />
  <device id="{00070EB7-0000-0000-0000-504944564944}" name="ftec_dd_2_pc" priority="100" type="wheel" />
  <device id="{0FFBF055-0000-0000-0000-504944564944}" name="simucube_osw_mmos" priority="100" type="wheel" official="false" />
  <device id="{0D5A16D0-0000-0000-0000-504944564944}" name="simucube_osw" priority="100" type="wheel" official="false" />
  <device id="{0D6116D0-0000-0000-0000-504944564944}" name="simucube2_sport" priority="100" type="wheel" official="false" />
  <device id="{0D6016D0-0000-0000-0000-504944564944}" name="simucube2_pro" priority="100" type="wheel" official="false" />
  <device id="{0D5F16D0-0000-0000-0000-504944564944}" name="simucube2_ultimate" priority="100" type="wheel" official="false" />
  <device id="{09CC054C-0000-0000-0000-504944564944}" name="ps4_pad" priority="100" type="pad" />
  <device id="{C26E046D-0000-0000-0000-504944564944}" name="lg_g923_xone" priority="100" type="wheel" />
  <device id="{C266046D-0000-0000-0000-504944564944}" name="lg_g923_ps4" priority="100" type="wheel" />

  <device official="false" name="moza_wheel_r16_r21" type="wheel" id="{0000346E-0000-0000-0000-504944564944}" priority="100"/>
  <device official="false" name="moza_wheel_r16_r21" type="wheel" id="{0000346E-0000-0000-0000-504944564944}" priority="100"/>
  <device official="false" name="moza_wheel_r9" type="wheel" id="{0002346E-0000-0000-0000-504944564944}" priority="100"/>
  <device official="false" name="moza_wheel_r5" type="wheel" id="{0004346E-0000-0000-0000-504944564944}" priority="100"/>
  <device official="false" name="moza_wheel_r3" type="wheel" id="{0005346E-0000-0000-0000-504944564944}" priority="100"/>
  <device official="false" name="moza_wheel_r12" type="wheel" id="{0006346E-0000-0000-0000-504944564944}" priority="100"/>
</device_list>

@cjhelloletsgo
Copy link
Author

I started up boxflat and it says my forced feedback is at 80%.
image

Steam input is disabled
image

I tried @Lawstorant's xml file, it looks the same as mine and didn't make a difference in game.

it still is showing up but no forced feedback :(
It is set as a wheel instead of a controller or anything else
image

And forced feedback override is set to Device Driver
image

I am on proton experimental but tried with proton 8.0-5 and 9.0-2 and it made no difference.

As for this:
Can you try different game? For example, ETS/ATS? To test if driver works correctly.
I don't have any other racing games yet to try out

Or tests from berarma/ffbtools ?
I looked at this but I honestly don't understand how to use it.

Sorry I'm being a pain here lol, I appreciate your help.

@Lawstorant
Copy link
Contributor

Lawstorant commented Jul 16, 2024

No worries! We all had the same problems at some point.
I did some updates to boxflat, so you shouldn't see these errors anymore. And there's a .desktop file so you should be able to easily find it in your applications.

For the FFB part, I've run this driver with: Dirt rally, Dirat rally 2.0, EA WRC, WRC 10, ETS/ATS, ACC.
And yeah, I was doing extensive testing with ffbtools/ffbplay when I was ding quirks for Moza.

May I ask, how did you install your driver? Could you post your dmesg after you connect your wheelbase?

@cjhelloletsgo
Copy link
Author

cjhelloletsgo commented Jul 16, 2024

I installed using the dkms method in the README, here is a screenshot to confirm it is installed
image

here is the output of sudo dmesg

I gave berarma/ffbtools another try and got it to compile at least but I still don't really get how I am supposed to use it.

What commands did you use for testing with ffbplay?
I got it to work with this command ./build/ffbplay -d /dev/input/event14 -i

And get this menu
image

Edit: I ran this command to run a sin function test but the wheel didn't do anything
./build/ffbplay -d /dev/input/event14 -t tests/sine.ffb
image

@JacKeTUs
Copy link
Owner

First, can you please update universal-pidff to latest version?
Second, can you please check in mobile Moza app that you have wheelbase power limit is not 0?
Commands you ran should output some FFB, but if nothing happens, may be something wrong with your wheelbase?... Is it working on Windows? What firmware are you running?

@JacKeTUs
Copy link
Owner

Hmm, at second glance, i see wrong message in your dmesg, from stock pidff driver, not from universal-pidff
Do you have SecureBoot enabled? May be DKMS can't load module properly?
Can you try manually load the driver with insmod?

@cjhelloletsgo
Copy link
Author

IT WORKS!!!

I think you were right on the SecureBoot stuff. I ended up doing this:

After step 3 in the manual build steps in the README I generated a key pair:

openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Your Name/"

Enrolled the key:

sudo mokutil --import MOK.der

Rebooted and was greeted with this screen:
adding_key

Selected the "Enroll MOK" option and added the key by confirming the password

Signed the module:

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 MOK.priv MOK.der hid-universal-pidff.ko

Loaded the module:

sudo insmod hid-universal-pidff.ko

Confirmed the module was loaded:

sudo dmesg | grep hid-universal-pidff

image

Then tested again with:

./build/ffbplay -d /dev/input/event14 -t tests/sine.ffb

and finally got the forced feedback. Also tested with Dirt Rally 2.0 and it works in there as well. Thanks for the help everyone!

@JacKeTUs
Copy link
Owner

I will add these steps for signing module on SecureBoot system to the docs, thank you for the follow-up and enjoy racing :D

@JacKeTUs
Copy link
Owner

@cjhelloletsgo, please check instructions in branch signing 🙏
#15

@KaJe5380 KaJe5380 mentioned this issue Aug 9, 2024
@JacKeTUs JacKeTUs added moza documentation Improvements or additions to documentation labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation moza
Projects
None yet
Development

No branches or pull requests

4 participants