Repository navigation
Description
What happened?
HDMI Atmos badge drops on pause/resume — follow-up to #834
What happens
First, thanks for the fix in #834. Restricting the silent Atmos helper to HDMI makes sense and should be preserved.
There's one separate issue on HDMI that I'd like to address.
With an Apple TV 4K connected to a Samsung HW-Q990H, an Atmos title using APAC can briefly lose its Atmos indication when playback is paused and resumed. The soundbar then re-locks to Atmos, sometimes accompanied by a short audio interruption.
The same thing can happen repeatedly during pause/play and scrubbing.
I observed this in an AetherEngine-based player. An experiment that kept the silent Atmos helper running across normal pauses eliminated the repeated receiver re-lock. I haven't yet physically retested the stock 7.45.0 release, but the relevant pause behavior is still present in its code.
Why #834 doesn't fix this case
Issue #834 fixed an AirPlay/HomePod problem by making AtmosOutputActivator HDMI-only. This is a different problem affecting an HDMI receiver.
In AetherEngine 7.45.0, Sources/AetherEngine/Audio/Spatial/AtmosOutputActivator.swift still contains:
guard routeTakesIt else {
release()
return
}
guard host.timeControlStatus != .paused else {
player.pause()
return
}
if looper == nil {
looper = AVPlayerLooper(
player: player,
templateItem: AVPlayerItem(url: Self.silentAtmosStream)
)
}
player.play()On every ordinary host pause, the silent Atmos stream pauses too. When playback resumes, it restarts. But that stream is what tells certain HDMI receivers to enter Atmos mode in the first place.
Suggested fix
For an HDMI output, could we make the helper follow the lifetime of the eligible APAC item, instead of the host's play/pause state?
In other words, once Atmos has been established, leave the silent stream running through pause, resume, buffering, and seeking. Release it when the item is no longer APAC, the session ends, or the output is no longer HDMI.
The core of update() could look something like:
private func update() {
guard let host,
let item = host.currentItem,
playsAPAC(item) else {
release()
return
}
// Keep the HDMI-only protection introduced in #834.
guard Self.routeTakesActivator(
outputPortTypes: outputPortTypes()
) else {
release()
return
}
// An eligible HDMI Atmos item already has its route keeper.
// An ordinary pause or seek should not restart it.
guard looper == nil else { return }
looper = AVPlayerLooper(
player: player,
templateItem: AVPlayerItem(url: Self.silentAtmosStream)
)
player.play()
}There is one additional lifecycle case to handle: tvOS can independently interrupt or pause the helper player. It may need to be restarted after that interruption, without intentionally pausing it for every host pause:
private func restartAfterExternalInterruption() {
guard looper != nil,
let host,
host.timeControlStatus != .paused,
player.rate == 0 else { return }
player.play()
}These are illustrative snippets, not a complete patch. Repeated attach() calls, observer handling, interruptions, audio-track changes, and session teardown should all be covered.
I realize leaving a silent player active during a long pause has power and audio-session implications. If changing the default isn't desirable, an opt-in HDMI continuity policy would also work.
Steps to reproduce
Reproduction and acceptance criteria
Environment: Apple TV 4K (third generation), tvOS 27, Samsung HW-Q990H over HDMI, native loopback playback with TrueHD Atmos rendered to APAC (objectAudioRendering = .apac(.l714) and the appropriate package trait enabled).
- Play an eligible Atmos track and confirm the soundbar shows Dolby Atmos.
- Pause for a few seconds, resume, and repeat.
- Seek or scrub several times.
- Observe the Atmos badge and listen for audio interruptions.
- Repeat with an AirPlay route to ensure the AtmosOutputActivator pauses with the host: no audio after resume #834 protection remains intact.
Expected: While an eligible APAC item remains attached over HDMI, normal pause/resume/seek operations do not make the Atmos badge drop and reappear. Changing away from APAC, ending playback, or leaving HDMI should still release the helper.
The soundbar's own indicator matters here: AVAudioSession reporting MAT/APAC does not reliably tell us whether the receiver has established Atmos mode.
Related: #834 (AirPlay route restriction) and #740 (original silent Atmos activator).
Code inspected: 7.45.0; physical reproduction observed with an earlier private integration
AetherEngine version or commit SHA
7.45.0
Host app
Custom / my own integration
Platform
tvOS
OS version
tvOS 27.0
Device / chip
Apple TV 4K 3rd Generation
Playback path
Native AVPlayer
Source media (for playback bugs)
No response
Error codes / log lines
Anything else
No response
Activity
chrws commentedon Oct 22, 2026
Heads-up that might change what you're seeing here: on 7.45.0 and 7.46.0 the activator never runs on an HDMI route on tvOS, so on those releases it isn't pausing and restarting at all.
AtmosOutputActivator.hdmiPortTypeis"HDMI", butAVAudioSession.Port.HDMI.rawValueis"HDMIOutput", sorouteTakesActivatorhas been false for every HDMI route since d1b227a. On an Apple TV 4K (3rd gen, tvOS 27.0) into an LG CX and a Sonos Arc over eARC, the log says:portTypeMatchesTheSessionwould catch it, but it only builds for iOS and tvOS, and the route tests pass"HDMI"themselves, so the macOS run stays green.With the constant set to
"HDMIOutput"the log readsactive on route ports=[HDMIOutput], and on my setup it made a real difference. On a local branch where APAC also plays through the software path's audio renderer, the Arc showed Multichannel PCM 7.1 without the activator and Dolby Atmos with it.So the change suggested above would only take effect once the name matches. I've opened #854 with the constant, the test fixtures and a pin that also runs on macOS.
Merge fix/atmos-activator-pause-grace-848: the Atmos activator rides …
superuser404notfound commentedon Oct 25, 2026
Thanks for the detailed write-up, and thanks @chrws for spotting the port name. As noted above, 7.45.0 and 7.46.0 never ran the activator on HDMI at all (
"HDMI"vs"HDMIOutput"), so the pause/restart cycle only became real again with 7.47.0.Merged to main in 9e76478 (fix 20b8573), going out with the next release:
It deliberately does not follow the whole item lifetime: a playing player keeps the receiver busy and counts as audio playing, so an indefinite pause would hold the soundbar in Atmos for as long as the app sits paused. A long pause re-locking once on resume seemed the smaller cost, and 60 s ends before the shortest tvOS screen saver delay. If 60 s turns out too short for real scrubbing sessions on the Q990H, that is easy to tune.
Unit tests cover the grace, the resume-inside-the-grace case and the release paths. What they cannot check is the soundbar's own indicator, so a retest on the HW-Q990H once the release is out would be very welcome: pause/resume and scrub a few times and watch whether the Atmos badge holds.
fix(audio): the Atmos activator rides through a short pause on HDMI (s…
merge: origin/main (9e76478, superuser404notfound#848 and superuser40…
Merge PR #856 (PieterVO): #808 review follow-ups, software host Atmos…
docs(changelog): 7.48.0 carries the Atmos activator pause grace (#848)
docs(changelog): credit the #848 reporter
superuser404notfound commentedon Oct 26, 2026
Released in 7.48.0 (263dc11). Leaving this open for the retest.
test: deflake the three tests that kept main red (superuser404notfoun…
fix(atmos): the output activator keeps its stream across a re-attach …
fix(atmos): the output activator keeps its stream across a re-attach …