From ecd91fce797643442ee8d297a61fddc274072a2b Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 12 Apr 2016 04:34:25 +0200 Subject: [PATCH] DSD demod: enhanced DSDplus debugging output --- dsdplus/dmr_data.cpp | 2 +- dsdplus/dmr_voice.cpp | 18 ++++++++++++++++-- dsdplus/dmr_voice.h | 24 +++++++++++++----------- dsdplus/dsd_decoder.cpp | 4 ++-- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/dsdplus/dmr_data.cpp b/dsdplus/dmr_data.cpp index 9c6e2ef42..8826715af 100644 --- a/dsdplus/dmr_data.cpp +++ b/dsdplus/dmr_data.cpp @@ -212,7 +212,7 @@ void DSDDMRData::preProcess() if (m_dsdDecoder->m_opts.errorbars == 1) { - fprintf(stderr, "%s %s ", m_dsdDecoder->m_state.slot0light, m_dsdDecoder->m_state.slot1light); + fprintf(stderr, "%s %s\n", m_dsdDecoder->m_state.slot0light, m_dsdDecoder->m_state.slot1light); } } diff --git a/dsdplus/dmr_voice.cpp b/dsdplus/dmr_voice.cpp index f34539853..0300c61ee 100644 --- a/dsdplus/dmr_voice.cpp +++ b/dsdplus/dmr_voice.cpp @@ -178,7 +178,7 @@ void DSDDMRVoice::postProcess(int symbolIndex) if (symbolIndex == 54+12+54-1) // very last symbol -> go back to search sync state { - fprintf(stderr, "\nDSDDMRVoice::postProcess: end of frame\n"); + fprintf(stderr, "DSDDMRVoice::postProcess: end of frame\n"); m_dsdDecoder->m_fsmState = DSDDecoder::DSDLookForSync; } } @@ -388,8 +388,19 @@ void DSDDMRVoice::processSlot5(int symbolIndex) // Slot5 is a 18 symbol slot } else { + if (m_dsdDecoder->m_opts.errorbars == 1) { + fprintf(stderr, "\nMBE: "); + } + m_dsdDecoder->m_mbeDecoder.processFrame(0, ambe_fr, 0); + if (m_dsdDecoder->m_opts.errorbars == 1) { + fprintf(stderr, "."); + } + m_dsdDecoder->m_mbeDecoder.processFrame(0, ambe_fr2, 0); + if (m_dsdDecoder->m_opts.errorbars == 1) { + fprintf(stderr, "."); + } } } } @@ -425,6 +436,10 @@ void DSDDMRVoice::processSlot6(int symbolIndex) // Slot6 is a 36 symbol slot if (mutecurrentslot == 0) { m_dsdDecoder->m_mbeDecoder.processFrame(0, ambe_fr3, 0); + + if (m_dsdDecoder->m_opts.errorbars == 1) { + fprintf(stderr, "\n"); + } } } } @@ -467,7 +482,6 @@ void DSDDMRVoice::processSlot9(int symbolIndex) // Slot9 is a 24 symbol slot sync[24] = 0; syncdata[24] = 0; - } } diff --git a/dsdplus/dmr_voice.h b/dsdplus/dmr_voice.h index 2aa1eda73..f8d9ad611 100644 --- a/dsdplus/dmr_voice.h +++ b/dsdplus/dmr_voice.h @@ -20,23 +20,25 @@ * Map is as follows in number of bytes * * 0 ... 5 - * A 0 54 ... 54 <- this one is always skipped - * 1 12 12 <- cache data - * 2 36 36 <- AMBE slot - * 3 18 18 <- AMBE slot - * 4 24 24 <- sync data - * B 5 18 18 <- AMBE slot - * 6 36 36 <- AMBE slot - * 7 12 12 <- cache data - * 8 54 54 <- this one is always skipped - * 9 24 24 <- sync data + * A 0 54 ... 54 <- AMBE DMR slot 0 frame 2 1/2 + frame 3: skipped + * 1 12 12 <- CACH data + * 2 36 36 <- AMBE DMR slot 1 frame 1 + * 3 18 18 <- AMBE DMR slot 1 frame 2 1/2 + * 4 24 24 <- SYNC data + * B 5 18 18 <- AMBE DMR slot 1 frame 2 1/2 + * 6 36 36 <- AMBE DMR slot 1 frame 3 + * 7 12 12 <- CACH data + * 8 54 54 <- AMBE DMR slot 0 frame 1 + frame 2 1/2: skipped + * 9 24 24 <- SYNC data * - * The A gtoup of the first major block is already in memory and is processed + * The A group of the first major block is already in memory and is processed * at initialization time * Then dibits for each slot are stored in cache and processed right after the * last dibit for the slot has been added. * For skipped slots the dibits are simply thrown away * + * The DMR slot 0 is ignored. Only the DMR slot 1 is processed (listening to one conversation at a time) + * */ #ifndef DSDPLUS_DMR_VOICE_H_ diff --git a/dsdplus/dsd_decoder.cpp b/dsdplus/dsd_decoder.cpp index 471d8d9d2..29c780ad9 100644 --- a/dsdplus/dsd_decoder.cpp +++ b/dsdplus/dsd_decoder.cpp @@ -628,7 +628,7 @@ void DSDDecoder::printFrameSync(const char *frametype, int offset, char *modulat { if (m_opts.verbose > 0) { - fprintf(stderr, "\nSync: %s ", frametype); + fprintf(stderr, "Sync: %s ", frametype); } if (m_opts.verbose > 2) { @@ -1511,7 +1511,7 @@ int DSDDecoder::getFrameSync() if ((m_opts.errorbars == 1) && (m_opts.verbose > 1) && (m_state.carrier == 1)) { - printf("\nSync: no sync\n"); + printf("Sync: no sync\n"); } noCarrier();