The DMX USB plugin had a fundamental design flaw.
Looking back at the core timer tick diagram, it is clear that NOTHING should interfere with its work, especially because it has only 20ms to process EVERY component of the chain, either in the engine or in the virtual console.
DMX USB (and actually other plugins too) was the bad apple of the chain, performing serial operations (SLOW!) within a timer tick, therefore blocking it and the whole UI with it.
My fault I didn't realize this before, after so many "flickering" reports, frozen UI and whatsoever.
The key points are:
- the QLC+ engine timer runs at 50Hz, DMX runs at 44Hz. A miracle PRO devices worked so far. Actually Enttec MK2 and DMXKing ultraDMX Pro are apparently capable to handle 50Hz. Eurolite "PRO" devices are not.
- OpenDMX devices were running at 30Hz since ages (WTF) I already checked, and OpenDMX clones might flicker on Windows at 44Hz. That's because Windows sucks. Anyway, reducing the output frequency to 40Hz worked for me.
- The OpenDMX process was calculating the elapsed time between DMX frames with QTime, which is well known to be subject to system clock adjustments. No wonder why after many hours everything got frozen
- awkward and difficult frequency parameter tuning. I tried myself changing parameters on macOS, and it's a pain in the ass. Now output frequency can be set in the configuration dialog, in case some crappy clones are not capable of running at 44Hz. Default is 44Hz for every device.
Screenshot:
Also I used another Qt class called QElapsedTimer, with microseconds precision, to perform intra frame sleeps to guarantee the requested output frequency.
Note that this rework doesn't affect other plugins (like Peperoni or uDMX) but the same rework can be done there too.