diff --git a/src/dsd_audio.c b/src/dsd_audio.c index 4995d93..285f826 100644 --- a/src/dsd_audio.c +++ b/src/dsd_audio.c @@ -119,8 +119,8 @@ void openOSSOutput (dsd_opts * opts) } opts->audio_out_type = 5; //5 for 1 channel - 48k OSS 16-bit short output (matching with input) - opts->pulse_digi_rate_out = 48000; //this is used to force to upsample - opts->pulse_digi_out_channels = 1; + opts->pulse_digi_rate_out = 48000; //this is used to force to upsample and also allow source audio monitor conditional check + opts->pulse_digi_out_channels = 1; //this is used to allow source audio monitor conditional check opts->audio_gain = 0; } } diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 0321ad4..9add35e 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2323,6 +2323,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (opts->audio_gain == 0) printw (" (+/-) Auto"); if (opts->audio_gain > 0) printw (" (+/-) Manual"); // if (state->audio_smoothing == 1 && opts->floating_point == 0) printw (" Smoothing On;"); //only on short + if ( (opts->audio_out_type == 5 && opts->pulse_digi_rate_out == 48000 && opts->pulse_digi_out_channels == 1) || opts->frame_provoice == 1) + printw (" - Analog RMS: %04ld ", opts->rtl_rms); printw (" \n"); } diff --git a/src/dsd_symbol.c b/src/dsd_symbol.c index accce8f..b0bd9c3 100644 --- a/src/dsd_symbol.c +++ b/src/dsd_symbol.c @@ -283,9 +283,32 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync) //debug // opts->rtl_rms = 101; + //make it a little quieter + for (int x = 0; x < 960; x++) + state->analog_out[x] /= 4; + + + //seems to be working now, but RMS values are lower on actual analog signal than on no signal but noise - if ( (opts->audio_out_type == 0) && (opts->rtl_rms > opts->rtl_squelch_level) ) - pa_simple_write(opts->pulse_raw_dev_out, state->analog_out, 960*2, NULL); + if ( opts->rtl_rms > opts->rtl_squelch_level ) + { + if (opts->audio_out_type == 0) + pa_simple_write(opts->pulse_raw_dev_out, state->analog_out, 960*2, NULL); + + //NOTE: Worked okay earlier in Cygwin, so should be fine -- can only operate at 48k1, else slow mode lag + + //This one will only operate when OSS 48k1 (when both input and output are OSS audio) + if (opts->audio_out_type == 5 && opts->pulse_digi_rate_out == 48000 && opts->pulse_digi_out_channels == 1) + write (opts->audio_out_fd, state->analog_out, 960*2); + + //STDOUT, but only when operating at 48k1 (no go just yet) + // if (opts->audio_out_type == 1 && opts->pulse_digi_rate_out == 48000 && opts->pulse_digi_out_channels == 1) + // write (opts->audio_out_fd, state->analog_out, 960*2); + + //OSS 8k1 (no go just yet) + // if (opts->audio_out_type == 2 && opts->pulse_digi_rate_out == 48000 && opts->pulse_digi_out_channels == 1) + // write (opts->audio_out_fd, state->analog_out, 960*2); + } memset (state->analog_out, 0, sizeof(state->analog_out)); state->analog_sample_counter = 0;