Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Adding workaround to fix Dolby Atmos playback on iOS 15 #2577

Closed

Conversation

aolivier
Copy link

Currently, we discovered that Dolby Atmos does not correctly playback on iPhones running iOS 15.x (see #2554). This PR includes a workaround to fix Atmos playback without negatively impacting other platforms, until it is fixed by Apple.

To test playback, use the Dolby Atmos test stream. If the file is playing back in Atmos, the user will hear an alternating static noise. If the file is not playing back in Atmos, the user will hear static in mono. See Dolby Atmos device support here.

Hopefully Apple will fix this in a future release, but until then...

Description of workaround

  • Apple handles events coming from AirPods as Remote Command events
  • By adding a handler for spatial audio remote command events, we indicate to the OS that the device is capable of playing spatial audio (otherwise, it is never able to figure this out)
  • Whenever we play video, we must add this event handler that returns a success status for all remote command events
  • Whenever we stop video or destroy the player, remove this event handler

Discoveries during testing:

  • Dolby Atmos does not work in the native player on supported iPhone devices starting at iOS version 15.0. In previous iOS versions (14.x), Atmos playback worked with both supported headphones (AirPods 3) and built-in speakers where applicable.
  • If displaying video using an AVPlayerViewController, it is possible to get Atmos to play by skipping around the video after it has been playing for several seconds. Atmos will never render on first time playback, or without manually seeking.
  • It is never possible to get Atmos playback when using an AVPlayer / AVPlayerLayer

- Add and remove spatial audio remote command handler
- Whenever we play video, we must add this event handler that returns a success status for all remote command events
- Whenever we stop video or destroy the player, remove this event handler
- This is a workaround to get Dolby Atmos working on iOS 15 and above
@Fedeorlandau
Copy link

This is great!

@andrii-gusarov andrii-gusarov force-pushed the bugfix/atmos-workaround branch 2 times, most recently from 42737af to 9b83972 Compare February 1, 2022 16:36
@stale
Copy link

stale bot commented Apr 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are having a similar problem, please open a new issue and reference this one instead of commenting on a stale or closed issue.

@stale stale bot added the stale Closed due to inactivity or lack or resources label Apr 19, 2022
@hueniverse hueniverse removed the stale Closed due to inactivity or lack or resources label Apr 20, 2022
@TheWidlarzGroup TheWidlarzGroup deleted a comment from nickfujita May 21, 2022
@hueniverse
Copy link
Contributor

@aolivier Are you still interested in getting this merged? It would require a rebase to start a review process. Thanks!

@hueniverse hueniverse added the bug label May 21, 2022
@hueniverse
Copy link
Contributor

Closing due to lack of response (from the original submitted or anyone else to review and rebase). If someone wants to pick this up please open a new PR that ports this code into the current master. We are doing our best to start clean with v6 which requires being a bit aggressive in closing stale PRs that are over a year old. Please don't consider this dismissing of your work and contribution - it's greatly appreciated.

@hueniverse hueniverse closed this Jun 23, 2022
@hueniverse hueniverse added the stale Closed due to inactivity or lack or resources label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Platform: iOS stale Closed due to inactivity or lack or resources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants