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