From 99c120d46df11f9d7e52b1343d4dba704b5c29d1 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Tue, 19 Nov 2024 20:20:38 -0800 Subject: [PATCH] Clean up debugging, add tests for RADE/700E/1600. --- .github/workflows/cmake-windows.yml | 47 +++++++++++++++++------------ src/audio/PortAudioDevice.cpp | 4 --- src/audio/PortAudioDevice.h | 2 +- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cmake-windows.yml b/.github/workflows/cmake-windows.yml index 2d51ba013..72c37333a 100644 --- a/.github/workflows/cmake-windows.yml +++ b/.github/workflows/cmake-windows.yml @@ -137,8 +137,8 @@ jobs: Start-Sleep -Seconds 10 # For convenience, make sure we fail fast if for whatever reason the install gets blocked on some GUI prompt. timeout-minutes: 5 - - - name: Start Windows Audio Service + + - name: Grant FreeDV access to the microphone run: | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" -Name Value -Value Allow Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" -Name Value -Value Allow @@ -146,34 +146,41 @@ jobs: Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone\NonPackaged" -Name Value -Value Allow New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\" -Name "AppPrivacy" -Force Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" -Name LetAppsAccessMicrophone -Value 0 + + - name: Start Windows Audio Service + run: | net start audiosrv - name: List audio devices shell: pwsh run: | Get-CimInstance win32_sounddevice - - #- name: Prep ProcDump - # shell: pwsh - # working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin - # run: | - # Invoke-WebRequest https://download.sysinternals.com/files/Procdump.zip -OutFile Procdump.zip - # Expand-Archive -Path Procdump.zip -DestinationPath Procdump - # mkdir dumps - + + - name: Test RADE + shell: pwsh + working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin + run: | + .\TestFreeDVFullDuplex.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" -ModeToTest RADE -NumberOfRuns 1 + timeout-minutes: 5 + - name: Test 700D shell: pwsh working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin run: | - #.\Procdump\procdump64.exe -accepteula -mp -e 1 -at 120 -w freedv.exe & .\TestFreeDVFullDuplex.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" -ModeToTest 700D -NumberOfRuns 1 - #Start-Sleep -Seconds 10 timeout-minutes: 5 - #continue-on-error: true - #- name: Upload crash dump - # #if: ${{ failure() }} - # uses: actions/upload-artifact@v4 - # with: - # name: CrashDump - # path: ${{github.workspace}}/FreeDV-Install-Location/bin/*.dmp + - name: Test 700E + shell: pwsh + working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin + run: | + .\TestFreeDVFullDuplex.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" -ModeToTest 700E -NumberOfRuns 1 + timeout-minutes: 5 + + - name: Test 1600 + shell: pwsh + working-directory: ${{github.workspace}}\FreeDV-Install-Location\bin + run: | + .\TestFreeDVFullDuplex.ps1 -RadioToComputerDevice "${{env.RADIO_TO_COMPUTER_DEVICE}}" -ComputerToRadioDevice "${{env.COMPUTER_TO_RADIO_DEVICE}}" -MicrophoneToComputerDevice "${{env.MICROPHONE_TO_COMPUTER_DEVICE}}" -ComputerToSpeakerDevice "${{env.COMPUTER_TO_SPEAKER_DEVICE}}" -ModeToTest 1600 -NumberOfRuns 1 + timeout-minutes: 5 + diff --git a/src/audio/PortAudioDevice.cpp b/src/audio/PortAudioDevice.cpp index 959854c8a..efd6628b0 100644 --- a/src/audio/PortAudioDevice.cpp +++ b/src/audio/PortAudioDevice.cpp @@ -81,8 +81,6 @@ void PortAudioDevice::start() streamParameters.suggestedLatency = deviceInfo->defaultHighInputLatency; streamParameters.hostApiSpecificStreamInfo = NULL; - fprintf(stderr, "PortAudioDevice: opening ID %d with %d channels and %d sample rate\n", deviceId_, numChannels_, sampleRate_); - auto error = Pa_OpenStream( &deviceStream_, direction_ == IAudioEngine::AUDIO_ENGINE_IN ? &streamParameters : nullptr, @@ -116,8 +114,6 @@ void PortAudioDevice::start() Pa_CloseStream(deviceStream_); deviceStream_ = nullptr; } - - fprintf(stderr, "PortAudioDevice: opened ID %d successfully\n", deviceId_); } else { diff --git a/src/audio/PortAudioDevice.h b/src/audio/PortAudioDevice.h index f1291a8cd..4d1c722e0 100644 --- a/src/audio/PortAudioDevice.h +++ b/src/audio/PortAudioDevice.h @@ -56,4 +56,4 @@ class PortAudioDevice : public IAudioDevice static int OnPortAudioStreamCallback_(const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData); }; -#endif // PORT_AUDIO_DEVICE_H +#endif // PORT_AUDIO_DEVICE_H \ No newline at end of file