@@ -56,6 +56,7 @@ void usage(void)
5656 "\t[-n number of samples to read (default: 0, infinite)]\n"
5757 "\t[-S force sync output (default: async)]\n"
5858 "\t[-D direct_sampling_mode, 0 (default/off), 1 (I), 2 (Q), 3 (no-mod)]\n"
59+ "\t[-N no dithering (default: use dithering)]\n"
5960 "\tfilename (a '-' dumps samples to stdout)\n\n" );
6061 exit (1 );
6162}
@@ -115,6 +116,7 @@ int main(int argc, char **argv)
115116 int ppm_error = 0 ;
116117 int sync_mode = 0 ;
117118 int direct_sampling = 0 ;
119+ int dithering = 1 ;
118120 FILE * file ;
119121 uint8_t * buffer ;
120122 int dev_index = 0 ;
@@ -123,7 +125,7 @@ int main(int argc, char **argv)
123125 uint32_t samp_rate = DEFAULT_SAMPLE_RATE ;
124126 uint32_t out_block_size = DEFAULT_BUF_LENGTH ;
125127
126- while ((opt = getopt (argc , argv , "d:f:g:s:b:n:p:D:S " )) != -1 ) {
128+ while ((opt = getopt (argc , argv , "d:f:g:s:b:n:p:D:SN " )) != -1 ) {
127129 switch (opt ) {
128130 case 'd' :
129131 dev_index = verbose_device_search (optarg );
@@ -153,6 +155,9 @@ int main(int argc, char **argv)
153155 case 'D' :
154156 direct_sampling = atoi (optarg );
155157 break ;
158+ case 'N' :
159+ dithering = 0 ;
160+ break ;
156161 default :
157162 usage ();
158163 break ;
@@ -203,6 +208,16 @@ int main(int argc, char **argv)
203208 SetConsoleCtrlHandler ( (PHANDLER_ROUTINE ) sighandler , TRUE );
204209#endif
205210
211+ if (!dithering ) {
212+ fprintf (stderr , "Disabling dithering... " );
213+ r = rtlsdr_set_dithering (dev , dithering );
214+ if (r ) {
215+ fprintf (stderr , "failure\n" );
216+ } else {
217+ fprintf (stderr , "success\n" );
218+ }
219+ }
220+
206221 if (direct_sampling ) {
207222 verbose_direct_sampling (dev , direct_sampling );
208223 }
0 commit comments