I've been working on porting the rtlsdr library over to Java, testing against an original RTL-2832/E4000 Tuner.
I'm using integral polyphase decimation to arrive at a final 48k channel rate and I was experiencing very choppy demodulated audio (buffer underruns). After ruling out computer performance as a factor, I wrote a test app to measure the sample rate output from the rtl2832.
I tried hundreds of combinations of settings for registers 0x9F (high bits) and 0xA1 (low bits) and measured the output of each setting, averaged over a 100 second period, and discovered a significant disconnect between the expected sample rates set through the rtlsdr library versus actual output sample rates. It seems that register 0xA1 doesn't affect the sample rate.
It appears that the rtl2832 supports two sets of sample rate outputs. Both are divided multiples of the oscillator/crystal frequency.
RTL2832 with an E4000 with 28.8 MHz oscillator supports sampling rates of: 225-300 kHz and 900 - 2032 kHz. I couldn't get consistent stabilized outputs above 2032 kHz.
It looks like the anti-aliasing filters work equally well across both sets of rates, but I haven't tested all of the IF filter settings yet to verify. This might work out well for the folks trying to use these devices on lower powered processors like the raspberry pi, so that they don't have to process such high sample rates.
Here's what I discovered for 16-bit demod register 0x9F:
FEDCBA9876543210 (bit positions)
FEDC - not used for sample rate
B = 0 = 32x divider mode
A9876 - integral units ( 1 x oscillator frequency - 1/32nd of the oscillator frequency )
543210 - fractional units
--------------------------
B = 1 = 128x divider mode
A9876 - integral units ( 1/96th - 1/128th of the oscillator frequency )
543210 - fractional units
Some example settings for register 0x9F:
32x mode:
0x037F - 2057143 Hz (highest setting that locks consistently on my E4K)
0x07FF - 900000 Hz
128x mode:
0x0800 - 300000 Hz
0x0FFF - 225000 Hz
The full range of divided sample rates in 128x mode (225-300 kHz) works very well. The highest rates in 32x mode (1 - 13x) don't appear to lock at all. 14x (2057 MHz) drifts considerably from 2025 to 2031 Hz.
v/r,
Denny