Gamepadproxy

General Chat, Feel Free To talk about anything here.
J2Kbr
Posts: 6
Joined: Wed Jan 11, 2012 5:07 pm

Re: Gamepadproxy

Post by J2Kbr » Tue Jan 31, 2012 9:32 pm

Thank you Matlo. :D
I'm very happy to participate of the GIMX project.

J2Kbr
Posts: 6
Joined: Wed Jan 11, 2012 5:07 pm

Re: Gamepadproxy

Post by J2Kbr » Sun Feb 12, 2012 11:55 am

Malto, How's the progress with GIMX and GPP? Did you found something about the latency issue?

I'm working on an API (windows) for direct access the GPP, very similar to what we did with libusb on Linux. I got some results that surprised even me. On the PS3 we achieved a rate higher than 400 updates/s, with average latency around 2.3ms. On the XBox 360 the rate is above 800 updates per second, with average latency of 1.2ms.

Here is a video with these tests.

http://youtu.be/oUgYru7GYRk

The difference between the XBox 360 and PS3 is caused by the difference in complexity of the protocols between these controllers.

User avatar
Matlo
Posts: 5323
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Gamepadproxy

Post by Matlo » Sun Feb 12, 2012 3:18 pm

I managed to work-around the libusb latency problem. I'm now using the hidraw device in Linux.
I've no idea about when I will be able to make a new release with this functionnality...
J2Kbr wrote:On the PS3 we achieved a rate higher than 400 updates/s,
I thought the ps3 was only polling the sixaxis at 100Hz?
J2Kbr wrote:with average latency around 2.3ms.
What latency are you measuring in your tests?
The time between the usb packet from the gamepad and the usb packet to the console?
GIMX creator Donate Shop

J2Kbr
Posts: 6
Joined: Wed Jan 11, 2012 5:07 pm

Re: Gamepadproxy

Post by J2Kbr » Sun Feb 12, 2012 3:48 pm

Matlo wrote:I thought the ps3 was only polling the sixaxis at 100Hz?
If you look at the USB descriptors of DS3 the "interval" parameter of endpoints is 1 (1 ms), which means a max pooling rate of 1000Hz. I'm not sure about Bluetooth pooling rate.
Matlo wrote:What latency are you measuring in your tests? The time between the usb packet from the gamepad and the usb packet to the console?
I'm measuring, basically, the time required to send a data packet from the application to the GPP and, consequently, to the console.

Anything I can do to help you in relation to GIMX and GPP, please just tell me.

User avatar
Matlo
Posts: 5323
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Gamepadproxy

Post by Matlo » Sun Feb 12, 2012 10:00 pm

J2Kbr wrote: If you look at the USB descriptors of DS3 the "interval" parameter of endpoints is 1 (1 ms), which means a max pooling rate of 1000Hz. I'm not sure about Bluetooth pooling rate.
The BT polling rate is 100Hz, and I thought the USB polling rate would also be 100Hz. But you are right about the USB descriptor :)
J2Kbr wrote: Anything I can do to help you in relation to GIMX and GPP, please just tell me.
The source code is already commited to the svn repo, but I still need to code a few things for the Linux hidraw layer.
If you can test the windows code, please do it.
There is a wiki about how to build GIMX in Windows there: link.
GIMX creator Donate Shop

User avatar
Matlo
Posts: 5323
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Gamepadproxy

Post by Matlo » Tue Feb 14, 2012 9:03 am

I did the same test in Linux with a PS3 and I got similar numbers.
J2Kbr wrote:If you look at the USB descriptors of DS3 the "interval" parameter of endpoints is 1 (1 ms), which means a max pooling rate of 1000Hz.
As this interval is 4ms for the 360 pad, it is useless to send updates faster than 250Hz to the GPP connected to a 360, right?
GIMX creator Donate Shop

J2Kbr
Posts: 6
Joined: Wed Jan 11, 2012 5:07 pm

Re: Gamepadproxy

Post by J2Kbr » Tue Feb 14, 2012 10:54 am

Matlo wrote:I did the same test in Linux with a PS3 and I got similar numbers.
Good! :)
Matlo wrote:
J2Kbr wrote:If you look at the USB descriptors of DS3 the "interval" parameter of endpoints is 1 (1 ms), which means a max polling rate of 1000Hz.
As this interval is 4ms for the 360 pad, it is useless to send updates faster than 250Hz to the GPP connected to a 360, right?
You're right about the interval of XBox360. But :mrgreen: ... if you looking at the USB descriptors of GPP, in both XBox360 and PS3 modes, you will see that I changed the bInterval of EndPoints to 0.

I did it not to increase the update rate, but to decrease latency to the maximum. Making bInterval 0 allows the GPP send a data packet to the console as soon the packet is ready. Otherwise the GPP would have to wait up to 4ms (XBox360) before be able to send the packet, the time required to receive the token IN of the USB protocol.

For sure is great be able to send hundreds of updates per second to the console. But we must agree 100 updates/s is more than enough. During the project phase of the GPP I remember reading, in a documentation about design for gaming devices, that a minimum recommended for a good experience is 50 updates/s.

I looked at the procedure to compile GIMX on windows. As it needs to install a new compiling environment, I'll do it during the weekend.

[]'s

User avatar
Matlo
Posts: 5323
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Gamepadproxy

Post by Matlo » Tue Feb 14, 2012 1:34 pm

J2Kbr wrote: You're right about the interval of XBox360. But :mrgreen: ... if you looking at the USB descriptors of GPP, in both XBox360 and PS3 modes, you will see that I changed the bInterval of EndPoints to 0.
I actually had a look at the USB descriptors of the GPP but I didn't see such values. I guess that's because I still have not updated the firmware.

The usb spec specifies that bInterval should be in 1-255 for full-speed devices.
What's the effect of setting 0 as bInterval? Does the host still poll the device each frame = 1ms?
GIMX creator Donate Shop

J2Kbr
Posts: 6
Joined: Wed Jan 11, 2012 5:07 pm

Re: Gamepadproxy

Post by J2Kbr » Tue Feb 14, 2012 2:05 pm

Matlo wrote:I actually had a look at the USB descriptors of the GPP but I didn't see such values. I guess that's because I still have not updated the firmware.
I just checked here and actually bInterval values ​​are no longer 0, I had changed it when I did some compatibility testing. I'll return these parameters to 0 (or 1) in the next FW.
Matlo wrote:The usb spec specifies that bInterval should be in 1-255 for full-speed devices.
What's the effect of setting 0 as bInterval? Does the host still poll the device each frame = 1ms?
For being counter I believe make it 0 has the same effect as if it was 1, since 1ms is the smallest unit of time for tokens transmission of USB protocol. I "copied" this idea from a Bluetooth adapter I have here, which has bInterval = 0 in some endpoints.

J2Kbr
Posts: 6
Joined: Wed Jan 11, 2012 5:07 pm

Re: Gamepadproxy

Post by J2Kbr » Tue Feb 14, 2012 4:10 pm

Matlo, was very good we have had this discussion. I had forgotten the detail about the bInterval. The important thing is I've already patched it, now the bInterval value is 1, for both PS3 and XBox360.

I tested with 0 and the reception rate of IN tokens remained 1000/s, so there's no reason to keep it at 0.

When you get a chance do the firmware update, I'm already working on version 1.08 and it has had many improvements since version 1.01.

Post Reply