Hello community,

here is the log from the commit of package soapy-uhd for openSUSE:Factory 
checked in at 2018-06-19 12:02:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/soapy-uhd (Old)
 and      /work/SRC/openSUSE:Factory/.soapy-uhd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "soapy-uhd"

Tue Jun 19 12:02:23 2018 rev:2 rq:616940 version:0.3.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/soapy-uhd/soapy-uhd.changes      2017-11-08 
15:09:44.170918724 +0100
+++ /work/SRC/openSUSE:Factory/.soapy-uhd.new/soapy-uhd.changes 2018-06-19 
12:02:26.276762165 +0200
@@ -1,0 +2,10 @@
+Fri Jun  8 10:45:21 UTC 2018 - [email protected]
+
+- Update to version 0.3.4
+  * Optional check for dsp freq range in property tree
+  * Tx de/activateStream() return 0 for NOP, not an error
+  * Support timestamp for deactivateStream() stream command
+  * Conditional support for new logging API (replaces msg.hpp)
+  * Tx stream activation hooks based on start and end of burst
+
+-------------------------------------------------------------------

Old:
----
  soapy-uhd-0.3.3.tar.gz

New:
----
  soapy-uhd-0.3.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ soapy-uhd.spec ++++++
--- /var/tmp/diff_new_pack.AGY6Ap/_old  2018-06-19 12:02:26.884739591 +0200
+++ /var/tmp/diff_new_pack.AGY6Ap/_new  2018-06-19 12:02:26.888739443 +0200
@@ -1,6 +1,7 @@
 #
 # spec file for package soapy-uhd
 #
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 # Copyright (c) 2017, Martin Hauke <[email protected]>
 #
 # All modifications and additions to the file contributed by third parties
@@ -19,7 +20,7 @@
 %define soapy_modname soapysdr%{soapy_modver}-module-uhd
 
 Name:           soapy-uhd
-Version:        0.3.3
+Version:        0.3.4
 Release:        0
 Summary:        Soapy SDR plugins for UHD supported SDR devices
 License:        GPL-3.0

++++++ soapy-uhd-0.3.3.tar.gz -> soapy-uhd-0.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyUHD-soapy-uhd-0.3.3/CMakeLists.txt 
new/SoapyUHD-soapy-uhd-0.3.4/CMakeLists.txt
--- old/SoapyUHD-soapy-uhd-0.3.3/CMakeLists.txt 2017-04-30 00:11:21.000000000 
+0200
+++ new/SoapyUHD-soapy-uhd-0.3.4/CMakeLists.txt 2017-12-15 02:43:42.000000000 
+0100
@@ -93,6 +93,13 @@
     message(STATUS "  has set_publisher() API")
 endif()
 
+if (EXISTS "${UHD_INCLUDE_DIRS}/uhd/utils/msg.hpp")
+    add_definitions(-DUHD_HAS_MSG_HPP)
+    message(STATUS "  use msg.hpp for logging")
+else()
+    message(STATUS "  use log.hpp for logging")
+endif()
+
 ########################################################################
 # Setup boost
 ########################################################################
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyUHD-soapy-uhd-0.3.3/Changelog.txt 
new/SoapyUHD-soapy-uhd-0.3.4/Changelog.txt
--- old/SoapyUHD-soapy-uhd-0.3.3/Changelog.txt  2017-04-30 00:11:21.000000000 
+0200
+++ new/SoapyUHD-soapy-uhd-0.3.4/Changelog.txt  2017-12-15 02:43:42.000000000 
+0100
@@ -1,3 +1,12 @@
+Release 0.3.4 (2017-12-14)
+==========================
+
+- Optional check for dsp freq range in property tree
+- Tx de/activateStream() return 0 for NOP, not an error
+- Support timestamp for deactivateStream() stream command
+- Conditional support for new logging API (replaces msg.hpp)
+- Tx stream activation hooks based on start and end of burst
+
 Release 0.3.3 (2017-04-29)
 ==========================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyUHD-soapy-uhd-0.3.3/SoapyUHDDevice.cpp 
new/SoapyUHD-soapy-uhd-0.3.4/SoapyUHDDevice.cpp
--- old/SoapyUHD-soapy-uhd-0.3.3/SoapyUHDDevice.cpp     2017-04-30 
00:11:21.000000000 +0200
+++ new/SoapyUHD-soapy-uhd-0.3.4/SoapyUHDDevice.cpp     2017-12-15 
02:43:42.000000000 +0100
@@ -11,7 +11,11 @@
 #include <SoapySDR/Logger.hpp>
 #include <uhd/version.hpp>
 #include <uhd/device.hpp>
+#ifdef UHD_HAS_MSG_HPP
 #include <uhd/utils/msg.hpp>
+#else
+#include <uhd/utils/log_add.hpp>
+#endif
 #include <uhd/usrp/multi_usrp.hpp>
 #include <uhd/property_tree.hpp>
 #include <cctype>
@@ -236,7 +240,7 @@
     int activateStream(SoapySDR::Stream *handle, const int flags, const long 
long timeNs, const size_t numElems)
     {
         SoapyUHDStream *stream = reinterpret_cast<SoapyUHDStream *>(handle);
-        if (not stream->rx) return SoapySDR::Device::activateStream(handle, 
flags, timeNs, numElems);
+        if (not stream->rx) return 0; //NOP, does nothing, but not an error
 
         //determine stream mode
         uhd::stream_cmd_t::stream_mode_t mode;
@@ -258,11 +262,15 @@
     int deactivateStream(SoapySDR::Stream *handle, const int flags, const long 
long timeNs)
     {
         SoapyUHDStream *stream = reinterpret_cast<SoapyUHDStream *>(handle);
-        if (not stream->rx) return SoapySDR::Device::deactivateStream(handle, 
flags, timeNs);
-        if (flags != 0) return SOAPY_SDR_NOT_SUPPORTED;
+        if (not stream->rx) return 0; //NOP, does nothing, but not an error
 
-        //stop the stream
-        
stream->rx->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
+        //stop the stream (stop mode might support a timestamp)
+        uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
+        cmd.stream_now = (flags & SOAPY_SDR_HAS_TIME) == 0;
+        cmd.time_spec = uhd::time_spec_t::from_ticks(timeNs, 1e9);
+
+        //issue command
+        stream->rx->issue_stream_cmd(cmd);
         return 0;
     }
 
@@ -580,7 +588,8 @@
             //read the range from the property tree
             uhd::property_tree::sptr tree = _dev->get_device()->get_tree();
             const std::string path = 
str(boost::format("/mboards/0/%s_dsps/%u/freq/range") % ((dir == 
SOAPY_SDR_TX)?"tx":"rx") % channel);
-            return 
metaRangeToRangeList(tree->access<uhd::meta_range_t>(path).get());
+            if (tree->exists(path)) return 
metaRangeToRangeList(tree->access<uhd::meta_range_t>(path).get());
+            else return SoapySDR::RangeList(1, 
SoapySDR::Range(-getSampleRate(dir, channel)/2, getSampleRate(dir, channel)/2));
         }
         return SoapySDR::Device::getFrequencyRange(dir, channel, name);
     }
@@ -825,6 +834,7 @@
 /***********************************************************************
  * Register into logger
  **********************************************************************/
+#ifdef UHD_HAS_MSG_HPP
 static void SoapyUHDLogger(uhd::msg::type_t t, const std::string &s)
 {
     if (s.empty()) return;
@@ -837,6 +847,37 @@
     case uhd::msg::fastpath: SoapySDR::log(SOAPY_SDR_SSI, s); break;
     }
 }
+#else
+static void SoapyUHDLogger(const uhd::log::logging_info &info)
+{
+    //build a log message formatted from the information
+    std::string message;
+
+    if (not info.file.empty())
+    {
+        std::string shortfile = info.file.substr(info.file.find_last_of("/\\") 
+ 1);
+        message += "[" + shortfile + ":" + std::to_string(info.line) + "] ";
+    }
+
+    if (not info.component.empty())
+    {
+        message += "[" + info.component + "] ";
+    }
+
+    message += info.message;
+
+    switch(info.verbosity)
+    {
+    case uhd::log::trace:   SoapySDR::log(SOAPY_SDR_TRACE, message); break;
+    case uhd::log::debug:   SoapySDR::log(SOAPY_SDR_DEBUG, message); break;
+    case uhd::log::info:    SoapySDR::log(SOAPY_SDR_INFO, message); break;
+    case uhd::log::warning: SoapySDR::log(SOAPY_SDR_WARNING, message); break;
+    case uhd::log::error:   SoapySDR::log(SOAPY_SDR_ERROR, message); break;
+    case uhd::log::fatal:   SoapySDR::log(SOAPY_SDR_FATAL, message); break;
+    default: break;
+    }
+}
+#endif
 
 /***********************************************************************
  * Registration
@@ -886,7 +927,11 @@
         "Suggestion: install an ABI compatible version of UHD,\n"
         "or rebuild SoapySDR UHD support against this ABI version.\n"
     ) % UHD_VERSION_ABI_STRING % uhd::get_abi_string()));
+    #ifdef UHD_HAS_MSG_HPP
     uhd::msg::register_handler(&SoapyUHDLogger);
+    #else
+    uhd::log::add_logger("SoapyUHDDevice", &SoapyUHDLogger);
+    #endif
     return new SoapyUHDDevice(uhd::usrp::multi_usrp::make(kwargsToDict(args)), 
args);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyUHD-soapy-uhd-0.3.3/UHDSoapyDevice.cpp 
new/SoapyUHD-soapy-uhd-0.3.4/UHDSoapyDevice.cpp
--- old/SoapyUHD-soapy-uhd-0.3.3/UHDSoapyDevice.cpp     2017-04-30 
00:11:21.000000000 +0200
+++ new/SoapyUHD-soapy-uhd-0.3.4/UHDSoapyDevice.cpp     2017-12-15 
02:43:42.000000000 +0100
@@ -15,7 +15,11 @@
 #include <uhd/property_tree.hpp>
 #include <uhd/device.hpp>
 #include <uhd/convert.hpp>
+#ifdef UHD_HAS_MSG_HPP
 #include <uhd/utils/msg.hpp>
+#else
+#include <uhd/utils/log.hpp>
+#endif
 #include <uhd/types/sensors.hpp>
 #include <uhd/types/ranges.hpp>
 #include <uhd/usrp/mboard_eeprom.hpp>
@@ -690,18 +694,18 @@
 {
 public:
     UHDSoapyTxStream(SoapySDR::Device *d, const uhd::stream_args_t &args):
+        _active(false),
         _device(d),
         _stream(make_stream(d, SOAPY_SDR_TX, args)),
         _nchan(std::max<size_t>(1, args.channels.size())),
         _elemSize(uhd::convert::get_bytes_per_item(args.cpu_format))
     {
         _offsetBuffs.resize(_nchan);
-        _device->activateStream(_stream);
     }
 
     ~UHDSoapyTxStream(void)
     {
-        _device->deactivateStream(_stream);
+        if (_active) _device->deactivateStream(_stream);
         _device->closeStream(_stream);
     }
 
@@ -722,6 +726,13 @@
         const double timeout = 0.1
     )
     {
+        //perform activation at the latest/on the first call to send
+        if (not _active)
+        {
+            _device->activateStream(_stream);
+            _active = true;
+        }
+
         size_t total = 0;
         const long long timeNs(md.time_spec.to_ticks(1e9));
 
@@ -738,6 +749,13 @@
             total += ret;
         }
 
+        //implement deactivation hook for very last sample consumed on end of 
burst
+        if (_active and md.end_of_burst and total == nsamps_per_buff)
+        {
+            _device->deactivateStream(_stream);
+            _active = false;
+        }
+
         return total;
     }
 
@@ -793,6 +811,7 @@
     }
 
 private:
+    bool _active;
     SoapySDR::Device *_device;
     SoapySDR::Stream *_stream;
     const size_t _nchan;
@@ -820,8 +839,10 @@
  **********************************************************************/
 static void UHDSoapyLogger(const SoapySDR::LogLevel logLevel, const char 
*message)
 {
+    #define component "UHDSoapyDevice"
     switch(logLevel)
     {
+    #ifdef UHD_HAS_MSG_HPP
     case SOAPY_SDR_FATAL:
     case SOAPY_SDR_CRITICAL:
     case SOAPY_SDR_ERROR: UHD_MSG(error) << message << std::endl; break;
@@ -831,6 +852,17 @@
     case SOAPY_SDR_DEBUG:
     case SOAPY_SDR_TRACE: UHD_MSG(status) << message << std::endl; break;
     case SOAPY_SDR_SSI: UHD_MSG(fastpath) << message << std::flush; break;
+    #else
+    case SOAPY_SDR_FATAL:
+    case SOAPY_SDR_CRITICAL:  UHD_LOG_FATAL(component, message); break;
+    case SOAPY_SDR_ERROR:     UHD_LOG_FATAL(component, message); break;
+    case SOAPY_SDR_WARNING:   UHD_LOG_WARNING(component, message); break;
+    case SOAPY_SDR_NOTICE:
+    case SOAPY_SDR_INFO:      UHD_LOG_INFO(component, message); break;
+    case SOAPY_SDR_DEBUG:
+    case SOAPY_SDR_TRACE:     UHD_LOG_TRACE(component, message); break;
+    case SOAPY_SDR_SSI:       UHD_LOG_FASTPATH(message); break;
+    #endif
     }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyUHD-soapy-uhd-0.3.3/debian/changelog 
new/SoapyUHD-soapy-uhd-0.3.4/debian/changelog
--- old/SoapyUHD-soapy-uhd-0.3.3/debian/changelog       2017-04-30 
00:11:21.000000000 +0200
+++ new/SoapyUHD-soapy-uhd-0.3.4/debian/changelog       2017-12-15 
02:43:42.000000000 +0100
@@ -1,3 +1,9 @@
+soapyuhd (0.3.4-1) unstable; urgency=low
+
+  * Release 0.3.4 (2017-12-14)
+
+ -- Josh Blum <[email protected]>  Thu, 14 Dec 2017 19:43:38 -0000
+
 soapyuhd (0.3.3-1) unstable; urgency=low
 
   * Release 0.3.3 (2017-04-29)


Reply via email to