From b14ae1e7c1b3baf0a598c98be504483759faddd6 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 19 Mar 2016 08:54:31 +0100 Subject: [PATCH] SDRdaemon: GUI fix. Limit r/w balance correction --- Readme.md | 2 +- plugins/samplesource/sdrdaemon/sdrdaemonbuffer.cpp | 9 +++++++++ plugins/samplesource/sdrdaemon/sdrdaemongui.ui | 14 +++++++------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Readme.md b/Readme.md index 17e8a9eef..0c24ba44c 100644 --- a/Readme.md +++ b/Readme.md @@ -195,7 +195,7 @@ Then you should be all set to build the software with `cmake` and `make` as disc This is new in version 1.1.3 and also experimental. Use at your own risk! This may or may not work on your machine and version of Windows. It was tested more or less successfully in native Windows 7, 8 and 10 however it does not work in a Virtualbox guest supposedly because it uses OpenGL ES 2.0 instead of the OpenGL desktop version (OpenGL 4.3) when it is running native and I think the OpenGL code in SDRangel is still not quite right to be compatible with the ES version (use of QtGLWidget instead of QtOpenGLWidget). -You should take note that the Windows scheduler is just a piece of crap and not suitable for near real time applications like SDRs. If you encounter any problem just grab a Linux installation CD or .iso file and get yourself a decent OS first. You have been warned! +You should take note that the Windows scheduler is just a piece of crap and not suitable for near real time applications like SDRs. In any case you should make sure that the sdrangel process does not take more than 35% of the global CPU (check with Task Manager). Unload channel plugins if necessary. If you encounter any problem just grab a Linux installation CD or .iso file and get yourself a decent OS first. You have been warned! There is no plug-in to interface to BladeRF hardware due to the complexity of building `libbladerf` for Windows. diff --git a/plugins/samplesource/sdrdaemon/sdrdaemonbuffer.cpp b/plugins/samplesource/sdrdaemon/sdrdaemonbuffer.cpp index 7f773f410..6a6be27af 100644 --- a/plugins/samplesource/sdrdaemon/sdrdaemonbuffer.cpp +++ b/plugins/samplesource/sdrdaemon/sdrdaemonbuffer.cpp @@ -269,6 +269,15 @@ uint8_t *SDRdaemonBuffer::readData(int32_t length) } m_balCorrection += dBytes / (int32_t) (m_nbReads * m_iqSampleSize); // correction is in number of samples + int32_t limit = (int32_t) m_rawSize / (int32_t) (5 * m_rawBufferLengthSeconds * m_iqSampleSize); + + if (m_balCorrection < -limit) { + m_balCorrection = -limit; + } else if (m_balCorrection > limit) { + m_balCorrection = limit; + } + + m_nbReads = 0; } else diff --git a/plugins/samplesource/sdrdaemon/sdrdaemongui.ui b/plugins/samplesource/sdrdaemon/sdrdaemongui.ui index 34e89663b..2dd6193d3 100644 --- a/plugins/samplesource/sdrdaemon/sdrdaemongui.ui +++ b/plugins/samplesource/sdrdaemon/sdrdaemongui.ui @@ -240,6 +240,13 @@ + + + + Qt::Horizontal + + + @@ -397,13 +404,6 @@ - - - - Qt::Horizontal - - -