Skip to content

AtmosOutputActivator pauses with the host: no audio after resume #834

Open

Description

@badrabbit

What happened?

I play a title with object audio on the native loopback path with
objectAudioRendering: .apac(.l714), host is a stock AVPlayerViewController,
audio out over AirPlay to a HomePod stereo pair.

I expected pause and resume to behave like a seek: audio comes back.

What happens instead:

  • Seek + resume → audio keeps playing. Every time.
  • Pause + resume → the audio is gone and does not come back. The picture runs
    on, there is no sound, and it stays that way.
  • Second pause + resume → the picture freezes as well.
  • A seek restores both. Every time.

Reproducible, identical on every attempt. The audio never returns on its own
after a pause — only a seek brings it back.

The cause is in AtmosOutputActivator.update():

guard host.timeControlStatus != .paused else {
    player.pause()
    return
}

The silent, Atmos-signalled keep-alive stream pauses together with the host.
That stream is what holds the route in surround, so the route falls back on
every pause. A seek does not pause the activator, which is exactly why seeking
works and pausing does not. The class comment states the same property: it
brings the sink to Atmos "before the first frame and kept it there across a
seek".

I confirmed it from the other side as well: with objectAudioRendering: .off
the problem is gone — pause and resume keep the audio. That is what I run with
now, at the cost of the height channels.

Steps to reproduce

  1. LoadOptions with objectAudioRendering: .apac(.l714), native loopback path,
    host is a stock AVPlayerViewController.
  2. Audio output over AirPlay to a HomePod stereo pair (not HDMI).
  3. engine.load(url:) on a title with object audio, let it play until the route
    reports rendering=surround.
  4. Press pause, wait ~2 s, press play → picture runs, no audio.
  5. Press pause again, wait ~2 s, press play → picture freezes as well.
  6. Seek anywhere → both come back immediately.

AetherEngine version or commit SHA

7.38.1

Host app

Custom / my own integration

Platform

tvOS

OS version

tvOS 27.2

Device / chip

Apple TV 4K (3rd gen, 2022)

Playback path

Native AVPlayer

Source media (for playback bugs)

MKV, HEVC (x265) 3840x2024, Dolby Vision + HDR10, two TrueHD Atmos 7.1 tracks.
2160p Blu-ray remux, "Top Gun: Maverick".

The engine bridges it rather than stream-copying:

[HLSVideoEngine] audio: codec=truehd (bridge required), decoding + Atmos
object render into 7.1.4, APAC re-encode
[SpatialAudioBridge] init: layout=7.1.4 bitRate=3840 kbps codecs=apac.31.03
priming=2048 frames
[HLSVideoEngine] TrueHD Atmos: objects rendered into 7.1.4, delivered as
apac.31.03 (lossy; the lossless 7.1 channel presentation is not used)

Output route is AirPlay to a HomePod stereo pair, so the sink takes 2 channels
and the route decides whether it renders surround.

The item's audio track is fine throughout — apac ch=12 sr=48000, one enabled
audio track, in EVERY sample, including those taken while there is no sound.
So this is neither track selection nor the stream.

Error codes / log lines

Engine log lines captured on the device, interleaved with the host's
timeControlStatus transitions (engine-log relative seconds):

   5.744 s  audio playing                    rendering=surround
   8.783 s  PAUSE 1                          -> notApplicable at 8.806 s
  11.168 s  resume
  11.461 s                                   -> surround, but still no audible audio
  15.742 s  PAUSE 2                          -> notApplicable at 15.752 s
  18.053 s  resume                           stays notApplicable while the host is playing
  21.855 s  SEEK (521 s -> 531 s)
  22.514 s                                   -> surround, and the audio returns

[AetherEngine] audioRoute rendering mode changed output=2 preferred=0 max=2
  rendering=notApplicable multichannelContent=true
  ports=[AirPlay[ch=2, labels=-x2, heights=0]] latency=2000ms io=23.2ms

After the second pause the picture stops as well, with the buffer full
(avBufAhead=7.1s avBufBehind=25.7s), so AVPlayer is waiting on audio, not on
data:

[HLSSegmentProducer] #65 backpressure PARK (advance) head=88 target=78
  cacheTarget=77 highStored=87 cached=16 parked=12s stuck=2s idle=2s
  (no playback progress)
[HLSVideoEngine] #421 backpressure wedge with seg77 already stored:
  the consumer is silent on content it can have

Anything else

Two things are worth separating:

  1. The route leaves surround on EVERY pause, within ~20 ms of the host
    reaching .paused.
  2. After the second pause it stays in notApplicable for 3.8 s while the host
    is already playing, and recovers only on the seek.

The route reporting surround again after pause 1 did NOT mean audio was
audible — there was no sound until the seek. So the route state is a symptom
here, not a complete measure of the fault.

On the route: the activator is documented for HDMI ("Keeps a tvOS HDMI route in
Dolby Atmos", measured on a Samsung HW-Q990C). On an AirPlay route the second,
unmuted AVQueuePlayer sits on the same route as the programme. Users of other
Apple TV players report the same Atmos-after-pause loss, so the platform
behaviour the activator compensates for is not HDMI-specific — but the
compensation stops exactly when it is needed.

Suggestion: keep the keep-alive stream running while the host is paused — it
decodes to digital silence, so nothing is mixed into a paused programme — or
restart it ahead of the host's resume rather than together with it. A host-side
opt-out would help as well, for routes where a second player is unwanted.

Activity

  1. superuser404notfound commented on Oct 21, 2026

    @superuser404notfound
    Owner

    Thanks for the careful report and the timeline, that made this easy to follow.

    Fixed on main in d1b227a, it will go out with the next release.

    I went a slightly different way than the suggestion. The activator exists for one thing: getting an HDMI sink that does not show Atmos for APAC on its own (the HW-Q990C case) to light its indicator. An AirPlay route has no such indicator, so the activator has nothing to do there, and a second unmuted player on the AirPlay session is pure risk. So instead of keeping the keep-alive stream running across a pause, it now runs only while every output port is HDMI. It re-checks on AVAudioSession.routeChangeNotification and logs its verdict once per change:

    [AtmosOutputActivator] off on route ports=[AirPlay]
    

    Keeping it alive across a pause would have left a playing player on the audio session for however long the pause lasts, which is exactly what the class avoids. HDMI behaviour is unchanged.

    One caveat on the cause. The objectAudioRendering: .off counter-test turns off APAC along with the activator, so it does not separate the two. Restarting the keep-alive on resume fits the symptoms (a seek never restarts it), but so would APAC over a buffered AirPlay route (latency=2000ms) failing to come back from a pause by itself. With this change the two separate cleanly on your setup:

    • If pause and resume over the HomePod pair keep the audio with .apac(.l714) on, it was the activator.
    • If the audio is still gone after a pause, it is the APAC path on AirPlay itself. In that case a log from pause to resume (with the off on route line in it) would help me look at that next.

    I am leaving the issue open until you have had a chance to try it.

  2. superuser404notfound commented on Oct 21, 2026

    @superuser404notfound
    Owner

    Released in 7.45.0 (52802af).

  3. superuser404notfound commented on Oct 23, 2026

    @superuser404notfound
    Owner

    Follow-up released in 7.47.0 (814fef14): the HDMI-only gate from 7.45.0 compared the route against "HDMI", while AVAudioSession.Port.HDMI is "HDMIOutput", so the activator refused every HDMI route and receivers that need it stopped showing Dolby Atmos. It plays on HDMI again; AirPlay routes stay excluded as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions