Comments (4)
DSPAcquisitionInit can hang as well, the second time time an RTL SDR is started. Similar workaround applies.
And forgot to mention, there needs to be coded added to DSPDeviceSourceEngine::handleInputMessages() to handle those messages.
(RTL SDR driver crash on stop has been worked around by using rtlsdr_read_sync instead of rtlsdr_read_async)
from sdrangel.
So, it appears there are cases where we do need to wait some of these DSPDeviceSourceEngine commands to complete.
One such case is in void MainWindow::removeDeviceSet. It starts by calling deviceEngine->stopAcquistion(); which results in RTLSDRInput::stop being called. It later on calls deleteSampleSourcePluginInstanceInput, which calls ~RTLSDRInput which also calls RTLSDRInput::stop(). In this instance, it's on the main thread, so it will hang if the previous stop hasn't completed.
So, we need a way for DSPDeviceSourceEngine and friends to indicate when they have completed, but without blocking. As an experiment, I've tried adding an acquistionStopped signal to DSPDeviceSourceEngine. MainWindow::removeDeviceSet then needs to be broken up in to two parts: First calling stopAcquistion - then when it gets the acquistionStopped signal, it can continue the rest of the device set deletion. Seems to work.
from sdrangel.
It does get a little trickier though. In mainwindow.cpp, there are several places where all device sets are removed as part of some other sequential code, such as:
// Do X...
// Remove device sets
while (m_deviceUIs.size() > 0) {
removeLastDeviceSet();
}
// Do Y...
This needs to be broken up in to separate steps, with a non-blocking wait for a signal after each device set is removed, before trying to remove the next.
Trying to think of the cleanest way to write this code, I came across Qt's State Machine API: https://doc.qt.io/qt-5/statemachine-api.html - which seems like a reasonable way to sequence different bits of code using signals. I will give it a try.
Any thoughts on any of this?
from sdrangel.
I only had a quick look at the Qt state machine and I find it quite interesting. When the events and event handlers start to be rather complex it probably helps keep things tidy. State Machine is a well known design pattern.
from sdrangel.
Related Issues (20)
- SDRAngel Android: Error saving files HOT 5
- Hey It NOT ISSUES But i need colormap Add cubehelix HOT 1
- qtgamepad not exist in QT6 HOT 6
- Ability to pre-cache map data (so that you can see the ADB-S map while offline) HOT 1
- 7.21.4 fails to open W11 x64. HOT 2
- Sdrangel doesn't see Hackrf on Mac HOT 2
- SDRAngel stutters 30 seconds after being put to background on Android HOT 2
- SDRAngel stops receiving after 7 hours on Android HOT 2
- Switching between software using Plutosdr HOT 1
- Cannot load library & Could not start sample source HOT 3
- SDRAngel loses connection to SDR-dongle when plugging/unplugging AC-adapter on android HOT 1
- Broadcast FM modulator plugin HOT 4
- Raspberry PI or sdarngel
- ADSB, no map display
- Build fails with `datvideorender.cpp:282:46: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channels’`; and warning `AutoUic: /var/cache/makepkg/build/sdrangel-git/src/sdrangel/plugins/channelrx/demodft8/ft8demodgui.ui: Warning: The name 'verticalLayout_2' (QVBoxLayout) is already in use, defaulting to 'verticalLayout_21'`.
- Windows 11 HOT 2
- server from ubuntu
- Unable to open software for nooelec SDR V5 on iMac. HOT 11
- SDRangel crashes APT
- Converting special characters in pocsag logger
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 sdrangel.