From: IOhannes m zmölnig (Debian/GNU) Date: Thu, 17 Oct 2024 17:33:36 +0000 (+0200) Subject: New upstream version 2.4.1+ds X-Git-Tag: archive/raspbian/2.5.1+ds-1+rpi1^2~7^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=868ad844ec1bbaa66dd5fa44ccb37021512c5079;p=jacktrip.git New upstream version 2.4.1+ds --- diff --git a/docs/changelog.yml b/docs/changelog.yml index 105c429..811e2ec 100644 --- a/docs/changelog.yml +++ b/docs/changelog.yml @@ -1,3 +1,9 @@ +- Version: "2.4.1" + Date: 2024-09-27 + Description: + - (fixed) Disabling qWave Quality of Service for Windows users + - (fixed) PLC occasional popping sound when you first connect + - (fixed) PLC auto headroom optimization for very low jitter - Version: "2.4.0" Date: 2024-09-13 Description: diff --git a/src/Regulator.cpp b/src/Regulator.cpp index f847a0d..cbf06d7 100644 --- a/src/Regulator.cpp +++ b/src/Regulator.cpp @@ -479,8 +479,18 @@ void Regulator::updateTolerance(int glitches, int skipped) // only increase headroom if doing so would have reduced the number of // glitches that occured over the past second by 1% or more. // prevent headroom from growing beyond rolling average of max. - const int skipsAllowed = - static_cast(AutoHeadroomGlitchTolerance * mSampleRate / mPeerFPP); + int skipsAllowed; + if (mMsecTolerance >= (mPeerFPPdurMsec * 2)) { + // calculate skips allowed if tolerance if above or equal to duration of two + // packets + skipsAllowed = + static_cast(AutoHeadroomGlitchTolerance * mSampleRate / mPeerFPP); + } else { + // zero skips allowed if tolerance is below duration of two packets + skipsAllowed = 0; + // also don't require two intervals in a row (override) + mSkipAutoHeadroom = false; + } if (glitches > 0 && skipped > skipsAllowed && mCurrentHeadroom + 1 <= pushStat->longTermMax) { if (mSkipAutoHeadroom) { @@ -494,8 +504,8 @@ void Regulator::updateTolerance(int glitches, int skipped) << " (max=" << pushStat->longTermMax << ")" << endl; } } else { - // require 2 seconds in a row if headroom >= two packet intervals - mSkipAutoHeadroom = mMsecTolerance >= (mPeerFPPdurMsec * 2); + // thresholds not met: require 2 intervals in a row + mSkipAutoHeadroom = true; } } else { // fixed headroom @@ -541,7 +551,16 @@ void Regulator::updatePushStats(int seq_num) mLastSkipped = totalSkipped; if (mAuto && pushStat->lastTime > AutoInitDur) { // after AutoInitDur: update auto tolerance once per second - updateTolerance(newGlitches, newSkipped); + if (pushStat->lastTime <= (AutoInitDur + 3000)) { + // Ignore glitches and skips for the first 3 seconds after + // we have switched from using the startup tolerance to + // a calculated tolerance. Otherwise, the switch can + // sometimes cause it to bump headroom prematurely even + // though there are no real audio glitches. + updateTolerance(0, 0); + } else { + updateTolerance(newGlitches, newSkipped); + } } } } @@ -565,7 +584,11 @@ bool Regulator::pullPacket() const int lastSeqNumIn = mLastSeqNumIn.load(std::memory_order_acquire); int skipped = 0; - if ((lastSeqNumIn == -1) || (!mInitialized)) { + if ((lastSeqNumIn == -1) || (!mInitialized) || (now < mMsecTolerance)) { + // return silence during startup: + // * no packets arrived yet + // * not initialized + // * hasn't run long enough to meet tolerance goto ZERO_OUTPUT; } else if (lastSeqNumIn == mLastSeqNumOut) { goto UNDERRUN; diff --git a/src/UdpDataProtocol.cpp b/src/UdpDataProtocol.cpp index 9ae8709..cc499a9 100644 --- a/src/UdpDataProtocol.cpp +++ b/src/UdpDataProtocol.cpp @@ -294,7 +294,7 @@ socket_type UdpDataProtocol::bindSocket() ::setsockopt(sock_fd, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)); #endif - // set qos for windows after flow is established (requires peer address/port) + // set quality of service for the UDP socket if (setSocketQos(sock_fd)) { std::cout << "Set QoS for network socket" << std::endl; } else { @@ -324,6 +324,9 @@ bool UdpDataProtocol::setSocketQos(socket_type& sock_fd) // https://learn.microsoft.com/en-us/windows/win32/api/_qos/ // https://learn.microsoft.com/en-us/previous-versions/windows/desktop/qos/qwave-api-reference +#if 0 + // DISABLED SINCE THIS CAUSES GARBLED AUDIO FOR SOME PEOPLE + // Initialize the QoS version parameter. QOS_VERSION Version; Version.MajorVersion = 1; @@ -354,6 +357,8 @@ bool UdpDataProtocol::setSocketQos(socket_type& sock_fd) std::cerr << WSAGetLastError() << std::endl; return false; } +#endif + #elif defined(__APPLE__) // set service type "Interactive Voice" // TODO: this is supposed to be the right thing to do on OSX, but doesn't seem to do diff --git a/src/jacktrip_globals.h b/src/jacktrip_globals.h index e61162a..daeed16 100644 --- a/src/jacktrip_globals.h +++ b/src/jacktrip_globals.h @@ -40,7 +40,7 @@ #include "AudioInterface.h" -constexpr const char* const gVersion = "2.4.0"; ///< JackTrip version +constexpr const char* const gVersion = "2.4.1"; ///< JackTrip version //******************************************************************************* /// \name Default Values diff --git a/win/meson.build b/win/meson.build index b7ed4d4..7362bba 100644 --- a/win/meson.build +++ b/win/meson.build @@ -31,7 +31,6 @@ if host_machine.system() == 'windows' link_args += 'Winhttp.lib' link_args += 'Dnsapi.lib' link_args += 'Iphlpapi.lib' - link_args += 'Qwave.lib' endif endif