-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual sound device on Windows Instance #2528
Comments
Hello, @cmaughan
|
This works great :) Thanks so much for the effort; I hope it didn't take too long! |
@al-cheb Thanks for this snippet, it works great. I took the liberty of simplifying it a bit: - name: Install Scream
shell: powershell
run: |
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.8/Scream3.8.zip -OutFile Scream3.8.zip
Expand-Archive -Path Scream3.8.zip -DestinationPath Scream
Import-Certificate -FilePath Scream\Install\driver\x64\Scream.cat -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream One thing I noticed is that Scream only provides an output (render) audio device. I wonder if we could use a different driver to provide an input (capture) device as well. |
@dechamps I use VBCable in the Windows part of sound-ci-helpers (which I use by running https://github.com/LABSN/sound-ci-helpers
Feel free to try it! I should probably make this a proper GitHub Action step, I don't think it would be too difficult! |
On the new - run: net start audiosrv |
@al-cheb can we revive the discussion? Scream cannot afford the certificates, which is more than understandable. GitHub as part of Microsoft may can contribute or support, so that audio testing can become available again on windows: |
@Gustl22 it looks like you are talking about driver code signing, whereas this issue is about setting up a virtual sound device on CIs (which does seem possible using two solutions mentioned above: #2528 (comment), #2528 (comment)) |
@larsoner #2528 (comment) is no solution (I'm pretty sure at least), it just is an additional step to let Scream add a virtual device, see this run. And your mentioned action also fails, see this run. Yes, it is not about the specific solution, but it is about a working solution supported by GH Actions. |
Should be fixed now, feel free to try again 👍 Hopefully it works for now (until GH officially supports something, if ever!) |
Thanks for fixing @larsoner, but even in your solution you propose to use scream once, vb cable driver breaks. @al-cheb please reconsider opening again. How does Microsoft solve this problem internally for their tests? Are they using real sound cards for that? Thx. |
Updates scream install script to a simpler version written by Etienne Dechamps in: actions/runner-images#2528 (comment).
Looks like the Scream-based solution stopped working at some point on
Same if I upgrade to latest Scream 4.0. Example run: https://github.com/dechamps/FlexASIO/actions/runs/9238174920/job/25415967004 Not sure what broke it? |
It took some heroics, but I was able to capture a screenshot: - shell: powershell
run: Install-Module -Name PShot -AcceptLicense -Force
- shell: powershell
run: |
Import-Module -Name PShot
Start-Job { Get-PShot -Directory . -Delay 30 }
Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream
continue-on-error: true
timeout-minutes: 1
- uses: actions/upload-artifact@v2
with:
path: 'PShot*' The result: Looks like the |
And I guess this is why: I found duncanthrax/scream#215 about this. Looks like it's not going to be fixed, so we're gonna have to find some way to work around this or use a different driver. |
…and here's how I worked around it: - run: 'Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/4.0/Scream4.0.zip -OutFile Scream4.0.zip'
- run: 'Expand-Archive -Path Scream4.0.zip -DestinationPath Scream'
# To work around https://github.com/duncanthrax/scream/issues/215, create our own self-signed certificate for the Scream driver.
# makecert.exe insists on interactively asking the user for a password (sigh...), so use OpenSSL instead.
# `-extensions v3_req` is a trick to make sure the resulting cert has basic constraint CA:FALSE (the default is CA:TRUE which is problematic here) without having to create an OpenSSL config file.
- run: 'openssl req -batch -verbose -x509 -newkey rsa -keyout ScreamCertificate.pvk -out ScreamCertificate.cer -nodes -extensions v3_req'
- run: 'openssl pkcs12 -export -nodes -in ScreamCertificate.cer -inkey ScreamCertificate.pvk -out ScreamCertificate.pfx -passout pass:'
# This is just to make sure signtool.exe is in the PATH
- uses: ilammy/msvc-dev-cmd@v1
# Sign the driver with the self-signed certificate we just made.
- run: 'signtool sign /v /fd SHA256 /f ScreamCertificate.pfx Scream\Install\driver\x64\Scream.cat'
# Tell Windows to trust the self-signed certificate we just made.
# (For some reason it has to be added to both stores for it to work.)
- run: 'Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\root'
- run: 'Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher'
# Finally, install the driver.
- run: 'Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream'
# For convenience, make sure we fail fast if for whatever reason the install gets blocked on some GUI prompt.
timeout-minutes: 5 All good now: https://github.com/dechamps/FlexASIO/actions/runs/9242970185/job/25426485555 You'll then likely want to follow that with |
For anyone trying to do what I was doing, install a virtual sound device on |
Description
I'm writing tests for Sonic Pi, using Github Actions.
On Linux I can do 'jackd -d dummy &' to get a virtual audio device.
On Mac, Soundflower is automatically installed (a virtual audio device)
But I'm stuck on Windows. Is there a way for my github action to run a test which finds an audio device on a windows instance? It doesn't need to make a sound, obviously, just register as an audio device that the software can connect to.
Question, Bug, or Feature?:
Question
Virtual environments affected
Expected behavior
Some kind of valid sound device is installed
Actual behavior
No sound device is found
Repro steps
Launch an executable as part of an action that requires a sound device (virtual or real).
The text was updated successfully, but these errors were encountered: