sdrangel icon indicating copy to clipboard operation
sdrangel copied to clipboard

DeviceInput::applySettings should be on a different thread?

Open srcejon opened this issue 1 year ago • 18 comments

It appears currently that input device's applySettings method executes on Qt's main thread. This can be problematic when updating an SDR setting that takes a long time (E.g. changing frequency can take ~100ms on some devices), as it can block the Qt UI and cause audio drop outs on other SDRs that are running.

To see this, create a workspace with two SDRs. Set one up to demod broadcast FM. For the other SDR, add a delay in to applySettings, to accentuate the problem. E.g.:

QThread::sleep(1);
// just before rtlsdr_set_center_freq for example

Now when you change the frequency on the second SDR, you should hear an audio drop out for the first SDR and the display will freeze.

Obviously no devices take as long as this, but I've heard a few brief drop outs in normal operation, and I think they are related to this. Just thinking theoretically, if the UI is blocked for >20ms, that would mean a video frame could be missed.

srcejon avatar Nov 24 '22 20:11 srcejon