Hello community, here is the log from the commit of package soapy-hackrf for openSUSE:Factory checked in at 2017-11-21 15:34:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/soapy-hackrf (Old) and /work/SRC/openSUSE:Factory/.soapy-hackrf.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "soapy-hackrf" Tue Nov 21 15:34:26 2017 rev:2 rq:544077 version:0.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/soapy-hackrf/soapy-hackrf.changes 2017-11-08 15:09:26.267572361 +0100 +++ /work/SRC/openSUSE:Factory/.soapy-hackrf.new/soapy-hackrf.changes 2017-11-21 15:34:33.248465826 +0100 @@ -1,0 +2,10 @@ +Mon Nov 20 19:12:15 UTC 2017 - [email protected] + +- Update to version 0.3.2 + * Corrected order of gain elements in the Rx direction + * Track settings during TX/RX switch for TRX switching + * Prevent spin loop in SoapyHackRF::acquireReadBuffer() + * Fix edge case in SoapyHackRF::releaseReadBuffer() + * Standard style find script for FindLIBHACKRF.cmake + +------------------------------------------------------------------- Old: ---- soapy-hackrf-0.3.1.tar.gz New: ---- soapy-hackrf-0.3.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ soapy-hackrf.spec ++++++ --- /var/tmp/diff_new_pack.PTpt0M/_old 2017-11-21 15:34:34.212430894 +0100 +++ /var/tmp/diff_new_pack.PTpt0M/_new 2017-11-21 15:34:34.212430894 +0100 @@ -1,6 +1,7 @@ # # spec file for package soapy-hackrf # +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -15,11 +16,12 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %define soapy_modver 0.6 %define soapy_modname soapysdr%{soapy_modver}-module-hackrf Name: soapy-hackrf -Version: 0.3.1 +Version: 0.3.2 Release: 0 Summary: SoapySDR HackRF module License: MIT ++++++ soapy-hackrf-0.3.1.tar.gz -> soapy-hackrf-0.3.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyHackRF-soapy-hackrf-0.3.1/CMakeLists.txt new/SoapyHackRF-soapy-hackrf-0.3.2/CMakeLists.txt --- old/SoapyHackRF-soapy-hackrf-0.3.1/CMakeLists.txt 2017-06-20 03:18:23.000000000 +0200 +++ new/SoapyHackRF-soapy-hackrf-0.3.2/CMakeLists.txt 2017-11-19 22:39:22.000000000 +0100 @@ -16,12 +16,12 @@ if (NOT LIBHACKRF_FOUND) message(FATAL_ERROR "HackRF development files not found...") endif () -message(STATUS "LIBHACKRF_INCLUDE_DIR - ${LIBHACKRF_INCLUDE_DIR}") +message(STATUS "LIBHACKRF_INCLUDE_DIRS - ${LIBHACKRF_INCLUDE_DIRS}") message(STATUS "LIBHACKRF_LIBRARIES - ${LIBHACKRF_LIBRARIES}") include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${LIBHACKRF_INCLUDE_DIR}) +include_directories(${LIBHACKRF_INCLUDE_DIRS}) #enable c++11 features if(CMAKE_COMPILER_IS_GNUCXX) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyHackRF-soapy-hackrf-0.3.1/Changelog.txt new/SoapyHackRF-soapy-hackrf-0.3.2/Changelog.txt --- old/SoapyHackRF-soapy-hackrf-0.3.1/Changelog.txt 2017-06-20 03:18:23.000000000 +0200 +++ new/SoapyHackRF-soapy-hackrf-0.3.2/Changelog.txt 2017-11-19 22:39:22.000000000 +0100 @@ -1,3 +1,12 @@ +Release 0.3.2 (2017-11-19) +========================== + +- Corrected order of gain elements in the Rx direction +- Track settings during TX/RX switch for TRX switching +- Prevent spin loop in SoapyHackRF::acquireReadBuffer() +- Fix edge case in SoapyHackRF::releaseReadBuffer() +- Standard style find script for FindLIBHACKRF.cmake + Release 0.3.1 (2017-06-19) ========================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyHackRF-soapy-hackrf-0.3.1/FindLIBHACKRF.cmake new/SoapyHackRF-soapy-hackrf-0.3.2/FindLIBHACKRF.cmake --- old/SoapyHackRF-soapy-hackrf-0.3.1/FindLIBHACKRF.cmake 2017-06-20 03:18:23.000000000 +0200 +++ new/SoapyHackRF-soapy-hackrf-0.3.2/FindLIBHACKRF.cmake 2017-11-19 22:39:22.000000000 +0100 @@ -1,55 +1,33 @@ -# - Try to find the libhackrf library -# Once done this defines -# -# LIBHACKRF_FOUND - system has libhackrf -# LIBHACKRF_INCLUDE_DIR - the libhackrf include directory -# LIBHACKRF_LIBRARIES - Link these to use libhackrf - -# Copyright (c) 2013 Benjamin Vernoux -# - - -if (LIBHACKRF_INCLUDE_DIR AND LIBHACKRF_LIBRARIES) - - # in cache already - set(LIBHACKRF_FOUND TRUE) - -else (LIBHACKRF_INCLUDE_DIR AND LIBHACKRF_LIBRARIES) - IF (NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(PC_LIBHACKRF QUIET libhackrf) - ENDIF(NOT WIN32) +# - Try to find libhackrf +# Once done this will define +# LIBHACKRF_FOUND - System has libhackrf +# LIBHACKRF_INCLUDE_DIRS - The libhackrf include directories +# LIBHACKRF_LIBRARIES - The libraries needed to use libhackrf - FIND_PATH(LIBHACKRF_INCLUDE_DIR +find_package(PkgConfig) +pkg_check_modules(PC_LIBHACKRF QUIET libhackrf) + +find_path(LIBHACKRF_INCLUDE_DIR NAMES hackrf.h - HINTS $ENV{LIBHACKRF_DIR}/include ${PC_LIBHACKRF_INCLUDEDIR} - PATHS /usr/local/include/libhackrf /usr/include/libhackrf /usr/local/include - /usr/include ${CMAKE_SOURCE_DIR}/../libhackrf/src - /opt/local/include/libhackrf - ${LIBHACKRF_INCLUDE_DIR} - ) - - set(libhackrf_library_names hackrf) - - FIND_LIBRARY(LIBHACKRF_LIBRARIES - NAMES ${libhackrf_library_names} - HINTS $ENV{LIBHACKRF_DIR}/lib ${PC_LIBHACKRF_LIBDIR} - PATHS /usr/local/lib /usr/lib /opt/local/lib ${PC_LIBHACKRF_LIBDIR} ${PC_LIBHACKRF_LIBRARY_DIRS} ${CMAKE_SOURCE_DIR}/../libhackrf/src - ) - - if(LIBHACKRF_INCLUDE_DIR) - set(CMAKE_REQUIRED_INCLUDES ${LIBHACKRF_INCLUDE_DIR}) - endif() - - if(LIBHACKRF_LIBRARIES) - set(CMAKE_REQUIRED_LIBRARIES ${LIBHACKRF_LIBRARIES}) - endif() + HINTS + $ENV{LIBHACKRF_DIR}/include + ${PC_LIBHACKRF_INCLUDEDIR} + ${PC_LIBHACKRF_INCLUDE_DIRS} + PATH_SUFFIXES libhackrf +) + +find_library(LIBHACKRF_LIBRARY + NAMES hackrf + HINTS + $ENV{LIBHACKRF_DIR}/lib + ${PC_LIBHACKRF_LIBDIR} + ${PC_LIBHACKRF_LIBRARY_DIRS} +) - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBHACKRF DEFAULT_MSG LIBHACKRF_LIBRARIES LIBHACKRF_INCLUDE_DIR) +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBHACKRF DEFAULT_MSG LIBHACKRF_LIBRARY LIBHACKRF_INCLUDE_DIR) - MARK_AS_ADVANCED(LIBHACKRF_INCLUDE_DIR LIBHACKRF_LIBRARIES) +mark_as_advanced(LIBHACKRF_INCLUDE_DIR LIBHACKRF_LIBRARY) -endif (LIBHACKRF_INCLUDE_DIR AND LIBHACKRF_LIBRARIES) \ No newline at end of file +set(LIBHACKRF_INCLUDE_DIRS ${LIBHACKRF_INCLUDE_DIR}) +set(LIBHACKRF_LIBRARIES ${LIBHACKRF_LIBRARY}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyHackRF-soapy-hackrf-0.3.1/HackRF_Settings.cpp new/SoapyHackRF-soapy-hackrf-0.3.2/HackRF_Settings.cpp --- old/SoapyHackRF-soapy-hackrf-0.3.1/HackRF_Settings.cpp 2017-06-20 03:18:23.000000000 +0200 +++ new/SoapyHackRF-soapy-hackrf-0.3.2/HackRF_Settings.cpp 2017-11-19 22:39:22.000000000 +0100 @@ -251,10 +251,16 @@ std::vector<std::string> options; if ( direction == SOAPY_SDR_RX ) { - options.push_back( "LNA" ); + // in gr-osmosdr/lib/soapy/ soapy_sink_c.cc and soapy_source_c.cc expect if_gain at front and bb_gain at back + options.push_back( "LNA" ); // RX: if_gain + options.push_back( "AMP" ); // RX: rf_gain + options.push_back( "VGA" ); // RX: bb_gain + } + else + { + options.push_back( "VGA" ); // TX: if_gain + options.push_back( "AMP" ); // TX: rf_gain } - options.push_back( "VGA" ); - options.push_back( "AMP" ); return(options); /* @@ -282,6 +288,7 @@ std::lock_guard<std::mutex> lock(_device_mutex); int32_t ret(0), gain(0); gain = value; + SoapySDR_logf(SOAPY_SDR_DEBUG,"setGain RF %s, channel %d, gain %d", direction == SOAPY_SDR_RX ? "RX" : "TX", channel, gain); if ( direction == SOAPY_SDR_RX ) { @@ -343,6 +350,7 @@ void SoapyHackRF::setGain( const int direction, const size_t channel, const std::string &name, const double value ) { std::lock_guard<std::mutex> lock(_device_mutex); + SoapySDR_logf(SOAPY_SDR_DEBUG,"setGain %s %s, channel %d, gain %d", name.c_str(), direction == SOAPY_SDR_RX ? "RX" : "TX", channel, (int)value); if ( name == "AMP" ) { _current_amp = value; @@ -354,6 +362,9 @@ _tx_stream.amp_gain=_current_amp; } + if( ((direction == SOAPY_SDR_RX) && (_current_mode == HACKRF_TRANSCEIVER_MODE_RX)) + || ((direction == SOAPY_SDR_TX) && (_current_mode == HACKRF_TRANSCEIVER_MODE_TX)) ) + { if ( _dev != NULL ) { int ret = hackrf_set_amp_enable( _dev, (_current_amp > 0)?1 : 0 ); @@ -362,6 +373,7 @@ SoapySDR::logf( SOAPY_SDR_ERROR, "hackrf_set_amp_enable(%f) returned %s", _current_amp, hackrf_error_name( (hackrf_error) ret ) ); } } + } }else if ( direction == SOAPY_SDR_RX and name == "LNA" ) { _rx_stream.lna_gain = value; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyHackRF-soapy-hackrf-0.3.1/HackRF_Streaming.cpp new/SoapyHackRF-soapy-hackrf-0.3.2/HackRF_Streaming.cpp --- old/SoapyHackRF-soapy-hackrf-0.3.1/HackRF_Streaming.cpp 2017-06-20 03:18:23.000000000 +0200 +++ new/SoapyHackRF-soapy-hackrf-0.3.2/HackRF_Streaming.cpp 2017-11-19 22:39:22.000000000 +0100 @@ -300,6 +300,42 @@ } hackrf_stop_tx(_dev); + + // determine what (if any) settings need to be changed for RX; only applicable if there is both a source and sink block + // sample_rate + if(_current_samplerate != _rx_stream.samplerate) { + _current_samplerate = _rx_stream.samplerate; + SoapySDR_logf(SOAPY_SDR_DEBUG, "activateStream - Set RX samplerate to %f", _current_samplerate); + hackrf_set_sample_rate(_dev,_current_samplerate); + } + + // frequency + if(_current_frequency != _rx_stream.frequency) { + _current_frequency = _rx_stream.frequency; + SoapySDR_logf(SOAPY_SDR_DEBUG, "activateStream - Set RX frequency to %lu", _current_frequency); + hackrf_set_freq(_dev,_current_frequency); + } + + // frequency_correction; assume RX and TX use the same correction + // This will be the setting of whichever block was last added to the flow graph + + // RF Gain (RF Amp for TX & RX) + if(_current_amp != _rx_stream.amp_gain) { + _current_amp = _rx_stream.amp_gain; + SoapySDR_logf(SOAPY_SDR_DEBUG, "activateStream - Set RX amp gain to %d", _current_amp); + hackrf_set_amp_enable(_dev,(_current_amp > 0)?1 : 0 ); + } + + // IF Gain (LNA for RX; VGA_TX for TX) + // BB Gain (VGA for RX; n/a for TX) + // These are independant values in the hackrf, so no need to change + + // Bandwidth + if(_current_bandwidth !=_rx_stream.bandwidth) { + _current_bandwidth =_rx_stream.bandwidth; + SoapySDR_logf(SOAPY_SDR_DEBUG, "activateStream - Set RX bandwidth to %d", _current_bandwidth); + hackrf_set_baseband_filter_bandwidth(_dev,_current_bandwidth); + } } SoapySDR_logf(SOAPY_SDR_DEBUG, "Start RX"); @@ -329,7 +365,7 @@ _current_bandwidth=_rx_stream.bandwidth; hackrf_set_baseband_filter_bandwidth(_dev,_current_bandwidth); _current_amp=_rx_stream.amp_gain; - hackrf_set_amp_enable(_dev,_current_amp); + hackrf_set_amp_enable(_dev,(_current_amp > 0)?1 : 0 ); hackrf_set_lna_gain(_dev,_rx_stream.lna_gain); hackrf_set_vga_gain(_dev,_rx_stream.vga_gain); hackrf_start_rx(_dev,_hackrf_rx_callback,(void *) this); @@ -361,6 +397,43 @@ if(_current_mode==HACKRF_TRANSCEIVER_MODE_RX){ hackrf_stop_rx(_dev); + + // determine what (if any) settings need to be changed for TX; only applicable if there is both a source and sink block + // sample_rate + if(_current_samplerate != _tx_stream.samplerate) { + _current_samplerate=_tx_stream.samplerate; + SoapySDR_logf(SOAPY_SDR_DEBUG, "activateStream - Set TX samplerate to %f", _current_samplerate); + hackrf_set_sample_rate(_dev,_current_samplerate); + } + + // frequency + if(_current_frequency != _tx_stream.frequency) { + _current_frequency=_tx_stream.frequency; + SoapySDR_logf(SOAPY_SDR_DEBUG, "activateStream - Set TX frequency to %lu", _current_frequency); + hackrf_set_freq(_dev,_current_frequency); + } + + // frequency_correction; assume RX and TX use the same correction + // This will be the setting of whichever block was last added to the flow graph + + // RF Gain (RF Amp for TX & RX) + if(_current_amp != _tx_stream.amp_gain) { + _current_amp=_tx_stream.amp_gain; + SoapySDR_logf(SOAPY_SDR_DEBUG, "activateStream - Set TX amp gain to %d", _current_amp); + hackrf_set_amp_enable(_dev,(_current_amp > 0)?1 : 0 ); + } + + // IF Gain (LNA for RX, VGA_TX for TX) + // BB Gain (VGA for RX, n/a for TX) + // These are independant values in the hackrf, so no need to change + + // Bandwidth + if(_current_bandwidth !=_tx_stream.bandwidth) { + _current_bandwidth =_tx_stream.bandwidth; + SoapySDR_logf(SOAPY_SDR_DEBUG, "activateStream - Set RX bandwidth to %d", _current_bandwidth); + hackrf_set_baseband_filter_bandwidth(_dev,_current_bandwidth); + } + } SoapySDR_logf( SOAPY_SDR_DEBUG, "Start TX" ); @@ -385,7 +458,7 @@ _current_bandwidth=_tx_stream.bandwidth; hackrf_set_baseband_filter_bandwidth(_dev,_current_bandwidth); _current_amp=_rx_stream.amp_gain; - hackrf_set_amp_enable(_dev,_current_amp); + hackrf_set_amp_enable(_dev,(_current_amp > 0)?1 : 0 ); hackrf_set_txvga_gain(_dev,_tx_stream.vga_gain); hackrf_set_antenna_enable(_dev,_tx_stream.bias); hackrf_start_tx(_dev,_hackrf_tx_callback,(void *) this); @@ -688,12 +761,10 @@ if ( _current_mode!=HACKRF_TRANSCEIVER_MODE_RX ) { //wait for tx to be consumed before switching - const auto exitTime = std::chrono::high_resolution_clock::now() + std::chrono::microseconds(timeoutUs); - while (true) { std::unique_lock <std::mutex> lock( _buf_mutex ); - if (_tx_stream.buf_count == 0) break; - if (std::chrono::high_resolution_clock::now() > exitTime) return SOAPY_SDR_TIMEOUT; + if (not _buf_cond.wait_for(lock, std::chrono::microseconds(timeoutUs), + [this]{return this->_tx_stream.buf_count == 0;})) return SOAPY_SDR_TIMEOUT; } int ret=this->activateStream(stream); @@ -730,13 +801,8 @@ throw std::runtime_error("Invalid stream"); } - if(!_tx_stream.burst_end){ - - std::unique_lock <std::mutex> lock( _buf_mutex ); - - _rx_stream.buf_count--; - } - + std::unique_lock <std::mutex> lock( _buf_mutex ); + _rx_stream.buf_count--; } int SoapyHackRF::acquireWriteBuffer( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoapyHackRF-soapy-hackrf-0.3.1/debian/changelog new/SoapyHackRF-soapy-hackrf-0.3.2/debian/changelog --- old/SoapyHackRF-soapy-hackrf-0.3.1/debian/changelog 2017-06-20 03:18:23.000000000 +0200 +++ new/SoapyHackRF-soapy-hackrf-0.3.2/debian/changelog 2017-11-19 22:39:22.000000000 +0100 @@ -1,3 +1,9 @@ +soapyhackrf (0.3.2-1) unstable; urgency=low + + * Release 0.3.2 (2017-11-19) + + -- Josh Blum <[email protected]> Sun, 19 Nov 2017 15:39:14 -0000 + soapyhackrf (0.3.1-1) unstable; urgency=low * Release 0.3.1 (2017-06-19)
