MPV + CavernPipe β Real-time Dolby Atmos playback through spatial audio rendering.
This is a modified build of mpv (v0.41.0) with an integrated CavernPipe audio decoder that sends compressed audio (E-AC-3 / AC-3) to CavernPipeServer for Dolby Atmos spatial rendering, and receives rendered PCM back for playback.
TrueHD streams are decoded locally via FFmpeg's built-in decoder.
Media File (E-AC-3 / AC-3 with Dolby Atmos)
β
mpv (ad_cavernpipe decoder)
β [compressed frames via Windows named pipe]
CavernPipeServer (Atmos spatial rendering)
β [PCM float32]
Audio Output (WASAPI / Snapserver / etc.)
For TrueHD:
Media File (TrueHD)
β
mpv (ad_cavernpipe / FFmpeg TrueHD decoder)
β [PCM]
Audio Output
| Codec | Path | Atmos Support |
|---|---|---|
| E-AC-3 (Dolby Digital Plus) | CavernPipeServer | β Full JOC/Atmos spatial rendering |
| AC-3 (Dolby Digital) | CavernPipeServer | β Spatial rendering |
| TrueHD | FFmpeg (local decode) | β Channel bed only (7.1) |
- Windows 10/11
- .NET 8.0 Runtime (for CavernPipeServer)
CavernPipeServer\CavernPipeServer.exeThe server creates a Windows named pipe (\\.\pipe\CavernPipe) and waits for connections.
build\mpv.exe --ad=cavernpipe "your-atmos-file.mkv"Or with verbose logging:
build\mpv.exe --ad=cavernpipe --no-video -v "your-atmos-file.mkv"build\mpv.exe --ad=cavernpipe "your-truehd-file.mkv"The output channel count is read from %APPDATA%\Cavern\Save.dat (first line). This is set by the Cavern Driver configuration tool. Default is 6 channels (5.1).
To change manually:
echo 8 > "%APPDATA%\Cavern\Save.dat"Supported: up to 64 channels. For >8 channels, the output uses an "unknown" channel layout to bypass mpv's remixing.
Requires MSYS2 with clang64 toolchain and FFmpeg development libraries.
# In MSYS2 clang64 shell
meson setup build
meson compile -C build| File | Purpose |
|---|---|
audio/decode/ad_cavernpipe.c |
CavernPipe audio decoder (E-AC-3/AC-3 via pipe, TrueHD via FFmpeg) |
filters/f_decoder_wrapper.c |
Decoder selection logic (cavernpipe integration) |
filters/f_decoder_wrapper.h |
Decoder wrapper header |
meson.build |
Build system (includes ad_cavernpipe.c) |
The named pipe protocol is synchronous:
- Handshake (8 bytes):
[BitDepth=32][MandatoryFrames][Channels U16 LE][UpdateRate I32 LE] - Send:
[U32 length LE][compressed audio bytes] - Receive:
[U32 length LE][float32 PCM bytes] - Repeat 2-3.
- E-AC-3 with AHT (Adaptive Hybrid Transform): Not supported by Cavern's decoder β these files will fail.
- TrueHD Atmos objects: FFmpeg decodes the channel bed only (up to 7.1); Atmos spatial metadata is not preserved. Full TrueHD Atmos requires a native MLP decoder in Cavern (not yet implemented).
- WASAPI shared mode: Limited to the device's configured channel count (typically 2 or 8).
- One client at a time: CavernPipeServer accepts a single pipe connection.
- mpv β Free, open-source media player: mpv.io | GitHub
- Cavern β Open-source spatial audio engine by VoidX (sbence): GitHub
- CavernPipeServer β Part of the Cavern project, provides real-time Dolby Atmos rendering via named pipe
mpv is licensed under GPLv2+ (see LICENSE.GPL) and LGPLv2.1+ (see LICENSE.LGPL).
The CavernPipe decoder (ad_cavernpipe.c) follows the same license as mpv.
CavernPipeServer and Cavern libraries are provided under their own license β see the Cavern repository for details.