Comments (11)
@cjcliffe If you feel like giving this a shot, try this branch: https://github.com/pothosware/SoapyRemote/commits/ssdp_work It works, but its not well tested. We will have to see how portable the multicast code ends up being across platforms.
from soapyremote.
Here is an interesting quirk of SSDP (at least in my mind). So we have this system where anyone should be able to open a UDP socket, join the multi-cast group and discover and share information. But the service provider replies to the MSEARCH queries through unicast UDP. So when you have multiple processes on the same host, only one of them is going to actually receive the unicast response, and its not always going to be the one that sent the multicast MSEARCH request.
That's not a problem when a host only runs one instance of the SSDP service, and there are some platform specific means to query from the deamon/service what network services have been discovered. But for this use case, I want the SoapyRemote implementation to be portable, so it must talk to a socket and not a platform-specific interface. Also, I want localhost clients to be able to discover localhost servers. Or even multiple of such clients.
For reference, here is another with the same problem: https://stackoverflow.com/questions/12794761/upnp-multicast-missing-answers-from-m-search-discovery The work-a-round of using a different port would not fix the multiple processes issue. It basically makes its own domain-specific multi-cast group separate from the other SSDP traffic, which would also be technically OK for SoapyRemote.
Anyway, my workaround for this issue was to simply respond to MSEARCH with multicast. The usual unicast MSEARCH response is still sent. In addition, the server responds with a multicast NOTIFY packet. NOTIFY packets are part of the specification, and this way the client always gets notified ASAP, one way or the other. Triggering a NOTIFY from an MSEARCH may or may not be typical, but judging from my local network (with wireshark), NOTIFY packets are like a forest full of birds in spring all trying to get their mating calls heard.
from soapyremote.
OSX Update
- IPv4 protocol works
- IPv6 IPV6_JOIN_GROUP for ff02::c fails (Can't assign requested address)
- MCAST_JOIN_GROUP should handle multicast joining for both IPv4 and IPv6, and it would simplify the code. That too fails on OSX, for both IPv4 and IPv6. I might think it was me doing something wrong but: https://bugs.php.net/bug.php?id=63000
- Set SO_REUSEPORT when using multicast, but only on BSD style machine (portability grrr):
#ifdef __APPLE__
ret = ::setsockopt(_sock, SOL_SOCKET, SO_REUSEPORT, (const char *)&one, sizeof(one));
if (ret != 0)
{
SoapySDR::logf(SOAPY_SDR_ERROR, "setsockopt(SO_REUSEPORT) -- %d", ret);
}
#endif //__APPLE__
from soapyremote.
Will try this out here on OSX this weekend -- should be able to get a couple systems on the network and see how it goes.
from soapyremote.
@cjcliffe Let me know if you get the IPV6_JOIN_GROUP error as well. Its harmless, it just means the ipv6 part of the service doesn't run. You are welcome to mess around with sockets. But more to the point, if every every apple is going to dump an error here, I will just ifdef out the ipv6 multicast for osx. To test it, just run SoapySDRServer --bind
, it happens right away.
from soapyremote.
merged. We will just have to see what errors come up.
from soapyremote.
@guruofquality aye; haven't had a chance to spin it up here yet been battling some CubicSDR crashes and gain updates :)
from soapyremote.
No problem. I tested enough so that things should be safe to use -- worst case, the feature doesn't work. And I did some tweaks to the error reporting so that any failures wouldn’t look obnoxious.
from soapyremote.
Relevant comments about the OSX IPv6 issue, it may not support the automatic interface (ipv6mr_interface = 0): syncthing/syncthing#1563
from soapyremote.
This was the work-around, basically logic to automatically select an interface thats up, not loopback, and supports multicast: 43a5bef
So everything seems to be working as far as I can test. Closing off.
from soapyremote.
awesome work, actually building on Raspberry Pi for testing some remote stuff at the moment; will be trying discovery soon
from soapyremote.
Related Issues (20)
- SSDP: periodic message handling broken HOT 3
- Installation docs reference old package name HOT 1
- abort using with cubic sdr
- `SoapySDRUtil --find="remote=a.b.c.d"` instantly throws `No devices found! ` without trying to send a packet. HOT 2
- Use of SoapySDR Converter subsystem
- Crash on failure to create avahi client or poller HOT 3
- Crash after connect HOT 6
- Tips for wifi ? HOT 2
- Crash with more than 31 network interfaces HOT 2
- apt-get Errors were encountered while processing: soapysdr-server HOT 1
- REQ: SoapySDRServer for Android.
- CubicSDR can connect but cannot listen. HOT 4
- Timeout on OpenWebRX HOT 2
- Transmission timeouts
- Can't connect to SoapyRemote
- setupStream() arguments HOT 1
- Use of remote:prot=tcp on resource constrained devices HOT 4
- SoapyRPCUnpacker::recv(header) FAIL on Raspberry PI OS 64bit
- FR: Option to disable mDNS HOT 2
- Match SoapySDR platform support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soapyremote.