Skip to content

Commit

Permalink
Clean up debugging, add tests for RADE/700E/1600.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiw committed Nov 20, 2024
1 parent 1397a5c commit 99c120d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
47 changes: 27 additions & 20 deletions .github/workflows/cmake-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,43 +137,50 @@ 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
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone\" -Name "NonPackaged" -Force
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

4 changes: 0 additions & 4 deletions src/audio/PortAudioDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -116,8 +114,6 @@ void PortAudioDevice::start()
Pa_CloseStream(deviceStream_);
deviceStream_ = nullptr;
}

fprintf(stderr, "PortAudioDevice: opened ID %d successfully\n", deviceId_);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/audio/PortAudioDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 99c120d

Please sign in to comment.