Reconfigure RTL Volume Multiplier to be more dynamic;

This commit is contained in:
lwvmobile 2024-04-01 11:20:25 -04:00
parent f35aa046c1
commit fe9b5b51e8
6 changed files with 16 additions and 3 deletions

View File

@ -214,6 +214,8 @@ V - Toggle Low Pass Filter on Analog Voice or Raw Signal Monitoring
B - Toggle High Pass Filter on Analog Voice or Raw Signal Monitoring
N - Toggle Passband Filter on Analog Voice or Raw Signal Monitoring
v - Cycle RTL Input Volume Multiplier 1X, 2X, 3X (lower v)
```
## Sending Audio to a Icecast 2 Server via FFmpeg (Windows)

View File

@ -4602,6 +4602,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
}
if (c == 118 && opts->audio_in_type == 3) //'v' key, cycle rtl volume multiplier, when active
{
if (opts->rtl_volume_multiplier == 1 || opts->rtl_volume_multiplier == 2) opts->rtl_volume_multiplier++;
else opts->rtl_volume_multiplier = 1;
}
if (c == 86) // 'V' Key, toggle LPF
{
if (opts->use_lpf == 0) opts->use_lpf = 1;

View File

@ -133,6 +133,7 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
cleanupAndExit(opts, state);
//update root means square power level
opts->rtl_rms = rtl_return_rms();
sample *= opts->rtl_volume_multiplier;
#endif
}

View File

@ -208,18 +208,21 @@ void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn
for (i = 0; i < 960; i++)
{
get_rtlsdr_sample(&sample, opts, state);
sample *= opts->rtl_volume_multiplier;
analog1[i] = sample;
}
for (i = 0; i < 960; i++)
{
get_rtlsdr_sample(&sample, opts, state);
sample *= opts->rtl_volume_multiplier;
analog2[i] = sample;
}
for (i = 0; i < 960; i++)
{
get_rtlsdr_sample(&sample, opts, state);
sample *= opts->rtl_volume_multiplier;
analog3[i] = sample;
}
//the rtl rms value works properly without needing a 'hard' squelch value

View File

@ -1847,6 +1847,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
for (j = 0; j < dec; j++)
if (get_rtlsdr_sample(&sample, opts, state) < 0)
cleanupAndExit(opts, state);
sample *= opts->rtl_volume_multiplier;
voice1[i] = sample;
}
@ -1855,6 +1856,7 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
for (j = 0; j < dec; j++)
if (get_rtlsdr_sample(&sample, opts, state) < 0)
cleanupAndExit(opts, state);
sample *= opts->rtl_volume_multiplier;
voice2[i] = sample;
}

View File

@ -1027,6 +1027,7 @@ void open_rtlsdr_stream(dsd_opts *opts)
int r;
rtl_bandwidth = opts->rtl_bandwidth * 1000; //reverted back to straight value
bandwidth_multiplier = (bandwidth_divisor / rtl_bandwidth);
volume_multiplier = 1; //moved to external handling to be more dynamic
//this needs to be initted first, then we set the parameters
dongle_init(&dongle);
@ -1057,9 +1058,7 @@ void open_rtlsdr_stream(dsd_opts *opts)
if (opts->rtl_udp_port != 0) port = opts->rtl_udp_port; //set this here, only open socket thread if set
if (opts->rtl_gain_value > 0) {
dongle.gain = opts->rtl_gain_value * 10; //multiple by ten to make it consitent with the way rtl_fm works
}
volume_multiplier = opts->rtl_volume_multiplier;
// fprintf (stderr, "Setting RTL Volume Multiplier to %d\n", volume_multiplier);
}
/* quadruple sample_rate to limit to Δθ to ±π/2 */
demod.rate_in *= demod.post_downsample;