mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-17 11:17:22 -05:00
Fix RTL Source Audio Monitoring Bug;
This commit is contained in:
@@ -1134,8 +1134,7 @@ usage ()
|
|||||||
printf (" -r <files> Read/Play saved mbe data from file(s)\n");
|
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 (" -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 (" -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 (" -8 Enable Experimental Source Audio Monitor (OSS at 48k1 and Pulse Audio)\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 (" (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 (" -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 (" (Per Call can only be used in Ncurses Terminal!)\n");
|
||||||
@@ -1305,8 +1304,6 @@ if (opts->audio_in_type == 1)
|
|||||||
|
|
||||||
open_rtlsdr_stream(opts);
|
open_rtlsdr_stream(opts);
|
||||||
opts->rtl_started = 1; //set here so ncurses terminal doesn't attempt to open it again
|
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
|
#endif
|
||||||
|
|
||||||
@@ -1502,8 +1499,7 @@ main (int argc, char **argv)
|
|||||||
//experimental audio monitoring
|
//experimental audio monitoring
|
||||||
case '8':
|
case '8':
|
||||||
opts.monitor_input_audio = 1;
|
opts.monitor_input_audio = 1;
|
||||||
fprintf (stderr,"Experimental Raw Analog Source Monitoring Enabled (Pulse Audio Only!)\n");
|
fprintf (stderr,"Experimental Raw Analog Source Monitoring Enabled\n");
|
||||||
fprintf (stderr,"WARNING! May Cause HIGH CPU Usage and/or break when using RTL Input\n");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//rc4 enforcement on DMR (due to missing the PI header)
|
//rc4 enforcement on DMR (due to missing the PI header)
|
||||||
|
|||||||
@@ -152,14 +152,8 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
|
|||||||
else if (opts->audio_in_type == 3)
|
else if (opts->audio_in_type == 3)
|
||||||
{
|
{
|
||||||
#ifdef USE_RTLSDR
|
#ifdef USE_RTLSDR
|
||||||
// TODO: need to read demodulated stream here
|
// Read demodulated stream here
|
||||||
// get_rtlsdr_sample(&sample);
|
|
||||||
get_rtlsdr_sample(&sample, opts, state);
|
get_rtlsdr_sample(&sample, opts, state);
|
||||||
if (opts->monitor_input_audio == 1 && state->lastsynctype == -1 && sample < 32767 && sample > -32767)
|
|
||||||
{
|
|
||||||
state->pulse_raw_out_buffer = sample; //steal raw out buffer sample here?
|
|
||||||
pa_simple_write(opts->pulse_raw_dev_out, (void*)&state->pulse_raw_out_buffer, 2, NULL);
|
|
||||||
}
|
|
||||||
opts->rtl_rms = rtl_return_rms();
|
opts->rtl_rms = rtl_return_rms();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -298,7 +292,7 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
|
|||||||
if (opts->audio_out_type == 0)
|
if (opts->audio_out_type == 0)
|
||||||
pa_simple_write(opts->pulse_raw_dev_out, state->analog_out, 960*2, NULL);
|
pa_simple_write(opts->pulse_raw_dev_out, state->analog_out, 960*2, NULL);
|
||||||
|
|
||||||
//NOTE: I haven't personally tested this in Cygwin, so it might suck or lag, who knows
|
//NOTE: Worked okay earlier in Cygwin, so should be fine
|
||||||
if (opts->audio_out_type == 5)
|
if (opts->audio_out_type == 5)
|
||||||
write (opts->audio_out_fd, state->analog_out, 960*2);
|
write (opts->audio_out_fd, state->analog_out, 960*2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user