Commit Graph

171 Commits

Author SHA1 Message Date
vsonnier
e32e687fe8 Make IOThreads terminate() fully non-blocking and misc.
- Thanks to timed-pop() usage, it is no longer needed to nudge queues with dummy to wake them
- Less bad luck to be stuck there
- Misc: leave the trace about the audio thread staturation, useful despite it raises some alarm among users...
2017-08-14 09:46:53 +02:00
vsonnier
c64baab99d Threads vs. Queues lifetimes, cleanups.
- Ideally Queues must outlive the threads using them, but wasn't done so. Yes, std::shared_ptr them!
- Now queues are always valid in the context of the threads using them.
- No longer need tedious queues deallocation by the original owner.
- Misc cleanups.
2017-08-13 19:19:25 +02:00
vsonnier
98c7c30aee Yet another Thread termination problem found, and try killing the app if the closing turns bad 2017-08-13 12:11:14 +02:00
vsonnier
3604b7f1ff Even better thread and application termination:
- Now that timed-pop()/try_pop() prevent indefinite blocking it is best to flush() on thread stopping to unblock push()
- Reworked a bit the CubicSDR::OnExit() sequence, see comments.
2017-06-01 19:57:58 +02:00
vsonnier
9b0ce69e8f Use the nuclear option to solve the hung problem:
Besides deadlocks, a thread can in theory get stuck in a blocking pop(),
not seeing the stopping flag in particular. So assure liveness by making all
pop() timed pop.
2017-05-25 09:32:27 +02:00
vsonnier
4b323e9863 Make ReBuffer refcount management automatic, using std::shared_ptr:
- No longer need to call setRefCount() / decRefCount()
- Restore old ThreadBlockingQueue using std::deque, for std::shared_ptr correct behaviour.
2017-05-24 12:28:37 +02:00
vsonnier
051ebec49f BLOCKING_QUEUE: let audio-out try_push() too, else it often blocks evrything while in debugger... 2017-02-18 10:15:47 +01:00
vsonnier
3ed65eff8e BLOCKING_QUEUE: don't forget to cleanup if we try_push() 2017-02-15 20:27:57 +01:00
vsonnier
c7467a88bc BLOCKING_QUEUE: prepare by raising up max queue lenghts
BLOCKING_QUEUE: Replaced ThreadQueue usage by ThreadBlockingQueue usage
BLOCKING_QUEUE: instrument all push() with timeouts, showed some call have to be non-blocking...
BLOCKING_QUEUE: tuned push()/try_push()
2017-02-14 18:42:05 +01:00
Charles J. Cliffe
3ec14fbe38 Licence fix, add SPDX-License-Identifier, remove unused code files 2017-01-02 21:07:43 -05:00
Charles J. Cliffe
6ede20c3e8 Prevent solo-squelch focus from interrupting user actions; acts as temporary hold as well 2016-08-16 17:55:40 -04:00
vsonnier
0d50a2b241 SMALL_SQUELCH_CLEANUP: No need to DSP tricks to compute magnitude, sqrt() is free on desktop CPUs 2016-08-13 21:25:54 +02:00
Charles J. Cliffe
6a9e60efa9 Only use audio signal level for AM based modems 2016-08-13 14:50:20 -04:00
Charles J. Cliffe
9f5c674646 Make sure squelch lock is released on de-activate too 2016-08-13 14:18:41 -04:00
Charles J. Cliffe
2bbae7209f Solo squelch break focus lock/tweak 2016-08-12 22:58:33 -04:00
Charles J. Cliffe
6ea2b5b8e8 More squelch tweaks; include I/Q dB and compare to audio for peak 2016-08-12 21:34:34 -04:00
Charles J. Cliffe
606d41bc30 Make audio the signal level instead of I/Q.. Fix attack/decay base to sample time. 2016-08-12 20:31:20 -04:00
Charles J. Cliffe
dedac01709 Moving signal ceil/floor for squelch 2016-08-10 14:02:25 -04:00
Charles J. Cliffe
0f5b891b20 Fix Digital scope 2016-07-24 17:24:29 -04:00
Charles J. Cliffe
0090838070 Make modemFactories function ref vs. instances which carry other dsp kit stuff 2016-07-24 15:25:17 -04:00
vsonnier
21c8a81c32 TH_CLEAN_3.5: push() cleanup side of things, assure SDRThread::readStream() to actually check for full + make ThreadQueue notify even in case on not-successfull push(), make it spam notify_all() everytime 2016-07-08 23:30:15 +02:00
vsonnier
b495b388c9 TH_CLEAN_3: Use of non-blocking try_pop() when possible,
AudioThread concurrent access hardening and simplified,
and misc.
2016-07-05 21:45:42 +02:00
vsonnier
567d84711f THREAD_CLEAN_PART2: Assure correct terminate()/isTerminated(delay)/delete sequence +
Removed the NotifyQueue between DemodulatorInstance participants, actually not needed
since DemodulatorInstance::IsTerminated() is explicitly called on some events for cleanups

DELETE_CLEANUP: properly nullify deleted pointers when needed
2016-07-03 14:22:41 +02:00
vsonnier
52de909cfb THREAD_CLEAN: Clearly distinguish between a request to stop by terminate() from the actual termination isTerminated() 2016-06-28 22:16:34 +02:00
vsonnier
4ec08b8b68 MISC 1 : Create ReBuffer by default with refcount 1, so remove redundant refCount(1) evertwhere 2016-06-09 19:38:20 +02:00
Charles J. Cliffe
b54ab38a47 More minor tweaks; getBuffer refcount 1 init suggestion from @vsonnier 2016-06-08 19:48:46 -04:00
Charles J. Cliffe
2bdefca263 Trying.. still one stuck in the queue on delete.. 2016-06-07 21:12:30 -04:00
Charles J. Cliffe
50bfb251f8 Attempt to clean up any buffers that weren't used on terminate, still one hanging around.. 2016-06-07 20:36:59 -04:00
Charles J. Cliffe
fa9dfc2fb4 Rough visual cue for demod instances, implement squelch break indicator 2016-06-03 20:05:38 -04:00
Charles J. Cliffe
6d63d570aa comment out some noisy stdout logging until there's a proper facility for log outputs 2016-06-02 19:45:34 -04:00
Charles J. Cliffe
99f7beba49 ReBuffer is overkill for scope vis and crashes OSX; just push and delete at reciever; clean up lazy exception-fallback loadSession code 2016-06-02 19:25:52 -04:00
Charles J. Cliffe
d2943b56c4 Merge branch 'session_bugfix' 2016-06-01 19:48:32 -04:00
Charles J. Cliffe
688181e566 Cleanup MSVC warnings and deprecated C++ exception stuff 2016-06-01 19:42:34 -04:00
vsonnier
357dcc967b MISC 1: make IOThread input and output queues returned as ThreadQueueBase*, not void*, cleaner.
then use static_cast for downcasts, because we know what we are doing
2016-06-01 19:42:11 +02:00
vsonnier
41ca39eab7 FIX audioVisOutputQueue nullptr crash 2016-06-01 19:32:22 +02:00
Charles J. Cliffe
786f5ba524 Don't squelch-break solo-follow if breaker is muted. 2016-02-11 02:01:04 -05:00
Charles J. Cliffe
008a7bf77d Add solo squelch break 2016-02-11 01:32:39 -05:00
Charles J. Cliffe
16ba35a892 Solo mode :) 2016-02-11 01:09:15 -05:00
Charles J. Cliffe
65005b60ac Linux - missing header and warning fixes 2016-02-04 18:05:33 -05:00
Charles J. Cliffe
c4dac53532 Fix remaining init order and unused warnings 2016-01-28 18:11:53 -05:00
Stanisław Pitucha
035353123d Fix signed/unsigned variables 2016-01-29 07:49:31 +11:00
Charles J. Cliffe
cdc80b890b Add ReBuffer buffer count warning, fix SDRPostThread off-by-one channel reset 2015-12-04 22:10:51 -05:00
Charles J. Cliffe
c303b68284 Basic X/Y scope plot while in digital mode 2015-11-29 13:35:12 -05:00
Charles J. Cliffe
7b301fadc1 Clean up some early prototype garbage.. 2015-11-22 23:25:45 -05:00
Charles J. Cliffe
724808d9ff Clean-up/fix squelch 2015-11-21 15:12:20 -05:00
Charles J. Cliffe
fb677d0ee2 Constructor init order warning fixes 2015-11-20 22:29:04 -05:00
Charles J. Cliffe
a55dcad8be Remove unused demod buffer 2015-11-20 22:13:09 -05:00
Charles J. Cliffe
7e856988a2 Fix spectrum/waveform display when higher than audio rate 2015-11-20 20:46:25 -05:00
Charles J. Cliffe
86270b3300 race/init fix; skip audio output on digital 2015-11-19 00:11:34 -05:00
Charles J. Cliffe
10aa9f86dd Apply source formatting for demodulator thread 2015-11-18 21:13:04 -05:00