From 84df9bbca7343690f20c6cac88fed1600779bd39 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Fri, 6 Oct 2023 10:43:13 -0400 Subject: [PATCH] P25p2 -- Slot ON/OFF During Realtime Tuning; --- src/dsd_frame_sync.c | 3 + src/dsd_main.c | 3 + src/p25p1_mdpu.c | 42 ++++++++++++++ src/p25p1_tsbk.c | 14 +++++ src/p25p2_vpdu.c | 127 +++++++++++++++++++++++++++++++++++++++++++ src/p25p2_xcch.c | 6 ++ 6 files changed, 195 insertions(+) diff --git a/src/dsd_frame_sync.c b/src/dsd_frame_sync.c index 2e32169..2c320e2 100644 --- a/src/dsd_frame_sync.c +++ b/src/dsd_frame_sync.c @@ -130,6 +130,9 @@ getFrameSync (dsd_opts * opts, dsd_state * state) { state->samplesPerSymbol = 10; state->symbolCenter = 4; + //re-enable both slots + opts->slot1_on = 1; + opts->slot2_on = 1; } //start going through the lcn/frequencies CC/signal hunting diff --git a/src/dsd_main.c b/src/dsd_main.c index d17575e..f9786fe 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -216,6 +216,9 @@ if(opts->frame_m17 == 1) //&& opts->audio_in_type == 5 { state->samplesPerSymbol = 10; state->symbolCenter = 4; + //re-enable both slots + opts->slot1_on = 1; + opts->slot2_on = 1; } } //zero out vc frequencies? diff --git a/src/p25p1_mdpu.c b/src/p25p1_mdpu.c index fa1f99b..d8138ed 100644 --- a/src/p25p1_mdpu.c +++ b/src/p25p1_mdpu.c @@ -356,6 +356,20 @@ void processMPDU(dsd_opts * opts, dsd_state * state) { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channelt & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } //rigctl @@ -459,6 +473,20 @@ void processMPDU(dsd_opts * opts, dsd_state * state) { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channelt & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } //rigctl @@ -569,6 +597,20 @@ void processMPDU(dsd_opts * opts, dsd_state * state) { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channelt & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } //rigctl diff --git a/src/p25p1_tsbk.c b/src/p25p1_tsbk.c index 4bebea9..5280ed2 100644 --- a/src/p25p1_tsbk.c +++ b/src/p25p1_tsbk.c @@ -238,6 +238,20 @@ void processTSBK(dsd_opts * opts, dsd_state * state) { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channel & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } //rigctl diff --git a/src/p25p2_vpdu.c b/src/p25p2_vpdu.c index f564390..d20d374 100644 --- a/src/p25p2_vpdu.c +++ b/src/p25p2_vpdu.c @@ -139,6 +139,20 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channel & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } @@ -225,6 +239,20 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channel & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } @@ -342,6 +370,20 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (tunable_chan & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } @@ -453,6 +495,20 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channel & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } @@ -546,7 +602,21 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channel & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } } + } //rigctl @@ -702,6 +772,20 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (tunable_chan & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } @@ -879,6 +963,20 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (tunable_chan & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } @@ -1001,6 +1099,20 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (tunable_chan & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } } @@ -1116,7 +1228,22 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon { state->samplesPerSymbol = 8; state->symbolCenter = 3; + + //shim fix to stutter/lag by only enabling slot on the target/channel we tuned to + //this will only occur in realtime tuning, not not required .bin or .wav playback + if (channelt & 1) //VCH1 + { + opts->slot1_on = 0; + opts->slot2_on = 1; + } + else //VCH0 + { + opts->slot1_on = 1; + opts->slot2_on = 0; + } + } + } //rigctl diff --git a/src/p25p2_xcch.c b/src/p25p2_xcch.c index d888001..daf60a6 100644 --- a/src/p25p2_xcch.c +++ b/src/p25p2_xcch.c @@ -279,6 +279,9 @@ void process_SACCH_MAC_PDU (dsd_opts * opts, dsd_state * state, int payload[180] { state->samplesPerSymbol = 10; state->symbolCenter = 4; + //re-enable both slots + opts->slot1_on = 1; + opts->slot2_on = 1; } //rigctl @@ -614,6 +617,9 @@ void process_FACCH_MAC_PDU (dsd_opts * opts, dsd_state * state, int payload[156] { state->samplesPerSymbol = 10; state->symbolCenter = 4; + //re-enable both slots + opts->slot1_on = 1; + opts->slot2_on = 1; } //rigctl