Both devices being tested should be wired to the same button, and then the two inputs should be mapped to separate Mame buttons. On the CPS test screen, Player 1 and Player 2's "SHOT1" button indicators occupy the same vertical space.
That was really witty.
I've been watching your videos. Considering you get a count of 1.5 in your previous videos this means that 50% of the times the input is processed just in time for the next frame. I'd say this is the best result we've seen so far, quite close the ones by rCadeGaming but slightly better.
This 50% seems to match with the samples taken when the led state changes while in the first half of the previous frame. This would be consistent with an input processing time of half the duration of a frame. If we assume a frame to last 16.77 ms (at 59,60 Hz), it would mean that from the instant you press a button to the moment MAME is notified of it, it takes around 16.77 / 2 -> 8 ms.
There were differences 25% of the time, with the Mayflash being a full gameplay frame slower.
That 25% compared with the previous result would imply an additional delay of 0.25 x 16.77 / 2 -> 2 ms. Then 8 + 2 = 10 ms.
This means there's seems to be a difference of 8 ms vs 10 ms. This could very well be due to the actual pcb being slower rather than the API itself.
IIRC the Microsoft documentation says DirectInput involves more overhead than Raw Input because it needs to create a separate thread for input polling or whatever it does. I already said in the other thread that more overhead not necessarily means more lag at the scale we're working at, specially as systems get faster. However till now tests seemed to be confirming that DirectInput was noticeably more laggy. Maybe it could be just that the input hardware we were testing was slow to react (as Randy Fromm suggested).
Regarding 0.156 not making a difference with -frame_delay, while 0.161 does, I'm a bit puzzled about that, because the relevant frame_delay improvement was introduced in switchres 0.015d which is the one 0.156 uses. Wondering if the ASIO build has anything to do.