airspy / airspyone_host

AirSpy's usemode driver and associated tools
http://airspy.com
245 stars 88 forks source link

Signal condition on USB error #75

Closed johanhedin closed 3 years ago

johanhedin commented 3 years ago

Signal the same condition on USB error as on a successful transfer so that the consumer_threadproc can exit properly when a USB error occur (like a device disconnect).

Mitigates issue #74.

bvernoux commented 3 years ago

This code shall be reviewed more carefully (and tested)

johanhedin commented 3 years ago
  • It seems in the code you have modified device->streaming = false shall be replaced by device->stop_requested = true for a clean stop to be confirmed/checked

Replacing device->streaming = false with device->stop_requested = true in the three locations my patch touches seem to work as well. But, this will remove the way to detect that something has happened since airspy_is_streaming() will now continue to return "streaming" even after the device is pulled...

And the streaming has stopped, so it feels logical that airspy_is_streaming() should return false in this case. But this can of course be fixed by extending airspy_is_streaming() to also check for device->stop_requested and return false if it is set to true.

johanhedin commented 3 years ago

Created a new pull request according to your suggestion (#76). Works as intended om my test setup. I will remove the irrelevant pull requests when the dust settles.

bvernoux commented 3 years ago

This PR is cancelled in favor to https://github.com/airspy/airspyone_host/pull/76