From f6bb325daca32f96ca38700a8f717ce6027d0852 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Wed, 14 Dec 2022 18:06:50 -0500 Subject: [PATCH] DMR RTL Trunking Code Fix; --- src/dmr_csbk.c | 52 ++++++++++++++++++++++++++------------------------ src/dsd_main.c | 2 +- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/dmr_csbk.c b/src/dmr_csbk.c index 1467388..bdac93f 100644 --- a/src/dmr_csbk.c +++ b/src/dmr_csbk.c @@ -176,14 +176,15 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 state->p25_vc_freq[0] = state->p25_vc_freq[1] = freq; opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop } - } - //rtl_udp - else if (opts->audio_in_type == 3) - { - rtl_udp_tune (opts, state, freq); - state->p25_vc_freq[0] = state->p25_vc_freq[1] = freq; - opts->p25_is_tuned = 1; + //rtl_udp + else if (opts->audio_in_type == 3) + { + rtl_udp_tune (opts, state, freq); + state->p25_vc_freq[0] = state->p25_vc_freq[1] = freq; + opts->p25_is_tuned = 1; + } + } } } @@ -507,22 +508,22 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop j = 11; //break loop } - } - //rtl_udp - else if (opts->audio_in_type == 3) - { - rtl_udp_tune (opts, state, state->trunk_chan_map[j+1]); - state->p25_vc_freq[0] = state->p25_vc_freq[1] = state->trunk_chan_map[j+1]; - opts->p25_is_tuned = 1; - j = 11; //break loop + //rtl_udp + else if (opts->audio_in_type == 3) + { + rtl_udp_tune (opts, state, state->trunk_chan_map[j+1]); + state->p25_vc_freq[0] = state->p25_vc_freq[1] = state->trunk_chan_map[j+1]; + opts->p25_is_tuned = 1; + j = 11; //break loop + } + } } } } - } } @@ -610,16 +611,17 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 state->is_con_plus = 1; //flag on state->last_vc_sync_time = time(NULL); //bugfix: set sync here so we don't immediately tune back to CC constantly. } - } - //rtl_udp - else if (opts->audio_in_type == 3) - { - rtl_udp_tune (opts, state, state->trunk_chan_map[lcn]); - state->p25_vc_freq[0] = state->p25_vc_freq[1] = state->trunk_chan_map[lcn]; - opts->p25_is_tuned = 1; - state->is_con_plus = 1; //flag on - state->last_vc_sync_time = time(NULL); //bugfix: set sync here so we don't immediately tune back to CC constantly. + //rtl_udp + else if (opts->audio_in_type == 3) + { + rtl_udp_tune (opts, state, state->trunk_chan_map[lcn]); + state->p25_vc_freq[0] = state->p25_vc_freq[1] = state->trunk_chan_map[lcn]; + opts->p25_is_tuned = 1; + state->is_con_plus = 1; //flag on + state->last_vc_sync_time = time(NULL); //bugfix: set sync here so we don't immediately tune back to CC constantly. + } + } } } diff --git a/src/dsd_main.c b/src/dsd_main.c index 77666ac..8481ad3 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -409,7 +409,7 @@ initOpts (dsd_opts * opts) opts->rtl_dev_index = 0; //choose which device we want by index number opts->rtl_gain_value = 26; //mid value, 0 - AGC (not recommended) 49 highest value opts->rtl_squelch_level = 0; //fully open by default, want to specify level for things like NXDN with false positives - opts->rtl_volume_multiplier = 3; //sample multiplier; 3 seems like a good value + opts->rtl_volume_multiplier = 1; //sample multiplier; 1 seems like a good value opts->rtl_udp_port = 6020; //set UDP port for RTL remote opts->rtl_bandwidth = 12; //changed recommended default to 12, 24 for ProVoice opts->rtlsdr_ppm_error = 0; //initialize ppm with 0 value; bug reported by N.