1
0
Fork 0

Be accurate in disallowing sampling rates in SoftFM.

The rtl-sdr driver code disallows most of the sampling rates below
900 kS/s. However, it allows a small window of sampling rates
between [250001, 300000]. The update to the conditional is along
the lines of the conditions imposed by the RTL SDR driver here:

http://cgit.osmocom.org/rtl-sdr/tree/src/librtlsdr.c

The default sampling rate of 1 MS/s causes severe buffer underruns on
a Raspberry Pi 2. However choosing a sampling rate of 250 kS/s and
lower values for PCM sampling causes successful FM demodulation of
strong FM stations on the device.
This commit is contained in:
Divye Kapoor 2015-11-21 07:57:47 +00:00
parent fc30717198
commit e9fe05c4ea
1 changed files with 7 additions and 4 deletions

View File

@ -219,7 +219,7 @@ void usage()
" -d devidx RTL-SDR device index, 'list' to show device list (default 0)\n"
" -g gain Set LNA gain in dB, or 'auto' (default auto)\n"
" -a Enable RTL AGC mode (default disabled)\n"
" -s ifrate IF sample rate in Hz (default 1000000, min 900001)\n"
" -s ifrate IF sample rate in Hz (default 1000000, valid range: [225001, 300000] U [900000, 3200000])\n"
" -r pcmrate Audio sample rate in Hz (default 48000 Hz)\n"
" -M Disable stereo decoding\n"
" -R filename Write audio data as raw S16_LE samples\n"
@ -355,8 +355,11 @@ int main(int argc, char **argv)
}
break;
case 's':
// NOTE: RTL does not suppor sample rate 900 kS/s or lower
if (!parse_dbl(optarg, ifrate) || ifrate <= 900000) {
// NOTE: RTL does not support some sample rates below 900 kS/s
// Also, max sampling rate is 3.2 MS/s
if (!parse_dbl(optarg, ifrate) ||
(ifrate <= 225000) || (ifrate > 3200000) ||
((ifrate > 300000) && (ifrate <= 900000))) {
badarg("-s");
}
break;