psieg / Lightpack

Lightpack and Prismatik open repository
GNU General Public License v3.0
1.57k stars 188 forks source link

Excess frames from other modes on startup #385

Closed dmadison closed 4 years ago

dmadison commented 4 years ago

Someone brought this to my attention on my Adalight repo (dmadison/Adalight-FastLED#24) and I've traced it back to Prismatik.

On application startup and when set to the "Screen Grabbing" mode, Prismatik sends several excess frames before screen grabbing begins. The content of these frames vary between the currently selected mood light color and the scene luminosity threshold. This occurs whether or not the device is 'ON' is Prismatik.

All tests were done on the latest release (5.11.2.23). From testing it looks like this first appears in 5.11.2.21 or 5.11.2.20. It is not present in 5.11.2.19 (comparison). Testing with 5.11.2.21 shows the same results as the latest release.


When the application is started and lights are initially OFF, sniffing the USB data shows three frames:

  1. Mood light color (t 0)
  2. Off (all 0) (t +5 ms)
  3. All channels at luminosity threshold (t +100 ms)

If the luminosity threshold is not 0, the lights are effectively 'on' (though likely dim). Turning the lights 'ON' in Prismatik then sends two more frames:

  1. Mood light color (t 0)
  2. All channels at luminosity threshold (t +200 ms)

After this point the screen grabbing begins and the lights continue as normal. With version 5.11.2.19, no frames are written when the application is started and the lights are 'OFF'.


When the application is started and lights are initially ON, the USB data shows four frames:

  1. Mood light color (t 0)
  2. Mood light color (t +5 ms)
  3. Mood light color (t +100 ms)
  4. All channels at luminosity threshold (t +435 ms)

Then the screen grabbing continues as normal. With version 5.11.2.19, a single frame of the luminosity threshold is written before the first screen grab frame is sent (~ 20 ms) and there are no mood light frames. With 5.11.21, the mood light color is visible for a full half second before the screen grabbing takes over.

I tested with both Adalight and Ardulight devices configured in Prismatik and both show the same behavior. I'm not sure whether this is limited to serial-based devices or not.

zomfg commented 4 years ago

thanks for the details! I never saw those flashes, weird