Good day,
I found an issue, when i call rtl_test from external program with "-p” argument. PPM is written into stdout, which means it will be automatically flushed on interactive shell or when fflush called manually. Neither of this was used. All other output was written to stderr, hence simple patch:
diff --git a/src/rtl_test.c b/src/rtl_test.c
index 9a6cfda..c7e60c5 100644
--- a/src/rtl_test.c
+++ b/src/rtl_test.c
@@ -202,7 +202,7 @@
interval += (int64_t)(ppm_now.tv_nsec - ppm_recent.tv_nsec);
nsamples_total += nsamples;
interval_total += interval;
- printf("real sample rate: %i current PPM: %i cumulative PPM: %i\n",
+ fprintf(stderr, "real sample rate: %i current PPM: %i cumulative PPM: %i\n",
(int)((1000000000UL * nsamples) / interval),
ppm_report(nsamples, interval),
ppm_report(nsamples_total, interval_total));
Best Regards,
Andrey
Hi All,
I recently purchased a couple of DVB-sticks on Amazon, titled:
"RTL-SDR, FM+DAB, DVB-T USB Stick Set with RTL2832U & R820T. Great SDR
for SDR#, HDSD"
I got "No supported tuner found" when running the rtl_test command. I
see others have had the same issue, so when I finally figured it out, I
thought some of you might be interested.
First of all, this stick has a FC0012 tuner despite the title. Secondly
this stick is obliviously wired differently than other sticks with
FC0012 because it needs different gpio settings. I added a few lines to
the rtlsdr_open() function in librtlsdr.c, just before probing for FCxxx:
/* initialise GPIOs */
rtlsdr_set_gpio_output(dev, 0);
rtlsdr_set_gpio_output(dev, 3);
rtlsdr_set_gpio_output(dev, 4);
rtlsdr_set_gpio_output(dev, 5);
rtlsdr_set_gpio_output(dev, 6);
rtlsdr_set_gpio_bit(dev, 3, 1);
rtlsdr_set_gpio_bit(dev, 4, 0);
rtlsdr_set_gpio_bit(dev, 6, 0);
/* reset tuner before probing */
rtlsdr_set_gpio_bit(dev, 5, 1);
rtlsdr_set_gpio_bit(dev, 5, 0);
With this modification the tuner comes a live and everything works.
Kindest regards,
Gabor Mikes
I've prepared this patch in response to Debian bug #870804
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870804
It passes the text from the -a and -p options through
getaddrinfo() and uses the first result that has a valid
socket with a successful bind.
While not a complete bind to all possible valid names, it
does appear to address the use case of the bug submitter
without completely changing the program flow.
I submit this for inclusion in the osmocom rtl-sdr repo
as it may be of use to others.
Thanks for your consideration,
-Maitland