diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index 03f02a5..5efd96d 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -358,7 +358,6 @@ AppFrame::AppFrame() : SetAcceleratorTable(accel); // frame rate = 1000 / 30 = 33ms - frame_timer.Start(33); // static const int attribs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 }; // wxLogStatus("Double-buffered display %s supported", wxGLCanvas::IsDisplaySupported(attribs) ? "is" : "not"); // ShowFullScreen(true); @@ -381,6 +380,10 @@ void AppFrame::initDeviceParams(std::string deviceId) { if (devConfig->getIQSwap()) { iqSwapMenuItem->Check(); } + + if (!frame_timer.IsRunning()) { + frame_timer.Start(33); + } } @@ -719,7 +722,8 @@ void AppFrame::OnTimer(wxTimerEvent& event) { } else { fftDistrib.setFFTSize(DEFAULT_FFT_SIZE); } - fftDistrib.setLinesPerSecond(60); + fftDistrib.setLinesPerSecond(24); + wxGetApp().getWaterfallVisualQueue()->set_max_num_items(24); fftDistrib.run(); wproc->setView(waterfallCanvas->getViewState()); diff --git a/src/CubicSDR.cpp b/src/CubicSDR.cpp index 51deb24..c6bbbe4 100644 --- a/src/CubicSDR.cpp +++ b/src/CubicSDR.cpp @@ -58,10 +58,10 @@ bool CubicSDR::OnInit() { spectrumDistributor.setInput(pipeIQVisualData); pipeDemodIQVisualData = new DemodulatorThreadInputQueue(); - pipeIQVisualData->set_max_num_items(1); + pipeDemodIQVisualData->set_max_num_items(1); pipeSpectrumIQVisualData = new DemodulatorThreadInputQueue(); - pipeIQVisualData->set_max_num_items(1); + pipeSpectrumIQVisualData->set_max_num_items(1); pipeWaterfallIQVisualData = new DemodulatorThreadInputQueue(); pipeWaterfallIQVisualData->set_max_num_items(512); diff --git a/src/sdr/SDRPostThread.cpp b/src/sdr/SDRPostThread.cpp index 9baa1c7..4efc143 100644 --- a/src/sdr/SDRPostThread.cpp +++ b/src/sdr/SDRPostThread.cpp @@ -117,6 +117,7 @@ void SDRPostThread::run() { if (iqVisualQueue != NULL && iqVisualQueue->empty()) { DemodulatorThreadIQData *visualDataOut = visualDataBuffers.getBuffer(); + visualDataOut->busy_rw.lock(); visualDataOut->setRefCount(1); if (visualDataOut->data.size() < num_vis_samples) { @@ -130,6 +131,7 @@ void SDRPostThread::run() { visualDataOut->sampleRate = data_in->sampleRate; visualDataOut->data.assign(dataOut.begin(), dataOut.begin() + num_vis_samples); + visualDataOut->busy_rw.unlock(); iqVisualQueue->push(visualDataOut); }