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

Timeout on OpenWebRX #87

Open
n1zzo opened this issue Mar 9, 2021 · 2 comments
Open

Timeout on OpenWebRX #87

n1zzo opened this issue Mar 9, 2021 · 2 comments

Comments

@n1zzo
Copy link

n1zzo commented Mar 9, 2021

When using SoapyRemote with a RTL-SDR Blog V3 on ArchLinux ARM on a Raspberry Pi 2,
with OpenWebRX as a client, I get a timeout error every 1-3 hours.

While this happens the SoapyRemote stdout is clean:

$ SoapySDRServer --bind
######################################################
## Soapy Server -- Use any Soapy SDR remotely
######################################################

Server version: 0.5.1-unknown
Server UUID: 01ff786f-d886-1667-8567-1486a8c06e04
Launching the server... tcp://[::]:55132
Server bound to [::]:55132
Launching discovery server...
Connecting to DNS-SD daemon...
[INFO] Avahi version:  avahi 0.8
[INFO] Avahi hostname: degu-2
[INFO] Avahi domain:   local
[INFO] Avahi FQDN:     degu-2.local
[INFO] avahi_entry_group_add_service(degu-2._soapy._tcp)
Press Ctrl+C to stop the server
SoapyServerListener::accept([::ffff:192.168.4.200]:58286)
Found Rafael Micro R820T/2 tuner
SoapyServerListener::accept([::ffff:192.168.4.200]:58292)
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.4.200]:58294)
Found Rafael Micro R820T/2 tuner
Allocating 15 zero-copy buffers

This kind of fault is considered unrecoverable by the OpenWebRX client, here is the related issue on their side.

@guruofquality
Copy link
Contributor

Help me bisect the problem. Can you throw some prints into SoapyRTLSDR readStream? Lets see if the timeout comes from the hardware driver or the SoapyRemote: https://github.com/pothosware/SoapyRTLSDR/blob/master/Streaming.cpp#L340

If the hardware driver actually starts returning timeous, then so will the calls to SoapyRemote's readStream

@n1zzo
Copy link
Author

n1zzo commented Mar 30, 2021

Hi guruofquality,
sorry for the late reply, I should have performed the tests you asked.
This is the patch I've created which prints the number of read elements:

diff --git a/Streaming.cpp b/Streaming.cpp
index cac56e6..703ce7d 100644
--- a/Streaming.cpp
+++ b/Streaming.cpp
@@ -359,6 +359,7 @@ int SoapyRTLSDR::readStream(
     if (bufferedElems == 0)
     {
         int ret = this->acquireReadBuffer(stream, _currentHandle, (const void **)&_currentBuff, flags, timeNs, timeoutUs);
+       fprintf(stderr, "Read %d elements from SDR\n", ret);
         if (ret < 0) return ret;
         bufferedElems = ret;
     }

After having compiled, installed, and executed the code,
after waiting openwebrx to hang, these are the latest debug messages:

Read 131072 elements from SDR
Read -1 elements from SDR
Read 131072 elements from SDR
Read -1 elements from SDR
Read 131072 elements from SDR
Read -1 elements from SDR
Read 131072 elements from SDR
Read -1 elements from SDR
Read 131072 elements from SDR
Read -1 elements from SDR
Read 131072 elements from SDR
Read -1 elements from SDR
Read 131072 elements from SDR
Read -1 elements from SDR
Read 131072 elements from SDR
Read -1 elements from SDR
Read 131072 elements from SDR

So it appears that there were no errors from the SDR device and the timeout is coming from SoapyRemote itself, am I correct?

If you need further testing just let me know.

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

2 participants