102 Commits

Author SHA1 Message Date
vsonnier
030628c5ed SDRPostThread is better using try_push, restore previous audio-related code in DemodulatorInstance 2017-09-02 16:24:25 +02:00
vsonnier
9bbcb582e3 Fix hang when the active demodulator goes out-of-bandwwidth by changing sample rate 2017-08-31 20:51:37 +02:00
vsonnier
03bf38fea8 Squashing an actual memory leak in SDRPostThread by simplifying the code 2017-08-28 21:22:07 +02: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
3c3939e0b7 Use nullptr instead of NULL when shared_ptr is used 2017-08-27 13:00:32 +02:00
vsonnier
37712c7a81 Simplify SDRPostThread: no longer binding methods, directly use the true list of demodulators 2017-08-27 12:39:28 +02:00
vsonnier
a8f8f4a7e2 Initial commit: working... 2017-08-27 11:11:30 +02:00
vsonnier
c112026a2c Make processing queues timed-push, to be able to escape deadlocks. Rollback 'restart device when blocked' that is ineffective in practice. 2017-08-26 23:34:48 +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
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
8f608bbf5c Cleanup: remove some unused params and variables, conversion warnings seen with #550. 2017-05-29 20:22:10 +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
77a82e1617 Another fix for the neverending hung application bugs:
- Clear up DemodulatorInstance garbage collection, only do it in a single thread (AppFrame::OnIdle)
- Add a specific mutex lock for the list of deleted demodulators,
- Add a specific lock to control DemodulatorInstance thread lifetimes, protecting IsTerminated() of concurrent join and delete
2017-05-25 08:03:08 +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
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
4783ae5be1 Dummy data bump shouldn't be needed now; racing with small bandwidths? 2016-07-10 20:29:31 -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
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
5bb43f5aaa Replace mutex lock/unlock pairs with guards, cleanups 2016-06-03 18:45:03 +02:00
Charles J. Cliffe
423c83f500 mutex locking cleanup for demod add / remove chain 2016-06-02 21:48:01 -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
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
Charles J. Cliffe
c1863d9319 Basic cleanup / mutex additions / bulk demod add 2016-05-31 19:58:37 -04:00
Charles J. Cliffe
f22ef685f5 Static analysis related fixes 2016-03-30 19:34:36 -04:00
Charles J. Cliffe
93d2c73fb9 Add delta lock -- lock modem relative to center frequency 2016-02-15 17:43:10 -05:00
Stanisław Pitucha
77b2d54870 Initialize frequency 2016-01-29 20:08:33 +11:00
Stanisław Pitucha
035353123d Fix signed/unsigned variables 2016-01-29 07:49:31 +11:00
Charles J. Cliffe
68c409486e Fix toggling between low/high bw with same channel count 2015-12-29 23:25:22 -05:00
Charles J. Cliffe
7d6a387a77 Updates and improvements for low-bandwidth input usage 2015-12-29 20:52:49 -05:00
Charles J. Cliffe
1eb84d6fa7 SDRPostThread cleanup 2015-12-05 18:52:36 -05: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
7027e7bf0b Missed crash fix for channelizer channel 0 2015-10-27 17:06:39 -04:00
Charles J. Cliffe
3fc6f9ad80 Several crash/bug fixes, uninitialized vars 2015-10-27 16:53:06 -04:00
Charles J. Cliffe
ac93aa369b Manual Gain Control :-)
- Disable AGC from settings menu
- Requires latest SoapySDRPlay gain commits for SDRPlay
2015-10-27 01:56:49 -04:00
Charles J. Cliffe
b89d606af3 SoapySDR 0.4.0 updates
- Requires up-to-date SoapySDR 0.4.x and re-built modules
2015-10-23 02:53:51 -04:00
Charles J. Cliffe
67c184262a Minor tweaks and cleanup
- add functions to access SDRPostThread
2015-10-18 12:26:07 -04:00
Charles J. Cliffe
6ee51711db Fix channel gap on upper edge of spectrum 2015-10-17 18:25:14 -04:00
Charles J. Cliffe
f1475fb9be Move DC correction to channel 0, reduce demod vis CPU usage
- Demod vis now uses channelizer output instead of decimation
- DC correction now only applied to channel 0
2015-10-17 16:17:12 -04:00
Charles J. Cliffe
beccdf8c63 firpfbch2->firpfbch experiment
- My assumption about this not working correctly may be wrong, this
actually seems to work ok compared to firpfbch2
2015-10-16 18:40:40 -04:00
Charles J. Cliffe
a4dc4498fc Add support for my experimental firpfbch2_crcf_set_channel_state
- Needs my fork of liquid-dsp at:
https://github.com/cjcliffe/liquid-dsp/tree/firpfbch_toggle_channels
2015-10-15 21:01:07 -04:00
Charles J. Cliffe
249e04e69c Move DC blocking filter to SDRThread
- DC blocker + Channelizer too heavy together
2015-10-15 01:35:08 -04:00
Charles J. Cliffe
d8c048fecc SDRPostThread cleanup/refactor
- Cache active demodulators and channel info instead of running the
whole list each time
2015-10-14 18:09:29 -04: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
9d06fa77c7 Use hardware DC when available
- un-comment code in SoapySDRThread for remote testing…
2015-09-30 23:45:06 -04:00
Charles J. Cliffe
1918707304 Initial experimental support for SoapySDR device input 2015-09-13 22:18:29 -04:00