Skip to content

setAudioShaping while paused: the rebuild never presents a frame, hasFirstFrameReadyForDisplay stays false #973

Closed

Description

@secunit404

What happened?

I called setAudioShaping(_:) while playback was paused. I expected the session-preserving rebuild at the playhead to show the paused frame again and republish hasFirstFrameReadyForDisplay = true, as the setAudioShaping docs describe ("about 0.3 s of held picture with the position preserved").

Instead, the rebuild finishes (AE#923: rebuilt at the playhead with audio shaping …) but stops at #361 startup 7/8 ready: there is no 8/8 presenting, the video renderer goes to readyForDisplay = NO and never back to YES, and hasFirstFrameReadyForDisplay stays false for as long as the session stays paused.

A host that follows the documented contract (cover and "picture ready" UI gated on $hasFirstFrameReadyForDisplay) then treats the paused session as having no picture: a waiting spinner, hidden transport controls, no scrubbing, no track menu, until play().

Steps to reproduce

  1. engine.load(url:options:) on the file below with default LoadOptions (no audio shaping), let it play, then pause(). state == .paused, hasFirstFrameReadyForDisplay == true.
  2. engine.setAudioShaping(AudioShaping(dialogueGainDB: 6)).
  3. About 0.2 s later, engine.setAudioShaping(AudioShaping()).
  4. Observe $hasFirstFrameReadyForDisplay: it goes false at the first rebuild and stays false while paused. Both rebuilds log startup 7/8 ready and no 8/8 presenting.

The same steps while playing are fine. Not checked: whether a single paused setAudioShaping call (no second call) or a paused setAudioDelay(_:) behaves the same; both go through reloadAtCurrentPosition().

AetherEngine version or commit SHA

7.54.0 (ee5027c). I didn't see a related fix in the 7.55.0 or 7.56.0 notes.

Host app

Custom / my own integration

Platform

tvOS

OS version

tvOS 27.2 (Simulator)

Device / chip

Apple TV 4K (3rd generation) Simulator on an Apple silicon Mac

Playback path

Software (dav1d) host

Source media (for playback bugs)

MKV, H.264 8-bit 4:2:0 (libx264), 1920x1080, 24 fps, SDR; AAC-LC stereo 48 kHz. 6 minutes, about 22 MB. Served over plain HTTP with byte ranges (seekable). The session runs on the software host because the simulator's VideoToolbox doesn't decode this stream ("codec=27 not hardware-decodable by VideoToolbox; routing to the software path").

Error codes / log lines

[AetherEngine] #361 startup 8/8 presenting (gen 1)                      <- first load, normal
... pause() ...
[AetherEngine] #361 startup 0/8 dispatched (gen 2)
<<<< AVSampleBufferVideoRenderer >>>> setting readyForDisplay to NO
<<<< FigVideoQueue >>>> signalled err=-12080
[SWHost] audio: AE#923 shaping (dialogue +6.0 dB) keeps the track on the PCM decode
[AetherEngine] AE#923: audio shaping applied (dialogue +6.0 dB)
[AetherEngine] #361 startup 7/8 ready (gen 2)
[AetherEngine] AE#923: rebuilt at the playhead with audio shaping dialogue +6.0 dB
<<<< FigVideoQueue >>>> signalled err=-12783
[AetherEngine] AE#923: audio shaping off (off)
[AetherEngine] #361 startup 0/8 dispatched (gen 3)
<<<< AVSampleBufferVideoRenderer >>>> setting readyForDisplay to NO
[AetherEngine] #361 startup 7/8 ready (gen 3)
[AetherEngine] AE#923: rebuilt at the playhead with audio shaping off
(no "8/8 presenting" for gen 2 or gen 3, no "readyForDisplay to YES" while paused)

Anything else

The rebuild resumes paused as intended (setLoadedAutoplay(sessionRebuildResumesPlaying); the audio renderer is set to rate 0), so the question is only the frame: a paused rebuild doesn't seem to decode and enqueue the frame at the playhead. The host is not compensating for this; it waits for the engine's signal.

Activity

  1. added
    area: api
    area: video
    bug
    on Nov 3, 2026
  2. superuser404notfound commented on Nov 3, 2026

    @superuser404notfound
    Owner

    Thanks for the precise report, the log lines pointed straight at it.

    Cause. The software host only started its demux and decode loops in play(). A load with autoplay = false never touched the host after loading, and a rebuild of a paused session (setAudioShaping, setAudioDelay, reloadAtCurrentPosition) mounts paused through that same path. So in all three cases nothing was decoded, and the ladder stopped at startup 7/8 ready until the next play(). The native path was not affected.

    Fix (7ba20e66, merged to main in 0821e958, not in a release yet). A paused mount now pauses the host. When a host is loaded but has never played, a pause starts the loops under the existing hold for a pause before the first frame: the clock stays stopped, the frame at the playhead is decoded and presented, and the loops park again.

    Checked with aetherctl play --sw --paused plus two paused --switch-audio-shaping calls 200 ms apart, on a 1080p H.264 MKV with AAC:

    • before: rfd=n for the whole run, no 8/8 presenting for any generation
    • after: 8/8 presenting for the mount and for both rebuilds, state=paused, and the clock does not move (also with a 20 s start position)

    Pause at start then play(), shaping while playing, and paused mount then play all behave as before. Full suite is green, and there is a new regression test in Issue973PausedLoadFirstFrameTests.

    This also covers your two unchecked cases. A single paused setAudioShaping and a paused setAudioDelay go through the same rebuild, so they had the same problem and get the same fix.

    I'll leave the issue open until a release ships it and you've retested.

  3. superuser404notfound commented on Nov 5, 2026

    @superuser404notfound
    Owner

    Released in 7.57.0 (7d50497): a paused software session, after setAudioShaping, setAudioDelay, reloadAtCurrentPosition or a load with autoplay = false, presents its frame again. A retest on that build would confirm it on the reporting setup.

  4. secunit404 commented on Nov 5, 2026

    @secunit404
    Author

    Confirmed fixed on 7.57.0. With playback paused, setAudioShaping now rebuilds and presents a frame on the software host, and hasFirstFrameReadyForDisplay turns true without calling play(). Tested in the tvOS simulator. Thanks for the quick fix. Fine to close from my side.

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

    area: apiarea: videobug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions