1
0
Fork 0

Disable RTL AGC mode by default.

This commit is contained in:
Joris van Rantwijk 2014-01-26 21:42:01 +01:00
parent c2de34860a
commit ec8fc6bee3
1 changed files with 6 additions and 8 deletions

14
main.cc
View File

@ -218,9 +218,9 @@ void usage()
" -f freq Frequency of radio station in Hz\n" " -f freq Frequency of radio station in Hz\n"
" -d devidx RTL-SDR device index, 'list' to show device list (default 0)\n" " -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" " -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, min 900001)\n"
" -r pcmrate Audio sample rate in Hz (default 48000 Hz)\n" " -r pcmrate Audio sample rate in Hz (default 48000 Hz)\n"
" -a 0 Disable RTL AGC mode (default 1 = enabled)\n"
" -M Disable stereo decoding\n" " -M Disable stereo decoding\n"
" -R filename Write audio data as raw S16_LE samples\n" " -R filename Write audio data as raw S16_LE samples\n"
" use filename '-' to write to stdout\n" " use filename '-' to write to stdout\n"
@ -293,6 +293,7 @@ int main(int argc, char **argv)
double freq = -1; double freq = -1;
int devidx = 0; int devidx = 0;
int lnagain = INT_MIN; int lnagain = INT_MIN;
bool agcmode = false;
double ifrate = 1.0e6; double ifrate = 1.0e6;
int pcmrate = 48000; int pcmrate = 48000;
bool stereo = true; bool stereo = true;
@ -303,7 +304,6 @@ int main(int argc, char **argv)
string ppsfilename; string ppsfilename;
FILE * ppsfile = NULL; FILE * ppsfile = NULL;
double bufsecs = -1; double bufsecs = -1;
int agcmode = 1;
fprintf(stderr, fprintf(stderr,
"SoftFM - Software decoder for FM broadcast radio with RTL-SDR\n"); "SoftFM - Software decoder for FM broadcast radio with RTL-SDR\n");
@ -314,7 +314,7 @@ int main(int argc, char **argv)
{ "gain", 1, NULL, 'g' }, { "gain", 1, NULL, 'g' },
{ "ifrate", 1, NULL, 's' }, { "ifrate", 1, NULL, 's' },
{ "pcmrate", 1, NULL, 'r' }, { "pcmrate", 1, NULL, 'r' },
{ "agc", 1, NULL, 'a' }, { "agc", 0, NULL, 'a' },
{ "mono", 0, NULL, 'M' }, { "mono", 0, NULL, 'M' },
{ "raw", 1, NULL, 'R' }, { "raw", 1, NULL, 'R' },
{ "wav", 1, NULL, 'W' }, { "wav", 1, NULL, 'W' },
@ -325,7 +325,7 @@ int main(int argc, char **argv)
int c, longindex; int c, longindex;
while ((c = getopt_long(argc, argv, while ((c = getopt_long(argc, argv,
"f:d:g:s:r:MR:W:P::T:b:a:", "f:d:g:s:r:MR:W:P::T:b:a",
longopts, &longindex)) >= 0) { longopts, &longindex)) >= 0) {
switch (c) { switch (c) {
case 'f': case 'f':
@ -390,9 +390,7 @@ int main(int argc, char **argv)
} }
break; break;
case 'a': case 'a':
if (!parse_int(optarg, agcmode)) { agcmode = true;
badarg("-a");
}
break; break;
default: default:
usage(); usage();
@ -403,7 +401,7 @@ int main(int argc, char **argv)
if (optind < argc) { if (optind < argc) {
usage(); usage();
fprintf(stderr, "ERROR: Invalid command line options\n"); fprintf(stderr, "ERROR: Unexpected command line options\n");
exit(1); exit(1);
} }