more fixes

This commit is contained in:
Ryzerth 2020-12-04 20:12:36 +01:00
parent 9805e4a395
commit 92b77904f6
11 changed files with 52 additions and 26 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ build/
*.zip
*.wav
.DS_Store
sdrpp_v0.2.5_beta_x64

View File

@ -145,12 +145,12 @@ private:
int bufferSize = sampleRate / 60.0f;
if (dev->channels == 2) {
stereoRB.data.setMaxLatency(bufferSize * 3);
stereoRB.data.setMaxLatency(bufferSize * 2);
stereoRB.start();
err = Pa_OpenStream(&stream, NULL, &outputParams, sampleRate, bufferSize, 0, _stereo_cb, this);
}
else {
monoRB.data.setMaxLatency(bufferSize * 3);
monoRB.data.setMaxLatency(bufferSize * 2);
monoRB.start();
err = Pa_OpenStream(&stream, NULL, &outputParams, sampleRate, bufferSize, 0, _mono_cb, this);
}

View File

@ -99,7 +99,6 @@ int sdrpp_main() {
if (window == NULL)
return 1;
glfwMakeContextCurrent(window);
glfwSwapInterval(1); // Enable vsync
#if (GLFW_VERSION_MAJOR == 3) && (GLFW_VERSION_MINOR >= 3)
if (maximized) {
@ -240,6 +239,7 @@ int sdrpp_main() {
glClear(GL_COLOR_BUFFER_BIT);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
glfwSwapInterval(1); // Enable vsync
glfwSwapBuffers(window);
}

View File

@ -92,7 +92,7 @@ namespace dsp {
generic_block<AGC>::registerOutput(&out);
}
void setInputSize(stream<float>* in) {
void setInput(stream<float>* in) {
std::lock_guard<std::mutex> lck(generic_block<AGC>::ctrlMtx);
generic_block<AGC>::tempStop();
generic_block<AGC>::unregisterInput(_in);

View File

@ -62,6 +62,8 @@
#if !defined(DUK_CONFIG_H_INCLUDED)
#define DUK_CONFIG_H_INCLUDED
#define DUK_USE_DATE_NOW_WINDOWS
/*
* Intermediate helper defines
*/

View File

@ -127,6 +127,7 @@ void windowInit() {
// Add squelsh
// CW and RAW modes;
// Bring VFO to a visible place when changing sample rate if it's smaller
// Use DUK_USE_DATE_NOW_WINDOWS for windows 7 support
// TODO for 0.2.6
// And a module add/remove/change order menu

View File

@ -114,24 +114,24 @@ private:
ImGui::EndGroup();
ImGui::Text("WFM Deemphasis");
ImGui::SameLine();
ImGui::PushItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_deemp_select_", _this->name), &_this->deemp, DEEMP_LIST)) {
_this->sigPath.setDeemphasis(_this->deemp);
if (_this->demod == 1) {
ImGui::Text("WFM Deemphasis");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
if (ImGui::Combo(CONCAT("##_deemp_select_", _this->name), &_this->deemp, DEEMP_LIST)) {
_this->sigPath.setDeemphasis(_this->deemp);
}
}
ImGui::PopItemWidth();
ImGui::Text("Bandwidth");
ImGui::SameLine();
ImGui::PushItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());
if (ImGui::InputInt(CONCAT("##_bw_select_", _this->name), &_this->bandWidth, 100, 1000)) {
_this->bandWidth = std::clamp<int>(_this->bandWidth, _this->bandWidthMin, _this->bandWidthMax);
_this->sigPath.setBandwidth(_this->bandWidth);
}
ImGui::PopItemWidth();
ImGui::Text("Snap Interval");
ImGui::SameLine();
ImGui::SetNextItemWidth(menuColumnWidth - ImGui::GetCursorPosX());

View File

@ -84,12 +84,15 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
amDemod.stop();
}
else if (_demod == DEMOD_USB) {
agc.stop();
ssbDemod.stop();
}
else if (_demod == DEMOD_LSB) {
agc.stop();
ssbDemod.stop();
}
else if (_demod == DEMOD_DSB) {
agc.stop();
ssbDemod.stop();
}
else {
@ -139,6 +142,7 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
else if (demId == DEMOD_AM) {
demodOutputSamplerate = 125000;
vfo->setSampleRate(12500, bandwidth);
agc.setInput(&amDemod.out);
audioResamp.setInput(&agc.out);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
@ -157,7 +161,8 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
demodOutputSamplerate = 6000;
vfo->setSampleRate(6000, bandwidth);
ssbDemod.setMode(dsp::SSBDemod::MODE_USB);
audioResamp.setInput(&ssbDemod.out);
agc.setInput(&ssbDemod.out);
audioResamp.setInput(&agc.out);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
audioResamp.setInSampleRate(6000);
@ -168,13 +173,15 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
deemp.bypass = true;
vfo->setReference(ImGui::WaterfallVFO::REF_LOWER);
agc.start();
ssbDemod.start();
}
else if (demId == DEMOD_LSB) {
demodOutputSamplerate = 6000;
vfo->setSampleRate(6000, bandwidth);
ssbDemod.setMode(dsp::SSBDemod::MODE_LSB);
audioResamp.setInput(&ssbDemod.out);
agc.setInput(&ssbDemod.out);
audioResamp.setInput(&agc.out);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
audioResamp.setInSampleRate(6000);
@ -185,13 +192,15 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
deemp.bypass = true;
vfo->setReference(ImGui::WaterfallVFO::REF_UPPER);
agc.start();
ssbDemod.start();
}
else if (demId == DEMOD_DSB) {
demodOutputSamplerate = 6000;
vfo->setSampleRate(6000, bandwidth);
ssbDemod.setMode(dsp::SSBDemod::MODE_DSB);
audioResamp.setInput(&ssbDemod.out);
agc.setInput(&ssbDemod.out);
audioResamp.setInput(&agc.out);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
audioResamp.setInSampleRate(6000);
@ -202,6 +211,7 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
deemp.bypass = true;
vfo->setReference(ImGui::WaterfallVFO::REF_CENTER);
agc.start();
ssbDemod.start();
}
else {

View File

@ -21,10 +21,11 @@
"fftHeight": 296,
"frequency": 99000000,
"max": 0.0,
"maximized": false,
"maximized": true,
"menuOrder": [
"Source",
"Radio",
"Radio 1",
"Radio 2",
"Recorder",
"Sinks",
"Audio",
@ -33,16 +34,26 @@
"Display"
],
"menuWidth": 300,
"min": -70.5882339477539,
"min": -53.676475524902344,
"offset": 0.0,
"showWaterfall": true,
"source": "PlutoSDR",
"source": "SoapySDR",
"sourceSettings": {},
"streams": {
"Radio": {
"muted": false,
"sink": "Audio",
"volume": 0.5306122303009033
},
"Radio 1": {
"muted": true,
"sink": "Audio",
"volume": 0.65625
"volume": 0.625
},
"Radio 2": {
"muted": false,
"sink": "Audio",
"volume": 1.0
}
},
"windowSize": {

View File

@ -1,5 +1,6 @@
{
"Radio": "./radio/Release/radio.dll",
"Radio 1": "./radio/Release/radio.dll",
"Radio 2": "./radio/Release/radio.dll",
"Recorder": "./recorder/Release/recorder.dll",
"Soapy": "./soapy/Release/soapy.dll",
"RTLTCPSource": "./rtl_tcp_source/Release/rtl_tcp_source.dll",

View File

@ -1,5 +1,5 @@
{
"device": "Generic RTL2832U OEM :: 00000001",
"device": "HackRF One #0 901868dc282c8f8b",
"devices": {
"": {
"gains": {
@ -29,10 +29,10 @@
"HackRF One #0 901868dc282c8f8b": {
"gains": {
"AMP": 0.0,
"LNA": 24.711999893188477,
"VGA": 21.749000549316406
"LNA": 23.415000915527344,
"VGA": 16.332000732421875
},
"sampleRate": 2000000.0
"sampleRate": 8000000.0
},
"Microphone (Realtek High Definition Audio)": {
"sampleRate": 96000.0