FairPlay multi-key: intermittent missing audio/video license request — evidence review

GitHub source

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

Local reproduction and solution — 18 November 2026#

Status: Related public MultiKey failures and legacy controls reproduced; original root cause not established.

Source and evidence#

Upstream case · local report and evidence · portable reproduction instructions

Observed results are Reproduced only within the stated seam. Implementation explanations remain Inferred, not Apple Confirmed.

Reconstruct the scene#

The official public Axinom MultiKey audio/video playlists carry distinct SKD references. Test reported Shaka 4.16.6 plus a separate 5.0.4 A/B on Safari 26.3.1.

4.16.6 modern makes two license HTTP200 responses/usable keys but stalls; only one attempted modern cycle is recorded. Legacy completes 30 cycles with 90 HTTP200 license responses and no Shaka errors. In 5.0.4 modern, one license and 3016 are observed, with decoder error before the response; same-version legacy plays.

Solution / guideline#

Explicit legacy Apple Media Keys is a tested conditional workaround for these public controls. Do not claim a permanent missing-audio/video-license patch or a KSM root cause without selected-track/event correlation.

All pinned patches and results

Limits / remaining work#

The original provider’s intermittent failure on the reported versions is not causally reproduced. Local issues34 and48 are the same upstream #9268 case, not independent confirmations.

This update supersedes earlier no-local-run statements below only within the stated scope. Historical source reports are retained; no unresolved issue is closed by this publication.


Earlier investigation and source history

Primary report: shaka-project/shaka-player#9268 (opened 23 October 2025). Evidence status: public reporter observations; root cause UNVERIFIED. This is a Safari/Shaka case, not proof of a native AVPlayer defect.

Symptom and scope#

The reporter used FairPlay multi-key HLS on macOS Safari, with distinct keys/KIDs for video and encrypted audio. Shaka 4.11.17 and 4.16.6 were reported affected. On more than half of attempts, only one of the expected audio/video license requests was observed and playback failed with Shaka 3016.

When both license requests occurred, playback reportedly succeeded. The same asset reportedly worked in Video.js and other HTML5 players; that comparison does not establish identical key-system mode or request handling. The maintainer requested certificate URL, initDataTransform, and reproducible configuration.

The issue closed 14 November 2025 due to inactivity, without a verified fix.

Evidence: shaka-project/shaka-player#9268 and its maintainer comments.

What the evidence establishes#

The first reported divergence is missing license-request dispatch for one expected key, not a demonstrated failure of CKC processing, decryption, or KSM authorization. Shaka error 3016 is downstream and nonspecific. The phrase “one of two license requests” is reporter-observed network behavior, not proof that the corresponding encrypted event, EME session, or SPC was never generated.

Causal dependency map#

Master/media playlists and EXT-X-KEY / KEYFORMAT
  -> selected encrypted audio and video samples / key identities
  -> browser native HLS vs Shaka MSE mode (VERIFY)
  -> EME encrypted/initData event(s)
  -> key-system and MediaKeys setup
  -> session creation / generateRequest
  -> EME message / SPC
  -> Shaka networking request filter
  -> license HTTP -> KSM -> CKC
  -> session.update / key status
  -> protected audio AND video decoding

The first proven internal divergence is UNKNOWN because no paired failing/successful event trace or source-level reproduction was supplied.

Competing hypotheses and falsification#

  1. Missing/merged key initialization event or session dispatch: log per-key encrypted, initData identity (hash only), generateRequest, message, session ID and key status. If both events and messages exist, this hypothesis fails.
  2. Shaka lifecycle/race or request filtering: pin Shaka builds and inspect DrmEngine, initDataTransform, request/response filters and source-mode selection. If a message exists but only one HTTP request, focus on filter/dispatch; do not blame Safari yet.
  3. HLS rendition/key mapping or multi-key packaging: compare EXT-X-KEY per rendition, KEYFORMAT, SKD identifiers, encryption methods, discontinuities and actual selected tracks. Do not assume one license request per EXT-X-KEY tag: deduplication and session behavior depend on implementation.
  4. KSM/transport failure: if both HTTP requests were sent but only one was visible in the reporter's filtered view, inspect redirect, caching, response status and transaction IDs. A KSM failure is not established by the present report.
  5. Safari-specific key-system behavior: compare native com.apple.fps with authorized legacy-key-system integration where supported, controlling for the same media and configuration. WebKit source cannot be treated as native AVFoundation source.

Minimum reproducible experiment (client-only)#

Pin Safari/macOS build, Shaka release/commit, certificate configuration, chosen native-HLS/MSE path, asset/manifest hashes and the expected distinct key identifiers. Run >=20 cold-start attempts per configuration (reported failure is intermittent), preserving each run's monotonic event timeline.

Instrument encrypted, waitingforkey, message, keystatuseschange, generateRequest and update promise resolution/rejection; record sanitized license HTTP request metadata, response status, key-status transitions and player errors.

Correlate audio and video key identities by non-reversible hashes, not raw SPC/CKC or keys. Compare failing and successful runs at the earliest missing transition. Repeat with a single-key asset, clear HLS, another web player and a separate native AVPlayer harness.

Do not assume browser and native key-session internals are identical.

Decision table: If no event for missing key, inspect manifest/track selection and browser initialization; if event but no EME message, inspect session/EME path; if message but no HTTP, inspect Shaka filters/network dispatch; if HTTP but no usable key, inspect response and authorized KSM metadata; if keys usable but no playback, inspect media/decoder pipeline.

Client-only mitigation candidates (not verified fixes)#

Instrument and correlate expected key identities and actual key-status coverage before classifying a generic decode failure. Gate playback readiness on both encrypted audio and video being usable where the application can reliably observe this. Try a bounded session/asset recreation after a proven missing-dispatch state; preserve logs and avoid infinite retries. Compare a pinned known-good player/key-system mode. CDN/packager/KSM modifications are proposals, not client-only actions.

Reusable insight#

For multi-key FairPlay, count the key lifecycle per required key identity, not just license HTTP 200s or a final Shaka error. Missing license dispatch, license rejection, unusable key and protected decode failure are different causal boundaries.

Root-cause verdict#

INTERMITTENT MULTI-KEY LICENSE DISPATCH GAP REPORTED; ROOT CAUSE UNVERIFIED. No physical-device run, byte-verified manifest, pinned source diff, or authorized KSM experiment was executed for this article.


Extended investigation prompt#

Show the full second-AI investigation prompt
ROLE: Act as a senior iOS/tvOS reverse engineer, AVFoundation/CoreMedia investigator, WebKit EME source analyst, HLS/CMAF forensic engineer and FairPlay DRM specialist.

CASE: https://github.com/shaka-project/shaka-player/issues/9268
In macOS Safari, Shaka 4.11.17–4.16.6 reportedly intermittently sends only one of two expected audio/video FairPlay license requests for multi-key HLS, then fails with Shaka 3016. Both requests reportedly correlate with success. Root cause is UNKNOWN.

GOAL: Determine the FIRST PROVEN causal divergence. Do not infer the meaning of Shaka 3016 or undocumented AVFoundation codes.

STRICT EVIDENCE HIERARCHY:
T1 — Apple Developer Documentation, FairPlay Streaming SDK, Apple HLS Authoring Specification, Apple engineering/WWDC materials, W3C EME, IETF HLS and ISO BMFF contracts.
T2 — Pinned Shaka source, verified WebKit source, Apple open-source code, symbolicated AVFoundation/CoreMedia/CFNetwork traces, peer-reviewed or independently verified DRM/security research. For source claims supply repository, commit SHA, file, function, exact lines, and control flow. WebKit is NOT native AVPlayer source.
T3 — Byte-verified manifests/segments, captured EME/network/key-status timelines, reproducible authorized A/B experiments and sanitized KSM metadata.
T4 — Explicitly labeled hypotheses.
For each claim give evidence tier, URL, observation, counterevidence, confidence and falsification test. Never invent measurements, source lines or internal behavior.

TRACE: HLS master/media playlists and per-rendition EXT-X-KEY, KEYFORMAT, SKD/KID -> selected encrypted audio/video -> native src= vs MSE ownership -> encrypted/initData events -> key-system selection -> MediaKeys -> sessions/generateRequest -> message/SPC -> Shaka request filters -> license HTTP -> KSM -> CKC -> update/key statuses -> audio/video protected decoding.

INVESTIGATE: Build a key-identity matrix (hash only). Determine which key first disappears. Pin Shaka 4.11.17 and 4.16.6; inspect DrmEngine, initDataTransform, filters, session deduplication and HLS mode. Verify all WebKit source claims. Compare failing and successful runs with >=20 trials per condition, same asset and network; change one variable per experiment. Include single-key, clear, alternative browser player and independent native AVPlayer/AVContentKeySession controls. Capture monotonic event timings, full NSError chains and sanitized request metadata.

SECURITY: Use authorized assets and KSM access. Do not expose keys, SPC/CKC payloads, private certificates or credentials. Do not bypass DRM.

ROOT CAUSE only if failure reproduced, first divergence established, one controlled intervention reverses it, and major alternatives falsified. Otherwise say ROOT CAUSE UNVERIFIED.

DELIVER: Executive finding, evidence ledger, protocol contracts, HLS/key map, successful/failing timelines, first divergence, pinned source audit, WebKit vs AVFoundation limits, network/KSM evidence, A/B results, competing hypotheses, client-only mitigation, separately labeled server/packager proposals, regression tests, unknowns, exact source URLs, and publication-ready technical article.