Skip to content

Commit

Permalink
added some troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
gotzl committed Jan 3, 2025
1 parent 3e4e3a9 commit df257f0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ To access advanced functions from user space please see the [hid-fanatecff-tools
* Packaging for more distros

## Troubleshooting
### No FFB, nothing on LEDs/display
Check permissions `ls -l /dev/hidrawXX`, if it is not `0666`, then check with `udevadm test /dev/hidrawXX` if there are any additional rules overwriting the mode set by the `fanatec.rules` file.
Check correct driver module version is loaded: `modinfo hid-fanatec | grep hidraw`
Check game log `PROTON_LOG=+hid,+input,+dinput %command%`, ensure that there is a line called `found 3 TLCs`. If it is not there, then a proton/wine version is used that doesn't support multi TLCs (yet).

### Game hangs at startup
* Clear enumerated HID devices: `protontricks -c "wine reg delete 'HKLM\System\CurrentControlSet\Enum\HID' /f" <appid>`
* If using separated pedals, 'pump' a pedal (to generate input) during game startup (seen in F1 23, AMS2, ??)

### Large deadzone or chunky input
Check the deadzone/flatness/fuzz settings:
```
Expand Down
17 changes: 14 additions & 3 deletions hid-ftecff.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,8 @@ static void ftecff_update_slot(struct ftecff_slot *slot, struct ftecff_effect_pa
#define CLAMP_VALUE_U16(x) ((unsigned short)((x) > 0xffff ? 0xffff : (x)))
#define CLAMP_VALUE_S16(x) ((unsigned short)((x) <= -0x8000 ? -0x8000 : ((x) > 0x7fff ? 0x7fff : (x))))
#define TRANSLATE_FORCE(x, bits) ((CLAMP_VALUE_S16(x) + 0x8000) >> (16 - bits))
#define SCALE_COEFF(x, bits) SCALE_VALUE_U16(abs(x) * 2, bits)
#define SCALE_VALUE_U16(x, bits) (CLAMP_VALUE_U16(x) >> (16 - bits))
#define SCALE_COEFF(x, bits) SCALE_VALUE_U16(abs(x) * 2, bits)

switch (slot->effect_type) {
case FF_CONSTANT:
Expand Down Expand Up @@ -969,13 +969,24 @@ static int ftecff_upload_effect(struct input_dev *dev, struct ff_effect *effect,
struct ftecff_effect_state *state;
unsigned long now = JIFFIES2MS(jiffies);
unsigned long flags;

state = &drv_data->states[effect->id];

if (0) {
struct ff_condition_effect *condition = &effect->u.condition[0];
printk("id %u, state %lu, delay %u, interval %u, type %#02x, effect direction %#04x", effect->id, state->flags, effect->replay.delay, effect->trigger.interval, effect->type, effect->direction);
if (effect->type == FF_PERIODIC) {
printk(KERN_CONT ", magnitude %i, offset %i, phase %#02x, period %u\n", effect->u.periodic.magnitude, effect->u.periodic.offset, effect->u.periodic.phase, effect->u.periodic.period);
} else {
printk(KERN_CONT ", level %i, left_coeff %i, right_coeff %i, left_saturation %i, right_saturation %i\n", effect->u.constant.level, condition->left_coeff, condition->right_coeff, condition->left_saturation, condition->right_saturation);
}
// return 0;
}

if (effect->type == FF_PERIODIC && effect->u.periodic.period == 0) {
return -EINVAL;
}

state = &drv_data->states[effect->id];

if (test_bit(FF_EFFECT_STARTED, &state->flags) && effect->type != state->effect.type) {
return -EINVAL;
}
Expand Down

0 comments on commit df257f0

Please sign in to comment.