Camera Capture Session Sometimes Fails To Resume After Application Suspension
| Originator: | colin.cornaby | ||
| Number: | rdar://10421964 | Date Originated: | 09-Nov-2011 02:20 PM |
| Status: | Open | Resolved: | |
| Product: | iPhone/iPod Touch | Product Version: | 9A334 |
| Classification: | Serious Bug | Reproducible: | Sometimes |
09-Nov-2011 02:20 PM Colin Cornaby:
Summary:
We have an app store application that uses an AVCaptureSession to continuously capture frames from the camera for augmented reality use. The capture session is active as long as the user is within a specific tab.
The view within the tap starts the capture session on viewDidLoad:, and only starts/stops the application on viewWillDisapear and viewDidAppear.
From our understanding, iOS should automatically handle shutting down and restarting our capture session for us when the app goes into the background. Generally, this seems to be what occurs. We get proper session interrupted and session resumed messages when we move between background and foreground. However, occasionally the capture session fails to resume, and we get one of the following messages logged to the console.
- The "back camera access not allowed in background" message.
- A console log like the following:
Oct 27 17:05:51 unknown misd[3273] <Notice>: Airplane Mode is ON
Oct 27 17:05:51 unknown misd[3273] <Info>: checking for carrier provisioning
Oct 27 17:05:51 unknown misd[3273] <Info>: carrier service is available
Oct 27 17:05:51 unknown misd[3273] <Info>: maximum number of wireless tethered hosts is 5
Oct 27 17:05:51 unknown misd[3273] <Debug>: published changes: success
Oct 27 17:05:53 unknown misd[3273] <Debug>: attached to SpringBoard (0x1c528fe0, port 0x4b3f)
Oct 27 17:05:53 unknown misd[3273] <Debug>: detached from SpringBoard (0x1c528fe0, port 0x1c529020)
Oct 27 17:05:55 unknown mediaserverd[686] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received to terminate [686] with reason 'fig rpc timeout -- frlremote_AssureFormatReaderSync'
Oct 27 17:05:56 unknown DigimarcDiscover[3445] <Warning>: DMVideoCaptureLib AVCaptureSessionWasInterruptedNotification
Oct 27 17:05:56 unknown DigimarcDiscover[3445] <Warning>: DMVideoCaptureLib AVCaptureSessionDidStopRunningNotification
Oct 27 17:05:56 unknown DigimarcDiscover[3445] <Warning>: DMVideoCaptureLib AVCaptureSessionInterruptionEndedNotification
Oct 27 17:05:56 unknown ReportCrash[3454] <Error>: Saved crashreport to /Library/Logs/CrashReporter/mediaserverd-2011-10-27-170555.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Oct 27 17:05:56 unknown mediaserverd[686] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: RPCTimeout message received; stackshot generated
Oct 27 17:05:56 unknown mediaserverd[686] <Error>: <<<< FIGSERVER >>>> FigPlayerRemoteServer_KillAndForceCrashReport: TERMINATING our process [686]
Oct 27 17:05:56 unknown MobileMusicPlayer[3036] <Warning>: _serverConnectionDiedNotification. Info -- notification=NSConcreteNotification 0x1fda1a50 {name = AVController_ServerConnectionDiedNotification; object = <AVController: 0x1fda9ba0>}, AVController = <AVController: 0x1fda9ba0>, currentTime = 0.00
Oct 27 17:05:56 unknown DigimarcDiscover[3445] <Warning>:
applicationWillEnterForeground
We have also noticed this behavior on iOS 4.3.5 and 4.3.3.
Steps to Reproduce:
1) Use the application for an unknown period of time.
2) Leave the application, and possibly interact with other applications.
3) Resume the application.
Expected Results:
The capture session should properly resume and the camera preview should be working.
Actual Results:
The capture session will fail to restart, and the camera preview will remain black.
Regression:
We had noticed this behavior in previous versions of our application in which we had specifically tried to start the capture session manually when our application resumed. We removed this behavior and let the system manage resumption, and it temporarily seemed to cut down on this behavior. After making some changes to our application, the behavior began to re-surface. We are not sure if changes may have brought this issue back, but we don't have access to enough information to determine that. In addition, the crashing of mediaserverd happens outside our process.
We were advised by DTS to create a bug.
Tabbing out and tabbing back (which calls stop/start on the capture session) will make the capture session start again.
Notes:
This being observed in a shipping application and we consider it a critical bug.
14-Nov-2011 02:58 PM Colin Cornaby:
QA encountered this problem today and had a different log message appear:
Nov 14 14:32:16 unknown DigimarcDiscover[1356] <Warning>: DMVideoCaptureLib AVCaptureSessionInterruptionEndedNotification
Nov 14 14:32:16 unknown kernel[0] <Debug>: AppleH4CamIn::newUserClient
Nov 14 14:32:16 unknown kernel[0] <Debug>: AppleH4CamInUserClient::init
Nov 14 14:32:16 unknown kernel[0] <Debug>: AppleH4CamInUserClient::start
Nov 14 14:32:16 unknown kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 1
Nov 14 14:32:16 unknown kernel[0] <Debug>: AppleH4CamIn::power_on_hardware
Nov 14 14:32:16 unknown kernel[0] <Debug>: AppleH4CamIn::ISP_Init - Sending full-res lens-shading table for back-camera to firmware
Nov 14 14:32:17 unknown DigimarcDiscover[1356] <Warning>: DMVideoCaptureLib AVCaptureSessionDidStartRunningNotification
The camera did not resume after the AVCaptureSessionDidStartRunningNotification.
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!