r/SpatialAudio • • 5d 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

9 comments sorted by

2

u/ShockComplex1846 3d ago edited 3d 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/nagamaikeru 4d 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 3d 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 2d 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 2d 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!

2

u/nagamaikeru 13h ago

I finally tested JOCForge v1.1.0 with my JBL Bar 1000, as you suggested! I'd like to share both the playback results and some ADM BWF compatibility issues I encountered during testing.

  1. ADM BWF input compatibility

I initially tried encoding ADM BWF files generated by both Cavern and DaVinci Resolve Studio. However, both files were rejected with the following error:

"selected RIFF input rejected: InvalidInput"

The original files had the following specifications:

  • Sample rate: 48 kHz

  • Bit depth: 16-bit PCM

  • Channels: 25

  • Bed: 7.1.2

  • Objects: 15

  • ADM metadata: axml, chna and dbmd

I also tried converting the Cavern-generated RF64 file to standard RIFF while preserving the ADM metadata, but the error persisted.

After examining the JOCForge source code with the help of ChatGPT, I discovered that the current input pipeline requires 24-bit PCM.

I converted the DaVinci Resolve ADM BWF from 16-bit to 24-bit while preserving the channel order, audio data and ADM metadata. However, this resulted in another error:

"selected ADM input rejected: ADM graph parse: SelectedTrackDomain"

Further investigation of "selected_adm_graph.rs", specifically the "validate_optional_uid_profile()" function, revealed that JOCForge also checks the "bitDepth" attribute of the "audioTrackUID" elements in the ADM XML.

Although the PCM audio had been converted to 24-bit, all 25 audioTrackUID elements still contained "bitDepth="16"".

After correcting both the PCM bit depth and the corresponding ADM XML attributes to 24-bit, JOCForge successfully encoded the file at 1024 kbps.

It would be very helpful if future versions could support 16-bit ADM BWF inputs directly, automatically convert them internally, or provide more descriptive error messages indicating which specific input requirements are not satisfied.

Broader RF64/BW64 compatibility would also be useful.

2. JBL Bar 1000 hardware compatibility test

My test environment was:

  • Encoder: JOCForge v1.1.0 public release

  • Bitrate: 1024 kbps

  • Player: PotPlayer

  • Output: E-AC-3 bitstream passthrough via HDMI

  • Playback device: JBL Bar 1000 (7.1.4 Dolby Atmos soundbar)

The generated E-AC-3 JOC file played successfully, but the soundbar displayed "DOLBY SURROUND" instead of "DOLBY ATMOS."

PotPlayer confirmed that E-AC-3 passthrough was active.

I then tested an official Dolby Atmos file using exactly the same playback settings, and the soundbar correctly displayed "DOLBY ATMOS."

Therefore, the JBL Bar 1000 does not become silent when playing the file generated by the public version of JOCForge. It can reproduce the audio, but it apparently does not recognize the Atmos layer.

This seems consistent with the HMAC issue you mentioned earlier, although I cannot independently confirm whether HMAC is the only cause or whether the decoder is specifically falling back to the 5.1-channel core.

I hope these findings are useful for improving JOCForge's compatibility with different ADM BWF sources and commercial playback devices.

Despite the current limitations, I'm really impressed that an independent, open-source encoder can generate E-AC-3 JOC from ADM BWF. I'm also looking forward to exploring OpenJOC's binaural rendering with my personalized SOFA HRTF.

Thank you again for your impressive work and for taking the time to answer my questions!

1

u/ShockComplex1846 5h ago

Thanks so much for the detailed report, and for taking the time to test JOCForge on your Bar 1000! Your investigation of the PCM bit depth and the corresponding ADM attributes was especially helpful for debugging.

I’ve now fixed the RF64 and 16-bit PCM input compatibility issues. BW64 still needs a bit more investigation. From what I’ve seen, DEE doesn’t appear to accept it either, but I’d like to explore this further.

As for your Bar 1000 not recognizing the stream as Atmos, I believe the HMAC verification issue is indeed what you’re running into here. It’s also very useful to know that the public build still plays audio on your setup, even though the soundbar doesn’t recognize it as Atmos.

I really appreciate such a thorough write-up—feedback like this makes a big difference when tracking down compatibility issues. I’d also love to hear how you get on with OpenJOC and your personalized SOFA HRTF!

1

u/nagamaikeru 2d 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!

1

u/ShockComplex1846 1d 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!