Hello!
I noticed a problem with rtl_fm and r820t tuners. In few words, it doesn't matter what value of gain you set with the -g parameter. The r820t tuner will be always at its lower gain, this is deaf as a doorknob.
Otherwise, the same dongles works fine with GNU Radio or GQRX for example, and gain can be set without problems.
rtl_fm gain works nicely on e4k tuners.
Someone else have noticed this?
*>>> Are you sure you are setting a supported gain value?*
Of course!
No matter what setting you put into -g parameter, the tuner is always at its lowest gain.
On 11/12/13, Miguel A. Vallejo ea4eoz@gmail.com wrote:
I noticed a problem with rtl_fm and r820t tuners. In few words, it doesn't matter what value of gain you set with the -g parameter. The r820t tuner will be always at its lower gain, this is deaf as a doorknob.
Are you sure?
rtl_fm -f 100M -g 50 > /dev/null Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000013 .... Found Rafael Micro R820T tuner .... Tuner gain set to 49.60 dB.
-Kyle http://kmkeen.com
*>>> Are you sure?*
Yes.
For the skeptics:
~$ rtl_fm -f 89000000 -R -s 1000000 -g 0 - | baudline -stdin -samplerate 1000000 -quadrature -flipcomplex -channels 2 -format le16 Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000013
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle Found Rafael Micro R820T tuner Oversampling input by: 2x. Oversampling output by: 1x. Buffer size: 4.10ms Tuned to 89500000 Hz. Sampling at 2000000 Hz. Output at 1000000 Hz. Exact sample rate is: 2000000.052982 Hz Tuner gain set to 0.00 dB.
Result: https://dl.dropboxusercontent.com/u/102802145/baudline0dB.jpg
~$ rtl_fm -f 89000000 -R -s 1000000 -g 30 - | baudline -stdin -samplerate 1000000 -quadrature -flipcomplex -channels 2 -format le16 Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000013
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle Found Rafael Micro R820T tuner Oversampling input by: 2x. Oversampling output by: 1x. Buffer size: 4.10ms Tuned to 89500000 Hz. Sampling at 2000000 Hz. Output at 1000000 Hz. Exact sample rate is: 2000000.052982 Hz Tuner gain set to 29.70 dB.
Result: https://dl.dropboxusercontent.com/u/102802145/baudline30dB.jpg
GQRX, LNA gain = 0dB
Result: https://dl.dropboxusercontent.com/u/102802145/gqrx0dB.jpg
GQRX, LNA gain=30dB
Result: https://dl.dropboxusercontent.com/u/102802145/gqrx30dB.jpg
It's clear rtl_fm does not set any gain to the r820t tuner
Hi,
On 12.11.2013 22:02, Miguel A. Vallejo wrote:
It's clear rtl_fm does not set any gain to the r820t tuner
Can't confirm. Using the current master, an R820T stick, and the exact same commands you posted I get the following:
http://steve-m.de/pics/rtl_fm/0db.png http://steve-m.de/pics/rtl_fm/30db.png
Can you please try the following patch and report back your output?
diff --git a/src/librtlsdr.c b/src/librtlsdr.c index 9b76a96..8a52602 100644 --- a/src/librtlsdr.c +++ b/src/librtlsdr.c @@ -948,6 +948,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); + fprintf(stderr, "%s(%d) -> %d\n", __FUNCTION__, gain, r); rtlsdr_set_i2c_repeater(dev, 0); }
@@ -993,6 +994,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); + fprintf(stderr, "%s(%d) -> %d\n", __FUNCTION__, mode, r); rtlsdr_set_i2c_repeater(dev, 0); }
Regards, Steve
*>>> Can you please try the following patch and report back your output?*
Sorry, but diff --git doesn't work in my system:
diff: unrecognized option '--git' diff: Try 'diff --help' for more information.
Well, never mind. I added the two lines by hand:
~$ rtl_fm -f 89000000 -R -s 1000000 -g 0 - | baudline -stdin -samplerate 1000000 -quadrature -flipcomplex -channels 2 -format le16 Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000013
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle Found Rafael Micro R820T tuner Oversampling input by: 2x. Oversampling output by: 1x. Buffer size: 4.10ms Tuned to 89500000 Hz. Sampling at 2000000 Hz. Output at 1000000 Hz. Exact sample rate is: 2000000.052982 Hz rtlsdr_set_tuner_gain_mode(1) -> 0 rtlsdr_set_tuner_gain(0) -> 0 Tuner gain set to 0.00 dB.
~$ rtl_fm -f 89000000 -R -s 1000000 -g 30 - | baudline -stdin -samplerate 1000000 -quadrature -flipcomplex -channels 2 -format le16 Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000013
Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle Found Rafael Micro R820T tuner Oversampling input by: 2x. Oversampling output by: 1x. Buffer size: 4.10ms Tuned to 89500000 Hz. Sampling at 2000000 Hz. Output at 1000000 Hz. Exact sample rate is: 2000000.052982 Hz rtlsdr_set_tuner_gain_mode(1) -> 0 rtlsdr_set_tuner_gain(297) -> 0 Tuner gain set to 29.70 dB.
Hope this helps...
*>>> I am still not sure of what your problem is.*
I think it was clear: No matter what gain I set to rtl_fm with the -g switch, the tuner is ALWAYS at its lowest gain.
*>>> It looks to me like the tuner gain is getting set.*
For me too
*>>> Does any other program work with that dongle?* *>>> Perhaps the tuner chip is fried. *
No it isn't. It works just fine with GQRX or SDR#. The problem seems related to rtl_fm only.