ola icon indicating copy to clipboard operation
ola copied to clipboard

"Data Loss!"

Open kengruven opened this issue 2 years ago • 2 comments

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 avatar Nov 22 '23 21:11 kengruven

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.

kengruven avatar Jan 19 '24 18:01 kengruven