Skip to content
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

Controls delay on the screen #46

Closed
skaftanis opened this issue Nov 18, 2017 · 1 comment
Closed

Controls delay on the screen #46

skaftanis opened this issue Nov 18, 2017 · 1 comment

Comments

@skaftanis
Copy link

Hi, thanks for the good work!

I use this code to read data from a racing wheel. The problem is that the data aren't exactly real time, because there is some kind of internal delay. When for example I stop steering the wheel I can see in the screen all the values between my current position and the previous for many seconds. I want to do it exactly real time like this: http://html5gamepad.com/

Thanks!

@skaftanis skaftanis changed the title Controls delay to appear Controls delay on the screen Nov 18, 2017
@rene-aguirre
Copy link
Owner

@skaftanis for realtime performance your processing has to be shorter than the signal sampling.

How many samples per second do you receive? What is your processing time? Do you drop samples on jitter? Do you process one sample at a time or a block of samples? etc.

I recommend you getting started with passing the data received on your callbacks (start with raw data) with a timestamp attached into another thread that only has a receiving queue that writes to a file.

Straight file operations are usually much faster than visual IO (e.g. print to screen in an IDE or even CLI).

That'd give you a context in what are your realtime expectations like data throughput and jitter.

PyWinUSB does asynchronous reading in a dedicated python thread which only posts messages to a consumer thread.

That's the reason you don't loose data, your data would get accumulated if your rate of consumption is slower than the rate of production.

Based on your analysis you might need to (not necessarily mutually exclusive options):

  • Do faster processing
  • Decimate the data
  • Drop data

Anyway... start with data :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants