This repository is independent research tooling for generating 16-bit stereo
WAV files with Type B control signals recognized by FFmpeg's hdcd decoder.
It is a working encoder research project, not an emulation or replacement for
Pacific Microsonics Model One/Two hardware.
Sloproom is tested and supported with stereo PCM WAV and FLAC input. Other SoundFile-readable containers can reach the development code, but they are not supported. Do not use surround or other multichannel input.
The current implementation supports deterministic Type B packet injection, neutral TPDF dither, decoder-complementary Peak Extend (PE), and a bounded Normal Low Level Extension (LLE) path. Its DSP behavior is validated against FFmpeg's open decoder mechanics; it does not claim hardware parity.
The public command-line entry point is hdcd_encoder.py. Run the commands
below from the repository root.
- Type A encoding, Special-mode LLE DSP, Transient Filter generation, proprietary dither emulation, and automatic hardware-policy recovery are outside the current release scope.
- PE and Normal LLE DSP modes are explicitly FFmpeg-decoder-complementary. They are useful, tested research modes, not a claim that original hardware used the same forward policy.
- FFmpeg validation is strong. A small, level-matched human pilot found no detectable difference between selected PE test excerpts and their FFmpeg-decoded output; that is not a universal audibility or compatibility claim.
- A first physical audio-CD pass succeeded: ImgBurn-authored output activated HDCD recognition on a Philips DVD751 -> optical/TOSLink -> Marantz SR5004 chain, and EAC re-rips retained clean FFmpeg Type B/PE/LLE diagnostics. This confirms the tested chain recognizes the controls; it does not establish Pacific Microsonics hardware parity. See the physical-player validation record.
For detailed evidence, limitations, and reproducible research methods, see the optional research archive.
New to Git, Python environments, or executable packaging? Start with the step-by-step build-from-source guide. It explains how to clone the public repository, install prerequisites, run from source, test the checkout, create a local executable bundle, and test that bundle on x86_64 or ARM hardware.
Use the project-local Python environment on Windows:
py -3.12 -m venv .venv
.venv\Scripts\python.exe -m pip install -r requirements.txtFFmpeg is optional for ordinary encoding. It is required for --check and
the objective research/validation tools. The portable Python verifier finds
ffmpeg or ffmpeg.exe on your PATH; this repository does not bundle an
FFmpeg executable.
Make a default export:
.venv\Scripts\python.exe hdcd_encoder.py `
--input mix.flac --output mix_sloproom.wavThe default applies +3 dB static pre-gain, the FFmpeg-complementary PE path, and the core48 Type B transport. Core48 preserves natural dither/PCM LSBs outside the planned 48-bit control core. It resamples the program to 44.1 kHz when needed, then writes a 44.1 kHz, 16-bit stereo WAV file.
Start with a 24-bit or 32-bit lossless source. The normal CLI stops on a
16-bit PCM source because encoding changes its existing LSB audio data. Use
--allow-16-bit-input only for an intentional test.
The PE working ceiling is +6.0206 dBFS. The encoder rejects a program that
would exceed that ceiling, or an above-full-scale start before PE becomes
active. Use --pre-gain-db 0 to disable the default boost, or add explicit
--pre-roll-ms 200 when a leading delivery prefix is acceptable.
Add Normal LLE:
.venv\Scripts\python.exe hdcd_encoder.py `
--input mix.flac --output mix_lle.wav --lleRun the guarded decoder-stress demonstration:
.venv\Scripts\python.exe hdcd_encoder.py `
--profile demo --input mix.flac --output mix_demo.wav --verifyThe demo profile uses core48, PE, Normal LLE, a +5.9 dBFS peak fit, and
200 ms of coded pre-roll. It is an FFmpeg-facing stress preset, not a normal
mastering recommendation. It rejects unsafe pre-control or post-LLE headroom
instead of clipping.
Verify an output with a separately installed FFmpeg:
.venv\Scripts\python.exe hdcd_encoder.py `
--input mix.flac --output mix_checked.wav --verifyUse --help for normal mastering controls and examples. Use --help-expert
for grouped research controls. Focused command-line pages are available through
--help-topic pe, --help-topic lle, --help-topic demo, --help-topic transport,
--help-topic validation, and --help-topic research. Read the user
guide before you use research controls.
For a historical natural-LSB transport reference, expert users can select
--type-b-layout rapid72-pre24. The legacy conservative layout uses forced
zero-LSB padding and is retained for regression research, not normal delivery.
For a generated output, --check runs the portable Python verifier and prints
the required FFmpeg counters. You can also inspect an existing file directly:
.venv\Scripts\python.exe hdcd_verify.py output_pe.wav --scan-seconds 30For a manual FFmpeg command with detailed counters:
ffmpeg -hide_banner -nostats -v verbose -i output_pe.wav -t 30 -vn `
-af hdcd -c:a pcm_s32le -f null - 2>&1 |
Select-String -Pattern "Channel 0: counter|Channel 1: counter|Channel 0: pe|Channel 1: pe|Packets: type|HDCD detected"Run the basic release-facing check:
.venv\Scripts\python.exe -m unittest scripts\test_cli_smoke.py -vThe research and validation scripts provide broader PE, LLE, transport, sample-rate, and listening-validation coverage.
- Build Sloproom from source, including a local executable bundle
- User guide and safe starting commands
- Contribution guide
- Research archive overview
- FFmpeg decoder ground truth
- DSP evidence and roadmap
- Human listening protocol
- Physical-player validation record
Copyright (C) 2026 Thomas Avent. Original Sloproom project code is licensed under GPL-3.0-only; see LICENSE. FFmpeg-derived decoder reference files retain their separate BSD-3-Clause terms; see THIRD_PARTY_NOTICES.md. The four named Signal Aperture v2 logo assets are CC BY-SA 4.0; see their source-adjacent notice and the complete CC BY-SA text. All other repository material retains its separately stated status.
For project discussion, use GitHub issues or pull requests. Informal contact: Mastodon @vandorb12@infosec.exchange.
Do not present Sloproom as official, certified, licensed, or endorsed by Microsoft or Pacific Microsonics. “HDCD” and “High Definition Compatible Digital” are trademarks of Microsoft Corporation. This independent project is not affiliated with, endorsed by, or licensed by Microsoft.
