Sampling rate?

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
olli09
Posts: 2
Joined: Thu Jun 07, 2007 8:36 am

Sampling rate?

Post by olli09 »

Hi,

What is the maximum sampling rate of the SpaceNavigator device. I intend to use it for response time measurements with at least an average sampling rate of about 50 Hz.

My Problem:
When I am polling the data (using Delphi), the driver indicates a interval between samples of 16 ms (period variable). That would be fine. However, when moving the device, it takes in fact between 50-100 ms before I get a sample with new, i.e. changed, data. Does somebody have idea, why the actual sampling rate so bad or what the reason is for these delays?

Thanks in advance,
Oliver
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Oliver,

The maximum rate the device can produce events is 62.5Hz. The driver smooths out inconsistencies in the USB bus sampling and sends data at the application at its own rate (you can control this via a registry entry). If the driver's internal timer times out before new data arrives, it just resends the last data event.

If you want/need data closer to real time, you might want to use HID or RawInput directly and take the driver out of the solution. You'd have to manage any inconsistencies yourself, but those APIs work quite well. There is a thread that references available sample code for these APIs.

Jim
3Dx Software Development
olli09
Posts: 2
Joined: Thu Jun 07, 2007 8:36 am

Post by olli09 »

Thanks, I'll takes this this solution into account.
Oliver
spainman
Posts: 53
Joined: Mon Jun 04, 2007 8:58 am

sampling rate

Post by spainman »

jwick wrote: The maximum rate the device can produce events is 62.5Hz. The driver smooths out inconsistencies in the USB bus sampling and sends data at the application at its own rate (you can control this via a registry entry).
Sorry for bringing up this old thread again.
Could you please specify which registry key controls the sampling rate? I would like to experiment with the setting.

Cheers,
Ruben
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

[HKLM\SOFTWARE\3Dconnexion\3DxWare\]
"USBDataRate"="15"

Would set the rate to 15 events per second.

This should work now, but it will no longer work in future drivers.
spainman
Posts: 53
Joined: Mon Jun 04, 2007 8:58 am

Post by spainman »

jwick wrote: This should work now, but it will no longer work in future drivers.
Thank you! Works like a charm.
I really hope you keep the option in the future versions because it just solved a problem I had with NX7 and the navigator where the framerate in NX was 40fps when moving with the navigator opposed to the normal 60fps (v-sync is on) I got when moving around with the mouse.

The problem happens depending on which devices are connected (or not connected) to the usb ports and whether the machine entered standby or not. Really strange! The strangest thing is possibly that I got a new G35 headset and all of the sudden attaching the headset along with installing it's driver fixed the framerate to 60fps! As soon as I remove the G35 it's back to the low 40fps value. So the G35 software/driver/hardware heals the Navigator update rate.

Another strange thing is that sometimes I got full 60fps in NX when another window than the NX window had the focus. As soon as I activated the NX window the movement was again jerky at 40fps.

Whatever. Just played around with the setting. With USBDataRate = 62 I get the ugly 40fps in NX. With USBDataRate = 63 I get the desired v-synced 60fps. So it seems to relate somehow to the 62.5Hz update rate of the device. As soon as I go past 62.5 everything works as expected. Maybe there is a bug in the driver. The effect is the same with and without the 3dx NX7 plugin so it has nothing to do with it.

Driver version is the latest from the download section. Please keep the registry setting for the usb rate or at least fix the described problem!

Cheers,
Ruben
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

I'd rather fix the underlying problem.
Post Reply