AirPlay playback can freeze at CKC expiry despite local AVContentKeySession renewal

GitHub source

Inferred. This page is generated from GitHub Issue #35; GitHub remains the canonical authoring and discussion source.

Source and environment#

  • Original report: https://developer.apple.com/forums/thread/776265 (March 2025)
  • Environment: iOS sender, AirPlay receiver, FairPlay-protected HLS, AVContentKeySession after migration from AVAssetResourceLoaderDelegate.
  • Evidence status: Public symptom reported; local renewal API contract documented; native AirPlay root cause unverified.

The debugging question#

The developer reports a 120-second CKC lifetime. On-device playback works, but AirPlay video and audio freeze at the old 120-second expiry. The app invokes renewExpiringResponseData(for:), receives contentKeySession(_:didProvideRenewingContentKeyRequest:), obtains a new CKC and submits it; HLS segments continue downloading. Renewing at approximately 100 seconds reportedly does not help. The prior resource-loader implementation reportedly works when renewal is implemented.

What is the first transition that differs between locally accepted renewal and protected playback continuing on the active AirPlay route? The public thread does not answer this.

What Apple's public API does and does not establish#

  • AVContentKeySession.renewExpiringResponseData(for:) requests renewal of previously supplied response data that is about to expire.
  • contentKeySession(_:didProvideRenewingContentKeyRequest:) provides a renewal request to the app.
  • AVContentKeyRequest.renewsExpiringResponseData identifies a renewal request.
  • contentKeySession(_:contentKeyRequestDidSucceed:) reports successful processing of a content-key response.
  • AVPlayer.isExternalPlaybackActive identifies the active external playback route; contentKeySession(_:externalProtectionStatusDidChangeFor:) can report external-protection changes.

None of these callbacks by itself proves that the external presentation path has adopted the renewed key and will continue decoding after the previous expiry. This is an observability limitation, not a claim about an undocumented AirPlay implementation.

Causal dependency graph#

HLS EXT-X-KEY / SKD identifier
  → AVContentKeySession / recipient / content-protection session
  → initial SPC → KSM → CKC (reported TTL 120 s)
  → device or AirPlay playback
  → renewExpiringResponseData (~100 s)
  → didProvideRenewingContentKeyRequest
  → renewed SPC → KSM → CKC
  → processContentKeyResponse
  → local contentKeyRequestDidSucceed
  --- LOCAL OBSERVABILITY BOUNDARY ---
  → renewed entitlement effective for external presentation [UNKNOWN]
  → protected samples continue to decode [UNKNOWN]
  → AirPlay audio/video continue after old expiry [REPORTED FAILURE]

An HTTP 200, a CKC payload, and a local key-request success callback are three distinct observations; none alone proves external playback continuity.

Competing hypotheses#

Hypothesis Decisive observation
H1: Renewal callback or local response processing fails Missing renewal callback, KSM error, or contentKeyRequest:didFailWithError:
H2: Renewal is locally accepted but not effective for external presentation Local success before expiry plus expiry-aligned AirPlay stall, with route/protection evidence
H3: Wrong key identifier, recipient or protection-session mapping Hashed SKD/KID, originatingRecipient, session ID and KSM transaction differ unexpectedly
H4: Incorrect KSM lifetime/rights for external route Authorized KSM metadata differs from intended policy
H5: Unrelated decoder/media or route failure Clear-HLS/long-lived-key control reproduces same stall
H6: Path-specific regression after migration Repeated matched AVContentKeySession failures and resource-loader successes on same device, content, route and license policy

Do not conclude H2 merely because the freeze occurs at 120 seconds. First establish which key request was processed and whether the receiver-side route was actually using the renewed entitlement.

Controlled verification plan#

  1. Lock device/receiver models, OS builds, HLS manifest/media hashes, selected rendition, encryption scheme, KSM rights and initial TTL.
  2. Capture monotonic timestamps for: route changes (isExternalPlaybackActive), initial and renewing callbacks, SPC generation result, KSM transaction status, CKC delivery, processContentKeyResponse, key-request success/failure, segment requests, player time, access/error logs, and first stall.
  3. Correlate full SKD URI and key identifiers using salted hashes, originatingRecipient, content protection session identity, and KSM transaction IDs. Never log key material.
  4. Run device playback, AirPlay without renewal, AirPlay with renewal at 90–100 s, AirPlay with a longer authorized license lifetime, and the previous resource-loader baseline. Change one variable at a time and repeat trials.
  5. If local renewal succeeds before the old expiry yet AirPlay stalls, collect sysdiagnose and permitted receiver-side diagnostics. Treat external key adoption as unknown until directly evidenced.
  6. Inspect pinned WebKit/Apple open-source and symbolicated framework traces only after a deterministic working/failing pair exists. WebKit is not native AVPlayer source code.

Synthetic diagnostic experiment — 27 October 2026#

I executed a local Python event-trace classifier against five synthetic timelines with 11 passing assertions:

Synthetic case First observable boundary
Device playback after timely renewal No renewal-related stall
AirPlay stalls at 120 s, local renewal success at 100.25 s Local renewal complete; external presentation state unknown
AirPlay without renewal callback Missing renewal callback
AirPlay with KSM HTTP failure No successful license transaction
AirPlay renewal completes after 120 s Renewal too late relative to old expiry

This experiment tests only trace classification. No native AVPlayer, AirPlay receiver, FairPlay KSM, CKC, or encrypted playback was executed. It does not reproduce or prove the reported bug.

Engineering guideline#

A content-key response accepted locally is not proof that a renewed entitlement is effective on an external presentation route. Measure both boundaries separately: local SPC/CKC processing and protected playback continuing past the old expiry.

Root cause: unresolved in public evidence. Use an Apple Feedback/sysdiagnose with redacted, correlated timestamps if the failure reproduces on current OS builds.

References#