firebase-ios-sdk
firebase-ios-sdk copied to clipboard
Fix frame rate metrics for dynamic refresh rates #10220
Fix frame rate metrics for dynamic refresh rates (#10220)
Discussion
Fix slow rendering false positives mentioned in #10220 (Work In Progress Ongoing testing!!!)
User Statements:
- Slow rendering values on tvOS approximately 150 times higher (~60%) than on iOS (<1%)
- ProMotion devices reporting inaccurate frame metrics during refresh rate changes
- 50Hz tvOS displays (Europe) incorrectly flagging smooth 18ms frames as slow
- Static 60Hz assumption breaks on modern Apple hardware with variable refresh rates
What this fixes? (My possible reproduction ideas on why this is happening):
Case 1 - tvOS 50Hz Display (Europe)
- Configure Apple TV to output 50Hz (Settings > Video and Audio > Format)
- Launch any app with smooth animations
- Monitor Firebase Performance console for slow rendering metrics
- Observe that 18ms frames (well within 20ms budget) get flagged as slow due to 16.67ms threshold
Case 2 - ProMotion iPhone, iPad and MacBook Dynamic Rates
- From the iPhone 13 Pro or Pro Max or more recently released iPhones (14, 15 16 Pro and Pro Max or any from the 17 line up), recent iPad Pro with ProMotion enabled and Macbook's equipped with a ProMotion Display Like the Pro models or recent Air Models
- Created a test mule app with static content (forces display to lower refresh rates for power saving)
- When display drops to 24Hz, 40ms frames are normal but get flagged as slow
- When display jumps to 120Hz, 10ms frames should be flagged as slow but aren't
Case 3 - External Displays with Custom Refresh Rates
- Connect Mac to external display supporting non-60Hz rates
- Set custom refresh rate in System Settings
- Launch app and observe incorrect frame classifications
Case 4 - Adaptive Sync Displays
- Use a display with VRR (In my case I tried with a Hisense U8N TV and Asus TUF Gaming VG27AQ3A)
- Content frame rate doesn't match display refresh rate
- Static thresholds fail to account for dynamic pacing
Testing
- Ongoing Testing, Work in Progress but locally it is passing all unit tests
- ONGOING!!! Manual testing on ProMotion devices with rate changes (iPhone 14 Pro, 16 Pro and a MacBook Pro 16 inch from 2021)
- ONGOING!!! Validation on 50Hz tvOS configuration
- ONGOING!!! Check for Backwards compatibility verified (60Hz behavior unchanged)
API Changes
- No API Changes