myriadrf / libxtrx

High-level XTRX API library
Apache License 2.0
28 stars 27 forks source link

Soapy RX results in incorrect stream runtime error #27

Closed hewittc closed 3 years ago

hewittc commented 4 years ago

The change introduced with https://github.com/xtrx-sdr/libxtrx/commit/1c0ad681f83a55fd7384e4b65a1ba014f9a9d15e#r38372515 causes requests for RX streams to fail with an "incorrect stream" runtime error.

hewittc commented 4 years ago

I think this patch addresses the issue and preserves the intended functionality:

diff --git a/soapy/SoapyXTRX.cpp b/soapy/SoapyXTRX.cpp
index 03a5e03..0b103c9 100644
--- a/soapy/SoapyXTRX.cpp
+++ b/soapy/SoapyXTRX.cpp
@@ -1191,7 +1191,8 @@ int SoapyXTRX::activateStream(
                } else {
                        _tx_internal = 32768;
                }
-       } else {
+       }
+       if ((stream != STREAM_RX) && (stream != STREAM_TX)) {
                throw std::runtime_error("SoapyXTRX::activateStream() - incorrect stream");
        }
G4GUO commented 4 years ago

I am getting this error too, only on receive streams, as you say the logic in activateStream looks wrong.