Commit Graph

86 Commits

Author SHA1 Message Date
Charles J. Cliffe a409822429 Enumerator class and warnings cleanup 2021-04-22 00:34:45 -04:00
Charles J. Cliffe 4605eaccf0 Cleanup: demodulator mgr, instances, threads 2021-04-04 22:14:31 -04:00
Charles J. Cliffe 850e646c6d Fix source of bandwidth display visual glitch 2020-08-10 23:16:37 -04: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 3f90cbb858 Flush queues on terminate() calls to unblock push()s and so ease threads termination 2017-08-28 20:53:21 +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 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 946a9801dc FIX: Inactive demod bendwiths are restored to 0 from sessions, because they were erroneously saved as such.
The problem lies in DemodulatorPreThread:
- settings were actually get/set unprotected from concurrent access (bendwiths, frequencies, sample rates...etc) so make them atomic.
- If bandwith has changed, return the new value instead of the current one, just like frequencies.
2017-02-20 21:39:12 +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
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 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 59b154c9b0 Merge pull request #269 from viraptor/demod_mem_init
Fix demodulator uninitialized read
2016-01-28 17:56:49 -05:00
Stanisław Pitucha 3835d5cef4 Fix demodulator uninitialized read 2016-01-29 09:50:25 +11: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 7e4d173996 Basic console window for digital output
- Probably end up making this a single tabbed dialog but this works for
the moment
2015-11-28 23:03:07 -05:00
Charles J. Cliffe e68ab1e82f Remember settings when toggling modem types
- Some additional race condition fixes for showing/hiding the modem
property grid
2015-11-26 22:06:29 -05:00
Charles J. Cliffe 4fa0cb7c67 Persist modem settings on new instances 2015-11-26 01:54:54 -05:00
Charles J. Cliffe 4af943791b Modem can now trigger kit rebuild, add FSK test settings 2015-11-23 20:44:48 -05:00
Charles J. Cliffe 7b301fadc1 Clean up some early prototype garbage.. 2015-11-22 23:25:45 -05:00
Charles J. Cliffe c0eca0b2f3 Allow modems to limit/control input rate
- Modems can now over-ride user rate input and lock/step as needed
- Separate digital code defs a bit more so it’s not required when
disabled
- Testing FSK based on @andresv ’s example at
https://github.com/jgaeddert/liquid-dsp/issues/9
2015-11-22 19:56:25 -05:00
Charles J. Cliffe fb677d0ee2 Constructor init order warning fixes 2015-11-20 22:29:04 -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 dfd7496175 digital modem wrap-up and re-connect
- Compiles but untested
2015-11-18 23:40:30 -05:00
Charles J. Cliffe 5f6b492478 Analog modems now somewhat functional
- Still major memory leaks.. :)
2015-11-17 23:23:23 -05:00
Charles J. Cliffe f53e228849 Cleanup / finalize demod before initial testing 2015-11-17 21:49:02 -05:00
Charles J. Cliffe 8ac4498db7 code cleanup 2015-11-17 20:47:00 -05:00
Charles J. Cliffe 39c42c2b82 Add modemkit to demod chain 2015-11-17 19:32:47 -05:00
Charles J. Cliffe 73ca52aee1 Convert demodulator type ids to strings for now 2015-11-17 18:57:42 -05:00
Charles J. Cliffe a1a6a467e8 Modem, ModemKit and initial ModemAnalog refactor 2015-11-16 23:49:54 -05:00
Charles J. Cliffe edd154296c FIR Polyphase filterbank channelizer prototype implementation
- Can now handle several 200khz FM streams with SDRPlay at 8Mhz+ on my
old 2010 Macbook Pro :)
- Demod bandwidth max now limited to 400khz, temporary until alternate
path for high-bandwidth is available
2015-10-14 00:54:48 -04:00
Charles J. Cliffe fe46fb191f Fix demodulator worker thread crash on terminate 2015-08-24 07:25:04 -04:00
Charles J. Cliffe 10e35002f1 AudioThread & demod worker IOThread queues, cleanup 2015-07-30 19:30:46 -04:00
Charles J. Cliffe 0a9dd7692a DemodulatorThread convert to IOThread named queues 2015-07-30 00:28:53 -04:00
Charles J. Cliffe d53aabf73a DemodulatorPreThread convert to IOThread named queues 2015-07-29 22:52:54 -04:00
Charles J. Cliffe 05cd99bbf1 IOThread all the things! 2015-07-29 20:57:02 -04:00
Charles J. Cliffe 2d8c2800cb more ReBuffer<> updates 2015-07-28 22:14:48 -04:00