Fix for rtlsdr_set_tuner_if_gain()

Stefan Sydow st at
Sun Jul 8 21:19:46 UTC 2012


Am 08.07.2012 12:01, schrieb Steve Markgraf:
> I've now pushed a change to librtlsdr that disables the AGC by
> default, and added the function rtlsdr_set_agc_mode() that can
> be used to re-enable it again.

This works well. I use rtlsdr_set_tuner_if_gain() now to compensate 
for the gain loss and found a bug there: The i2c repeater needs to 
be enabled.

--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -775,7 +775,9 @@ int rtlsdr_set_tuner_if_gain(rtlsdr_dev_t *dev, int stage, int gain)
                return -1;
        if (dev->tuner->set_if_gain) {
+               rtlsdr_set_i2c_repeater(dev, 1);
                r = dev->tuner->set_if_gain(dev, stage, gain);
+               rtlsdr_set_i2c_repeater(dev, 0);
        return r;

More information about the osmocom-sdr mailing list