high latency PortAudio option, fixed input overlows on rx on low power X200 machine...
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 3 May 2018 21:19:30 +0000 (21:19 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 3 May 2018 21:19:30 +0000 (21:19 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3569 01035d8c-6547-0410-b346-abe4f91aad63

freedv-dev/src/dlg_options.cpp
freedv-dev/src/fdmdv2_main.cpp

index 8fed24dfa9fce9655f0790a4be95e85d1246c417..eb59403b1791f1bb1528f8fcc2481352b8a36c75 100644 (file)
@@ -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);
index ee0718f5d7580e2e154110d72c1ab872f20d96f1..4ad81cd89d98f06dc3983dd3efa6227f5c6bb7b3 100644 (file)
@@ -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);
     }