follow keenerd and don't stop the i2c repeater on tuner gain/freq change. Fixes slow tune/gain changes on AMD devices apparently

This commit is contained in:
rtlsdrblog 2023-08-27 15:12:55 +12:00
parent 7b16cfbbe1
commit ef7651cc92

View File

@ -900,11 +900,12 @@ int rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq)
dev->direct_sampling = (freq < 28800000 && dev->tuner_type == RTLSDR_TUNER_R820T) ? 2 : 0;
if (dev->direct_sampling) {
rtlsdr_set_i2c_repeater(dev, 0);
r = rtlsdr_set_if_freq(dev, freq);
} else if (dev->tuner && dev->tuner->set_freq) {
rtlsdr_set_i2c_repeater(dev, 1);
r = dev->tuner->set_freq(dev, freq - dev->offs_freq);
rtlsdr_set_i2c_repeater(dev, 0);
/*rtlsdr_set_i2c_repeater(dev, 0);*/
}
if (!r)
@ -1053,7 +1054,7 @@ int rtlsdr_set_tuner_gain(rtlsdr_dev_t *dev, int gain)
if (dev->tuner->set_gain) {
rtlsdr_set_i2c_repeater(dev, 1);
r = dev->tuner->set_gain((void *)dev, gain);
rtlsdr_set_i2c_repeater(dev, 0);
/*rtlsdr_set_i2c_repeater(dev, 0);*/
}
if (!r)
@ -1082,7 +1083,7 @@ int rtlsdr_set_tuner_if_gain(rtlsdr_dev_t *dev, int stage, int gain)
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);
/*rtlsdr_set_i2c_repeater(dev, 0);*/
}
return r;
@ -1098,7 +1099,7 @@ int rtlsdr_set_tuner_gain_mode(rtlsdr_dev_t *dev, int mode)
if (dev->tuner->set_gain_mode) {
rtlsdr_set_i2c_repeater(dev, 1);
r = dev->tuner->set_gain_mode((void *)dev, mode);
rtlsdr_set_i2c_repeater(dev, 0);
/*rtlsdr_set_i2c_repeater(dev, 0);*/
}
return r;