From 3c7e817bfc8e706d7f8ab81c73e71e6986ae26ce Mon Sep 17 00:00:00 2001 From: drowe67 Date: Thu, 3 May 2018 21:19:30 +0000 Subject: [PATCH] high latency PortAudio option, fixed input overlows on rx on low power X200 machine, -ve SNR simulation in Tools-Options git-svn-id: https://svn.code.sf.net/p/freetel/code@3569 01035d8c-6547-0410-b346-abe4f91aad63 --- freedv-dev/src/dlg_options.cpp | 5 +++-- freedv-dev/src/fdmdv2_main.cpp | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/freedv-dev/src/dlg_options.cpp b/freedv-dev/src/dlg_options.cpp index 8fed24df..eb59403b 100644 --- a/freedv-dev/src/dlg_options.cpp +++ b/freedv-dev/src/dlg_options.cpp @@ -131,7 +131,7 @@ OptionsDlg::OptionsDlg(wxWindow* parent, wxWindowID id, const wxString& title, c m_ckboxChannelNoise = new wxCheckBox(this, wxID_ANY, _("Channel Noise SNR (dB):"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE); sbSizer_testFrames->Add(m_ckboxChannelNoise, 0, wxALIGN_LEFT, 0); - m_txtNoiseSNR = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(30,-1), 0, wxTextValidator(wxFILTER_DIGITS)); + m_txtNoiseSNR = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(30,-1), 0, wxTextValidator(wxFILTER_NUMERIC)); sbSizer_testFrames->Add(m_txtNoiseSNR, 0, wxALIGN_LEFT, 0); m_ckboxAttnCarrierEn = new wxCheckBox(this, wxID_ANY, _("Attn Carrier Carrier:"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE); @@ -407,7 +407,8 @@ void OptionsDlg::ExchangeData(int inout, bool storePersistent) long noise_snr; m_txtNoiseSNR->GetValue().ToLong(&noise_snr); wxGetApp().m_noise_snr = (int)noise_snr; - + //fprintf(stderr, "noise_snr: %d\n", (int)noise_snr); + wxGetApp().m_tone = m_ckboxTone->GetValue(); long tone_freq_hz, tone_amplitude; m_txtToneFreqHz->GetValue().ToLong(&tone_freq_hz); diff --git a/freedv-dev/src/fdmdv2_main.cpp b/freedv-dev/src/fdmdv2_main.cpp index ee0718f5..4ad81cd8 100644 --- a/freedv-dev/src/fdmdv2_main.cpp +++ b/freedv-dev/src/fdmdv2_main.cpp @@ -942,7 +942,7 @@ void MainFrame::OnTimer(wxTimerEvent &evt) char snr[15]; sprintf(snr, "%d", (int)(g_snr+0.5)); // round to nearest dB - //printf("snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est, m_snrBeta, g_snr, snr_limited); + //fprintf(stderr, "snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est, m_snrBeta, g_snr, snr_limited); wxString snr_string(snr); m_textSNR->SetLabel(snr_string); @@ -2598,7 +2598,7 @@ void MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDev if(inDevice != paNoDevice) { pa->setInputChannelCount(inputChannels); // stereo input pa->setInputSampleFormat(PA_SAMPLE_TYPE); - pa->setInputLatency(pa->getInputDefaultLowLatency()); + pa->setInputLatency(pa->getInputDefaultHighLatency()); fprintf(stderr,"PA in; low: %f high: %f\n", pa->getInputDefaultLowLatency(), pa->getInputDefaultHighLatency()); pa->setInputHostApiStreamInfo(NULL); } @@ -2611,7 +2611,7 @@ void MainFrame::initPortAudioDevice(PortAudioWrap *pa, int inDevice, int outDev if(outDevice != paNoDevice) { pa->setOutputChannelCount(2); // stereo output pa->setOutputSampleFormat(PA_SAMPLE_TYPE); - pa->setOutputLatency(pa->getOutputDefaultLowLatency()); + pa->setOutputLatency(pa->getOutputDefaultHighLatency()); fprintf(stderr,"PA out; low: %f high: %f\n", pa->getOutputDefaultLowLatency(), pa->getOutputDefaultHighLatency()); pa->setOutputHostApiStreamInfo(NULL); } -- 2.25.1