Closed luarvique closed 1 year ago
Once again, hardware errors should be handled by the hardware-specific libraries and modules. If a retry is appropriate, this can be handled by the device drivers. It is however inappropriate to assume that this is generally the case for all devices supported by SoapySDR.
The timeout should be an error condition, the only reason it isn't handled that way is stated in the comment above the corresponding block.
Also, I don't see the need to implement custom timekeeping in this piece of code. The timeout for readStream()
is configurable.
This pull request has been provided to you as a gesture of goodwill, in the hopes that you will use it to improve the quality of your software. You can accept or reject it as you like, it no longer makes any difference to me.
In the meanwhile, I will have to maintain and promote my own version of OpenWebRX, with all the changes I consider useful.
There's a lot of things I could say at this point, but you wouldn't listen to me anyway. You are bound to learn from your own experiences.
These changes will make Soapy connector restart streaming if readStream() keeps timing out for a long while (currently set to 60 seconds). The main reason for this behavior appears to be USB-connected SDR hardware having rare, intermittent failures due to fluctuating power. If this happens, SoapySDR may need to activateStream() again.
PS: Also somewhat reduced the number of log messages on timeouts, but it will tell how long it timed out in the log now.