Experimental Symbol Capture Bin Input Throttle

Experimental Symbol Capture Bin Input Throttle
--throttle read speed when reading capture bin files that are still being written to by OP25, quick easy piggyback (-n).
Readme tweaks
Minor tweaks
This commit is contained in:
lwvmobile 2022-09-19 15:48:14 -04:00 committed by GitHub
parent 5390a52313
commit cb5c160fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 13 deletions

View File

@ -1,14 +1,13 @@
# Digital Speech Decoder - Florida Man Edition
This version of DSD is a flavor blend of [szechyjs](https://github.com/szechyjs/dsd "szechyjs") RTL branch and some of my own additions, along with portions of DMR and NXDN code from the [LouisErigHerve](https://github.com/LouisErigHerve/dsd "LouisErigHerve") branch as well. This code also borrows snippets, inspiration, and ideas from other open source works including [Boatbod OP25](https://github.com/boatbod/op25 "Boatbod OP25"), [DSDcc](https://github.com/f4exb/dsdcc "DSDcc"), [SDTRunk](https://github.com/DSheirer/sdrtrunk "SDRTrunk"), [MMDVMHost](https://github.com/g4klx/MMDVMHost "MMDVMHost"), [LFSR](https://github.com/mattames/LFSR "LFSR"), and [EZPWD-Reed-Solomon](https://github.com/pjkundert/ezpwd-reed-solomon "EZPWD"). This project wouldn't be possible without a few good people providing me plenty of sample audio files to run over and over again. Special thanks to jurek1111, KrisMar, noamlivne, racingfan360, iScottyBotty, LimaZulu and hrh17 for the many hours of wav samples submitted by them.
This version of DSD is a flavor blend of [szechyjs](https://github.com/szechyjs/dsd "szechyjs") RTL branch and some of my own additions, along with portions of DMR and NXDN code from the [LouisErigHerve](https://github.com/LouisErigHerve/dsd "LouisErigHerve") branch. This code also borrows snippets, inspiration, and ideas from other open source works including [Boatbod OP25](https://github.com/boatbod/op25 "Boatbod OP25"), [DSDcc](https://github.com/f4exb/dsdcc "DSDcc"), [SDTRunk](https://github.com/DSheirer/sdrtrunk "SDRTrunk"), [MMDVMHost](https://github.com/g4klx/MMDVMHost "MMDVMHost"), [LFSR](https://github.com/mattames/LFSR "LFSR"), and [EZPWD-Reed-Solomon](https://github.com/pjkundert/ezpwd-reed-solomon "EZPWD"). This project wouldn't be possible without a few good people providing me plenty of sample audio files to run over and over again. Special thanks to jurek1111, KrisMar, noamlivne, racingfan360, iScottyBotty, LimaZulu and hrh17 for the many hours of wav samples submitted by them.
## 2022.09.17 Update ##
P25 Phase 2 Audio decoding has been implemented into DSD-FME. Currently, Phase 2 will only work from OP25 symbol capture bin files, or from wav files/SDR applications/RTL input that are sourced from FSK4 sources. CQPSK (LSM/H-D8PSK) will not work from audio sources. With the addition of Phases 2 audio, a new default decoder class has been implemented, XDMA, which is P25 Phase 1, Phase 2, DMR BS and MS (DMR Stereo). Furthermore, very limited Phase 1 TSBK support and Phase 2 FAcch/SaCCH/LCCH has been worked in just to get Network Status Broadcasts, which can fill in the required P2 parameters for WACN, SYSID, and CC for Phase 2 frame de-scrambling, and active voice call information.
With the implementation of the XDMA decoder class (default decoder), the CLI switches for DMR Stereo has been repurposed.
-T option will now open a per call wav file saving when used with NCurses Terminal, otherwise it will write wav files to slot 1 and slot 2 wav files.
With the implementation of the XDMA decoder class (default decoder), the CLI switches for DMR Stereo has been repurposed. -T option will now open a per call wav file saving when used with NCurses Terminal, otherwise it will write wav files to slot 1 and slot 2 wav files.
Anybody using dsd-fme -fr -T ...... should now just use dsd-fme -ft instead!
Anybody using `dsd-fme -fr -T` ...... should now just use `dsd-fme -ft` instead!
To see the up to date CLI options, please look at the help options with the -h CLI option.

View File

@ -592,6 +592,10 @@ typedef struct
int fourv_counter[2]; //external reference counter for ESS_B fragment collection
int p2_is_lcch; //flag to tell us when a frame is lcch and not sacch
//experimental symbol file capture read throttle
unsigned long long int symbol_throttle; //throttle speed
int use_throttle; //only use throttle if set to 1
//dstar header for ncurses
unsigned char dstarradioheader[41];

View File

@ -267,7 +267,7 @@ initOpts (dsd_opts * opts)
opts->frame_dpmr = 0;
opts->frame_provoice = 0;
opts->mod_c4fm = 1;
opts->mod_qpsk = 0;
opts->mod_qpsk = 1;
opts->mod_gfsk = 0;
opts->uvquality = 3;
opts->inverted_x2tdma = 1; // most transmitter + scanner + sound card combinations show inverted signals for this
@ -572,6 +572,10 @@ initState (dsd_state * state)
state->p2_hardset = 0;
state->p2_is_lcch = 0;
//experimental symbol file capture read throttle
state->symbol_throttle = 0; //throttle speed
state->use_throttle = 0; //only use throttle if set to 1
state->p2_scramble_offset = 0;
state->p2_vch_chan_num = 0;
@ -618,8 +622,8 @@ usage ()
printf (" -T Enable Per Call WAV file saving in XDMA and NXDN decoding classes\n");
printf (" (Per Call can only be used in Ncurses Terminal!)\n");
printf (" (Running in console will use static wav files)\n");
//printf (" -a Display port audio devices\n");
//printf (" -W Monitor Source Audio When No Sync Detected (broken!)\n");
printf (" -n Throttle Symbol Capture Bin Input");
printf (" (useful when reading files still being written to by OP25)");
printf ("\n");
printf ("RTL-SDR options:\n");
printf (" -c <hertz> RTL-SDR Frequency\n");
@ -662,9 +666,6 @@ usage ()
printf (" (default=36)\n");
printf (" -M <num> Min/Max buffer size for QPSK decision point tracking\n");
printf (" (default=15)\n");
// printf (" -T Enable DMR TDMA Stereo Voice (Two Slot Dual Voices)\n");
// printf (" This feature will open two streams for slot 1 voice and slot 2 voice\n");
// printf (" May Cause Skipping or sync issues if bad signal/errors\n");
// printf (" -F Enable DMR TDMA Stereo Passive Frame Sync\n");
// printf (" This feature will attempt to resync less often due to excessive voice errors\n");
// printf (" Use if skipping occurs, but may cause wonky audio due to loss of good sync\n");
@ -979,7 +980,9 @@ main (int argc, char **argv)
case 'v':
sscanf (optarg, "%d", &opts.verbose);
break;
case 'n':
state.use_throttle = 1;
break;
case 'K':
sscanf (optarg, "%lld", &state.K);
if (state.K > 256)

View File

@ -2052,6 +2052,30 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
printw("DES-OFB");
attron(COLOR_PAIR(3));
}
if (state->payload_algid == 0x83 || state->payload_algid == 0x23)
{
attron(COLOR_PAIR(1));
printw("Triple DES");
attron(COLOR_PAIR(3));
}
if (state->payload_algid == 0x85 || state->payload_algid == 0x24)
{
attron(COLOR_PAIR(1));
printw("AES-128");
attron(COLOR_PAIR(3));
}
if (state->payload_algid == 0x84 || state->payload_algid == 0x25)
{
attron(COLOR_PAIR(1));
printw("AES-256");
attron(COLOR_PAIR(3));
}
if (state->payload_algid == 0x02)
{
attron(COLOR_PAIR(1));
printw("Hytera Full Encrypt");
attron(COLOR_PAIR(3));
}
if(state->dmrburstL == 16 && state->dmr_so == 0x40 && state->R == 0) //0100 0000
{
@ -2179,6 +2203,30 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
printw("DES-OFB");
attron(COLOR_PAIR(3));
}
if (state->payload_algidR == 0x83 || state->payload_algidR == 0x23)
{
attron(COLOR_PAIR(1));
printw("Triple DES");
attron(COLOR_PAIR(3));
}
if (state->payload_algidR == 0x85 || state->payload_algidR == 0x24)
{
attron(COLOR_PAIR(1));
printw("AES-128");
attron(COLOR_PAIR(3));
}
if (state->payload_algidR == 0x84 || state->payload_algidR == 0x25)
{
attron(COLOR_PAIR(1));
printw("AES-256");
attron(COLOR_PAIR(3));
}
if (state->payload_algidR == 0x02)
{
attron(COLOR_PAIR(1));
printw("Hytera Full Encrypt");
attron(COLOR_PAIR(3));
}
//Call Types, may switch to the more robust version later?
if(state->dmrburstR == 16 && state->dmr_soR == 0x40 && state->R == 0) //0100 0000
{

View File

@ -363,6 +363,13 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
}
state->symbolc = fgetc(opts->symbolfile);
//experimental throttle
useconds_t stime = state->symbol_throttle;
if (state->use_throttle == 1)
{
usleep(stime);
}
//fprintf(stderr, "%d", state->symbolc);
if( feof(opts->symbolfile) )
{

View File

@ -144,6 +144,12 @@ void p2_dibit_buffer (dsd_opts * opts, dsd_state * state)
if (opts->audio_in_type == 4) //4
{
dibit = fgetc(opts->symbolfile);
//experimental throttle
useconds_t stime = state->symbol_throttle;
if (state->use_throttle == 1)
{
usleep(stime);
}
}
else
{
@ -203,7 +209,7 @@ void process_Frame_Scramble (dsd_opts * opts, dsd_state * state)
void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned long long int MAC[24])
{
//handle variable content MAC PDUs (Active, Idle, or Hangtime)
//handle variable content MAC PDUs (Active, Idle, Hangtime, or Signal)
//use type to specify SACCH or FACCH, so we know if we should invert the currentslot when assigning ids etc
//get first b1 and b2 values, and first offset value
//need a lookup table for message length values...aquired one from OP25
@ -228,7 +234,7 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon
int b_b = 0;
int mco_b = 0;
//assing here if OECI MAC SIGNAL, after passing RS and CRC
//assigning here if OECI MAC SIGNAL, after passing RS and CRC
if (state->p2_is_lcch)
{
if (slot == 0) state->dmrburstL = 30;