WIP: Source Audio Monitoring on V2.1b;

This commit is contained in:
lwvmobile
2023-08-09 01:14:00 -04:00
parent 152f0ea7f6
commit 7d6269efad
7 changed files with 109 additions and 114 deletions

View File

@@ -621,7 +621,7 @@ initOpts (dsd_opts * opts)
opts->dmr_mute_encL = 1;
opts->dmr_mute_encR = 1;
opts->monitor_input_audio = 0;
opts->monitor_input_audio = 0; //enable with -8
opts->inverted_p2 = 0;
opts->p2counter = 0;
@@ -715,6 +715,11 @@ initState (dsd_state * state)
//Upsampled Audio Smoothing
state->audio_smoothing = 0;
//analog/raw signal audio buffers
state->analog_sample_counter = 0; //when it reaches 960, then dump the raw/analog audio signal and reset
memset (state->analog_out, 0, sizeof(state->analog_out) );
//
state->audio_out_buf = malloc (sizeof (short) * 1000000);
state->audio_out_bufR = malloc (sizeof (short) * 1000000);
memset (state->audio_out_buf, 0, 100 * sizeof (short));
@@ -1129,6 +1134,9 @@ usage ()
printf (" -r <files> Read/Play saved mbe data from file(s)\n");
printf (" -g <num> Audio output gain (default = 0 = auto, disable = -1)\n");
printf (" -w <file> Output synthesized speech to a .wav file, legacy auto modes only.\n");
printf (" -8 Enable Experimental Source Audio Monitor (OSS and Pulse Audio at 48k1)\n");
printf (" (Caution! May Cause High CPU usage or break when using RTL input!)\n");
printf (" (Its recommended to use Squelch in SDR++ or GQRX, etc, if monitoring mixed analog/digital)\n");
printf (" -P 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");
@@ -1230,9 +1238,6 @@ usage ()
printf (" \n");
printf (" -3 Disable DMR Late Entry Encryption Identifiers (VC6 Single Burst) \n");
printf (" Note: Disable this if false positives on Voice ENC occur. \n");
// printf (" -3 Enable DMR Late Entry Encryption Identifiers (VC6 Single Burst) \n");
// printf (" Note: This is experimental and may produce false positives depending on system type, notably TXI. \n");
// printf (" Use -0 or -4 options above instead if needed. \n");
printf ("\n");
printf (" Trunking Options:\n");
printf (" -C <file> Import Channel to Frequency Map (channum, freq) from csv file. (Capital C) \n");
@@ -1300,6 +1305,8 @@ if (opts->audio_in_type == 1)
open_rtlsdr_stream(opts);
opts->rtl_started = 1; //set here so ncurses terminal doesn't attempt to open it again
//safety disable due to HIGH CPU usage this causes when using RTL input
if (opts->monitor_input_audio == 1) opts->monitor_input_audio = 0;
}
#endif
@@ -1492,6 +1499,13 @@ main (int argc, char **argv)
//NOTE: The 'K' option for single BP key has been swapped to 'b'
//'K' is now used for hexidecimal key.csv imports
//experimental audio monitoring
case '8':
opts.monitor_input_audio = 1;
fprintf (stderr,"Experimental Raw Analog Source Monitoring Enabled (Pulse Audio Only!)\n");
fprintf (stderr,"WARNING! May Cause HIGH CPU Usage and/or break when using RTL Input\n");
break;
//rc4 enforcement on DMR (due to missing the PI header)
case '0':
state.M = 0x21;