6.2 KiB
Remote audio on Windows
This project links Windows audio to a JackTrip hub on another machine. It runs JACK2 with the dummy driver, VB-Audio Hi-Fi Cable and ASIO Bridge with JACK Router, and a JackTrip hub client. The script connects the first two channels in both directions. No Windows audio hardware is needed for JACK's clock.
The PowerShell supervisor starts the programs in order, waits for their JACK ports, makes the connections, and monitors the child processes. It owns them through a Windows job object: stopping or losing the supervisor closes the programs it started. It refuses to take over or stop unrelated JACK, JackTrip, or ASIO Bridge processes.
First setup
- Copy
audio.example.jsontoaudio.json. Sethostto the JackTrip hub's hostname or IPv4 address. Edit executable paths if your installations use different locations. Relative paths are resolved from this project directory.audio.jsonis ignored by Git. - Run
.\audio.ps1 setupin an interactive PowerShell window. If JACK or JACK Router is absent, the script downloads and verifies the pinned JACK installer, then offers to run it. Choose Full installation (with JACK-Router). If JackTrip is absent, the script downloads a verified copy into.deps/. Hi-Fi Cable and ASIO Bridge require manual installation from VB-Audio, followed by a reboot. - In ASIO Bridge, select JACK Router and enable ASIO Direct. Set both Windows Hi-Fi Cable endpoint formats and the remote audio system to the same sample rate as
rate(48 kHz in the example). Start the JackTrip hub on the remote machine and ensure its network ports are reachable.
Versions, download URLs, and SHA-256 hashes are pinned in dependencies.json. Downloads and runtime files remain in the ignored .deps/ and .runtime/ directories.
Use
Run commands from this directory in PowerShell:
.\audio.ps1 toggle # start if stopped; stop if running
.\audio.ps1 start # start in the background
.\audio.ps1 stop # stop the owned stack
.\audio.ps1 status # show owned processes and cable max latency
.\audio.ps1 logs # show recent logs
.\audio.ps1 run # run the supervisor in this terminal; Ctrl-C stops it
.\audio.ps1 setup # check or install dependencies
toggle-audio.cmd is a shortcut-friendly wrapper for toggle -NonInteractive. Its console closes on success and pauses on error so the message stays visible. To pin it to the taskbar, create a shortcut to cmd.exe with target arguments /d /c ""<project-directory>\toggle-audio.cmd"" and set Start in to the project directory. Perform the interactive setup first; the shortcut will not prompt to install drivers. No scheduled task or service is required.
If PowerShell blocks direct script execution, use powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\audio.ps1 toggle. Run the stack as the signed-in desktop user because ASIO Bridge uses the interactive desktop.
Configuration
| Setting | Purpose |
|---|---|
jackd, jackTools, bridge, jacktrip |
Program and JACK tools paths. Missing JACK and JackTrip are handled by setup; Hi-Fi Cable requires manual installation. |
host |
JackTrip hub hostname or IPv4 address. |
forceIPv4 |
If true, resolve host to an IPv4 A record and pass its numeric address to JackTrip. Startup fails if no IPv4 address exists. JackTrip 2.7.2 does not have a dedicated IPv4 switch. |
channels |
JackTrip send and receive channel count. The script connects channels 1 and 2. |
rate, period |
JACK dummy sample rate and frames per period. period must be a power of two. |
preventPowerThrottling |
Ask Windows to keep the three audio processes out of EcoQoS and to honor their timer-resolution requests. Set to false if unsupported or if you want Windows-managed behavior. This may increase power use. |
JACK always starts at High process priority. JackTrip's local JACK client has the fixed name RemoteAudioJackTrip, so changing or resolving the hub hostname does not change the port names used for connections. The optional -Period argument on start or toggle overrides period for that run without editing audio.json.
Hi-Fi Cable max latency
.\audio.ps1 latency # read the VBAudioHFVAIO registry value
.\audio.ps1 latency 1024 # set a new value, from an administrator PowerShell
This is the cable's maximum pipe size, in samples, rather than a measured one-way audio delay. VB-Audio says the largest buffer in use should be below one third of the cable max; ASIO Bridge warns when the max is too small. With a displayed ASIO buffer of 128 samples, 1024 samples is a cautious first value to try. If there are no warnings or glitches, 512 is another possible trial; if another stream uses a larger buffer, keep the max above three times that larger value. At 48 kHz, 1024 samples span about 21.3 ms, but that does not mean the link adds 21.3 ms of delay. See the VB-CABLE reference manual.
Changing the registry value requires administrator rights. Reboot Windows after a change so the driver reloads it, then inspect ASIO Bridge for buffer or sample-rate warnings. The script only writes HKLM\SOFTWARE\VB-Audio\Cable\VBAudioHFVAIO.
Troubleshooting
status confirms process ownership and readiness, not that audio is audible. Use logs if startup fails or JackTrip disconnects. The JACK, bridge, JackTrip, and supervisor logs are in .runtime/logs/. If unrelated audio processes are reported, close them yourself before starting this stack.
Keep the Hi-Fi Cable input, output, ASIO Bridge, JACK, and remote sample rates aligned. If ASIO Bridge's centre sample-rate display falls or JACK reports xruns when windows lose focus, check preventPowerThrottling; Windows can ignore timer-resolution requests from invisible applications, and the supervisor uses per-process power controls to request stable timing. tests/power-policy.ps1 checks that Windows accepts those controls.