From b0081221490488e9c2fd928c09ac7b342c7b1efb Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Thu, 18 May 2023 10:22:05 -0400 Subject: [PATCH] More RTL Tweaks; #125 --- src/dsd_main.c | 6 +++--- src/dsd_ncurses.c | 15 +++++++++------ src/rtl_sdr_fm.cpp | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/dsd_main.c b/src/dsd_main.c index 2eb041c..7dc75e6 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -517,9 +517,9 @@ initOpts (dsd_opts * opts) opts->delay = 0; opts->use_cosine_filter = 1; opts->unmute_encrypted_p25 = 0; - //all RTL user options + //all RTL user options -- enabled AGC by default due to weak signal related issues opts->rtl_dev_index = 0; //choose which device we want by index number - opts->rtl_gain_value = 28; //mid value, 0 - AGC (not recommended) 49 highest value + opts->rtl_gain_value = 0; //mid value, 0 - AGC - 0 to 49 acceptable values opts->rtl_squelch_level = 0; //fully open by default, want to specify level for things like NXDN with false positives opts->rtl_volume_multiplier = 1; //sample multiplier; This multiplies the sample value to produce a higher 'inlvl' opts->rtl_udp_port = 0; //set UDP port for RTL remote -- 0 by default, will be making this optional for some external/legacy use cases (edacs-fm, etc) @@ -1384,7 +1384,7 @@ main (int argc, char **argv) break; case 'z': - sscanf (optarg, "%d", &opts.slot_preference); + sscanf (optarg, "%c", &opts.slot_preference); opts.slot_preference--; //user inputs 1 or 2, internally we want 0 and 1 if (opts.slot_preference > 1) opts.slot_preference = 1; fprintf (stderr, "TDMA (DMR and P2) Slot Voice Preference is Slot %d. \n", opts.slot_preference+1); diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index a401e29..9c5cc03 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2131,12 +2131,15 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) } if (opts->audio_in_type == 3) { - printw ("| RTL2838UHIDIR: %d", opts->rtl_dev_index); - printw (" Gain: %idB", opts->rtl_gain_value); - printw (" PPM: %i", opts->rtlsdr_ppm_error); - printw (" SQ: %i", opts->rtl_squelch_level); - printw (" BW %i kHz", opts->rtl_bandwidth); - printw (" Frequency: %i Hz", opts->rtlsdr_center_freq); + printw ("| RTL Dev: %d;", opts->rtl_dev_index); + if (opts->rtl_gain_value == 0) + printw (" Gain: AGC;"); + else + printw (" Gain: %idB;", opts->rtl_gain_value); + printw (" PPM: %i;", opts->rtlsdr_ppm_error); + printw (" SQ: %i;", opts->rtl_squelch_level); + printw (" BW: %i kHz;", opts->rtl_bandwidth); + printw (" FREQ: %i Hz;", opts->rtlsdr_center_freq); if (opts->rtl_udp_port != 0) printw ("\n| External Tuning on UDP Port: %i", opts->rtl_udp_port); printw ("\n"); } diff --git a/src/rtl_sdr_fm.cpp b/src/rtl_sdr_fm.cpp index dc4f2de..ffcd00e 100644 --- a/src/rtl_sdr_fm.cpp +++ b/src/rtl_sdr_fm.cpp @@ -753,7 +753,7 @@ static void optimal_settings(int freq, int rate) dm->output_scale = 1;} d->freq = (uint32_t)capture_freq; d->rate = (uint32_t)capture_rate; - fprintf (stderr, "Capture Frequency: %i Rate: %i \n", capture_freq, capture_rate); + // fprintf (stderr, "Capture Frequency: %i Rate: %i \n", capture_freq, capture_rate); } static void *controller_thread_fn(void *arg)