]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
fixed gpio mic gain. used mic gain to adjust mic input when FreeDV. changed font...
authorJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Thu, 10 Nov 2016 22:00:03 +0000 (22:00 +0000)
committerJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Thu, 10 Nov 2016 22:00:03 +0000 (22:00 +0000)
gpio.c
meter.c
new_protocol.c
old_protocol.c
pihpsdr
release/pihpsdr.tar
release/pihpsdr/libwdsp.so
release/pihpsdr/pihpsdr
release/pihpsdr/pihpsdr.desktop

diff --git a/gpio.c b/gpio.c
index af4859d25fe70ee7718431078a4d81ee25c805d7..c542f755948027850b839725e92146e8b163e0d5 100644 (file)
--- a/gpio.c
+++ b/gpio.c
@@ -749,7 +749,8 @@ static int af_encoder_changed(void *data) {
     if(function || isTransmitting()) {
       // mic gain
       double gain=mic_gain;
-      gain+=(double)pos/100.0;
+      //gain+=(double)pos/100.0;
+      gain+=(double)pos;
       if(gain<-10.0) {
         gain=-10.0;
       } else if(gain>50.0) {
diff --git a/meter.c b/meter.c
index 3f7fb7e49d109475d42155acf21fbcf49463521a..0b36ceed1df6fc77ba3d8a0dd0e66e17176ad595 100644 (file)
--- a/meter.c
+++ b/meter.c
@@ -302,7 +302,7 @@ void meter_update(int meter_type,double value,double reverse,double exciter,doub
         text_location=offset+(db*114)+5;
       }
 
-      cairo_set_font_size(cr, 16);
+      cairo_set_font_size(cr, 12);
       sprintf(sf,"%d dBm",(int)level);
       cairo_move_to(cr, text_location, 45);
       cairo_show_text(cr, sf);
@@ -314,7 +314,7 @@ void meter_update(int meter_type,double value,double reverse,double exciter,doub
         } else {
           cairo_set_source_rgb(cr, 1, 0, 0);
         }
-        cairo_set_font_size(cr, 16);
+        cairo_set_font_size(cr, 12);
         sprintf(sf,"SNR: %3.2f",freedv_snr);
         cairo_move_to(cr, text_location, 30);
         cairo_show_text(cr, sf);
@@ -346,7 +346,7 @@ void meter_update(int meter_type,double value,double reverse,double exciter,doub
       cairo_fill(cr);
 
       cairo_set_source_rgb(cr, 0, 1, 0);
-      cairo_set_font_size(cr, 16);
+      cairo_set_font_size(cr, 12);
       sprintf(sf,"Level: %d",(int)value);
       cairo_move_to(cr, 210, 45);
       cairo_show_text(cr, sf);
@@ -358,7 +358,7 @@ void meter_update(int meter_type,double value,double reverse,double exciter,doub
       cairo_select_font_face(cr, "FreeMono",
             CAIRO_FONT_SLANT_NORMAL,
             CAIRO_FONT_WEIGHT_BOLD);
-      cairo_set_font_size(cr, 18);
+      cairo_set_font_size(cr, 12);
 
       if((int)value>max_level || max_count==10) {
           max_level=(int)value;
@@ -374,7 +374,7 @@ void meter_update(int meter_type,double value,double reverse,double exciter,doub
       cairo_select_font_face(cr, "FreeMono",
             CAIRO_FONT_SLANT_NORMAL,
             CAIRO_FONT_WEIGHT_BOLD);
-      cairo_set_font_size(cr, 18);
+      cairo_set_font_size(cr, 12);
       sprintf(sf,"SWR: %1.1f:1",swr);
       cairo_move_to(cr, 10, 55);
       cairo_show_text(cr, sf);
index 4935301891d2194ea6e41b2e21b39ca8ea10ca13..36bfab07b2e5383eebff7b2c0d462953dc3e6599 100644 (file)
@@ -883,7 +883,8 @@ static void process_mic_data(unsigned char *buffer) {
                 micsample  = (int)((signed char) buffer[b++]) << 8;
                 micsample  |= (int)((unsigned char)buffer[b++] & 0xFF);
                 if(freedv_samples==0) { // 48K to 8K
-                    int modem_samples=mod_sample_freedv(micsample);
+                    int sample=(int)((double)micsample*pow(10.0, mic_gain / 20.0));
+                    int modem_samples=mod_sample_freedv(sample);
                     if(modem_samples!=0) {
                       for(s=0;s<modem_samples;s++) {
                         for(j=0;j<freedv_resample;j++) {  // 8K to 48K
index aeb1536473c301cd45e98435bf28e41db7757388..6304d6bef280893c03f2c4c5b2885c657fef9587 100644 (file)
@@ -453,7 +453,8 @@ static void process_ozy_input_buffer(char  *buffer) {
 #ifdef FREEDV
         if(mode==modeFREEDV && !tune) {
           if(freedv_samples==0) {
-            int modem_samples=mod_sample_freedv(mic_sample);
+            int sample=(int)((double)mic_sample*pow(10.0, mic_gain / 20.0));
+            int modem_samples=mod_sample_freedv(sample);
             if(modem_samples!=0) {
               int s;
               for(s=0;s<modem_samples;s++) {
diff --git a/pihpsdr b/pihpsdr
index a94591008af548ae1a59fa8a40f93f7720513575..d69c3c4e5b24bbef115655b1b6210e9139fc667f 100755 (executable)
Binary files a/pihpsdr and b/pihpsdr differ
index ae8906fd66ba2659a8550756af1f7129e7e7876f..3a1520650076709384ff56e2ad3be09473517be0 100644 (file)
Binary files a/release/pihpsdr.tar and b/release/pihpsdr.tar differ
index 82abe267c0767e0caaa4b7938daf3aa702090b7e..0ff7a89ed91847e3dbf04c4e0ad0ea9fdf19c5fd 100755 (executable)
Binary files a/release/pihpsdr/libwdsp.so and b/release/pihpsdr/libwdsp.so differ
index 1fc1b64f078604739e01866464b4dfbd58b44238..d69c3c4e5b24bbef115655b1b6210e9139fc667f 100755 (executable)
Binary files a/release/pihpsdr/pihpsdr and b/release/pihpsdr/pihpsdr differ
index 62f64180303ce7797c835ed7c06e8f295d85ee2e..aafd4d09d09969bd9ff1c363203a556de51e5f5d 100755 (executable)
@@ -8,3 +8,4 @@ Name[en_GB]=pihpsdr
 Exec=/home/pi/pihpsdr/start_pihpsdr.sh
 Name=pihpsdr
 Icon=/home/pi/pihpsdr/hpsdr_icon.png
+Categories=RadioMenuCategory