]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
fixed missing call to WDSP TX Analyzer when sample rate changed
authorJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Sat, 20 Aug 2016 07:54:36 +0000 (07:54 +0000)
committerJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Sat, 20 Aug 2016 07:54:36 +0000 (07:54 +0000)
pihpsdr
release/pihpsdr.tar
release/pihpsdr/pihpsdr
wdsp_init.c

diff --git a/pihpsdr b/pihpsdr
index 31111250ba6530876d5a6565b73e8d65de629a04..bfef73a50b596edfa51430502d7063541716bbe3 100755 (executable)
Binary files a/pihpsdr and b/pihpsdr differ
index 5b5e2a634fec13a687d7f1846357109f421beeae..fdadee6131a7c4facb9ff501b2336bedec2df829 100644 (file)
Binary files a/release/pihpsdr.tar and b/release/pihpsdr.tar differ
index 31111250ba6530876d5a6565b73e8d65de629a04..bfef73a50b596edfa51430502d7063541716bbe3 100755 (executable)
Binary files a/release/pihpsdr/pihpsdr and b/release/pihpsdr/pihpsdr differ
index 87df8fa43f0938983aa9acbd9797bd814a0340de..70a2b60f14884493a269f5a7cb32efad29192173 100644 (file)
@@ -79,6 +79,23 @@ static int SPECTRUM_UPDATES_PER_SECOND=10;
 
 static void initAnalyzer(int channel,int buffer_size);
 
+static void calc_tx_buffer_size() {
+  switch(sample_rate) {
+    case 48000:
+      tx_buffer_size=BUFFER_SIZE;
+      break;
+    case 96000:
+      tx_buffer_size=BUFFER_SIZE/2;
+      break;
+    case 192000:
+      tx_buffer_size=BUFFER_SIZE/4;
+      break;
+    case 384000:
+      tx_buffer_size=BUFFER_SIZE/8;
+      break;
+  }
+}
+
 void setRXMode(int rx,int m) {
 fprintf(stderr,"SetRXAMode: rx=%d mode=%d\n",rx,m);
   SetRXAMode(rx, m);
@@ -320,20 +337,8 @@ void wdsp_init(int rx,int pixels,int protocol) {
     while (gtk_events_pending ())
       gtk_main_iteration ();
 
-    switch(sample_rate) {
-      case 48000:
-        tx_buffer_size=BUFFER_SIZE;
-        break;
-      case 96000:
-        tx_buffer_size=BUFFER_SIZE/2;
-        break;
-      case 192000:
-        tx_buffer_size=BUFFER_SIZE/4;
-        break;
-      case 384000:
-        tx_buffer_size=BUFFER_SIZE/8;
-        break;
-    }
+    calc_tx_buffer_size();
+
     fprintf(stderr,"OpenChannel %d buffer_size=%d fft_size=%d sample_rate=%d dspRate=%d outputRate=%d\n",
                 CHANNEL_TX,
                 buffer_size,
@@ -394,6 +399,8 @@ void wdsp_init(int rx,int pixels,int protocol) {
 
 void wdsp_new_sample_rate(int rate) {
   SetChannelState(CHANNEL_TX,0,0);
+  calc_tx_buffer_size();
+  initAnalyzer(CHANNEL_TX,tx_buffer_size);
   SetInputSamplerate(CHANNEL_TX,rate);
   SetChannelState(CHANNEL_TX,1,0);