mcallegari / qlcplus

Q Light Controller Plus (QLC+) is a free and cross-platform software to control DMX or analog lighting systems like moving heads, dimmers, scanners etc. This project is a fork of the great QLC project written by Heikki Junnila that aims to continue the QLC development and to introduce new features.
Apache License 2.0
1.02k stars 360 forks source link

OS2L integration drops commands received in a short period of time #1633

Closed asdfMaciej closed 3 weeks ago

asdfMaciej commented 3 weeks ago

Hello, first of all: thanks for maintaining this project!

Describe the bug QLC+ ignores OS2L commands sent in a rapid succession.

I'm currently working on a OS2L application that sends packets to QLC+ based on physical inputs, for example:

{"evt": "cmd", "id": 123, "param": 211}
{"evt": "btn", "name": "somebutton", "state": "on"}

If packets are sent too often, QLC+ doesn't process them. Example scenarios:

I've looked through the OS2L integration source code and I don't see a reason why (nor a path to avoid this issue other than artificial delays), so I assume this is a bug.

My application is sending packets correctly, as I've also tested this configuration via an OS2L server. I've also replicated this in a more natural behaviour in VirtualDJ via rapid pad taps - they also get ignored. Also found this related discussion, which reported the same issue: https://www.qlcplus.org/forum/viewtopic.php?t=15642

To Reproduce Steps to reproduce the behavior:

If necessary, I can provide a reproduction script, but this is very easily replicated via Virtual DJ.

Expected behavior All commands are processed correctly

Desktop (please complete the following information):

asdfMaciej commented 3 weeks ago

On my machine, creating a 50 milisecond gap between os2l requests appears to mitigate this issue, 30 miliseconds and below reliably fails

This is however an infeasible workaround when attempting to for ex. press few buttons at the same time, as it introduces visible delay

mcallegari commented 3 weeks ago

This might be the line to check https://github.com/mcallegari/qlcplus/blob/master/plugins/os2l/os2lplugin.cpp#L211

However I need some script to reproduce the issue and make sure it is resolved with a fix

mcallegari commented 3 weeks ago

Should be fixed. Please check the latest build and report if it works as expected now