Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soapy overflow::SoapySDR::Device::readStream timeout! #42

Open
alexFab opened this issue Mar 6, 2021 · 4 comments
Open

Soapy overflow::SoapySDR::Device::readStream timeout! #42

alexFab opened this issue Mar 6, 2021 · 4 comments

Comments

@alexFab
Copy link

alexFab commented Mar 6, 2021

Describe the bug
if use SoapyUHD for openwebrx. works fine for few minutes, than
data stream stops. i opened a issue at openwebrx but it seems to be more of a problem with soapy.

SDR-Hardware
USRP B210

To Reproduce
It happens after 10 - 60 min. At a sample rate of 4Msps and much earlier using 8Msps .

Installation method

Versions
latest master branch

Log messages
WARNING: Soapy overflow
WARNING: SoapySDR::Device::readStream timeout!
WARNING: SoapySDR::Device::readStream timeout!
WARNING: SoapySDR::Device::readStream timeout!
WARNING: SoapySDR::Device::readStream timeout!
WARNING: SoapySDR::Device::readStream timeout!
WARNING: SoapySDR::Device::readStream timeout!
WARNING: SoapySDR::Device::readStream timeout!
WARNING: SoapySDR::Device::readStream timeout!

Additional context
I'm not sure where the error is coming from. SoapySDR? SoapyUHD? Or just some miss configuration?

thx a lot!

@guruofquality
Copy link
Contributor

The print is probably in owrx_connector, but the B210 driver in UHD is probably returning uhd::rx_metadata_t::ERROR_CODE_TIMEOUT in stream->recv(): https://github.com/pothosware/SoapyUHD/blob/master/SoapyUHDDevice.cpp#L279

Now either there is a driver problem in B210, or the timeout is just really small and there are no more samples in the allotted time window - for the later, that may be an issue to tweak the timeout in owrx_connector

@alexFab
Copy link
Author

alexFab commented Mar 6, 2021

thx for your quick reply. i check the timeout but 1e6ns aka 1ms doesn't seem to be that small. but i have no idea,.What do you mean by "realy small". I changed timeoutNs to 1e9ns aka 1 sec. after around 5min the stream breaks again, this time without the log message.

@jketterl
Copy link

jketterl commented Mar 7, 2021

The variable is named incorrectly, the API actually takes microseconds, so 1e6 should give a timeout of one second. The default for that parameter is 100000 (or 100ms).

@guruofquality
Copy link
Contributor

Probably not the timeout

The USRP buffers samples into packets containing multiple samples. So its possible to have a very small timeout such that there will be not be enough time for a packet of samples to become buffered and available. On the extreme end, a timeout of 0 would also cause something like this. However it looks like the timeout is 1 second long...

Check the UHD library

So I think the issue is that B200 here or its driver in UHD is actually having a problem. You might try to reproduce the streaming issue in some other application with B200 or adding prints in the UHD driver. Again, the SoapyUHD code here is just a micro-thin wrapper on the UHD library, especially for the streaming.

Maybe the stream mode?

One other thought comes to mind is if somehow activateStream put the B200 in burst mode (where it requests a specified number of samples). That would mean that it times out sooner at higher samples rates: https://github.com/pothosware/SoapyUHD/blob/master/SoapyUHDDevice.cpp#L242

When stream->rx->issue_stream_cmd(cmd); is called make sure the mode is uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS;` If not, I guess we have a bisect point for this problem. But I do kind of suspect the UHD library being some kind of issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants