PCIOS-868: iOS/Bluetooth: .routeConfigurationChange on an unchanged route tears down the player and never resumes - #4834
Conversation
…oute tears down the player and never resumes
|
Claude finished @pocketcasts's task in 1m 20s —— View job Review: PR #4834 — Bluetooth
|
|
I'll analyze this and get back to you. |
|
Claude finished @joashrajin's task in 2m 39s —— View job Review: PR #4834 (updated) — Bluetooth
|
Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @joashrajin's task in 2m 22s —— View job Review: PR #4834 (synchronize) — Bluetooth
|
Review feedback addressed
Validation: |
Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @joashrajin's task in 2m 45s —— View job Review: PR #4834 (synchronize) — Bluetooth
|
Additional review feedback addressed
Validation: |

Resolves https://linear.app/a8c/issue/PCIOS-868/iosbluetooth-routeconfigurationchange-on-an-unchanged-route-tears-down
Summary
When a Bluetooth head unit renegotiates its A2DP link, iOS can emit
.routeConfigurationChangewhile the set of audio ports remains unchanged. TheEffectsPlayeraudio engine may stop during that reconfiguration and needs to be rebuilt.Deep review also found a lifecycle race because the affected hardware emits reason-8 events in pairs. A duplicate event could arrive while
PlaybackManagerwas asynchronously activating a replacementEffectsPlayer; the old route handler would then permanently pause and tear down that not-yet-started replacement.Changes
.routeConfigurationChangedirectly from its API contract, without requiring previous-route metadata, and restart an actively intendedEffectsPlayerwithout rebuilding Now Playing data.EffectsPlayersetup if teardown wins the player lock, preventing an orphaned audio engine.shouldKeepPlaying.EffectsPlayeractually performs it, and snapshot route outputs before the main-thread hop for accurate diagnostics.Accepted trade-offs
engine.isRunningas a gate. Route and engine-configuration notifications have no documented ordering, so a staletrueresult could skip recovery and recreate the silent-playback failure.playcompletion because that callback represents a successful start; firing it could run stale seek or pause work against a replacement player.Verification
make format: PASSmake lint: PASSgit diff --check: PASSManual verification
The original issue is hardware-specific. Playback should still be verified with the affected Bluetooth/A2DP head unit, including paired reason-8 notifications and active Trim Silence playback. The pass should also check for an unacceptable audio gap or UI hitch during route reconfiguration.
Confidence
MEDIUM-HIGH for the state-management, route-policy, and diagnostic changes. Hardware verification remains necessary to confirm audible recovery behavior.