From 481dd0adb5e69a6b42adc4fffe20d9526da93815 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Thu, 12 Oct 2023 23:34:40 -0400 Subject: [PATCH] Misc Audio2/Frame Tweaks; --- src/dmr_bs.c | 16 +++++++++++----- src/dsd_main.c | 5 +++++ src/p25p2_frame.c | 4 ++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/dmr_bs.c b/src/dmr_bs.c index 4ceb42f..0ca219b 100644 --- a/src/dmr_bs.c +++ b/src/dmr_bs.c @@ -483,9 +483,9 @@ void dmrBS (dsd_opts * opts, dsd_state * state) //both working now, will need support added for ENC audio and no key //NOTE: We want this to play regardless of whether the slot is voice or data, to play silence in one slot and voice in the second, or voices in both - if (internalslot == 0 && opts->floating_point == 1 && opts->pulse_digi_rate_out == 8000) + if (internalslot == 1 && opts->floating_point == 1 && opts->pulse_digi_rate_out == 8000) playSynthesizedVoiceFS3 (opts, state); //Float Stereo Mix 3v2 - if (internalslot == 0 && opts->floating_point == 0 && opts->pulse_digi_rate_out == 8000) + if (internalslot == 1 && opts->floating_point == 0 && opts->pulse_digi_rate_out == 8000) playSynthesizedVoiceSS3 (opts, state); //Short Stereo Mix 3v2 if (skipcount > 3) //after 3 onsecutive data frames, drop back to getFrameSync and process with dmr_data_sync (need one more in order to push last voice on slot 2 only voice) @@ -788,12 +788,14 @@ void dmrBSBootstrap (dsd_opts * opts, dsd_state * state) { memcpy(state->f_l4[0], state->audio_out_temp_buf, sizeof(state->audio_out_temp_buf)); memcpy(state->s_l4[0], state->s_l, sizeof(state->s_l)); + memcpy(state->s_l4u[0], state->s_lu, sizeof(state->s_lu)); } else { memcpy(state->f_r4[0], state->audio_out_temp_bufR, sizeof(state->audio_out_temp_bufR)); memcpy(state->s_r4[0], state->s_r, sizeof(state->s_r)); + memcpy(state->s_r4u[0], state->s_ru, sizeof(state->s_ru)); } @@ -802,12 +804,14 @@ void dmrBSBootstrap (dsd_opts * opts, dsd_state * state) { memcpy(state->f_l4[1], state->audio_out_temp_buf, sizeof(state->audio_out_temp_buf)); memcpy(state->s_l4[1], state->s_l, sizeof(state->s_l)); + memcpy(state->s_l4u[1], state->s_lu, sizeof(state->s_lu)); } else { memcpy(state->f_r4[1], state->audio_out_temp_bufR, sizeof(state->audio_out_temp_bufR)); memcpy(state->s_r4[1], state->s_r, sizeof(state->s_r)); + memcpy(state->s_r4u[1], state->s_ru, sizeof(state->s_ru)); } processMbeFrame (opts, state, NULL, ambe_fr3, NULL); @@ -815,12 +819,14 @@ void dmrBSBootstrap (dsd_opts * opts, dsd_state * state) { memcpy(state->f_l4[2], state->audio_out_temp_buf, sizeof(state->audio_out_temp_buf)); memcpy(state->s_l4[2], state->s_l, sizeof(state->s_l)); + memcpy(state->s_l4u[2], state->s_lu, sizeof(state->s_lu)); } else { memcpy(state->f_r4[2], state->audio_out_temp_bufR, sizeof(state->audio_out_temp_bufR)); memcpy(state->s_r4[2], state->s_r, sizeof(state->s_r)); + memcpy(state->s_r4u[2], state->s_ru, sizeof(state->s_ru)); } //collect the mi fragment @@ -832,10 +838,10 @@ void dmrBSBootstrap (dsd_opts * opts, dsd_state * state) //update voice sync time for trunking purposes (particularly Con+) if (opts->p25_is_tuned == 1) state->last_vc_sync_time = time(NULL); - //NOTE: Only play on slot 0, if slot 1, then it'll play after the next TDMA frame in the BS loop instead - if (internalslot == 0 && opts->floating_point == 1 && opts->pulse_digi_rate_out == 8000) + //NOTE: Only play on slot 1, if slot 0, then it'll play after the next TDMA frame in the BS loop instead + if (internalslot == 1 && opts->floating_point == 1 && opts->pulse_digi_rate_out == 8000) playSynthesizedVoiceFS3 (opts, state); //Float Stereo Mix 3v2 - if (internalslot == 0 && opts->floating_point == 0 && opts->pulse_digi_rate_out == 8000) + if (internalslot == 1 && opts->floating_point == 0 && opts->pulse_digi_rate_out == 8000) playSynthesizedVoiceSS3 (opts, state); //Short Stereo Mix 3v2 dmrBS (opts, state); //bootstrap into full TDMA frame for BS mode diff --git a/src/dsd_main.c b/src/dsd_main.c index 17fd19d..61a9be6 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -1366,6 +1366,11 @@ liveScanner (dsd_opts * opts, dsd_state * state) if (opts->audio_gain > 50.0f) opts->audio_gain = 50.0f; if (opts->audio_gain < 0.0f) opts->audio_gain = 0.0f; } + else if (opts->audio_gain == 0) + { + state->aout_gain = 15.0f; + state->aout_gainR = 15.0f; + } #ifdef USE_RTLSDR if(opts->audio_in_type == 3) diff --git a/src/p25p2_frame.c b/src/p25p2_frame.c index c1a606c..c391eba 100644 --- a/src/p25p2_frame.c +++ b/src/p25p2_frame.c @@ -941,6 +941,10 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state) //add 360 bits to each counter vc_counter = vc_counter + 360; + //debug enable both slots before playback + // opts->slot1_on = 1; + // opts->slot2_on = 1; + //NOTE: Could be an issue if MAC_SIGNAL onn LCH 1 and voice in LCH 0? It might Stutter? if (sacch == 0 && ts_counter & 1 && opts->floating_point == 1 && opts->pulse_digi_rate_out == 8000) playSynthesizedVoiceFS4 (opts, state);