From: John Melton - G0ORX/N6LYT Date: Thu, 10 Nov 2016 22:00:03 +0000 (+0000) Subject: fixed gpio mic gain. used mic gain to adjust mic input when FreeDV. changed font... X-Git-Url: https://git.rkrishnan.org/pf/frontends/...?a=commitdiff_plain;h=3ecaadca369d3c3e84c49fd498d6504ad277e546;p=pihpsdr.git fixed gpio mic gain. used mic gain to adjust mic input when FreeDV. changed font size in meter. --- diff --git a/gpio.c b/gpio.c index af4859d..c542f75 100644 --- 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 3f7fb7e..0b36cee 100644 --- 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); diff --git a/new_protocol.c b/new_protocol.c index 4935301..36bfab0 100644 --- a/new_protocol.c +++ b/new_protocol.c @@ -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