Commit Graph

101 Commits

Author SHA1 Message Date
vsonnier
b55609c802 AudioThread: rollback some guard code because of previously wrong understanding 2018-01-22 07:26:13 +01:00
vsonnier
033bbd07df AudioThread: re-apply consistent formating 2018-01-22 07:10:45 +01:00
vsonnier
fc1c1c3b4d AudioThread: rollback deviceCleanup() to only doing terminate + TEST: apply to all platforms 2018-01-22 07:04:45 +01:00
vsonnier
36224defd7 AudioThread: Rework mutex usage (again) + added proper cleanups (hopefully) 2018-01-21 18:08:46 +01:00
vsonnier
d8ff4ea1de Squash some warnings with std::shared_ptr init seen on Ubuntu 16.04 2017-10-29 15:06:24 +01:00
vsonnier
230a87d8df AudioThread: Revised mutex usage for devices vs. AudioThread* due to erroneous implem., creating crashes in some cases
(damn those things are hard...)
2017-10-28 11:57:01 +02:00
vsonnier
f4107c1541 Optimized VisualProcessor by using a non-recursive mutex and making some ops non-blocking, small AudioThread opt as well 2017-10-14 11:34:25 +02:00
vsonnier
927d727a16 Try not to use atomics in performance code 2017-09-22 22:53:59 +02:00
vsonnier
252b6bf9f8 AudioThread polishing 2017-09-01 06:18:35 +02:00
vsonnier
3a5b30dda8 Fix AudioThread nullptr check 2017-08-31 21:29:53 +02:00
vsonnier
a8f8f4a7e2 Initial commit: working... 2017-08-27 11:11:30 +02:00
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
acc6d2a31d Restart the device automatically if stuck with read stream errors 2017-08-13 22:14:12 +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
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
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
vsonnier
196c664cf4 Device Sample Rate improvements: UI, changed device sample rates to be expressed as long instead of int at some places for safety/consistency. Also pedantic harmless traces changes. 2017-01-21 12:56:16 +01:00
Charles J. Cliffe
3ec14fbe38 Licence fix, add SPDX-License-Identifier, remove unused code files 2017-01-02 21:07:43 -05: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
Charles J. Cliffe
df33751f9e might be null.. 2016-06-08 21:48:10 -04:00
Charles J. Cliffe
d7ef86ae10 On second thought, let’s not go to Camelot. ‘Tis a silly place. 2016-06-08 21:45:52 -04:00
Charles J. Cliffe
0067e309d1 more debugging; fix some potential refcount leaks... 2016-06-08 21:31:52 -04: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
6d63d570aa comment out some noisy stdout logging until there's a proper facility for log outputs 2016-06-02 19:45: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
Charles J. Cliffe
f22ef685f5 Static analysis related fixes 2016-03-30 19:34:36 -04:00
Stanisław Pitucha
035353123d Fix signed/unsigned variables 2016-01-29 07:49:31 +11:00
Stanisław Pitucha
c1eb1de1bd Fix remaining unused parameters 2016-01-27 11:45:54 +11:00
Charles J. Cliffe
7d6a387a77 Updates and improvements for low-bandwidth input usage 2015-12-29 20:52:49 -05:00
Charles J. Cliffe
207d61cd0c Merge pull request #156 from cjcliffe/master
Two crash fixes from master branch
2015-10-09 12:58:44 -04:00
Eoin Mcloughlin
0b10a5b30c Fix crash in AudioThread::setActive
If AudioThread::run() hasn't been called yet, we can dereference a null inputQueue
2015-10-07 20:18:29 +01:00
Charles J. Cliffe
dff879f233 Move deviceSelector init startup -> appframe
- Plus some minor static analysis fixes and missing atomic store() for
MSVC
2015-10-05 19:59:17 -04:00
Charles J. Cliffe
bab2ad3780 cleanup 2015-08-03 23:41:37 -04:00
Charles J. Cliffe
10e35002f1 AudioThread & demod worker IOThread queues, cleanup 2015-07-30 19:30:46 -04:00
Charles J. Cliffe
05cd99bbf1 IOThread all the things! 2015-07-29 20:57:02 -04:00
Charles J. Cliffe
19f9b7ab70 MSVC fixes 2015-07-21 00:59:18 -04:00
Charles J. Cliffe
d5d44b0b30 Better initial sample rate setup, remove hard-coded default rate and use device info matching /w fallback 2015-03-22 20:47:07 -04:00
Charles J. Cliffe
4147582d2a Refactor for sample rate changes, audio thread race crash fixes 2015-03-15 21:02:26 -04:00
Charles J. Cliffe
b197a7ddb2 Can now set output sample rate, demodulator sample rate doesn't adjust yet so I find it rather hilarious at the moment :) 2015-03-13 22:25:07 -04:00
Charles J. Cliffe
84bd856c53 Remove unused non-mixer based code, simplifies audio thread and can be emulated by overloading thread device ids anyways 2015-03-12 19:34:50 -04:00
Charles J. Cliffe
4e13b625ca Fix for mixer clipping bug that's causing audio to crackle 2015-03-01 10:30:02 -05:00
Charles J. Cliffe
009e20e448 Linux patches 2015-02-22 01:58:00 -05:00
Charles J. Cliffe
8a859c661b MSVC + Win32/x86 patch 2015-02-20 00:34:32 -05:00
Charles J. Cliffe
c221ee2216 missing peak gain apply 2015-02-11 22:55:34 -05:00