OpenLightingProject / ola

The Open Lighting Architecture - The Travel Adaptor for the Lighting Industry
https://www.openlighting.org/ola/
Other
643 stars 204 forks source link

Documentation request: "Data Loss!" #1925

Open kengruven opened 10 months ago

kengruven commented 10 months ago

I was playing with the new web interface and not seeing any action from my fixtures, so I ran ola_dmxmonitor to make sure the data was getting sent to OLA. Every now and then, it pops up a little text alert that says "Data Loss!".

There doesn't seem to be any documentation anywhere which says what data is being lost, or if this is a problem, or what I should do about it. Or is this a bug? Intuitively, I wouldn't think that moving one slider in a web interface, with one terminal window monitoring the state of 500 bytes, should be enough to cause any kind of data loss.

kengruven commented 8 months ago

This warning seems to be generated by https://github.com/OpenLightingProject/ola/blob/1a687474167bd08aa40661ad7b94e734dc3e017a/examples/ola-dmxmonitor.cpp#L374 which is a really weird line.

According to the TimeInterval header (and USEC_IN_SECONDS), it's seconds and microseconds, so this looks like it means 2 seconds + 5 million microseconds = 7 seconds.

But the usec field is stored in type suseconds_t, which according to POSIX is only required to hold values in the range [-1, 1000000], and I can't find any documentation on what it might do when given a value outside of this range. (Wrap? Ignore? Overflow into the seconds field?)

My computer is pretty new, has lots of idle cores, plenty of RAM, and an SSD, and I can see the DMX monitor continuously update. I doubt it's ever gone even 1 second without a screen update. Whatever this code was intended to do, I'm skeptical it's actually doing that.