mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-04-03 01:55:39 +02:00
disable sample rate correction until we find a proper solution
This commit is contained in:
parent
2ad7b39e2d
commit
42a6592e63
@ -667,10 +667,10 @@ int rtlsdr_set_freq_correction(rtlsdr_dev_t *dev, int ppm)
|
|||||||
/* read corrected clock value into e4k structure */
|
/* read corrected clock value into e4k structure */
|
||||||
if (rtlsdr_get_xtal_freq(dev, NULL, &dev->e4k_s.vco.fosc))
|
if (rtlsdr_get_xtal_freq(dev, NULL, &dev->e4k_s.vco.fosc))
|
||||||
return -3;
|
return -3;
|
||||||
|
#if 0
|
||||||
if (dev->rate) /* reset sample rate to apply new correction value */
|
if (dev->rate) /* reset sample rate to apply new correction value */
|
||||||
r |= rtlsdr_set_sample_rate(dev, dev->rate);
|
r |= rtlsdr_set_sample_rate(dev, dev->rate);
|
||||||
|
#endif
|
||||||
if (dev->freq) /* retune to apply new correction value */
|
if (dev->freq) /* retune to apply new correction value */
|
||||||
r |= rtlsdr_set_center_freq(dev, dev->freq);
|
r |= rtlsdr_set_center_freq(dev, dev->freq);
|
||||||
|
|
||||||
@ -804,7 +804,7 @@ int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t samp_rate)
|
|||||||
uint16_t tmp;
|
uint16_t tmp;
|
||||||
uint32_t rsamp_ratio;
|
uint32_t rsamp_ratio;
|
||||||
double real_rate;
|
double real_rate;
|
||||||
uint32_t rtl_freq;
|
uint32_t rtl_freq = dev->rtl_xtal;
|
||||||
|
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return -1;
|
return -1;
|
||||||
@ -812,11 +812,14 @@ int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t samp_rate)
|
|||||||
/* check for the maximum rate the resampler supports */
|
/* check for the maximum rate the resampler supports */
|
||||||
if (samp_rate > MAX_SAMP_RATE)
|
if (samp_rate > MAX_SAMP_RATE)
|
||||||
samp_rate = MAX_SAMP_RATE;
|
samp_rate = MAX_SAMP_RATE;
|
||||||
|
#if 0
|
||||||
/* read corrected clock value */
|
/* read corrected clock value */
|
||||||
if (rtlsdr_get_xtal_freq(dev, &rtl_freq, NULL))
|
if (rtlsdr_get_xtal_freq(dev, &rtl_freq, NULL))
|
||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
|
if (samp_rate == MAX_SAMP_RATE && rtl_freq != DEF_RTL_XTAL_FREQ)
|
||||||
|
rtl_freq = DEF_RTL_XTAL_FREQ;
|
||||||
|
#endif
|
||||||
rsamp_ratio = (rtl_freq * TWO_POW(22)) / samp_rate;
|
rsamp_ratio = (rtl_freq * TWO_POW(22)) / samp_rate;
|
||||||
rsamp_ratio &= ~3;
|
rsamp_ratio &= ~3;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user