From 6a01c9d426da66bcacda0508447b31f5919c30b4 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Mon, 30 Nov 2020 17:43:53 +0100 Subject: [PATCH] trying to fix underrun when switching sdr --- audio_sink/src/main.cpp | 4 ++-- core/src/core.cpp | 29 +++++++++++++++-------------- core/src/gui/main_window.cpp | 11 ++++------- root_dev/module_list.json | 16 ++++++++-------- 4 files changed, 29 insertions(+), 31 deletions(-) diff --git a/audio_sink/src/main.cpp b/audio_sink/src/main.cpp index dd05a4c6..bb7d3c00 100644 --- a/audio_sink/src/main.cpp +++ b/audio_sink/src/main.cpp @@ -145,12 +145,12 @@ private: int bufferSize = sampleRate / 60.0f; if (dev->channels == 2) { - stereoRB.data.setMaxLatency(bufferSize * 2); + stereoRB.data.setMaxLatency(bufferSize * 3); stereoRB.start(); err = Pa_OpenStream(&stream, NULL, &outputParams, sampleRate, bufferSize, 0, _stereo_cb, this); } else { - monoRB.data.setMaxLatency(bufferSize * 2); + monoRB.data.setMaxLatency(bufferSize * 3); monoRB.start(); err = Pa_OpenStream(&stream, NULL, &outputParams, sampleRate, bufferSize, 0, _mono_cb, this); } diff --git a/core/src/core.cpp b/core/src/core.cpp index 025e1a40..ddd34286 100644 --- a/core/src/core.cpp +++ b/core/src/core.cpp @@ -155,23 +155,24 @@ int sdrpp_main() { // ==================================================== - // // glfwPollEvents(); - // ImGui_ImplOpenGL3_NewFrame(); - // // ImGui_ImplGlfw_NewFrame(); - // // ImGui::NewFrame(); + glfwPollEvents(); + ImGui_ImplOpenGL3_NewFrame(); + ImGui_ImplGlfw_NewFrame(); + ImGui::NewFrame(); - // // ImGui::ShowDemoWindow(); + ImGui::Begin("Main", NULL, WINDOW_FLAGS); + ImGui::ShowDemoWindow(); + ImGui::End(); - // // ImGui::Render(); - // int display_w, display_h; - // glfwGetFramebufferSize(window, &display_w, &display_h); - // glViewport(0, 0, display_w, display_h); - // glClearColor(0.0666f, 0.0666f, 0.0666f, 1.0f); - // //glClearColor(0.9f, 0.9f, 0.9f, 1.0f); - // glClear(GL_COLOR_BUFFER_BIT); - // // ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); + ImGui::Render(); + int display_w, display_h; + glfwGetFramebufferSize(window, &display_w, &display_h); + glViewport(0, 0, display_w, display_h); + glClearColor(0.0666f, 0.0666f, 0.0666f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); - // glfwSwapBuffers(window); + glfwSwapBuffers(window); // ==================================================== spdlog::info("Loading icons"); diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 0352c2e0..7d7598e6 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -119,17 +119,14 @@ void windowInit() { bandplanmenu::init(); displaymenu::init(); - // Load last source configuration - // Also add a loading screen - // Adjustable "snap to grid" for each VFO - // Finish the recorder module + // TODO for 0.2.5 + // Add a loading screen + // Add "select folder" option for the recorder module // Add squelsh - // Bandwidth ajustment // CW and RAW modes; // Bring VFO to a visible place when changing sample rate if it's smaller - // Add save config for modules - // Do VFO in two steps: First sample rate conversion, then filtering + // TODO for 0.2.6 // And a module add/remove/change order menu // Update UI settings diff --git a/root_dev/module_list.json b/root_dev/module_list.json index 360427f9..bacdf9ce 100644 --- a/root_dev/module_list.json +++ b/root_dev/module_list.json @@ -1,10 +1,10 @@ { - "Radio": "./radio/Release/radio.dll", - "Recorder": "./recorder/Release/recorder.dll", - "Soapy": "./soapy/Release/soapy.dll", - "RTLTCPSource": "./rtl_tcp_source/Release/rtl_tcp_source.dll", - "FileSource": "./file_source/Release/file_source.dll", - "RX888Source": "./rx888_source/Release/rx888_source.dll", - "PlutoSDRSource": "./plutosdr_source/Release/plutosdr_source.dll", - "AudioSink": "./audio_sink/Release/audio_sink.dll" + "Radio": "./radio/RelWithDebInfo/radio.dll", + "Recorder": "./recorder/RelWithDebInfo/recorder.dll", + "Soapy": "./soapy/RelWithDebInfo/soapy.dll", + "RTLTCPSource": "./rtl_tcp_source/RelWithDebInfo/rtl_tcp_source.dll", + "FileSource": "./file_source/RelWithDebInfo/file_source.dll", + "RX888Source": "./rx888_source/RelWithDebInfo/rx888_source.dll", + "PlutoSDRSource": "./plutosdr_source/RelWithDebInfo/plutosdr_source.dll", + "AudioSink": "./audio_sink/RelWithDebInfo/audio_sink.dll" }