diff options
| author | Dimitri Stolnikov <horiz0n@gmx.net> | 2012-08-05 16:35:47 +0200 |
|---|---|---|
| committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2012-08-05 16:35:47 +0200 |
| commit | b49a8336eeb7ad2e6ea9a00cec9b61a41b21d788 (patch) | |
| tree | 95b6a00d039a70d15f2d63aa1a5c97ec1d1fbe9c /src | |
| parent | 88cd4b33cf66bca84289e3de26f8e4145424f59e (diff) | |
disable e4k enhanced mixer gain as it seems to have no effect
Diffstat (limited to 'src')
| -rw-r--r-- | src/librtlsdr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librtlsdr.c b/src/librtlsdr.c index 6a92fa5..1ed81ce 100644 --- a/src/librtlsdr.c +++ b/src/librtlsdr.c @@ -106,14 +106,18 @@ int e4000_set_bw(void *dev, int bw) { int e4000_set_gain(void *dev, int gain) { rtlsdr_dev_t* devt = (rtlsdr_dev_t*)dev; int mixgain = (gain > 340) ? 12 : 4; +#if 0 int enhgain = (gain - 420); - if(e4k_set_lna_gain(&devt->e4k_s, min(300, gain - 40)) == -EINVAL) +#endif + if(e4k_set_lna_gain(&devt->e4k_s, min(300, gain - mixgain * 10)) == -EINVAL) return -1; if(e4k_mixer_gain_set(&devt->e4k_s, mixgain) == -EINVAL) return -1; +#if 0 /* enhanced mixer gain seems to have no effect */ if(enhgain >= 0) if(e4k_set_enh_gain(&devt->e4k_s, enhgain) == -EINVAL) return -1; +#endif return 0; } int e4000_set_if_gain(void *dev, int stage, int gain) { @@ -702,8 +706,9 @@ enum rtlsdr_tuner rtlsdr_get_tuner_type(rtlsdr_dev_t *dev) int rtlsdr_get_tuner_gains(rtlsdr_dev_t *dev, int *gains) { + /* all gain values are expressed in tenths of a dB */ const int e4k_gains[] = { -10, 15, 40, 65, 90, 115, 140, 165, 190, 215, - 240, 290, 340, 420, 430, 450, 470, 490 }; + 240, 290, 340, 420 }; const int fc0012_gains[] = { -99, -40, 71, 179, 192 }; const int fc0013_gains[] = { -63, 71, 191, 197 }; const int fc2580_gains[] = { 0 /* no gain values */ }; |
