Merge pull request #220 from lwvmobile/edacs_manual_modes

Edacs manual modes
This commit is contained in:
lwvmobile 2024-03-22 06:59:31 -04:00 committed by GitHub
commit 413e5f76a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 284 additions and 42 deletions

View File

@ -8,7 +8,11 @@
-fa Legacy Auto (not recommended)
-fi NXDN48
-fn NXDN96
-fp EDACS/Provoice
-fp Provoice
-fh EDACS Standard / Network
-fH EDACS Standard / Network with ESK
-fe EDACS Extended Addresssing
-fE EDACS Extended Addressing with ESK
-fm dPMR, also may need to use -xd if inverted dPMR.
-f1 P25P1
-f2 P25P2 (may need to specify wacn/sys/nac manually if traffic channel)
@ -100,11 +104,11 @@ and in a second terminal tab, same folder, run
EDACS Trunking (w/ channel map import)
--EDACS/PV Trunking using RIGCTL and TCP Direct Link Audio inside of SDR++ (Tested and Working on EDACS/EDACS-EA with Provoice, Analog Voice Monitoring and Per Call is Experimental)
--EDACS/PV Trunking using RIGCTL and TCP Direct Link Audio inside of SDR++ (see switches above for STD/NET, EA, and ESK modes)
`dsd-fme -i tcp -fp -C channel_map.csv -G group.csv -T -U 4532 -N 2> log.ans`
`dsd-fme -i tcp -fE -C channel_map.csv -G group.csv -T -U 4532 -N 2> log.ans`
--NXDN48 Trunking (standard band plan) with SDR++ (untested for frequency accuracy)
--NXDN48 Trunking (Direct Frequency Assignment) with SDR++ (untested for frequency accuracy)
`dsd-fme -fi -i tcp -T -U 4532 -N 2> log.ans`
@ -202,6 +206,9 @@ l - Hold TG in Slot 2 on TDMA Systems, or clear current hold
C - Drop Call and Return to CC during trunking operation
L - Manual Cycle Forward Channel Tuned when RIGCTL or using RTL input and channel csv loaded
S - Toggle Between EDACS Standard/Network and Extended Addressing Mode
A - Toggle EDACS ESK Mask
```
## Sending Audio to a Icecast 2 Server via FFmpeg (Windows)

View File

@ -17,9 +17,21 @@
dsd-fme -fs -i tcp -U 4532 -T -C dmr_t3_chan.csv -G group.csv -N 2> log.ans
#dsd-fme -fs -i rtl:0:450M:44:-2:8 -T -C connect_plus_chan.csv -G group.csv -N 2> log.ans
#EDACS/EDACS-EA Digital Only
#dsd-fme -fp -i tcp:192.168.7.5:7355 -U 4532 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#dsd-fme -fp -i rtl:0:850M:44:-2:24 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#EDACS Standard Network Analog and Digital
#dsd-fme -fh -i tcp:192.168.7.5:7355 -U 4532 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#dsd-fme -fh -i rtl:0:850M:44:-2:24 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#EDACS Standard Network Analog and Digital (with ESK)
#dsd-fme -fH -i tcp:192.168.7.5:7355 -U 4532 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#dsd-fme -fH -i rtl:0:850M:44:-2:24 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#EDACS Extended Address Analog and Digital
#dsd-fme -fe -i tcp:192.168.7.5:7355 -U 4532 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#dsd-fme -fe -i rtl:0:850M:44:-2:24 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#EDACS Extended Address Analog and Digital (with ESK)
#dsd-fme -fE -i tcp:192.168.7.5:7355 -U 4532 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#dsd-fme -fE -i rtl:0:850M:44:-2:24 -T -C edacs_channel_map.csv -G group.csv -N 2> log.ans
#NXDN48 Type-C or Type-D Trunking with Channel Map
#dsd-fme -fi -i tcp -T -U 4532 -C nxdn_channel_map.csv -N 2> log.ans

View File

@ -695,7 +695,7 @@ typedef struct
//edacs
int ea_mode;
int esk_mode;
unsigned short esk_mask;
unsigned long long int edacs_site_id;
int edacs_lcn_count; //running tally of lcn's observed on edacs system

View File

@ -1047,8 +1047,8 @@ initState (dsd_state * state)
//edacs - may need to make these user configurable instead for stability on non-ea systems
state->ea_mode = -1; //init on -1, 0 is standard, 1 is ea
state->esk_mode = -1; //same as above, but with esk or not
state->esk_mask = 0x0; //toggles from 0x0 to 0xA0 if esk mode enabled
state->esk_mask = 0x0; //esk mask value
state->edacs_site_id = 0;
state->edacs_lcn_count = 0;
state->edacs_cc_lcn = 0;
@ -1333,7 +1333,11 @@ usage ()
printf (" -fz Decode only M17*\n");
printf (" -fi Decode only NXDN48* (6.25 kHz) / IDAS*\n");
printf (" -fn Decode only NXDN96* (12.5 kHz)\n");
printf (" -fp Decode only EDACS/ProVoice*\n");
printf (" -fp Decode only ProVoice*\n");
printf (" -fh Decode only EDACS Standard/ProVoice*\n");
printf (" -fH Decode only EDACS Standard/ProVoice with ESK 0xA0*\n");
printf (" -fe Decode only EDACS EA/ProVoice*\n");
printf (" -fE Decode only EDACS EA/ProVoice with ESK 0xA0*\n");
printf (" -fm Decode only dPMR*\n");
printf (" -l Disable DMR, dPMR, and NXDN input filtering\n");
printf (" -u <num> Unvoiced speech quality (default=3)\n");
@ -1416,7 +1420,7 @@ usage ()
printf (" P25 - 12000; NXDN48 - 7000; NXDN96: 12000; DMR - 7000-12000; EDACS/PV - 12000-24000;\n"); //redo this, or check work, or whatever
printf (" May vary based on system stregnth, etc.\n");
printf (" -t <secs> Set Trunking or Scan Speed VC/sync loss hangtime in seconds. (default = 1 second)\n");
printf (" -9 Force Enable EDACS Standard or Networked Mode if Auto Detection Fails \n");
// printf (" -9 Force Enable EDACS Standard or Networked Mode if Auto Detection Fails \n");
printf ("\n");
printf (" Trunking Example TCP: dsd-fme -fs -i tcp -U 4532 -T -C dmr_t3_chan.csv -G group.csv -N 2> log.ans\n");
printf (" Trunking Example RTL: dsd-fme -fs -i rtl:0:450M:26:-2:8 -T -C connect_plus_chan.csv -G group.csv -N 2> log.ans\n");
@ -1684,9 +1688,10 @@ main (int argc, char **argv)
fprintf (stderr, "TG Hold set to %d \n", state.tg_hold);
break;
case '9': //This is a temporary fix for RR issue until a permanent fix can be found
case '9': //Leaving Enabled to maintain backwards compatability
state.ea_mode = 0;
fprintf (stderr,"Force Enabling EDACS Standard/Networked Mode Mode\n");
state.esk_mask = 0;
fprintf (stderr,"Force Enabling EDACS Standard/Networked Mode Mode without ESK.\n");
break;
//experimental audio monitoring
@ -2182,6 +2187,146 @@ main (int argc, char **argv)
opts.rtl_bandwidth = 24;
// opts.rtl_gain_value = 36;
}
else if (optarg[0] == 'h') //standard / net w/o ESK
{
opts.frame_dstar = 0;
opts.frame_x2tdma = 0;
opts.frame_p25p1 = 0;
opts.frame_p25p2 = 0;
opts.frame_nxdn48 = 0;
opts.frame_nxdn96 = 0;
opts.frame_dmr = 0;
opts.frame_dpmr = 0;
opts.frame_provoice = 1;
state.ea_mode = 0;
state.esk_mask = 0;
opts.frame_ysf = 0;
opts.frame_m17 = 0;
state.samplesPerSymbol = 5;
state.symbolCenter = 2;
opts.mod_c4fm = 0;
opts.mod_qpsk = 0;
opts.mod_gfsk = 1;
state.rf_mod = 2;
opts.pulse_digi_rate_out = 8000;
opts.pulse_digi_out_channels = 1;
opts.dmr_stereo = 0;
opts.dmr_mono = 0;
state.dmr_stereo = 0;
// opts.setmod_bw = 12500;
sprintf (opts.output_name, "EDACS/PV");
fprintf (stderr,"Setting symbol rate to 9600 / second\n");
fprintf (stderr,"Decoding EDACS STD/NET and ProVoice frames.\n");
fprintf (stderr,"EDACS Analog Voice Channels are Experimental.\n");
//rtl specific tweaks
opts.rtl_bandwidth = 24;
// opts.rtl_gain_value = 36;
}
else if (optarg[0] == 'H') //standard / net w/ ESK
{
opts.frame_dstar = 0;
opts.frame_x2tdma = 0;
opts.frame_p25p1 = 0;
opts.frame_p25p2 = 0;
opts.frame_nxdn48 = 0;
opts.frame_nxdn96 = 0;
opts.frame_dmr = 0;
opts.frame_dpmr = 0;
opts.frame_provoice = 1;
state.ea_mode = 0;
state.esk_mask = 0xA0;
opts.frame_ysf = 0;
opts.frame_m17 = 0;
state.samplesPerSymbol = 5;
state.symbolCenter = 2;
opts.mod_c4fm = 0;
opts.mod_qpsk = 0;
opts.mod_gfsk = 1;
state.rf_mod = 2;
opts.pulse_digi_rate_out = 8000;
opts.pulse_digi_out_channels = 1;
opts.dmr_stereo = 0;
opts.dmr_mono = 0;
state.dmr_stereo = 0;
// opts.setmod_bw = 12500;
sprintf (opts.output_name, "EDACS/PV");
fprintf (stderr,"Setting symbol rate to 9600 / second\n");
fprintf (stderr,"Decoding EDACS STD/NET w/ ESK and ProVoice frames.\n");
fprintf (stderr,"EDACS Analog Voice Channels are Experimental.\n");
//rtl specific tweaks
opts.rtl_bandwidth = 24;
// opts.rtl_gain_value = 36;
}
else if (optarg[0] == 'e') //extended addressing w/o ESK
{
opts.frame_dstar = 0;
opts.frame_x2tdma = 0;
opts.frame_p25p1 = 0;
opts.frame_p25p2 = 0;
opts.frame_nxdn48 = 0;
opts.frame_nxdn96 = 0;
opts.frame_dmr = 0;
opts.frame_dpmr = 0;
opts.frame_provoice = 1;
state.ea_mode = 1;
state.esk_mask = 0;
opts.frame_ysf = 0;
opts.frame_m17 = 0;
state.samplesPerSymbol = 5;
state.symbolCenter = 2;
opts.mod_c4fm = 0;
opts.mod_qpsk = 0;
opts.mod_gfsk = 1;
state.rf_mod = 2;
opts.pulse_digi_rate_out = 8000;
opts.pulse_digi_out_channels = 1;
opts.dmr_stereo = 0;
opts.dmr_mono = 0;
state.dmr_stereo = 0;
// opts.setmod_bw = 12500;
sprintf (opts.output_name, "EDACS/PV");
fprintf (stderr,"Setting symbol rate to 9600 / second\n");
fprintf (stderr,"Decoding EDACS Extended Addressing and ProVoice frames.\n");
fprintf (stderr,"EDACS Analog Voice Channels are Experimental.\n");
//rtl specific tweaks
opts.rtl_bandwidth = 24;
// opts.rtl_gain_value = 36;
}
else if (optarg[0] == 'E') //extended addressing w/ ESK
{
opts.frame_dstar = 0;
opts.frame_x2tdma = 0;
opts.frame_p25p1 = 0;
opts.frame_p25p2 = 0;
opts.frame_nxdn48 = 0;
opts.frame_nxdn96 = 0;
opts.frame_dmr = 0;
opts.frame_dpmr = 0;
opts.frame_provoice = 1;
state.ea_mode = 1;
state.esk_mask = 0xA0;
opts.frame_ysf = 0;
opts.frame_m17 = 0;
state.samplesPerSymbol = 5;
state.symbolCenter = 2;
opts.mod_c4fm = 0;
opts.mod_qpsk = 0;
opts.mod_gfsk = 1;
state.rf_mod = 2;
opts.pulse_digi_rate_out = 8000;
opts.pulse_digi_out_channels = 1;
opts.dmr_stereo = 0;
opts.dmr_mono = 0;
state.dmr_stereo = 0;
// opts.setmod_bw = 12500;
sprintf (opts.output_name, "EDACS/PV");
fprintf (stderr,"Setting symbol rate to 9600 / second\n");
fprintf (stderr,"Decoding EDACS Extended Addressing w/ ESK and ProVoice frames.\n");
fprintf (stderr,"EDACS Analog Voice Channels are Experimental.\n");
//rtl specific tweaks
opts.rtl_bandwidth = 24;
// opts.rtl_gain_value = 36;
}
else if (optarg[0] == '1')
{
opts.frame_dstar = 0;

View File

@ -2505,6 +2505,66 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
else printw (" - Black List Mode\n");
}
#endif
//print additional information for EDACS modes and toggles
#ifdef PRETTY_COLORS
if (opts->p25_trunk == 1 && opts->frame_provoice == 1)
{
printw ("| \\--EDACS -");
if (state->ea_mode == -1)
{
attron(COLOR_PAIR(2));
printw (" Standard/Network");
printw (" Extended Address");
attron(COLOR_PAIR(4));
}
else if (state->ea_mode == 0)
{
printw (" Standard/Network");
attron(COLOR_PAIR(2));
printw (" Extended Address");
attron(COLOR_PAIR(4));
}
else if (state->ea_mode == 1)
{
attron(COLOR_PAIR(2));
printw (" Standard/Network");
attron(COLOR_PAIR(4));
printw (" Extended Address");
}
printw (" Mode (S);");
printw(" ESK Mask: %02X", state->esk_mask);
printw (" (A); ");
attron(COLOR_PAIR(4));
printw ("\n");
}
#else //set on to UPPER CASE, off to lower case
if (opts->p25_trunk == 1 && opts->frame_provoice == 1)
{
printw ("| \\--EDACS -");
if (state->ea_mode == -1)
{
printw (" standard/network");
printw (" extended address");
}
else if (state->ea_mode == 0)
{
printw (" STANDARD/NETWORK");
printw (" extended address");
}
else if (state->ea_mode == 1)
{
printw (" standard/network");
printw (" EXTENDED ADDRESS");
}
printw (" Mode (S);");
printw(" ESK Mask: %02X", state->esk_mask);
printw (" (A) Toggle; ");
printw ("\n");
}
#endif
// if (opts->aggressive_framesync == 0) printw ("| Selective CRC ERR Bypass Enabled (RAS) \n");
if (state->M == 1)
{
@ -4412,6 +4472,31 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
}
if(opts->frame_provoice == 1 && c == 65) //'A' Key, toggle ESK mask 0xA0
{
if (state->esk_mask == 0) state->esk_mask = 0xA0;
else state->esk_mask = 0;
}
if(opts->frame_provoice == 1 && c == 83) //'S' Key, toggle STD or EA mode and reset
{
if (state->ea_mode == -1) state->ea_mode = 0;
else if (state->ea_mode == 0) state->ea_mode = 1;
else state->ea_mode = 0;
//reset -- test to make sure these don't do weird things when reset
state->edacs_site_id = 0;
state->edacs_lcn_count = 0;
state->edacs_cc_lcn = 0;
state->edacs_vc_lcn = 0;
state->edacs_tuned_lcn = -1;
state->p25_cc_freq = 0;
opts->p25_is_tuned = 0;
state->lasttg = 0;
state->lastsrc = 0;
}
//anything with an entry box will need the inputs and outputs stopped first
//so probably just write a function to handle c input, and when c = certain values
//needing an entry box, then stop all of those

View File

@ -442,6 +442,7 @@ void edacs(dsd_opts * opts, dsd_state * state)
unsigned int peercmd = 0xF88; //using for EA detection test
unsigned int netcmd = 0xF3; //using for Networked Test
UNUSED2(vcmd, idcmd);
UNUSED2(peercmd, netcmd);
char * timestr; //add timestr here, so we can assign it and also free it to prevent memory leak
timestr = getTimeE();
@ -496,34 +497,20 @@ void edacs(dsd_opts * opts, dsd_state * state)
else //BCH Pass, continue from here.
{
//ESK on/off detection, I honestly don't remember the logic for this anymore, but it works fine
if ( (((fr_1t & 0xF000000000) >> 36) != 0xB) && (((fr_1t & 0xF000000000) >> 36) != 0x1) && (((fr_1t & 0xFF00000000) >> 32) != 0xF3) )
{
//experimenting with values here, not too high, and not too low
if ( (((fr_1t & 0xF000000000) >> 36) <= 0x8 ))
{
state->esk_mask = 0xA0;
}
//ideal value would be 5, but some other values exist that don't allow it
if ( (((fr_1t & 0xF000000000) >> 36) > 0x8 ) )
{
state->esk_mask = 0x0;
}
}
//Auto Detection Modes Have Been Removed due to reliability issues,
//users will now need to manually specify these options:
/*
-fh Decode only EDACS Standard/ProVoice*\n");
-fH Decode only EDACS Standard/ProVoice with ESK 0xA0*\n");
-fe Decode only EDACS EA/ProVoice*\n");
-fE Decode only EDACS EA/ProVoice with ESK 0xA0*\n");
//Standard/Networked Auto Detection
//if (command == netcmd) //netcmd is F3 Standard/Networked (I think)
if ( (fr_1t >> 32 == netcmd) || (fr_1t >> 32 == (netcmd ^ 0xA0)) )
{
state->ea_mode = 0; //disable extended addressing mode
}
//EA Auto detection //peercmd is 0xF88 peer site relay 0xFF80000000 >> 28
if (fr_1t >> 28 == peercmd || fr_1t >> 28 == (peercmd ^ 0xA00) )
{
state->ea_mode = 1; //enable extended addressing mode
}
(A) key toggles mode; (S) key toggles mask value in ncurses
*/
//TODO: Consider re-adding the auto code to make a suggestion to users
//as to which mode to proceed in?
//Start Extended Addressing Mode
if (state->ea_mode == 1)
{
@ -1080,8 +1067,14 @@ void edacs(dsd_opts * opts, dsd_state * state)
} //end Standard or Networked
//supply user warning to use -9 switch if decoding doesn't start shortly
else fprintf (stderr, " Net/EA Auto Detect; Use -9 CLI Switch For Standard;");
//let users know they need to select an operational mode with the switches below
else
{
fprintf (stderr, " Detected: Use -fh, -fH, -fe, or -fE for std, esk, ea, or ea-esk;");
fprintf (stderr, "\n");
fprintf (stderr, " FR_1 [%010llX]", fr_1t);
fprintf (stderr, " FR_4 [%010llX]", fr_4t);
}
}