15 Commits

Author SHA1 Message Date
Oleg
94e6dfac6f Changes in VRS DFP config tool tinkering
Added installation of dotnet48
Switch Wine Windows version to 7
Move Wine prefix to hidden folder
Added VRS pedals into udev rules
2024-10-17 18:13:13 +03:00
Oleg
0fefe3dbc8 Bump dkms version to 0.0.9 2024-10-17 17:50:50 +03:00
Makarenko Oleg
31b4aa55b8 Merge branch 'main' into vrs 2024-10-17 11:14:22 +03:00
Makarenko Oleg
b4a1a47284 Merge branch 'main' into vrs 2024-08-09 12:30:57 +03:00
Oleg
e1c8ae6e54 Merge branch 'main' into vrs 2024-07-16 18:13:25 +03:00
Makarenko Oleg
49b38bcefb Merge branch 'main' into vrs 2024-07-16 17:29:07 +03:00
Oleg
6d25c361d2 Merge branch 'main' into vrs 2024-07-16 12:37:36 +03:00
Oleg
86b81767b6 Fix duplicate ids 2024-07-15 11:43:31 +03:00
Oleg
30ebc05078 Merge branch 'main' into vrs 2024-07-15 04:52:45 +03:00
Oleg
41c5bf3fd4 Added VRS DirectForce Pro wheelbase to README.md 2024-07-15 04:35:32 +03:00
Oleg
45360c7c34 Fix NO_DELAY_EFFECT quirk implementation 2024-07-15 04:31:27 +03:00
Oleg
6e39b84de7 Implement NO_STRICT_PID_CONTROL and NO_PID_PARAM_BLOCK_OFFSET quirks 2024-07-15 04:31:05 +03:00
Oleg
d11220c261 Clarification about new quirks 2024-07-15 04:29:55 +03:00
Oleg
9057ffeb6f Added quirks for VRS wheelbase 2024-07-15 04:19:37 +03:00
Oleg
365e585336 Added VRS DirectForce Pro ids 2024-07-15 04:19:20 +03:00
6 changed files with 103 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ That driver allows most DirectDrive wheelbases to initialize and work.
Most of the DirectDrive wheelbases are basically DirectInput wheels, but with some caveats, which Windows allows, but pidff doesn't.
In that repository - pidff driver with some changes, which allows most of the DirectDrive wheelbases to work.
1. Added quirks for better initialization rules for different wheelbases (MOZA, VRS, Cammus)
1. Added multiple quirks for better initialization rules for different wheelbases (MOZA, VRS, Cammus)
2. Fixes for infinite-length effects
3. Fixes for out-of-bounds values (no more spam in kernel logs)
@@ -17,7 +17,8 @@ And that's basically it
### Bases:
1. MOZA R3, R5, R9, R12, R16, R21
2. Cammus C5, C12
3. ...
3. VRS DirectForce Pro
4. ...
## What works?
1. FFB (all effects from device descriptor)
@@ -64,7 +65,7 @@ To unload module:
### Testing
To test the supported effects, use ffbplay from [ffbtools](https://github.com/berarma/ffbtools) and play the included [effect-test.ffb](./effect-test.ffb) file
## How to set up a base parameters?
## How to set up a base parameters (max rotation degree, max power, filters, etc)?
### MOZA
**[Boxflat](https://github.com/Lawstorant/boxflat)** is a Linux Pit House alternative made by [@Lawstorant](https://github.com/Lawstorant)
@@ -73,7 +74,43 @@ To test the supported effects, use ffbplay from [ffbtools](https://github.com/be
### Cammus
**[Android App](https://play.google.com/store/apps/details?id=com.cammus.simulator)**
### VRS DirectForce Pro
You can do it through VRS with Wine. You need to tweak Wine prefix for them.
That software uses hidraw to set up a base. You need to create `udev` rule for allow access to hidraw device:
```
# VRS DFP
echo 'KERNEL=="hidraw*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a355", MODE="0666", TAG+="uaccess"' | sudo tee /etc/udev/rules.d/11-vrs.rules
# VRS pedals
echo 'KERNEL=="hidraw*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a3be", MODE="0666", TAG+="uaccess"' | sudo tee /etc/udev/rules.d/11-vrs.rules
udevadm control --reload-rules && udevadm trigger
```
Then you need to force VRS software to use hidraw, not SDL, to find devices:
1. Create new Wine prefix for them:
`mkdir ~/.vrs-wine`
1. Launch regedit in prefix:
`WINEPREFIX=$HOME/.vrs-wine wine regedit`
1. Create two keys in
`HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\winebus`:
* `DisableInput` (DWORD) - set to `1`;
* `Enable SDL` (DWORD) - set to `0`; (yes, variable name contains space)
1. Install important packages for VRS config tool to work:
`WINEPREFIX=$HOME/.vrs-wine winetricks win7`
`WINEPREFIX=$HOME/.vrs-wine winetricks dotnet48`
1. Now you can launch soft through that WINEPREFIX:
`WINEPREFIX=$HOME/.vrs-wine wine VRS.exe` - launch VRS software from installation directory.
## Known issues with the driver
### MOZA
- Current limit of usable buttons is 160 (up from the Linux default of 80). Create an issue if you want this increased further.
## Known issues with the firmware

View File

@@ -1,5 +1,5 @@
PACKAGE_NAME="universal-pidff"
PACKAGE_VERSION="0.0.8"
PACKAGE_VERSION="0.0.9"
MAKE[0]="make KVERSION=$kernelver"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="hid-universal-pidff"

View File

@@ -10,6 +10,10 @@
#define USB_DEVICE_ID_MOZA_R12 0x0006
#define USB_DEVICE_ID_MOZA_R16_R21 0x0000
// VRS DrivingForce Pro
#define USB_VENDOR_ID_VRS 0x0483
#define USB_DEVICE_ID_VRS_DFP 0xa355
// Moza Racing FH5 mode
#define USB_DEVICE_ID_MOZA_R3_FH5 0x0015
#define USB_DEVICE_ID_MOZA_R5_FH5 0x0014

View File

@@ -41,6 +41,10 @@ static const struct hid_device_id pidff_wheel_devices[] = {
.driver_data = PIDFF_QUIRK_NO_DELAY_EFFECT },
{ HID_USB_DEVICE(USB_VENDOR_ID_CAMMUS, USB_DEVICE_ID_CAMMUS_C12),
.driver_data = PIDFF_QUIRK_NO_DELAY_EFFECT },
{ HID_USB_DEVICE(USB_VENDOR_ID_VRS, USB_DEVICE_ID_VRS_DFP),
.driver_data = PIDFF_QUIRK_NO_DELAY_EFFECT
| PIDFF_QUIRK_NO_STRICT_PID_CONTROL
| PIDFF_QUIRK_NO_PID_PARAM_BLOCK_OFFSET },
{ }
};
MODULE_DEVICE_TABLE(hid, pidff_wheel_devices);

View File

@@ -94,6 +94,11 @@ static const u8 pidff_set_condition[] = {
0x22, 0x23, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65
};
static const u8 pidff_set_condition_without_pbo[] = {
0x22, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65
};
#define PID_MAGNITUDE 1
#define PID_OFFSET 2
#define PID_PHASE 3
@@ -442,12 +447,19 @@ static void pidff_set_condition_report(struct pidff_device *pidff,
struct ff_effect *effect)
{
int i;
// Later we should take axis number out of the device.
// Our driver must work with MOZA AB9 FFB Base
int max_axis = 2;
pidff->set_condition[PID_EFFECT_BLOCK_INDEX].value[0] =
pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0];
for (i = 0; i < 2; i++) {
pidff->set_condition[PID_PARAM_BLOCK_OFFSET].value[0] = i;
if (pidff->quirks & PIDFF_QUIRK_NO_PID_PARAM_BLOCK_OFFSET)
max_axis = 1;
for (i = 0; i < max_axis; i++) {
if (! (pidff->quirks & PIDFF_QUIRK_NO_PID_PARAM_BLOCK_OFFSET) )
pidff->set_condition[PID_PARAM_BLOCK_OFFSET].value[0] = i;
pidff_set_signed(&pidff->set_condition[PID_CP_OFFSET],
effect->u.condition[i].center);
pidff_set_signed(&pidff->set_condition[PID_POS_COEFFICIENT],
@@ -999,6 +1011,10 @@ static int pidff_find_special_fields(struct pidff_device *pidff)
{
hid_dbg(pidff->hid, "finding special fields\n");
int strict_pid_device_control = 1;
if (pidff->quirks & PIDFF_QUIRK_NO_STRICT_PID_CONTROL)
strict_pid_device_control = 0;
pidff->create_new_effect_type =
pidff_find_special_field(pidff->reports[PID_CREATE_NEW_EFFECT],
0x25, 1);
@@ -1010,7 +1026,7 @@ static int pidff_find_special_fields(struct pidff_device *pidff)
0x57, 0);
pidff->device_control =
pidff_find_special_field(pidff->reports[PID_DEVICE_CONTROL],
0x96, 1);
0x96, strict_pid_device_control);
pidff->block_load_status =
pidff_find_special_field(pidff->reports[PID_BLOCK_LOAD],
0x8b, 1);
@@ -1207,7 +1223,23 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev)
clear_bit(FF_RAMP, dev->ffbit);
}
if ((test_bit(FF_SPRING, dev->ffbit) ||
if (pidff->quirks & PIDFF_QUIRK_NO_PID_PARAM_BLOCK_OFFSET) {
if ((test_bit(FF_SPRING, dev->ffbit) ||
test_bit(FF_DAMPER, dev->ffbit) ||
test_bit(FF_FRICTION, dev->ffbit) ||
test_bit(FF_INERTIA, dev->ffbit)) &&
pidff_find_fields(pidff->set_condition,
pidff_set_condition_without_pbo,
pidff->reports[PID_SET_CONDITION], \
sizeof(pidff_set_condition_without_pbo), 1)) {
hid_warn(pidff->hid, "unknown condition effect layout (w/o PBO)\n");
clear_bit(FF_SPRING, dev->ffbit);
clear_bit(FF_DAMPER, dev->ffbit);
clear_bit(FF_FRICTION, dev->ffbit);
clear_bit(FF_INERTIA, dev->ffbit);
}
}
else if ((test_bit(FF_SPRING, dev->ffbit) ||
test_bit(FF_DAMPER, dev->ffbit) ||
test_bit(FF_FRICTION, dev->ffbit) ||
test_bit(FF_INERTIA, dev->ffbit)) &&

View File

@@ -11,8 +11,24 @@
/*
* Skip initialization of 0xA7 descriptor (Delay effect)
*/
#define PIDFF_QUIRK_NO_DELAY_EFFECT BIT(1)
* Fixes VRS DFP, Cammus, old Simagic wheelbases
*/
#define PIDFF_QUIRK_NO_DELAY_EFFECT BIT(1)
/*
* Ignore PARAM_BLOCK_OFFSET (Axis number).
* Most of the wheelbases have only one Axis anyway
* Fixes VRS DFP
*/
#define PIDFF_QUIRK_NO_PID_PARAM_BLOCK_OFFSET BIT(2)
/*
* Some wheelbases don't have some PID_CONTROL fields.
* PID standard does not define fields that MUST exist, but
* that driver was strict about them. This quirk disables it.
* Fixes VRS DFP
*/
#define PIDFF_QUIRK_NO_STRICT_PID_CONTROL BIT(3)
int hid_pidff_init_quirks(struct hid_device *hid, const struct hid_device_id *id);