From 6bd03301aa7a9b3cf47a1773dcb77b5d728bfe8f Mon Sep 17 00:00:00 2001 From: Thijs Hekman Date: Wed, 19 Oct 2022 10:03:13 +0200 Subject: [PATCH] Bugfix: duplex stream came on output --- src/lasp/device/lasp_streammgr.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lasp/device/lasp_streammgr.cpp b/src/lasp/device/lasp_streammgr.cpp index e2714d4..dea3662 100644 --- a/src/lasp/device/lasp_streammgr.cpp +++ b/src/lasp/device/lasp_streammgr.cpp @@ -240,7 +240,8 @@ void StreamMgr::startStream(const DaqConfiguration &config) { devinfo = *devinfo2; } - isInput |= config.monitorOutput && devinfo.hasInternalOutputMonitor; + isInput |= (config.monitorOutput && devinfo.hasInternalOutputMonitor); + DEBUGTRACE_PRINT(isInput); bool isDuplex = isInput && isOutput; @@ -284,7 +285,9 @@ void StreamMgr::startStream(const DaqConfiguration &config) { _siggen->reset(daq->samplerate()); } outCallback = std::bind(&StreamMgr::outCallback, this, _1); + if(!isDuplex) { stream_placeholder = std::addressof(_outputStream); + } } daq->start(inCallback, outCallback); @@ -369,10 +372,11 @@ const Daq *StreamMgr::getDaq(StreamType type) const { return _inputStream.get(); } else { // Output stream. If input runs in duplex mode, this is also the output - // stream. In that case, we return the outputstram + // stream. In that case, we return the input stream if (_inputStream && _inputStream->duplexMode()) { return _inputStream.get(); + } else { + return _outputStream.get(); } - return _outputStream.get(); } }