diff --git a/README.md b/README.md index a201e7f2f..9f1a8eebe 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,7 @@ The following people and organisations have contributed to gqrx: * Dominic Chen * Doron Behar * Doug Hammond +* Edouard Lafargue * Elias Önal * Federico Fuga * Frank Brickle, AB2KT diff --git a/resources/news.txt b/resources/news.txt index 21ae4d548..e8e9714b6 100644 --- a/resources/news.txt +++ b/resources/news.txt @@ -5,6 +5,7 @@ NEW: Airspy support in Windows binary release. IMPROVED: Updated GNU Radio, SDR driver, and Qt versions in AppImage release. FIXED: Respond correctly to pipelined remote control commands. + FIXED: Limit UDP packet size to 1024, for compatibility with netcat. REMOVED: FreeSRP support in AppImage release. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 845b19639..cdb69568a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,7 +12,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") else() add_subdirectory(osxaudio) endif() - add_definitions(-DGQRX_OS_MACX) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD") if(${LINUX_AUDIO_BACKEND} MATCHES "Pulseaudio") add_subdirectory(pulseaudio) diff --git a/src/interfaces/udp_sink_f.cpp b/src/interfaces/udp_sink_f.cpp index 1f944f968..608b90397 100644 --- a/src/interfaces/udp_sink_f.cpp +++ b/src/interfaces/udp_sink_f.cpp @@ -51,6 +51,12 @@ static const int MAX_IN = 2; /*!< Maximum number of input streams. */ static const int MIN_OUT = 0; /*!< Minimum number of output streams. */ static const int MAX_OUT = 0; /*!< Maximum number of output streams. */ +// nc is used widely for receiving UDP streams and some versions of nc, +// notably on MacOS, use a 1024 byte buffer so we need to make sure we +// don't send packets that are larger than that, otherwise data will be +// lost. +static const int PAYLOAD_SIZE = 1024; + udp_sink_f::udp_sink_f() : gr::hier_block2("udp_sink_f", gr::io_signature::make(MIN_IN, MAX_IN, sizeof(float)), @@ -59,13 +65,7 @@ udp_sink_f::udp_sink_f() d_f2s = gr::blocks::float_to_short::make(1, 32767); #if GNURADIO_VERSION < 0x031000 -#ifdef GQRX_OS_MACX - // There seems to be excessive packet loss (even to localhost) on OS X - // unless the buffer size is limited. - d_sink = gr::blocks::udp_sink::make(sizeof(short), "localhost", 7355, 512); -#else - d_sink = gr::blocks::udp_sink::make(sizeof(short), "localhost", 7355); -#endif + d_sink = gr::blocks::udp_sink::make(sizeof(short), "localhost", 7355, PAYLOAD_SIZE); d_sink->disconnect(); #endif @@ -96,7 +96,7 @@ void udp_sink_f::start_streaming(const std::string host, int port, bool stereo) std::cout << (stereo ? "Stereo" : "Mono") << std::endl; #if GNURADIO_VERSION >= 0x031000 - d_sink = gr::network::udp_sink::make(sizeof(short), 1, host, port, HEADERTYPE_NONE, 1448, true); + d_sink = gr::network::udp_sink::make(sizeof(short), 1, host, port, HEADERTYPE_NONE, PAYLOAD_SIZE, true); #endif if (stereo)