Hi all,
I am new to this, but keen to learn and currently working my way through the source, and was wondering if I could get a little bit of guidance from anyone more familiar with the code base.
I'd like to start playing around with a way to optionally dampen the forces as they approach the centre point, to see if it can reduce overcorrection oscillations with a DD wheel, and so far it seems that https://github.com/matlo/GIMX/blob/58d2 ... eaks.c#L22 would be a suitable place to do it. The bit I'm unsure of at present is how to get the position of the axis from within that function.
Am I looking in the right place?
Cheers,
Scott
Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
-
- Posts: 46
- Joined: Wed Feb 16, 2022 9:44 am
-
- Posts: 46
- Joined: Wed Feb 16, 2022 9:44 am
Re: Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
Digging a bit more... and using this thread to make some notes
Think I can copy the way the joystick_corrections_list defines the axis e.g. <event type="axis" id="2"/>, then pick that up with ProcessEventElement and pass it through to cfg_set_ffb_tweaks as entry.event.id
Think I can copy the way the joystick_corrections_list defines the axis e.g. <event type="axis" id="2"/>, then pick that up with ProcessEventElement and pass it through to cfg_set_ffb_tweaks as entry.event.id
-
- Posts: 46
- Joined: Wed Feb 16, 2022 9:44 am
Re: Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
Ok, making some good progress with this. I ended up making two changes to check the approach works:
First I exposed the address of the axis variable:
This then allows access to it during the haptic_tweak_apply:
It's a proper hack-job at the moment, but it's totally removed the oscillations I was getting with my Simagic Alpha mini. I'll have a stab at making it configurable so the gain and axis range can be set.
If there is any other interest in this, I'll raise a PR for it in github.
First I exposed the address of the axis variable:
Code: Select all
void cfg_set_ffb_tweaks(const s_config_entry * entry)
{
// determine the axis for the tweaks
s_mapper* mapper = joystick_axes[entry->device.id][entry->controller_id][entry->profile_id].mappers;
int axis = mapper->axis_props.axis;
int *axis_address = &adapter_get(entry->controller_id)->axis[axis];
ginfo("setting ffb_tweaks for controller_id: %d, device_id: %d, profile_id: %d, axis: %d, axis_address: %p\n",
entry->controller_id, entry->device.id, entry->profile_id, axis, axis_address);
ffb_tweaks[entry->controller_id][entry->profile_id].axis_address = axis_address;
Code: Select all
case E_DATA_TYPE_CONSTANT:
// get the axis value
if(tweaks->axis_address) {
int axis_value = *(tweaks->axis_address);
int constant_level = data->constant.level;
// calculate the gain
if(abs(axis_value) < 300) {
int gain = abs(axis_value) / 3;
APPLY_GAIN(data->constant.level, gain, -SHRT_MAX, SHRT_MAX);
}
ginfo("haptic_tweak_apply: axis address: %p, axis value: %d, constant_level: %d, tweaked_constant_level\n", (void *)tweaks->axis_address, axis_value, constant_level, data->constant.level);
If there is any other interest in this, I'll raise a PR for it in github.
-
- Posts: 46
- Joined: Wed Feb 16, 2022 9:44 am
Re: Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
After a bit more testing, I have found there are still some instances where it can start to oscillate, but it's usually after an aggressive move and then releasing the wheel. Still a significant improvement in usability
I added a bit of code to read the values from the config profile too https://github.com/GeekyDeaks/GIMX/tree/g29-correction
I added a bit of code to read the values from the config profile too https://github.com/GeekyDeaks/GIMX/tree/g29-correction
Re: Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
Thanks for your contribution. I wish I could help you but I don't even own a wheel.
My hardware: PS3 Slim CFW 4.80 | PS4 Pro 500 Million LE | PS5 | Xbox Series X
Steam: Godlike_RU | PSN: GoDlike_RU | XBL: GoDlike
Steam: Godlike_RU | PSN: GoDlike_RU | XBL: GoDlike
-
- Posts: 46
- Joined: Wed Feb 16, 2022 9:44 am
Re: Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
Hey, no worries. You guys have been helping people hook up dodgy bits of gear to their console for ages! I'm more looking for guidance anyway, e.g. take a look at how X was done here... as learning new stuff is all part of the fun 
After quite a bit of testing, I can see some flaws in my approach, mostly due to what I think is trying to apply the profile for a slowly responding wheel (G29) to a quickly responding wheel (DD). This hack does me for now and means I'll be able to enjoy GT7 without breaking my thumbs. Longer term I am going to see if I play GT7 enough to warrant putting in the time to work on a new device profile as I think one of my friends might get a Sony approved DD that we could use to capture the USB traffic.
With that in mind, I'll probably not raise a PR as I think the amount of people that might want to try this out is likely to be low anyway and I also don't think you really want my dodgy code polluting your code base!

After quite a bit of testing, I can see some flaws in my approach, mostly due to what I think is trying to apply the profile for a slowly responding wheel (G29) to a quickly responding wheel (DD). This hack does me for now and means I'll be able to enjoy GT7 without breaking my thumbs. Longer term I am going to see if I play GT7 enough to warrant putting in the time to work on a new device profile as I think one of my friends might get a Sony approved DD that we could use to capture the USB traffic.
With that in mind, I'll probably not raise a PR as I think the amount of people that might want to try this out is likely to be low anyway and I also don't think you really want my dodgy code polluting your code base!
Re: Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
Hi GeekyDeaks. Just wanted to let you know I for one, am reading this thread and your progress with excitement and anticipation. I too, own a DD wheel...a Leo Bodnar Sim Steering 26NM version, and yes you are correct, there is too much oscillation happening around the center. I think it may be due to the way Polyphony coded their FFB in conjunction with what they thought would make for a good driving experience with the Logitech G29 wheel, and decided to make the forces a bit strong towards the center to compensate for the G29's lack of strong torque response(I mean, it *IS* an old gear driven type wheel afterall).
I strongly encourage you to keep digging into the code and continue seeing what you can do you eliminate this problem for us DD wheel users. I'm confident there are more of us out there than you may think
You have our full support brother...keep at it! 
I strongly encourage you to keep digging into the code and continue seeing what you can do you eliminate this problem for us DD wheel users. I'm confident there are more of us out there than you may think


-
- Posts: 46
- Joined: Wed Feb 16, 2022 9:44 am
Re: Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
Hiya! Not sure if you spotted the other thread where we have been discussing this? https://gimx.fr/forum/viewtopic.php?p=21145#p21145
The version linked to on the above post seems to be working fairly well for some people so far
Re: Direct Drive friendly haptics using G29 profile (aka how to match haptic sink to axis)
Awesome. Thanks for letting me know 
