diff --git a/src/dmr_bs.c b/src/dmr_bs.c index 84f0d1e..80a9c4d 100644 --- a/src/dmr_bs.c +++ b/src/dmr_bs.c @@ -285,10 +285,12 @@ void dmrBS (dsd_opts * opts, dsd_state * state) if (internalslot == 0) { vc1 = 1; + state->DMRvcL = 0; //reset here if internal sync forces reset } if (internalslot == 1) { vc2 = 1; + state->DMRvcR = 0; //reset here if internal sync forces reset } } @@ -350,6 +352,17 @@ void dmrBS (dsd_opts * opts, dsd_state * state) goto SKIP; } + //extra check to see if we have missed a voice/data frame sync at this point and then exit if required + if (opts->aggressive_framesync == 1) + { + //extremely aggressive + if ( vc1 > 7 || vc2 > 7 ) + { + goto END; + } + + } + //only play voice on no data sync if (strcmp (sync, DMR_BS_DATA_SYNC) != 0) { @@ -563,22 +576,6 @@ void dmrBS (dsd_opts * opts, dsd_state * state) { goto END; } - //using these conditions may cause excessive resyncs IF bad signal, - //but still better than getting stuck in a wonk wonk loop for too long. - //set for more aggressive or less aggressive resync during accumulated playback errs - if (opts->aggressive_framesync == 1) - { - //errors caused due to playing MBE files out of sync, break loop - if (state->errs > 2 || state->errsR > 2) - { - //goto END; // - } - //errors caused due to playing MBE files out of sync, break loop - if (state->errs2 > 4 || state->errs2R > 4) - { - goto END; // - } - } //earlier skip conditions teleport us here to process further skip conditions before restarting while loop SKIP: diff --git a/src/dmr_ms.c b/src/dmr_ms.c index a46c688..5b4c079 100644 --- a/src/dmr_ms.c +++ b/src/dmr_ms.c @@ -272,12 +272,14 @@ void dmrMS (dsd_opts * opts, dsd_state * state) if (internalslot == 0) { vc1 = 1; + state->DMRvcL = 0; //reset here if jitter/sync forces reset fprintf (stderr, "MS Slot 1 Voice Sync \n"); } if (internalslot == 1) { vc2 = 1; + state->DMRvcR = 0; //reset here if jitter/sync forces reset } state->dmr_ms_mode = 1; //set to 1 here?? diff --git a/src/dsd_frame_sync.c b/src/dsd_frame_sync.c index 272cc17..280c3a1 100644 --- a/src/dsd_frame_sync.c +++ b/src/dsd_frame_sync.c @@ -1304,7 +1304,7 @@ getFrameSync (dsd_opts * opts, dsd_state * state) if (state->samplesPerSymbol == 20) { //sprintf (state->ftype, " NXDN48 "); - sprintf (state->ftype, " NXDN48"); + sprintf (state->ftype, "NXDN48 "); if (opts->errorbars == 1) { //printFrameSync (opts, state, " +NXDN48 ", synctest_pos + 1, modulation); diff --git a/src/dsd_mbe.c b/src/dsd_mbe.c index 577b5b2..c1f7d07 100644 --- a/src/dsd_mbe.c +++ b/src/dsd_mbe.c @@ -313,9 +313,9 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a } //sanity check - if (state->DMRvcL > 18) + if (state->DMRvcL > 17) //18 { - state->DMRvcL = 18; + state->DMRvcL = 17; //18 } pos = state->DMRvcL * 49; @@ -408,9 +408,9 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a } //sanity check - if (state->DMRvcR > 18) + if (state->DMRvcR > 17) //18 { - state->DMRvcR = 18; + state->DMRvcR = 17; //18 } pos = state->DMRvcR * 49; diff --git a/src/p25_p2.c b/src/p25_p2.c index 2919630..7fccaa1 100644 --- a/src/p25_p2.c +++ b/src/p25_p2.c @@ -200,7 +200,7 @@ void process_FACCHc (dsd_opts * opts, dsd_state * state) } else { - fprintf(stderr, " R-S ERR Fc"); + fprintf (stderr, " R-S ERR Fc"); if (state->currentslot == 0) state->dmrburstL = 13; else state->dmrburstR = 13; } @@ -254,7 +254,7 @@ void process_FACCHs (dsd_opts * opts, dsd_state * state) } else { - fprintf(stderr, " R-S ERR Fs"); + fprintf (stderr, " R-S ERR Fs"); if (state->currentslot == 0) state->dmrburstL = 13; else state->dmrburstR = 13; } @@ -303,7 +303,7 @@ void process_SACCHc (dsd_opts * opts, dsd_state * state) } else { - fprintf(stderr, " R-S ERR Sc"); + fprintf (stderr, " R-S ERR Sc"); // if (state->currentslot == 0) state->dmrburstL = 13; // else state->dmrburstR = 13; } @@ -353,7 +353,7 @@ void process_SACCHs (dsd_opts * opts, dsd_state * state) } else { - fprintf(stderr, " R-S ERR Ss"); + fprintf (stderr, " R-S ERR Ss"); // if (state->currentslot == 0) state->dmrburstL = 13; // else state->dmrburstR = 13; } @@ -538,7 +538,7 @@ void process_ESS (dsd_opts * opts, dsd_state * state) fprintf (stderr, " ALG ID 0x%02X", state->payload_algid); fprintf (stderr, " KEY ID 0x%04X", state->payload_keyid); fprintf (stderr, " MI 0x%016llX", state->payload_miP); - fprintf(stderr, " ESSB"); + fprintf (stderr, " ESSB"); } } @@ -553,7 +553,7 @@ void process_ESS (dsd_opts * opts, dsd_state * state) fprintf (stderr, " ALG ID 0x%02X", state->payload_algidR); fprintf (stderr, " KEY ID 0x%04X", state->payload_keyidR); fprintf (stderr, " MI 0x%016llX", state->payload_miN); - fprintf(stderr, " ESSB"); + fprintf (stderr, " ESSB"); } }