-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Trigger and Move Button have a lot of dropouts #380
Comments
Which controller are you using? Is it a ZCM1 or ZCM2 (see the label on
the back)?
|
ZCM2 |
How are you determining the rate of generated "click events"? Just from
watching the console output in the example applications? Or by
triggering actions with these buttons (e.g. lighting the bulb)? Or by
actually measuring time offsets?
|
I had different tests: What helped was re-pairing the psmove. After that the buttons did response correctly, but after some time the error reappears and Move/Trigger Button are coming through approximately 3 out of 10 times. |
Does the behaviour change if, prior to calling while (keep_running) {
// consume old input reports
while (psmove_poll(move)) {
;
}
// get latest input report
if (psmove_poll(move)) {
unsigned int buttons = psmove_get_buttons(move);
// handle button presses etc.
}
} |
When i do it like your example i only get infrequent updates from the move controller for all buttons.
while (psmove_poll(it->second)) {
;
}
// get latest input report
if (!psmove_poll(it->second)) {
unsigned int buttons = psmove_get_buttons(it->second);
if (buttons & Btn_MOVE)
{
if (lastbuttons[Btn_MOVE] != ((buttons & Btn_MOVE) == 524288))
{
mStopWatch->stop();
int64_t elapsedTime = mStopWatch->elapsedMicroseconds();
printf("Move is pressed: %d\n", elapsedTime);
mStopWatch->start();
}
}
else
{
if (lastbuttons[Btn_MOVE] != ((buttons & Btn_MOVE) == 524288))
{
mStopWatch->stop();
int64_t elapsedTime = mStopWatch->elapsedMicroseconds();
printf("Move is released: %d\n", elapsedTime);
mStopWatch->start();
}
}
} My current implementation has this form: int delay = psmove_poll(it->second);
while (delay != 0)
{
delay = psmove_poll(it->second);
}
unsigned int pressed, released;
psmove_get_button_events(it->second, &pressed, &released);
for (unsigned int j = 0; j < mButtonMaskVector.size(); ++j)
{
//handle buttons
} Results for the time it took to get the release event after having the button pressed and releasing it(in microseconds): Pressed and released the Buttons as fast as i could(not highly sophisticated, but gives a overview). Move Button takes 10 times longer. |
You got this check backwards. |
Yes, I realized that my suggestion was a bit broken. We would rather remove the additional check
I don't know. I could not yet test your problem on Windows.
You could just have a look at the implementation. On Windows, hidapi is using the HidD API for setup and feature reports, and regular file I/O for input and output reports (button data is in the input report). If you spot something that might help tracking down and fixing your problem, any feedback would be appreciated. |
Please also check out the docs in the header file: https://github.com/thp/psmoveapi/blob/master/include/psmove.h#L635 Here's the lowdown: If you want to process all events, you MUST use:
Note that ideally the event processing is "cheap" in the sense that it doesn't take forever (e.g. don't draw the UI or something, just update the internal state). If processing is "expensive" and takes a while, the system might start dropping input events if they are not consumed. This behavior is probably different in Windows, Linux and macOS. If you do a The docs say:
I am not sure if this is the case for ZCM2E too (don't have one here for testing), but assuming it still is, you can also use the return value to see if there were any dropped frames. Currently we take the sequence that is returned from this:
It might very well be that ZCM2E does not write this field (or writes it in a different spot). But anyway, Can you for comparison try with the ZCM1 controller? |
Also, this part of the documentation:
|
After testing with a ZCM2 on Windows 10, I can confirm that the T button
and the Move button are rather unresponsive while the other buttons seem
to work just fine. I also tested a ZCM1 on the same system and it does
not show this behaviour.
I will look into this more closely when I have a little more time.
|
I only have ZCM2E Controllers.
That are good news for me, that you could reproduce my issue. I had no time for further tests. But if you have a clue or could use some support, i gladly help out. Do you have an idea when you can look into the issue? I would very much appreciate fixing this. |
Do you have an idea when you can look into the issue? I would very
much appreciate fixing this.
I am currently swamped with work. So it is probably not going to happen
soon, I am afraid.
|
All Buttons except Trigger and Move have a high fidelity. Pressing them gives the expected response of pressed and released. The Trigger and Move are less responsive. The faster you click one of those, the less click events are published. This behaviour is seen in the example and example_new_api, Windows 7 and 10 with inbuilt Bluetooth.
The text was updated successfully, but these errors were encountered: