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

OSX - figure out good default buffer size #15

Closed
ghost opened this issue Nov 1, 2015 · 6 comments
Closed

OSX - figure out good default buffer size #15

ghost opened this issue Nov 1, 2015 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 1, 2015

Server is Ubuntu 14.04 32 bits
Client is CubicSDR on OSX 10.10.5

All latest manual builds.

SDR thread starting.
device init()
[INFO] SoapyRemote::setupRxStream(remoteFormat=CS8, localFormat=CF32, scaleFactor=128, mtu=8192, window=16384000)
[INFO] Client side stream bound to 192.168.1.21:54160
[INFO] Client side status bound to 192.168.1.21:54160
[INFO] Using format CS8.
[INFO] Client side stream connected to 192.168.1.19:59808
[ERROR] StreamEndpoint resize socket buffer FAIL: setsockopt(SO_RCVBUF) [55: No buffer space available]
[INFO] Configured receiver endpoint: dgram=8144 bytes, 4060 elements @ 2 bytes, window=16000 KiB
[INFO] Server side stream bound to 192.168.1.19:59808
[INFO] Server side stream connected to 192.168.1.21:54160
[INFO] Server side status connected to 192.168.1.21:56720
[WARNING] StreamEndpoint resize socket buffer: set 16384000 bytes, got 1048576 bytes
[INFO] Configured sender endpoint: dgram=8144 bytes, 4060 elements @ 2 bytes, window=1024 KiB
[WARNING] Set thread priority 0.5 failed: Operation not permitted
Calculated optimal 6 channel element count of 85338
starting readLoop()
Calculated optimal 6 channel element count of 42666
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
@guruofquality
Copy link
Contributor

I may have recently "fixed" something in regards to reporting the error from setting the socket buffer. Has any behaviour actually changed other than the error message appearing. I assume the stream of SSSSS's were not there prior?

@ghost
Copy link
Author

ghost commented Nov 2, 2015

I never tried remote before, so i cannot tell you.

Ton.

On Sun, Nov 1, 2015 at 7:49 PM, Josh Blum [email protected] wrote:

I may have recently "fixed" something in regards to reporting the error
from setting the socket buffer. Has any behaviour actually changed other
than the error message appearing. I assume the stream of SSSSS's were not
there prior?


Reply to this email directly or view it on GitHub
#15 (comment)
.

@guruofquality
Copy link
Contributor

OSX is a little strange with the socket buffer sizes. We tried to pick a default on that would be acceptable. Some notes here: https:/pothosware/SoapyRemote/blob/master/common/SoapyRemoteDefs.hpp#L38

So then the resize fails like this, the actual size isnt known, and the flow control may not properly protect the socket buffer from overflow (thats the S printed). On linux, the resize never fails, it just comes up short. @cjcliffe When we last looked at this, did you have to change any OSX parameters to allow for the 16k buffer size?

So we need to figure out an acceptable default size, or some algorithm to determine the size-cap without erroring out, and to make the size readback robust as well, so we always know the actual size, even in the event of failure to set the size.

@guruofquality
Copy link
Contributor

This commit should readback the proper window, even after buffer resize fails. Plus better logging: 9f7a887

@Toontje Can you experiment with reducing #define SOAPY_REMOTE_DEFAULT_ENDPOINT_WINDOW (16*1024)? Im curious at what value it stops failing.

@cjcliffe
Copy link
Contributor

cjcliffe commented Nov 2, 2015

I assume it's an RTL dongle since I see the remote format as CS8 -- Not sure if it's related, but the following hack from when we were trying to figure out what was up with SoapyRemote+RTLSDR+OSX is still active on the version of CubicSDR that @Toontje is using:

    if (deviceArgs.count("rtl") != 0) {
        streamArgs["remote:mtu"] = "8192";
        streamArgs["remote:format"] = "CS8";
        streamArgs["remote:window"] = "16384000";
    }

That code has already been removed in my local commits as I'm adding all the stream and device settings into the device selection dialog which will let you change this stuff manually.

@guruofquality guruofquality changed the title No buffer space available OSX - figure out good default buffer size Nov 6, 2015
@guruofquality
Copy link
Contributor

Really old bug. OSX has different ifdef sizes here for this reason.

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

No branches or pull requests

2 participants