Skip to content
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

Enable Jack on Windows #1033

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Enable Jack on Windows #1033

wants to merge 2 commits into from

Conversation

ThreeDeeJay
Copy link
Contributor

@ThreeDeeJay ThreeDeeJay commented Aug 18, 2024

Following this suggestion to try Jack on Windows, I decided to give it a shot, but found out that just setting drivers=jack wasn't enough: the backend was not enabled for Windows builds. So I managed to install the dependencies and build it here.
https://github.com/ThreeDeeJay/openal-soft/actions/runs/10440094213

However, I was still not able to get it working. I'm not sure if it's an issue with OpenAL Soft, Jack, PortAudio, ASIO, or something else on my end, but it can't even establish an active connection/stream via the Jack control panel (which btw is unnervingly buggy for an app that deals with ASIO 👀💦 )
image
Changing buffer or sample rate doesn't help, though fwiw the dummy backend in Jack seems to play nice with ASIO4ALL (though 32000hz is the highest sample rate without "XRuns" (underruns?) warnings)

Anyhow, when attempting to use Jack in OpenAL Soft, the apps fail to open the device no matter what I do:
ALCapsViewer32_CwwUNS7JE7

Test build with config and logs: OpenALSoftJackTest.zip

Something to note: for some reason, the Jack installers copy DLLs to C:\Windows instead of C:\Windows\System32/C:\Windows\SysWOW64 so I had to copy them manually to the executable folder. Also, OpenAL Soft Win64 looks for libjack.dll even though the file added by Jack is libjack64.dll.

I know this sounds more like an issue but even though I'm not really fond of the friction it takes to set this up (especially since both the Win32 and Win64 make my AV and HybridAnalysis scream bloody murder), I figured I'd still share the CI in case someone can figure out how to get this working and maybe then this could be eventually merged so people don't have to go out of their way to compile with Jack.

@kcat
Copy link
Owner

kcat commented Aug 19, 2024

Hmm, JACK seems to work here on Wine. There was a bit of misbehavior when I tried changing the Interface to certain devices, but I think that was more a quirk of Wine/winepulse.drv and PortAudio's requirements for full duplex mode. Using WineASIO works fine, and I could also go to the Advanced tab to set Audio to Playback only from Duplex to make those other devices work. This is a pretty hefty audio stack (Windows JACK -> PortAudio -> WineASIO -> Linux JACK -> PipeWire), but I'm not using anything extreme (48khz with Frames/Period set to 512). and don't get any xruns (underruns or overruns).

And for OpenAL Soft, as long as the server was successfully running after pressing Start, it works fine with JACK for me. Fixing the backend to use libjack64.dll on 64-bit Windows was all I needed to do there (I didn't need to move the libjack DLLs from C:\Windows; LoadLibrary seems to pick them up fine from there).

I do notice something in your JACK Messages log that's different from me, though. Where it mentions jack_client_close, I see:

jack_client_close called with a NULL client
JackWinMMEDriver::Open - while creating input port: The driver was not enabled.
JackWinMMEDriver::Open - while creating input port: The driver was not enabled.
21:19:45.427 JACK connection change.

but you have a different message with JackWinMMEDriver::Open. Have you tweaked any JACK settings besides what you showed? Does it work if you turn up the Frames/Period setting?

@ThreeDeeJay
Copy link
Contributor Author

IIRC I had only changed interface, sample rate and periods (which I also tried maxing out with no luck), but after resetting everything in QJack Ctl to defaults, just setting Audio: Playback only seemed to allow starting some interfaces like FlexASIO (set to WASAPI), but even then, it completely ignores it along with sample rate and periods
image
It also ignores the separate output device selection.

Setting Server prefix to jackd (without -S -X winmme) stops it from loading ASIO4ALL when not selected, but when it is selected, it still fails to start, though at least it respects the sample rate and periods.
That setting (along with Playback only) also allows interfaces like MME, DirectSound and WASAPI to start and some work with OpenAL Soft, but it's still pretty buggy with errors, hangs and crashes often. 😔

I expected this setup to be tedious, but I thought Jack wasn't supposed to be this clunky on Windows, unless again, I'm just missing something. We'd probably need a guide to set this up right, or just keep Jack away from windows if the ASIO/WASAPI exclusive backends are gonna be a thing eventually 👀👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants