r/SpatialAudio • • 4d ago

I built an open-source Atmos encoder in Rust (ADM BWF → E-AC-3 JOC)

Hey everyone, I’m the developer behind OpenJOC, and I’ve been working on the other end of the chain: an encoder called JOCForge.

I also mix in Atmos myself, so this is something I wanted to use with my own projects. After a few months of work, I finally got the 7.1 encoding path working with full-length tracks, and figured people here might be interested.

JOCForge takes 48 kHz ADM BWF files and produces E-AC-3 JOC bitstreams. It’s written in Rust and available under the Apache 2.0 license.

The current encoding options are:

  • 5.1-core JOC: 384, 448, 576, 640, 768, or 1024 kbps.
  • Flat 7.1 JOC: 1664 kbps.

The encoding itself is handled by JOCForge. You can then use FFmpeg to remux the resulting .ec3 file into MKA or MP4/M4A without re-encoding the audio.

For playback testing, I’ve encoded complete songs and rendered them through OpenJOC. I’ve also opened the Flat 7.1 output in Audition and played it in Windows Media Player after remuxing to MKA. The Flat 7.1 output remuxed to M4A has played through the native iOS decoder in my tests as well.

One compatibility detail: the 5.1 JOC output currently plays silently through the native iOS decoder. The successful iOS playback tests above are with the Flat 7.1 output.

Downloads: Windows, macOS, and Linux builds

Source and instructions: JOCForge — independent encoder branch

The current encoder documentation is on that branch, including encoding commands and playback notes.

4 Upvotes

7 comments sorted by

2

u/ShockComplex1846 2d ago edited 1d ago

Quick update: quite a bit has changed since I posted this!

JOCForge’s independent encoder now supports all 980 E-AC-3 JOC variants covered by the project, up from the original 965. They all encode successfully and sound as intended when decoded with OpenJOC. I’ve also merged the independent encoder into main, so that’s the branch to use going forward.

One distinction I want to highlight, especially for anyone comparing this with raress96/dolby-atmos-encoder, is the encoding architecture. That project generates its own JOC/OAMD data around an externally encoded E-AC-3 core, using FFmpeg in its documented workflow. JOCForge implements the audio encoder itself as well as the JOC layer. ADM parsing, object rendering, AC-3/E-AC-3 encoding, metadata generation, and bitstream assembly all happen within the Rust implementation. No external audio encoder is required. FFmpeg is optional for remuxing the finished stream into containers such as MKA or M4A.

There’s also a lot of control over how the output is built: five JOC profiles, dependent-substream configurations, LFE ownership, block partitions, and different ways of carrying and signalling the metadata. Those combinations are what the 980 variants represent. This exposes a substantially wider range of E-AC-3/JOC bitstream configurations than DEE’s standard encoding workflow.

To my ears, it’s currently the closest open-source E-AC-3 JOC encoder to DEE in terms of sound. Getting that sound while also opening up this much control over the bitstream is the part I’m most excited about.

These playback results are with OpenJOC. The public build still omits the proprietary HMAC key, so compatibility with commercial Dolby decoders and AVRs remains a separate issue.

Current code and documentation: JOCForge on GitHub

1

u/ShockComplex1846 1h ago

Quick update: I’ve put together a small web demo so you can try out the basic functionality directly in your browser:

👉 https://atmos.chyinan.top/

It’s a simple way to get a feel for the project before setting it up locally. Feel free to give it a try, and let me know what you think or if you run into any issues!

1

u/nagamaikeru 2d ago

This is really impressive work!

I have one question: If I convert an ADM BWF file to E-AC-3 JOC using JOCForge, will a consumer Dolby Atmos-compatible AV receiver recognize and decode the output as Dolby Atmos?

If so, that's a huge achievement! As far as I know, Cavern couldn't encode E-AC-3 JOC while preserving Atmos object information, so this would make something possible that wasn't previously achievable with Cavern.

Thanks for your amazing work!

2

u/ShockComplex1846 2d ago

Thanks, I appreciate it!

JOCForge does encode the JOC/object metadata, but there’s a catch with the public release: it doesn’t include the proprietary HMAC key. So I wouldn’t promise that the stock binaries will be recognised as Atmos by a consumer AVR.

I’ve left a frame-protection hook for downstream builds, though. A custom build can supply that missing piece separately if it has the necessary implementation and key material. There’s room for custom builds to go further than the public binaries here, but the result would still need to be tested on the particular receiver.

Which AVR are you using?

1

u/nagamaikeru 16h ago

Thanks for the detailed explanation!

I'm using a JBL Bar 1000, which is a 7.1.4 Dolby Atmos soundbar rather than a traditional AVR.

I didn't realize that the proprietary HMAC key could prevent commercial Dolby decoders from recognizing the JOC object data.

If I play an E-AC-3 JOC file generated by the public version of JOCForge on my JBL Bar 1000, would it most likely fall back to the regular 5.1-channel audio, or could it fail to play entirely?

Also, is the missing HMAC key currently the main obstacle to commercial hardware compatibility, or are there other compatibility issues that still need to be resolved?

Thanks again for your impressive work!

1

u/ShockComplex1846 14h ago

Yes—as far as I’ve been able to determine, the missing HMAC key is the only remaining blocker preventing Dolby-licensed decoders from accepting the JOC layer in JOCForge’s 5.1-based Atmos output. iOS’s built-in decoder runs into the same issue: those files from the open-source version currently play back with no sound.

To be honest, I do have a private, closed-source patch that resolves this. But as you can probably imagine, I’m concerned about the legal implications of releasing it publicly, so I’m keeping that part private. The open-source code is there for anyone who wants to investigate further and work out their own solution.

As for the JBL Bar 1000, I don’t own one, so I can’t say for sure whether it would fall back to regular 5.1 audio or produce no sound at all. That would need to be tested on the actual device. You’re welcome to give JOCForge a try, though, and I’d be interested to hear how it behaves on your setup!

And thanks for the kind words—I really appreciate it!

1

u/nagamaikeru 12h ago

Thank you so much for taking the time to explain everything in such detail!

I initially thought JOCForge was mainly interesting because it could potentially do something Cavern couldn't — encode ADM BWF into E-AC-3 JOC while preserving the Atmos object information for playback on consumer devices.

But after learning more about JOCForge and OpenJOC, I realize the project is much more interesting than just getting Atmos playback working on an AVR or soundbar.

I was especially impressed by OpenJOC's binaural rendering capabilities, including support for custom SOFA HRTFs. The possibility of decoding and rendering Atmos independently of Dolby's proprietary software, and potentially using personalized HRTFs, is really exciting.

Your explanation of the HMAC issue was also very informative. I now understand why generating a JOC bitstream doesn't necessarily mean a commercial Dolby decoder will recognize it.

I really appreciate the amount of research and development you've put into these projects, especially making so much of the work open source.

As you suggested, I'll give JOCForge a try with my JBL Bar 1000 and see how it behaves with the publicly available encoder. I'm particularly curious whether it will recognize the output as Atmos, fall back to 5.1, or fail to play. I'll be happy to share my results with you!

Thanks again for your detailed explanations and for sharing such impressive work with the community!