-
Notifications
You must be signed in to change notification settings - Fork 110
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
Support: Impulse Triggers #23
Comments
I think directional rumble should also be possible... |
Documentation: FF report (ID
|
Not over BT i fear - since the HID output report |
I don't know the interfaces, but since we have left and right rumble, directional rumble is possible. In wine joy.cpl I see that you can set a direction for rumble effects. |
ah i see - directional in the sense of right/left! yes, thats for sure possible! :) what i thought you mean is if the force pulls/pushes into a specific direction |
Unfortunately I fear there is no impulse trigger support at the moment (at the linux kernel). Furthermore, the directional effect does not really make sense at the Xbox One Wireless Controller since both sides (left/right) do only offer one of both effects (strong rumble/weak rumble). They rumble hardware is not equal. But maybe I overlooked something, I will dig a bit deeper. |
I don't think that impulse trigger should be a rumble effect but instead a force feedback effect... Does Linux support force feedback (I mean, really applying counter force instead of playing just rumble effects) - then that would be the way to go. BTW: This feature isn't even supported by the Windows driver as far as some research shows. And the Steam community is full of posts about alternative drivers which support more Xbox controller features than the one MS provides in Windows. |
I think directional feedback should go as far as giving me feedback in a shooter if I'm hit from left or right. This is probably up to the game, as long as the interface is provided. Impulse triggers would be interesting for features like the shock when pulling the trigger to fire your weapon, or for driving simulations by sending feedback from the wheels or the motor. Also see previous youtube link. |
Well, as far as I know rumble is just a special kind of force feedback, at least in the sense the kernel handles it. The kernel does in fact support a bunch of FF effects, those are:
(take a look here) But none of those does really fit, right? To be honest, it is just a rumbling motor, so something like FF_RUMBLE_TRIGGER would be best, but it does not exist (at the moment). Our best bet seems to be FF_CONSTANT, since this seems to be the only one which is at least implemented in some drivers (but mostly wheels). Another solution would be to let the triggers rumble whenever the "normal" rumble occurs. What would you, as a gamer, prefer? |
Ah, mhm, for a short period it is okay I think. But a shot from the left feels a bit different than one from the right then ;D We would need two rumble motors (a weak one and a strong one) on both sides to fit the structure as it is in the kernel. Where is why: In practice this isn't possible - since most gamepads only have two rumble motors, one is the weak one, the other one is the strong one - and they are placed like: weak -> right handle, strong -> left handle (or vice versa). Therefore, we totally ignore the left/right directional property until now. Imagine the game requests a rumbling effect on the left using the motor (weak/strong) which is on the right - how should we do that? The only thing we could do then is to approximate the effect magnitude using the wrong motor (if a bit of strong rumbling is requested on the side where the weak motor is, then we could rumble a bit harder using the weak one). But yes, it is just an approximation then. Again @kakra: What do you think, should we prefer to offer directional effects or to be more precise? |
The Steam controller is pretty capable of emulating most of the effects. It doesn't have rumbling motors but small magentic accelerators that work like in a sound speaker, and for different directions. This is why the effect is very subtle and makes sounds. But if you flip the finger across the touch pad, it feels like a track ball is rotating with inertia, and when you stop it, you can feel that stopping shock, too. It has friction effects when you program a pad with virtual buttons. The triggers have a non-programmable hardware trigger point near the end (with some higher, clicking force). The Steam input driver can try to emulate many effects, but it's far from rumble. For the Xbox controller I could also think of FF_SPRING could be a usable effect. But without ever experiencing it, I cannot really help here. Do you have a test program which could play the trigger effects built into the controller? |
Ah, here I see what you mean: https://zh.ifixit.com/Guide/Xbox+One+Wireless+Controller+Trigger+Rumble+Motor+Replacement/36558 So, essentially the problem is that we have only two axis in the interface to apply FF effects to? |
BTW: From the pictures, it looks to me like the strong motors are left and right in the grips, and the weak motors in the triggers. Also, when I opened my F710, it had two identical motors on each side. Can you just turn the motors on and off, or is it possible to apply a value for rotation speed? |
I just found that there's |
I didn't knew about the others but I always used/use
For every kind of effect, you can set a direction:
Furthermore, there are effect-specific properties. For the FF_RUMBLE effect, you can also set:
That's the software part. The hardware looks like the following: We have three kinds of motors:
You can see the difference between the grip-motors (the weights) here. We can set a "rotational speed" for all four motors independently. Given that information, how would you handle an effect request, which wants:
The strong motor is on the left, but the direction requests an effect on the right side...^^
You mean experiencing the Impulse Trigger thingy? I can simply implement first support and we can decide on how exactly the interface should look like later - then you can test it too. |
It would make sense to have this test program when it could somehow access the trigger motors. It would be nice if it supported raw access to the functions so we could experiment with it. Is it possible to bypass the hid driver and access hidraw for this? I could think of this solution: Depending on the direction (left or right), not just play the strong or weak motor, but also the left or right trigger motor. If direction is forward, play both trigger motors. If backward, play no trigger motor but just the weak or strong motor. What do you think? |
BTW: Interesting... If I put the controller on the table and push down on the left grip only with a finger tip, playing the strong effect creates a strong pull to the right. Pushing down on the other side, it just wobbles. Can we exploit that somehow? ;-) |
I will give it a try and report back.
That's indeed a very clever but still a bit dirty solution. |
Let's be dirty then... ;-) Even if kernel interfaces changed, it will take time for games to adapt. So this dirty solution would be some sort of "legacy" mode. And we can add a modern mode later and expose that as a configurable module parameter so you can choose which interface suits your needs. |
If you provide the basic framework, I could add the rest of the code to it. |
Okay, as a temporary solution 😄 as long as there is no better kernel-support. Therefore the strength of the rumble at the right/left trigger will be influenced by two factors:
Agreed? |
Sounds fine, I was already thinking about it. As far as I can see, we can play the strong and weak motor independent of each other or at the same time, with a magnitude of 0 to 100% each. We should stick with a 1:1 mapping here to not change how games expect it to work. Now we emulate a direction. The further up the direction points, the stronger the magnitude. Point north should play both trigger motors at 100%. I think you'll need sine/cosine tables for it. But we can make it linear first and see if that easy solution works well enough. What do we do with the south direction? Should we map the complete Y axis of the circle to 0 to 100% (from bottom up), or just the upper half of the circle, and let the lower half just not play the triggers at all? I think the latter implementation could make more sense since the triggers are in the front only. The lower half could instead bias the grip motors instead. But we should not do this in the first implementation as it could violate games expectations. |
That's correct! What do you mean by 1:1 mapping?
Maybe not at 100% but at most as strong as e.g. the strong motor is playing? What do you think? Would be a bit strange it the Triggers are rumbling more than the Gampad itself.
I agree, I would also go fot the latter one. |
This latter solution has the advantage that you can play rumble without triggers by just pointing backward. Otherwise we would always have triggers rumble with no chance to prevent that. 1:1 means keep it how it works currently, not influenced by direction. |
0 = 0x0000, 2 = 0x2222 etc 0 to 4 and C to F map both trigger motors to off. This way it should be possible to play every combination of magnitude with every motor, right? It should even be possible to rumble the triggers only by sending a magnitude of 0 to the grip motors. |
I see, yes for sure - the direction will only influence the "new" trigger buttons. Everything else stays as normal.
Imagine that a game invokes an super-duper light effect on the left. This way (which you mentioned) the gamepad would play a very strong effect at the left trigger, which is way stronger than the main-rumbling which was requested. I therefore think that the grip-magnitude (which is the only we have) should influence the triggers too. So my suggestion would be: 0 to 4 and C to F map both trigger motors to off. |
I hope I find a game to test that... ;-) |
Maybe we could add a |
Maybe the choosen magnitude should not be a multiple of all magnitudes and a bias how I first imagined but simply a max of (weak,strong,directional). A module parameter then instead chooses if this max() value is used or if only directional is used. |
For sure, that's not a problem.
Maybe something like |
Ah yes, max(weak,strong)*directional makes more sense ;-) |
Or min(directional,max(weak,strong))... |
Perfect! Let's do it like that - it's easy to change afterwards if it does not work as expected ;) As always: Thank you very much and good night ;D |
Looking forward, I'll now research which Linux games could support that. At least wine joy.cpl has a directional interface for rumble. Maybe you could look at the source and see if and how it translates that to Linux... Then, I could try games in Wine. I'm not sure if one of the pseudo-native Linux games would support directional rumble. |
Looks like DIRT, GRID and Eurotruck Simulator 2 have support for directional FF. Tho, it may be used for centering the steering wheel. At least, I believe I have all three in my Steam library as native Linux games. |
pushed a first version which enables the other two motors, will do the math tomorrow (later). At least you can experience it with Btw: The magnitude for the triggers are downscaled to a fourth(!) |
Aw well, night time for me, too. |
in addition to the commit above i've added a very very basic test tool.
|
@kakra: this is what you are talking about, right? edit: ups, alpha should be |
Yes, tho I don't think we need curve functions. We can simply make it linear per each 45 degrees - at least for the start. Then a series of if clauses just does the math:
You get the idea... Pseudo code, "..." meaning non-inclusive (as in Ruby). The 0xFFFF check has to do an inclusive check. Or better, it checks against 0x10000, as actually the 0x1111 are endless fractionals and in that definition 0xFFFF does not exist. This is the fraction of 1/9, which makes 0.11111..., 0.22222... and so on but 0.999999... does not exist: It's equal to 1. Does it make sense? The circle has four or eight slices which is perfectly easy to do with a hexadecimal radial scale. How did I think we need to use 0x2222 etc? Well, whatever, the idea is the same. PS: I should have drawn the complete circle with slice 0-F instead of only the upper half 4-C, then I would have seen my error. Go with 0x2000, 0x4000 instead. ;-) |
ef8d113 |
I've added the parameter |
Let me test this, hopefully today or tomorrow. |
…tnumber) * changed damping parameter to 4 and made it linear see #23
I've added an test program yesterday, at least here it works |
@kakra have you found any native linux game that supports directional rumble? :) |
Not yet, or at least I didn't sense it doing so. But I found that sometimes, FF effects play, and sometimes they don't. Usually, that's pretty consistent throughout the gameplay: When it's missing from the start, FF usually never plays. When it works, it sometimes misses playing FF effects when there should be effects. I'm yet to figure this out better. It's somehow similar to how my modified test program plays only the first round of effects... |
I didn't yet came across a game that uses directional rumble. The rumble effects sometimes missing didn't occur in a while. It's consistently working in games currently. |
Thank you for getting back 👍 |
Closing - works |
While searching for a way to dim the Xbox-Logo light i explored another feature:
R2 and L2 are able to give some force feedback too, not sure how we should implement that
but it's funny as hell 😄
The text was updated successfully, but these errors were encountered: