From 150b2cde7d30f871b3f2663e604af31a5fe4d1ec Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Sat, 31 May 2025 19:00:45 -0700 Subject: [PATCH] Improve macOS test reliability (#904) * Return to 20ms block sizes on macOS to improve test reliability. * Use Windows 2022 in test environment. Don't want to be fighting Windows problems too. * Don't want to be fighting gfortran either. * Try caching Homebrew package install to decrease compile/test time for macOS. * See if we can make RADE reporting a bit more reliable in the GH environment. --- .github/workflows/cmake-macos.yml | 15 ++++++--------- .github/workflows/cmake-windows.yml | 2 +- src/audio/MacAudioDevice.mm | 4 ++-- test/hamlibserver.py | 4 ++-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cmake-macos.yml b/.github/workflows/cmake-macos.yml index 55e52066..aa072ad9 100644 --- a/.github/workflows/cmake-macos.yml +++ b/.github/workflows/cmake-macos.yml @@ -22,10 +22,9 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install packages - shell: bash - working-directory: ${{github.workspace}} - run: brew install automake libtool numpy sox octave wxwidgets speexdsp portaudio libsndfile libsamplerate hamlib + - uses: gerlero/brew-install@v1 + with: + packages: automake libtool numpy sox octave wxwidgets speexdsp portaudio libsndfile libsamplerate hamlib - name: Install octave-signal if: ${{ matrix.os == 'macos-13' }} @@ -33,7 +32,6 @@ jobs: working-directory: ${{github.workspace}} run: | # make sure gfortran is available - sudo ln -s /usr/local/bin/gfortran-14 /usr/local/bin/gfortran gfortran --version octave-cli --eval "pkg install -forge control; pkg install -forge signal" @@ -103,10 +101,9 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install packages - shell: bash - working-directory: ${{github.workspace}} - run: brew install automake libtool numpy sox + - uses: gerlero/brew-install@v1 + with: + packages: automake libtool numpy sox - name: Build universal freedv-gui shell: bash diff --git a/.github/workflows/cmake-windows.yml b/.github/workflows/cmake-windows.yml index c6c11e8b..e9248e3d 100644 --- a/.github/workflows/cmake-windows.yml +++ b/.github/workflows/cmake-windows.yml @@ -88,7 +88,7 @@ jobs: path: ${{github.workspace}}/build_windows/FreeDV.exe test: - runs-on: windows-latest + runs-on: windows-2022 needs: build env: RADIO_TO_COMPUTER_DEVICE: "CABLE Output (VB-Audio Virtual Cable)" diff --git a/src/audio/MacAudioDevice.mm b/src/audio/MacAudioDevice.mm index adcdd0ac..7c26ab9d 100644 --- a/src/audio/MacAudioDevice.mm +++ b/src/audio/MacAudioDevice.mm @@ -46,7 +46,7 @@ thread_local int MacAudioDevice::CurrentCoreAudioId_ = 0; constexpr static double kOneNanosecond = 1.0e9; // The I/O interval time in seconds. -constexpr static double AUDIO_SAMPLE_BLOCK_SEC = 0.010; +constexpr static double AUDIO_SAMPLE_BLOCK_SEC = 0.020; static OSStatus GetIOBufferFrameSizeRange(AudioObjectID inDeviceID, UInt32* outMinimum, @@ -801,4 +801,4 @@ int MacAudioDevice::DeviceOverloadCallback_( tmpThread.detach(); return noErr; -} \ No newline at end of file +} diff --git a/test/hamlibserver.py b/test/hamlibserver.py index 7e1361d1..3a56d822 100755 --- a/test/hamlibserver.py +++ b/test/hamlibserver.py @@ -322,9 +322,9 @@ class HamlibHandler: self.ErrParam() else: if (not x) and self.app.ptt: - # Sleep for 20ms to match typical SDR behavior. + # Sleep for 20ms to match typical SDR behavior + 5ms to account for varying system load. # Example: Flex 6000/8000 (https://community.flexradio.com/discussion/8028104/question-regarding-tx-delay) - time.sleep(20 / 1000) + time.sleep(25 / 1000) os.kill(self.pid, signal.SIGTERM) if x: self.app.ptt = 1