Comments (5)
from dab-cmdline.
The problem will occur if dabReset() is called twice quickly. Perhaps adding this to one of the examples will show it.
You can see there is a potential problem just by looking at the code for start(), stop() and run() though:
stop() uses 'running' to determine whether to join:
if (running. load ()) {
running. store (false);
myReader. setRunning (false);
sleep (1);
threadHandle. join ();
}
However, the running variable is only set some lines of code in to run()
void dabProcessor::run (void) {
std::complex FreqCorr;
timeSyncer myTimeSyncer (&myReader);
int32_t i;
float fineOffset = 0;
float coarseOffset = 0;
bool correctionNeeded = true;
std::vector<complex> ofdmBuffer (T_null);
int dip_attempts = 0;
int index_attempts = 0;
int startIndex = -1;
isSynced = false;
snr = 0;
running. store (true); //// Set here <----
If reset() is called twice quickly, it's possible that running isn't yet set from the first invocation when stop is called for the second invocation. This means join doesn't get called - and so when the thread destructor is called, terminate() is called as the thread is still joinable.
Unfortunately, just setting running to true in start() isn't enough. That ensures join is called - but the thread sometimes doesn't end.
from dab-cmdline.
from dab-cmdline.
That is because the DAB library was designed for just running a single service in a single channel.
I believe that is all that we are doing. What I think happens is the following:
- When the user changes the frequency, dabReset() is called.
- stop() in the dab library has a 1 second delay.
- This is long enough, that the user could change the frequency again, while it is waiting, resulting in a second call to dabReset() getting queued, so it is called immediately after the first returns.
I guess I could add some code to prevent that - but calling dabReset() twice in succession didn't seem unreasonable.
from dab-cmdline.
from dab-cmdline.
Related Issues (20)
- debian package build for dab-cmdline HOT 3
- mot-object: does not save object to filesystem HOT 3
- AAC_OUT: it seems AAC LC format changed to AAC SBR HOT 10
- Use newer SSE2NEON for more intrinsics with Arm/Aarch64 fastpath HOT 1
- Stack corruption in reedSolomon::decode_rs HOT 4
- [Win32] crash in FULL_SPIRAL_sse() HOT 11
- streamInit() failed in python-example HOT 3
- Random "Sorry cannot handle service" HOT 14
- no audio out with Raspberry Pi OS Lite HOT 5
- Library for python HOT 2
- Example 1 - dataOutHandler question HOT 7
- Audio-device for cmdline.py HOT 2
- Example 3 crashes HOT 13
- dab-library within MPD plugin HOT 7
- semaphore.h clashes with system semaphore.h HOT 1
- tii_data_t doesn't include userData parameter HOT 4
- Main TII of 0x16 decodes as 0xff HOT 20
- Problem in example 1 HOT 5
- Formal things HOT 5
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 dab-cmdline.