diff --git a/apps/osmocom_fft b/apps/osmocom_fft index decde8f..396fc33 100755 --- a/apps/osmocom_fft +++ b/apps/osmocom_fft @@ -97,6 +97,12 @@ class app_top_block(stdgui2.std_top_block, pubsub): self.src = osmosdr.source_c(options.args) + try: + self.src.get_sample_rates().start() + except RuntimeError: + print "Source has no sample rates (wrong device arguments?)." + sys.exit(1) + # Set the antenna if(options.antenna): self.src.set_antenna(options.antenna) diff --git a/apps/osmocom_siggen_base.py b/apps/osmocom_siggen_base.py index cc2e4f6..298341c 100644 --- a/apps/osmocom_siggen_base.py +++ b/apps/osmocom_siggen_base.py @@ -159,6 +159,12 @@ class top_block(gr.top_block, pubsub): def _setup_osmosdr(self, options): self._sink = osmosdr.sink_c(options.args) + try: + self._sink.get_sample_rates().start() + except RuntimeError: + print "Sink has no sample rates (wrong device arguments?)." + sys.exit(1) + if options.samp_rate is None: options.samp_rate = self._sink.get_sample_rates().start() diff --git a/apps/osmocom_spectrum_sense b/apps/osmocom_spectrum_sense index a13f64b..7096ba1 100755 --- a/apps/osmocom_spectrum_sense +++ b/apps/osmocom_spectrum_sense @@ -149,6 +149,12 @@ class my_top_block(gr.top_block): # build graph self.u = osmosdr.source_c(options.args) + try: + self.u.get_sample_rates().start() + except RuntimeError: + print "Source has no sample rates (wrong device arguments?)." + sys.exit(1) + # Set the antenna if(options.antenna): self.u.set_antenna(options.antenna, 0)