From 3fbddf7f0e83fe72b8f0e0e69faf05579c096f84 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Mon, 22 May 2017 00:24:10 +0200 Subject: [PATCH] DecodeSignal: Adjust the DecodeChunkLength The initial 4096 was too low, though it did make the UI quite responsive. In 9cc264 it was increased to 10*1024*1024 to speed up decoding but that makes the UI stall very badly under certain circumstances (e.g. when changing the baud rate for UART by entering digits). The reason is that every time a decoder property is changed, the decode is restarted. Restarting the decode means that the currently running processes need to shut down, so they're told to do so and the GUI thread waits for them to finish. However, the srd_session_send() call is blocking, meaning that libsrd will happily block the PV GUI thread until it's done processing the current chunk of data. For this reason, DecodeChunkLength can't be too high and 256*1024 looks like a reasonable compromise for now. --- pv/data/decodesignal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index a2fe8f63..5701aeb0 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -46,7 +46,7 @@ namespace data { const double DecodeSignal::DecodeMargin = 1.0; const double DecodeSignal::DecodeThreshold = 0.2; -const int64_t DecodeSignal::DecodeChunkLength = 10 * 1024 * 1024; +const int64_t DecodeSignal::DecodeChunkLength = 256 * 1024; mutex DecodeSignal::global_srd_mutex_; -- 2.30.2