fixes for ubuntu 16.04

- probably libfreedv/freedv_api.cpp needs more work to avoid crash if
  the user select 700C or 800XA
This commit is contained in:
Davide Gerhard 2019-05-09 14:18:27 +02:00
parent 44668ad425
commit 5ff197bc35
No known key found for this signature in database
GPG Key ID: 7CBEFA144857DC97
14 changed files with 92 additions and 61 deletions

View File

@ -259,31 +259,31 @@ find_package(Codec2)
# Devices
if(ENABLE_AIRSPY)
find_package(LibAIRSPY)
find_package(LibAIRSPY)
endif()
if(ENABLE_AIRSPYHF)
find_package(LibAIRSPYHF)
find_package(LibAIRSPYHF)
endif()
if(ENABLE_BLADERF)
find_package(LibBLADERF)
find_package(LibBLADERF 2.0)
endif()
if(ENABLE_HACKRF)
find_package(LibHACKRF)
find_package(LibHACKRF)
endif()
if(ENABLE_LIMESUITE)
find_package(LimeSuite)
find_package(LimeSuite)
endif()
if(ENABLE_IIO) # PlutoSDR
find_package(LibIIO)
find_package(LibIIO)
endif()
if(ENABLE_MIRISDR)
find_package(LibMiriSDR)
find_package(LibMiriSDR)
endif()
if(ENABLE_PERSEUS)
find_package(LibPerseus)
find_package(LibPerseus)
endif()
if(ENABLE_RTLSDR)
find_package(LibRTLSDR)
find_package(LibRTLSDR)
endif()
if(ENABLE_SOAPYSDR)
find_package(SoapySDR 0.4.0 NO_MODULE)

View File

@ -1,31 +1,34 @@
if(NOT LIBBLADERF_FOUND)
pkg_check_modules (LIBBLADERF_PKG libbladeRF)
find_path(LIBBLADERF_INCLUDE_DIR
NAMES libbladeRF.h
PATHS ${BLADERF_DIR}/include
${LIBBLADERF_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
)
pkg_check_modules (LIBBLADERF_PKG libbladerf>=2.0)
find_library(LIBBLADERF_LIBRARIES
NAMES bladeRF
PATHS ${BLADERF_DIR}/lib
${LIBBLADERF_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(LIBBLADERF_PKG_FOUND)
find_path(LIBBLADERF_INCLUDE_DIRS
NAMES libbladeRF.h
PATHS ${BLADERF_DIR}/include
${LIBBLADERF_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
)
if(LIBBLADERF_INCLUDE_DIR AND LIBBLADERF_LIBRARIES)
set(LIBBLADERF_FOUND TRUE CACHE INTERNAL "libbladerf found")
message(STATUS "Found libbladerf: ${LIBBLADERF_INCLUDE_DIR}, ${LIBBLADERF_LIBRARIES}")
else(LIBBLADERF_INCLUDE_DIR AND LIBBLADERF_LIBRARIES)
set(LIBBLADERF_FOUND FALSE CACHE INTERNAL "libbladerf found")
message(STATUS "libbladerf not found.")
endif(LIBBLADERF_INCLUDE_DIR AND LIBBLADERF_LIBRARIES)
find_library(LIBBLADERF_LIBRARIES
NAMES bladeRF
PATHS ${BLADERF_DIR}/lib
${LIBBLADERF_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
mark_as_advanced(LIBBLADERF_INCLUDE_DIR LIBBLADERF_LIBRARIES)
if(LIBBLADERF_INCLUDE_DIRS AND LIBBLADERF_LIBRARIES)
set(LIBBLADERF_FOUND TRUE CACHE INTERNAL "libbladerf found")
message(STATUS "Found libbladerf: ${LIBBLADERF_INCLUDE_DIRS}, ${LIBBLADERF_LIBRARIES}")
else()
set(LIBBLADERF_FOUND FALSE CACHE INTERNAL "libbladerf not found")
message(STATUS "libbladerf not found.")
endif()
mark_as_advanced(LIBBLADERF_INCLUDE_DIRS LIBBLADERF_LIBRARIES)
endif(LIBBLADERF_PKG_FOUND)
endif(NOT LIBBLADERF_FOUND)

View File

@ -1,24 +1,25 @@
if(NOT LIBIIO_FOUND)
pkg_check_modules (LIBIIO_PKG libiio)
find_path(LIBIIO_INCLUDE_DIR
NAMES iio.h
PATHS ${IIO_DIR}/include
${LIBIIO_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
)
pkg_check_modules (LIBIIO_PKG libiio>=0.7)
find_library(LIBIIO_LIBRARIES
NAMES iio
PATHS ${IIO_DIR}/lib
${LIBIIO_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(LIBIIO_PKG_FOUND)
find_path(LIBIIO_INCLUDE_DIR
NAMES iio.h
PATHS ${IIO_DIR}/include
${LIBIIO_PKG_INCLUDE_DIRS}
/usr/include
/usr/local/include
)
if(LIBIIO_INCLUDE_DIR AND LIBIIO_LIBRARIES)
find_library(LIBIIO_LIBRARIES
NAMES iio
PATHS ${IIO_DIR}/lib
${LIBIIO_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(LIBIIO_INCLUDE_DIR AND LIBIIO_LIBRARIES)
set(LIBIIO_FOUND TRUE CACHE INTERNAL "libiio found")
message(STATUS "Found libiio: ${LIBIIO_INCLUDE_DIR}, ${LIBIIO_LIBRARIES}")
else(LIBIIO_INCLUDE_DIR AND LIBIIO_LIBRARIES)
@ -28,4 +29,6 @@ if(NOT LIBIIO_FOUND)
mark_as_advanced(LIBIIO_INCLUDE_DIR LIBIIO_LIBRARIES)
endif(LIBIIO_PKG_FOUND)
endif(NOT LIBIIO_FOUND)

View File

@ -15,7 +15,7 @@ set(bladerf1device_HEADERS
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${LIBBLADERF_INCLUDE_DIR}
${LIBBLADERF_INCLUDE_DIRS}
)
add_library(bladerf1device SHARED

View File

@ -12,7 +12,7 @@ set(bladerf2device_HEADERS
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${LIBBLADERF_INCLUDE_DIR}
${LIBBLADERF_INCLUDE_DIRS}
)
add_library(bladerf2device SHARED

View File

@ -183,12 +183,18 @@ struct freedv *freedv_open_advanced(int mode, struct freedv_advanced *adv) {
case FREEDV_MODE_700B:
codec2_mode = CODEC2_MODE_700B;
break;
#ifdef CODEC2_MODE_700C
case FREEDV_MODE_700C:
codec2_mode = CODEC2_MODE_700C;
break;
default:
codec2_mode = CODEC2_MODE_700C;
fprintf(stderr, "FreeDV::freedv_open_advanced: unknown mode default to FREEDV_MODE_700C");
#else
default:
codec2_mode = CODEC2_MODE_700B;
fprintf(stderr, "FreeDV::freedv_open_advanced: unknown mode default to FREEDV_MODE_700B");
#endif
}
f->cohpsk = cohpsk_create();
@ -205,6 +211,7 @@ struct freedv *freedv_open_advanced(int mode, struct freedv_advanced *adv) {
f->sz_error_pattern = cohpsk_error_pattern_size();
}
#ifdef CODEC2_MODE_700C
if (mode == FREEDV_MODE_700D) {
/*
TODO:
@ -301,6 +308,7 @@ struct freedv *freedv_open_advanced(int mode, struct freedv_advanced *adv) {
ofdm_set_tx_bpf(f->ofdm, 1);
#endif
}
#endif
if ((mode == FREEDV_MODE_2400A) || (mode == FREEDV_MODE_2400B)) {
@ -364,6 +372,7 @@ struct freedv *freedv_open_advanced(int mode, struct freedv_advanced *adv) {
f->codec_bits = (int*) malloc(1);
}
#ifdef CODEC2_MODE_700C
if (mode == FREEDV_MODE_800XA) {
/* Create the framer|deframer */
f->deframer = fvhff_create_deframer(FREEDV_HF_FRAME_B,0);
@ -396,6 +405,7 @@ struct freedv *freedv_open_advanced(int mode, struct freedv_advanced *adv) {
fsk_stats_normalise_eye(f->fsk, 0);
f->sz_error_pattern = 0;
}
#endif
/* Init test frame states */

View File

@ -863,7 +863,7 @@ void fsk2_demod(struct FSK *fsk, uint8_t rx_bits[], float rx_sd[], COMP fsk_in[]
/* Check for NaNs in the fine timing estimate, return if found */
/* otherwise segfaults happen */
if( isnan(t_c.real) || isnan(t_c.imag)){
if( std::isnan(t_c.real) || std::isnan(t_c.imag)){
return;
}

View File

@ -12,6 +12,9 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// fix gcc >= 4.6
// see https://gcc.gnu.org/gcc-4.6/porting_to.html
#include <cstddef>
#include "_kiss_fft_guts.h"
/* The guts header contains all the multiplication and addition macros that are defined for

View File

@ -12,6 +12,10 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// fix gcc >= 4.6
// see https://gcc.gnu.org/gcc-4.6/porting_to.html
#include <cstddef>
#include "kiss_fftr.h"
#include "_kiss_fft_guts.h"
#include "assert.h"

View File

@ -26,13 +26,21 @@ if(NOT SERVER_MODE)
add_subdirectory(chanalyzer)
add_subdirectory(demodatv)
# At ffmpeg 3.1 !! TODO check more !!
# need ffmpeg 3.1 that correstonds to
# libavutil 55.27.100
# libavcodec 57.48.101
# libavformat 57.40.101
find_package(FFmpeg 57.48.101)
# TODO use libavcodec/version.h
find_package(FFmpeg)
if (FFMPEG_FOUND)
message(STATUS "Include demoddatv")
add_subdirectory(demoddatv)
# You can only get FFmpeg version from the command line
EXECUTE_PROCESS(COMMAND ffmpeg -version COMMAND grep ffmpeg COMMAND cut -d\ -f3 COMMAND tr -d '\n' OUTPUT_VARIABLE FFMPEG_VERSION)
message(STATUS "FFmpeg version ${FFMPEG_VERSION} found")
if(FFMPEG_VERSION VERSION_GREATER "3.1")
message(STATUS "Include demoddatv")
add_subdirectory(demoddatv)
else()
message(STATUS "FFmpeg too old to compile demoddatv; needs at least ffmpeg 3.1")
endif()
endif()
endif()

View File

@ -18,7 +18,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBBLADERF_INCLUDE_DIR}
${LIBBLADERF_INCLUDE_DIRS}
)
if(NOT SERVER_MODE)

View File

@ -18,7 +18,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBBLADERF_INCLUDE_DIR}
${LIBBLADERF_INCLUDE_DIRS}
)
if(NOT SERVER_MODE)

View File

@ -18,7 +18,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBBLADERF_INCLUDE_DIR}
${LIBBLADERF_INCLUDE_DIRS}
)
if(NOT SERVER_MODE)

View File

@ -18,7 +18,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBBLADERF_INCLUDE_DIR}
${LIBBLADERF_INCLUDE_DIRS}
)
if(NOT SERVER_MODE)