Comments (7)
I think you are right. The setupStream spawns the handler threads for both endpoints. For transmit, this isnt an issue, the transmit thread will never actually call writeStream() until the client provides data. But for receive, the thread immediately starts calling readStream(), before active stream can be called by the client.
However, I think most of the implementations basically timeout in the read/writeStream() calls if activateStream() has not been called. activateStream() was supposed to be a comparatively lightweight call to enable streaming after setupStream() did all of the heavy lifting.
So SoapyRemote might be acting "rude" by calling readStream prematurely, but SoapySDRPlay might be doing way too much in activate. I'm still thinking about... Its not like I declared in the documentation ahead of time that this particular order of calls should be safe :-)
from soapyremote.
I think this is ok if I know I should return timeout in this case; I think that would solve the issue we're seeing. It's possible I have some things in the wrong place and I'll review/compare that as well.
from soapyremote.
Keep in mind the timeout implementation is going to actually have to wait or sleep or it will end up with a 100% cpu loop in the stream thread.
from soapyremote.
Thinking about this more, if we couldn’t guarantee that it was safe to call readStream() before activateStream(), then its not super clear when the readStream() thread should be allowed to run -- because the activate/deactivate calls can handle advanced stream control like timed bursts. Even though there is an obvious answer in this case for SoapySDRPlay.
Also, we would loose the ability to have the threads setup ahead of time to be ready to go when the stream is activated. Its along the same lines of "setup stream does the costly setup and heavy lifting", "activate stream is doing lightweight minimal work enable/control the stream". And FWIW, SoapyRemote may not be the only instance where the stream API gets used like this because of how the user sets up threads for example.
So I think its best if SoapySDRPlay was robust against being read even before activation happens. And for that matter, any others if this issue also comes up.
from soapyremote.
Hopefully this wasn't too much of a "cop-out" coming up with the readStream() timeout before activate, but I think its for the best.
from soapyremote.
Aye, seems to work ok here now; I don't have a problem with it just might want to document it somewhere.
from soapyremote.
Good idea. I added some comments about it: pothosware/SoapySDR@9e7e528
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.