[PR #334] [MERGED] Fix failed set category on initAudioSession #1407

Closed
opened 2026-04-24 23:58:14 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf-app/pull/334
Author: @ronaldheft
Created: 8/27/2022
Status: Merged
Merged: 8/27/2022
Merged by: @advplyr

Base: masterHead: ios-failed-playback-session


📝 Commits (1)

  • 66ab402 Fix failed playback session on initAudioSession

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 ios/App/Shared/player/AudioPlayer.swift (+1 -1)

📄 Description

I occasionally see the following error when run on my device, which does not appear on the simulator:

Failed to set AVAudioSession category
Error Domain=NSOSStatusErrorDomain Code=2003329396

It turns out the call to AVAudioSession.sharedInstance().setCategory does not need the .allowAirPlay option. That option is only valid when the category is .playAndRecord.

I verified with this option removed AirPlay still functions, and the error is also gone.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf-app/pull/334 **Author:** [@ronaldheft](https://github.com/ronaldheft) **Created:** 8/27/2022 **Status:** ✅ Merged **Merged:** 8/27/2022 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `ios-failed-playback-session` --- ### 📝 Commits (1) - [`66ab402`](https://github.com/advplyr/audiobookshelf-app/commit/66ab402a50935540a511aa55550436daf78ad952) Fix failed playback session on initAudioSession ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `ios/App/Shared/player/AudioPlayer.swift` (+1 -1) </details> ### 📄 Description I occasionally see the following error when run on my device, which does not appear on the simulator: ``` Failed to set AVAudioSession category Error Domain=NSOSStatusErrorDomain Code=2003329396 ``` It turns out the call to `AVAudioSession.sharedInstance().setCategory` does not need the `.allowAirPlay` option. That option [is only valid when the category is `.playAndRecord`](https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1771736-allowairplay). I verified with this option removed AirPlay still functions, and the error is also gone. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-24 23:58:14 +02:00
adam closed this issue 2026-04-24 23:58:15 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1407