Immense lag/freezing using Media Player Framework on iOS 11.2 and up

Originator:edwin
Number:rdar://36308781 Date Originated:January 4th, 2018
Status:Open - Duplicate of 35947309 Resolved:Nope
Product:iOS Product Version:11.2+
Classification:Crash/Hang/Data Loss Reproducible:Yes
 
Update January 20th, 2018: Apple has marked this on bugreport.apple.com as a duplicate of "35947309", which unfortunately does not seem to have an OpenRadar entry. Regardless, this hopefully means that a human has read and acknowledged this bug.

---

Summary:
Basic playback functions within the media player framework cause immense lag/hanging on the main thread.

Steps to Reproduce:
You must be running a physical device with iOS 11.2 or higher to reproduce this issue.

I have built a project which you can use to reproduce this issue. You can find the project along with more info here: https://github.com/edwinfinch/mediaplayer_lag_ios-11.2_demo

0. Queue the user's music library using [MPMediaQuery songsQuery] through the system music player controller
1. Play music through the system music player controller
2. Keep track of the current playback time on the main thread and notice the immense lag.

Expected Results:
The main thread should not hang. It doesn't hang in iOS versions below 11.2.

Actual Results:
The main thread hangs for up to 12 seconds.
YouTube video demonstrating this: https://www.youtube.com/watch?v=TlKdZIIoMu0

Version/Build:
* XCode version 9.2 (9C40b)
* iOS version 11.2.1 (15C153)

Configuration:
* Almost 4000 songs in media library, however this issue is reproducible on any size of media library. As well, even with the same sized media library, this issue did not occur on iOS versions below 11.2.
* Music.app is still installed and was never uninstalled.
* Music permission properly granted and never changed.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!