honoru88 / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

A second call to Camera.takePicture() crashes the mediaserver if Camera.Parameters.setRecordingHint() is true #639

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On Glass, the MediaRecorder only works if the Camera Parameters has 
setRecordingHint(true). However, with this set, the camera can only take one 
picture. The second call to takePicture() crashes the mediaserver.

What steps will reproduce the problem?
1. Build a typical camera activity - SurfaceView, open the camera, etc.
2. After opening the camera, get its parameters, call .setRecordingHint(true) 
on the parameters, and then set those parameters back on the camera.
3. After calling startPreview() on the camera, call takePicture() with a JPEG 
callback.
4. Call startPreview in the JPEG callback, as normal, to be able to take 
another picture.
5. Call takePicture() again.

What is the expected output? What do you see instead?

A second successful call to takePicture() is expected. Instead, the mediaserver 
crashes.

The mediaserver crashes, and not always in the same place. Here's one of the 
stacktraces that appeared in logcat:

11-21 16:23:40.659: E/CameraHal(4351): (b7134348)   
hardware/ti/omap4xxx/camera/AppCallbackNotifier.cpp:254 errorNotify - 
AppCallbackNotifier received error 2
11-21 16:23:40.659: A/libc(4351): Fatal signal 6 (SIGABRT) at 0x000010ff 
(code=-6), thread 9227 (DisplayThread)
11-21 16:23:40.659: I/DEBUG(2328): BOOM: pid=4351 uid=1013 gid=1005 tid=9227
11-21 16:23:40.760: I/DEBUG(2328): *** *** *** *** *** *** *** *** *** *** *** 
*** *** *** *** ***
11-21 16:23:40.760: I/DEBUG(2328): Build fingerprint: 
'Google/glass_1/glass-1:4.4.4/XRX13B/1511057:user/release-keys'
11-21 16:23:40.760: I/DEBUG(2328): Revision: '4'
11-21 16:23:40.760: I/DEBUG(2328): pid: 4351, tid: 9227, name: DisplayThread  
>>> /system/bin/mediaserver <<<
11-21 16:23:40.760: I/DEBUG(2328): pid: 4351, tid: 9227, name: DisplayThread  
>>> /system/bin/mediaserver <<<
11-21 16:23:40.760: I/DEBUG(2328): signal 6 (SIGABRT), code -6 (SI_TKILL), 
fault addr --------
11-21 16:23:40.768: W/NativeCrashListener(543): Couldn't find ProcessRecord for 
pid 4351
11-21 16:23:40.854: I/DEBUG(2328):     r0 00000000  r1 0000240b  r2 00000006  
r3 00000000
11-21 16:23:40.854: I/DEBUG(2328): AM write failure (32 / Broken pipe)
11-21 16:23:40.854: I/DEBUG(2328):     r4 00000006  r5 00000009  r6 0000240b  
r7 0000010c
11-21 16:23:40.854: I/DEBUG(2328):     r8 b5e27dc8  r9 b5e1f3fc  sl b63e8530  
fp b5e2804f
11-21 16:23:40.854: I/DEBUG(2328):     ip b63ea004  sp b05f0b78  lr b6ee9f6d  
pc b6ef8f88  cpsr 000b0010
11-21 16:23:40.854: I/DEBUG(2328):     d0  614370706f727265  d1  
6f4e6b6361626c6c
11-21 16:23:40.854: I/DEBUG(2328):     d2  7220726569666974  d3  
2064657669656365
11-21 16:23:40.854: I/DEBUG(2328):     d4  726f7272455f584d  d5  
7c7c2029656e6f4e
11-21 16:23:40.854: I/DEBUG(2328):     d6  726f727245652820  d7  
5f584d4f203d3d20
11-21 16:23:40.854: I/DEBUG(2328):     d8  0000000000000000  d9  
0000000000000000
11-21 16:23:40.854: I/DEBUG(2328):     d10 0000000000000000  d11 
0000000000000000
11-21 16:23:40.854: I/DEBUG(2328):     d12 0000000000000000  d13 
0000000000000000
11-21 16:23:40.854: I/DEBUG(2328):     d14 0000000000000000  d15 
0000000000000000
11-21 16:23:40.854: I/DEBUG(2328):     d16 3fb308bd2ab7e2c3  d17 
4024000000000000
11-21 16:23:40.854: I/DEBUG(2328):     d18 3fc02589ba9d5581  d19 
3fd1df1c79400000
11-21 16:23:40.854: I/DEBUG(2328):     d20 3fc54e3fb79eb2ed  d21 
bf66b6a0bd6780eb
11-21 16:23:40.854: I/DEBUG(2328):     d22 3fd10a75b30036f2  d23 
3fc0000000000000
11-21 16:23:40.854: I/DEBUG(2328):     d24 3fa5f515569de618  d25 
bfa5f5155b88c2f2
11-21 16:23:40.854: I/DEBUG(2328):     d26 0000000000000000  d27 
4000000000000000
11-21 16:23:40.854: I/DEBUG(2328):     d28 3ffbbd62933ff244  d29 
bfd49dbf24b1185e
11-21 16:23:40.854: I/DEBUG(2328):     d30 3ff0000000000000  d31 
3fc5276fc92c4618
11-21 16:23:40.854: I/DEBUG(2328):     scr 60000010
11-21 16:23:40.870: I/DEBUG(2328): backtrace:
11-21 16:23:40.870: I/DEBUG(2328):     #00  pc 00022f88  /system/lib/libc.so
11-21 16:23:40.870: I/DEBUG(2328):     #01  pc 00013f69  /system/lib/libc.so
11-21 16:23:40.870: I/DEBUG(2328):     #02  pc 0001417d  /system/lib/libc.so
11-21 16:23:40.870: I/DEBUG(2328):     #03  pc 00012eb3  /system/lib/libc.so
11-21 16:23:40.870: I/DEBUG(2328):     #04  pc 0002283c  /system/lib/libc.so
11-21 16:23:40.870: I/DEBUG(2328):     #05  pc 0003162f  
/system/lib/hw/camera.omap4.so
11-21 16:23:40.870: I/DEBUG(2328):     #06  pc 00043237  
/system/lib/hw/camera.omap4.so
11-21 16:23:40.870: I/DEBUG(2328):     #07  pc 000387c1  
/system/lib/hw/camera.omap4.so
11-21 16:23:40.870: I/DEBUG(2328):     #08  pc 00030dcd  
/system/lib/hw/camera.omap4.so
11-21 16:23:40.870: I/DEBUG(2328):     #09  pc 000353cd  
/system/lib/hw/camera.omap4.so
11-21 16:23:40.870: I/DEBUG(2328):     #10  pc 000354d5  
/system/lib/hw/camera.omap4.so
11-21 16:23:40.870: I/DEBUG(2328):     #11  pc 0003550d  
/system/lib/hw/camera.omap4.so
11-21 16:23:40.870: I/DEBUG(2328):     #12  pc 0000ea75  /system/lib/libutils.so
11-21 16:23:40.870: I/DEBUG(2328):     #13  pc 0000e5a7  /system/lib/libutils.so
11-21 16:23:40.870: I/DEBUG(2328):     #14  pc 0000d338  /system/lib/libc.so
11-21 16:23:40.870: I/DEBUG(2328):     #15  pc 0000d4d0  /system/lib/libc.so
11-21 16:23:40.870: I/DEBUG(2328): stack:
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b38  b6005db4 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b3c  b6f93bd9  
/system/bin/linker
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b40  00000000 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b44  ffffffff 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b48  fffffffc 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b4c  b6f897d3  
/system/bin/linker
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b50  b7117930  [heap]
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b54  aeff2000 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b58  b7124908  [heap]
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b5c  00000001 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b60  000f7000 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b64  fffffffc 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b68  b6f93139  
/system/bin/linker
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b6c  b6f93bc8  
/system/bin/linker
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b70  b6f211f0  
/system/lib/libc.so
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b74  b7120008  [heap]
11-21 16:23:40.877: I/DEBUG(2328):     #00  b05f0b78  00000006 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b7c  00000009 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b80  0000240b 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b84  b63ea004  
/system/lib/libtiutils.so
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b88  b63ea004  
/system/lib/libtiutils.so
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b8c  b6ee9f6d  
/system/lib/libc.so
11-21 16:23:40.877: I/DEBUG(2328):     #01  b05f0b90  00000006 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b94  00000000 
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b98  b5e1d745  
/system/lib/hw/camera.omap4.so
11-21 16:23:40.877: I/DEBUG(2328):          b05f0b9c  b6eea181  
/system/lib/libc.so
11-21 16:23:40.877: I/DEBUG(2328):     #02  b05f0ba0  b05f0bac  [stack:9227]
11-21 16:23:40.877: I/DEBUG(2328):          b05f0ba4  b6ee8eb7  
/system/lib/libc.so

<snip>

11-21 16:23:40.995: I/DEBUG(2328): pid: 4351, tid: 4351, name: mediaserver
11-21 16:23:41.026: I/DEBUG(2328): pid: 4351, tid: 4384, name: ApmTone
11-21 16:23:41.041: I/DEBUG(2328): pid: 4351, tid: 4385, name: ApmAudio
11-21 16:23:41.057: I/DEBUG(2328): pid: 4351, tid: 4386, name: ApmOutput
11-21 16:23:41.073: I/DEBUG(2328): pid: 4351, tid: 4387, name: AudioOut_2
11-21 16:23:41.088: I/DEBUG(2328): pid: 4351, tid: 4388, name: Binder_1
11-21 16:23:41.104: I/DEBUG(2328): pid: 4351, tid: 4662, name: Merge Manager
11-21 16:23:41.120: I/DEBUG(2328): pid: 4351, tid: 4663, name: Merge Manager
11-21 16:23:41.143: I/DEBUG(2328): pid: 4351, tid: 4664, name: mediaserver
11-21 16:23:41.151: I/DEBUG(2328): pid: 4351, tid: 4665, name: Binder_2
11-21 16:23:41.166: I/DEBUG(2328): pid: 4351, tid: 5724, name: Binder_3
11-21 16:23:41.182: I/DEBUG(2328): pid: 4351, tid: 9217, name: CallbackThread
11-21 16:23:41.198: I/DEBUG(2328): pid: 4351, tid: 9218, name: OMXCallbackThre
11-21 16:23:41.206: I/DEBUG(2328): pid: 4351, tid: 9224, name: NotificationThr
11-21 16:23:41.229: I/BootReceiver(543): Copying /data/tombstones/tombstone_06 
to DropBox (SYSTEM_TOMBSTONE)
11-21 16:23:41.323: I/ServiceManager(117): service 'media.audio_flinger' died
11-21 16:23:41.323: I/ServiceManager(117): service 'media.player' died
11-21 16:23:41.323: I/ServiceManager(117): service 'media.camera' died
11-21 16:23:41.323: I/ServiceManager(117): service 'media.audio_policy' died
11-21 16:23:41.323: W/CameraBase(8526): Camera service died!
11-21 16:23:41.323: W/CameraBase(8526): mediaserver's remote binder Camera 
object died
11-21 16:23:41.323: W/AudioSystem(543): AudioPolicyService server died!
11-21 16:23:41.448: W/AudioSystem(543): AudioFlinger server died!
11-21 16:23:41.448: E/AudioService(543): Media server died.

What version of the product are you using? On what operating system?

XE22

Please provide any additional information below.

Original issue reported on code.google.com by james.at...@gmail.com on 21 Nov 2014 at 10:08

GoogleCodeExporter commented 9 years ago
Note that the second call to takePicture() does not need to be at all near (in 
time) to the first call. In this example, the second takePicture() call 
happened 3 seconds after the first.

Original comment by james.at...@gmail.com on 21 Nov 2014 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by ala...@google.com on 2 Dec 2014 at 4:18

GoogleCodeExporter commented 9 years ago
Hello,

Could you share a small source code or sample APK that we can use to reproduce? 
I've been using the described steps but can't make the crash happen.

Thanks!
Alain

Original comment by ala...@google.com on 4 Dec 2014 at 5:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here's a simple app which reliably crashes the mediaserver. It shows a simple 
count in the lower right hand corner for the number of successful takePicture() 
calls.

In the CameraActivity, if you comment out the line 
"parameters.setRecordingHint(true)", you can take as many pictures as you want. 
If you leave it in, then the media server will crash the second time you 
depress the camera shutter.

Original comment by james.at...@gmail.com on 5 Dec 2014 at 6:31

Attachments: