xmikos / soapy_power

Obtain power spectrum from SoapySDR devices (RTL-SDR, Airspy, SDRplay, HackRF, bladeRF, USRP, LimeSDR, etc.)
MIT License
172 stars 36 forks source link

Crash on macOS #21

Open citizenrich opened 5 years ago

citizenrich commented 5 years ago

When running qspectrum analyzer on macOS latest version with latest qsa and soapy_power the app crashes due to soapy_power.

Found Rafael Micro R820T tuner
WARNING: Sample rate 2560000.0 Hz is not supported, setting it to 96000.0 Hz!
INFO: Using device: Audio
[INFO] Using format CF32.
INFO: repeats: 439
INFO: samples: 4390 (time: 0.04573 s)
INFO: max_buffer_size (samples): 13107200 (repeats: 1310720.00, time: 136.53333 s)
INFO: buffer_size (samples): 6144 (repeats: 614.40, time: 0.06400 s)
INFO: buffer_repeats: 1
INFO: overlap: 0.00000
INFO: bin_size: 9600.00 Hz
INFO: bins: 10
INFO: bins (after crop): 10
INFO: sample_rate: 0.096 MHz
INFO: sample_rate (after crop): 0.096 MHz
INFO: freq_range: 21.000 MHz
INFO: hopping: YES
INFO: hop_size: 0.096 MHz
INFO: hops: 219
INFO: min_center_freq: 87.048 MHz
INFO: max_center_freq: 107.976 MHz
INFO: min_freq (after crop): 87.000 MHz
INFO: max_freq (after crop): 108.024 MHz
INFO: Total time: 0.625 s
Traceback (most recent call last):
  File "/usr/local/bin/soapy_power", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/soapypower/__main__.py", line 373, in main
    max_threads=args.max_threads, max_queue_size=args.max_queue_size
  File "/usr/local/lib/python3.7/site-packages/soapypower/power.py", line 296, in sweep
    psd_future, acq_time_start, acq_time_stop = self.psd(freq)
  File "/usr/local/lib/python3.7/site-packages/soapypower/power.py", line 256, in psd
    self.device.read_stream_into_buffer(self._buffer)
  File "/usr/local/lib/python3.7/site-packages/simplesoapy.py", line 484, in read_stream_into_buffer
    res.ret, SoapySDR.errToStr(res.ret)
RuntimeError: Unhandled readStream() error: -1 (TIMEOUT)
takurx commented 5 years ago

I have reproduced that on Beagle bone black, ubuntu 18.04.2, airspy mini ubuntu@arm:~$ soapy_power -r 1.0M -f 427M:447M -B 10k --fft-overlap 50 -F rtl_power_fftw -O output.csv --even -T 1 --debug DEBUG: scipy.fftpack module found WARNING: Sample rate 1000000.0 Hz is not supported, setting it to 3000000.0 Hz! INFO: Using device: Airspy DEBUG: SoapySDR stream - args: {} [INFO] Using format CF32. DEBUG: SoapySDR stream - buffer size: 65536 DEBUG: SoapySDR stream - read timeout: 0.121845 INFO: repeats: 1429 INFO: samples: 428700 (time: 0.14290 s) INFO: max_buffer_size (samples): 13107200 (repeats: 43690.67, time: 4.36907 s) INFO: buffer_size (samples): 458752 (repeats: 1529.17, time: 0.15292 s) INFO: buffer_repeats: 1 INFO: overlap: 0.00000 INFO: bin_size: 10000.00 Hz INFO: bins: 300 INFO: bins (after crop): 300 INFO: sample_rate: 3.000 MHz INFO: sample_rate (after crop): 3.000 MHz INFO: freq_range: 20.000 MHz INFO: hopping: YES INFO: hop_size: 3.000 MHz INFO: hops: 7 INFO: min_center_freq: 428.500 MHz INFO: max_center_freq: 446.500 MHz INFO: min_freq (after crop): 427.000 MHz INFO: max_freq (after crop): 448.000 MHz DEBUG: Frequency hops table: DEBUG: Min: Center: Max: DEBUG: 427.000 MHz 428.500 MHz 430.000 MHz DEBUG: 430.000 MHz 431.500 MHz 433.000 MHz DEBUG: 433.000 MHz 434.500 MHz 436.000 MHz DEBUG: 436.000 MHz 437.500 MHz 439.000 MHz DEBUG: 439.000 MHz 440.500 MHz 442.000 MHz DEBUG: 442.000 MHz 443.500 MHz 445.000 MHz DEBUG: 445.000 MHz 446.500 MHz 448.000 MHz DEBUG: Run: 1 DEBUG: Frequency hop: 428500000.00 Hz DEBUG: Tune time: 0.525 s DEBUG: Repeat: 1 INFO: Total time: 0.775 s Traceback (most recent call last): File "/usr/local/bin/soapy_power", line 10, in sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/soapypower/main.py", line 373, in main max_threads=args.max_threads, max_queue_size=args.max_queue_size File "/usr/local/lib/python3.6/dist-packages/soapypower/power.py", line 296, in sweep psd_future, acq_time_start, acq_time_stop = self.psd(freq) File "/usr/local/lib/python3.6/dist-packages/soapypower/power.py", line 256, in psd self.device.read_stream_into_buffer(self._buffer) File "/usr/local/lib/python3.6/dist-packages/simplesoapy.py", line 484, in read_stream_into_buffer res.ret, SoapySDR.errToStr(res.ret) RuntimeError: Unhandled readStream() error: -1 (TIMEOUT)

By the way, On Beagle bone black, ubuntu 18.04.2, rtl-sdr it works normally. On Thinkpad E480, ubuntu 18.04 airspy mini it works normally.