Repository navigation
fix(audio): loop silent Dolby Atmos beside APAC on tvOS so receivers switch to Atmos - #740
Conversation
APAC played on an Apple TV 4K with an Atmos soundbar, but the soundbar never showed Atmos. While an APAC session plays on tvOS, the engine now loops a silent E-AC-3 stream signalled as Dolby Atmos on a second player beside its own (AtmosOutputActivator), which brings the HDMI output into Atmos. The 2 s stream is digital silence, written from the E-AC-3 and object audio specifications by Scripts/make-silent-atmos.swift.
…AC alone Some sinks show Dolby Atmos for APAC on their own; a Samsung HW-Q990C does not. Name it, and drop the route channel counts, which did not track the soundbar's indicator across runs.
9d4b20c
into
superuser404notfound:main
… player (#740) AtmosOutputActivator holds an AVQueuePlayer of its own. A media services reset invalidates it along with the engine's player, but only the engine's was rebuilt, so after an Apple TV sleep the silent Atmos stream would have played on a dead object until the app restarted. The reset now detaches and drops the activator, and the next currentAVPlayer builds a fresh one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
|
Thank you, Kristoffer, for this and for contributing the stream and the script under the project's licence. Merged in 9d4b20c. What happened on the way in:
Before the next release this gets a device round on an Apple TV into a Sonos, a sink that already shows Atmos for APAC on its own, to confirm the activator changes nothing there and leaves Now Playing and the remote alone. I will report back here. |
|
Device round done: Apple TV 4K (3rd gen) into a Sonos soundbar, a sink that already shows Atmos for APAC on its own, with Sodalite on bf7b139.
So on a sink that needs no nudge the activator changes nothing, as you expected. One side observation, not caused by the activator: after switching from the APAC track to a 5.1 track the Sonos keeps showing Atmos, because tvOS leaves the HDMI output in the MAT carrier it negotiated for APAC ( Thanks again, this goes out with the next release. |
|
I don’t know how I feel about this! Playing a silent Atmos track to force the receiver to show Atmos light / indicator is deceptive. If the height channels are working with APAC without the “Atmos” indicator, then all this does is add a deceptive Atmos indicator where the height effects are coming from a different non-Atmos path (ie APAC over Dolby MAT). All this does is allow some apps to falsely claim “TrueHD Atmos” when it’s not true and it’s actually a silent lossy Atmos track that’s playing and the actual audible sound is coming from the Dolby MAT track. My opinion is, if some hardware doesn’t support Atmos over Dolby MAT, it’s a hardware limitation. Forcing a logo doesn’t change that. Users should get the honest picture and understand their hw limitations. |
…maximum After an APAC session tvOS keeps the HDMI output in the 2-channel MAT carrier it negotiated, so a 5.1 ec-3 item played next read output=2 and the warning claimed a downmix while the sink played the 5.1 intact (Apple TV 4K into a Sonos, max=32, found in the PR superuser404notfound#740 device round). The warning now fires only when the sink's advertised maximum is below the track's channel count. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
That's not how it works at all, without the silent Atmos track no height channels are being played at all. It's not about getting some logo lol, it's about getting spatial sound output. |
That definitely makes it worth it then! Looking forward to your DTS:X patch as well. Thanks for doing this! |
|
By the way, I’m sorry if I came across as disrespectful. Wasn’t my intention. Thanks for your reply and explanation. |
No worries! PR submitted. |
Hi, while working on integrating my APAC library into AetherEngine (and other tvOS media players) I noticed you had already implemented an alternative, LibTrueHD. Great work, glad to see so many people all work towards finally getting height channels from our Atmos content!
The most important difference between my library and the current implementation of LibTrueHD here is that only mine triggers Atmos on my soundbar. To solve this I and others like NativePlayer use a silent Atmos track played at same time, works brilliantly. Here's a PR that adds the same here, gets Atmos working for me (confirmed on my TV).
AI summary below.
Summary
TrueHD Atmos rendered to APAC doesn't reach every receiver as Atmos. tvOS sends APAC over HDMI as Dolby MAT, and some sinks show Dolby Atmos for that on their own: in #731, an Apple TV 4K (3rd gen, tvOS 27.0) into a Sonos soundbar reports Dolby Atmos. Others don't.
On my Samsung HW-Q990C soundbar, fed by an Apple TV 4K (2nd gen, tvOS 27.2), APAC plays but the soundbar never shows Atmos. Nothing inside the app shows the difference. AVPlayer plays 12-channel
apac, andAVAudioSessionreports a MAT format ('mat+') whether the soundbar shows Atmos or not.This adds an activator that gets such sinks into Atmos.
Ref #731
What changed
AtmosOutputActivatorloops a silent E-AC-3 stream signalled as Dolby Atmos on a second, unmutedAVQueuePlayer. With it, the HW-Q990C shows Atmos from the first frame and keeps it across seeks.currentAVPlayer: the item, the audio selection andtimeControlStatus. It plays while the host plays or waits to play an item from a session whose audio is APAC (HLSVideoEngine.audioIsAPAC), and pauses with the host. As soon as the item isn't APAC, it releases the stream, so nothing prerolled competes with other audio.Sources/AetherEngine/Resources/silent-atmos.mp4(194 KB, 2.016 s):dec3extension from it. AVFoundation reads it as'ec+3'layers over an'ec-3'core.Scripts/make-silent-atmos.swiftwrites every bit from ETSI TS 102 366 and TS 103 420.scripts/make-silent-atmos.swift, Apache-2.0), where the same file ships with itsAtmosOutputActivator. Withffmpeg -c copy -fflags +bitexact, the script reproduces the bundled file byte for byte (checked with FFmpeg 9.0.2). Apache-2.0 is compatible with LGPL-3.0, and as SpatialAudioBridge's author I contribute both files here under this project's licence.formats.mdandCHANGELOG.mdare updated.Test plan
Device / OS: Apple TV 4K (2nd gen), tvOS 27.2 beta, Samsung HW-Q990C over HDMI.
Source media: "2012" from Jellyfin. MKV, HEVC Main 10 4K HDR10, TrueHD Atmos. Sodalite with only
objectAudioRendering: .apac(.l714)set.Result: the soundbar's own indicator, read by eye.
mainmain+ the same activator in the host appIn-app signals didn't track the indicator, so they can't replace a look at the sink.
audioFormatread'mat+'in every run.outputNumberOfChannelsread 2 without the activator, 32 with it attached in the host, and 2 again with this PR.New test: the bundled stream loads from the module bundle and reads as E-AC-3 with
'ec+3'layers.swift test --filter "SpatialAudioBridgeTests|PublicAPIDocumentation|DocumentedConstants"passes, and a generic tvOS Simulator build of the package succeeds.This is one of three independent TrueHD Atmos fixes. Each adds an entry under Unreleased › Fixed in
CHANGELOG.md, so whichever merges second needs a one-line rebase there.Checklist
CHANGELOG.mdupdatedfeat(...),fix(...),chore(...))