Problem with buffered haptics (ovr_SubmitControllerVibration)
In my app I want to produce tiny haptic pulses that start with as low latency as possible and have as short a duration as possible. Currently I am achieving this by calling ovr_SubmitControllerVibration() with a buffer containing just a single sample of varying amplitude. This is general works, but in cases were I am submitting a sample every frame (at 90hz) for both controllers (which can happen due to user behavior) neither controller vibrates at all.
If I submit 1 sample every 90hz frame for a single controller (either left or right) it buzzes consistently. However, if I submit 1 sample for both controllers each frame, neither vibrates at all.
I have reproduced this in the "Buffered Haptics" SDK sample. If you remove the code that is currently submitting a haptics buffer to the left controller and replace it with the the following, you can see this problem:
If I submit 1 sample every 90hz frame for a single controller (either left or right) it buzzes consistently. However, if I submit 1 sample for both controllers each frame, neither vibrates at all.
I have reproduced this in the "Buffered Haptics" SDK sample. If you remove the code that is currently submitting a haptics buffer to the left controller and replace it with the the following, you can see this problem:
unsigned char buffer[1] = { 255 };
ovrHapticsBuffer hapticsBuffer;
hapticsBuffer.SubmitMode = ovrHapticsBufferSubmit_Enqueue;
hapticsBuffer.SamplesCount = 1;
hapticsBuffer.Samples = buffer;
if (inputState.Buttons & ovrTouch_X) {
ovr_SubmitControllerVibration(Session, ovrControllerType_LTouch, &hapticsBuffer);
}
if (inputState.Buttons & ovrTouch_A) {
ovr_SubmitControllerVibration(Session, ovrControllerType_RTouch, &hapticsBuffer);
}
If you run the sample with this code, when you hold down X the left controller buzzes consistently, and likewise for A and the right controller. However if you hold down both buttons simultaneously, neither controller vibrates at all.
Why is this happening? I assume this is not intended behavior? I shouldn't be overflowing any buffers because I am submitting 1 sample at 90hz and the haptics samples are played at 320hz, I believe.
Thanks.
Why is this happening? I assume this is not intended behavior? I shouldn't be overflowing any buffers because I am submitting 1 sample at 90hz and the haptics samples are played at 320hz, I believe.
Thanks.
