MediaRecorder prepare() causes segfault

by dwilde1 » Mon, 29 Mar 2010 13:47:36 GMT


Sponsored Links
 Folks,

I have a situation where my MediaRecorder instance causes a segfault.
I'm working with a HTC Hero, Android 1.5+APIs. In the log i see (after
the segfault announcement) a register dump and then a numbered list
#00 libmedia_jni.so to  #18 linker, then a stack trace.

My Eclipse won't let me copy the log buffer, but I've done three
screen captures that sum it up. If you have time to examine, send me a
direct e-mail.

<pre><code>
    if (mRecorder == null) mRecorder = new MediaRecorder();
    mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
    mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
//       mRecorder.setVideoSize(640, 480);
//       mRecorder.setVideoFrameRate(20);
    mRecorder.setPreviewDisplay(surfaceHolder.getSurface());
    mRecorder.prepare();
    mRecorder.start();
</code></pre>

I've tried other variants, including H263 and 3gp. What else can I do
to debug this? Everythin g seems fine up to prepare().

I tried adding the onErrorListener, but it seems to interfere with the
MediaPlayer's onErrorListener. I'm using a 4-second beep-count to
prepare for auto triggering of the camera, and when I enable the error
handler for the MR everything in my handler state machines goes awry.

Thanks in advance! :D

--



MediaRecorder prepare() causes segfault

by dwilde1 » Tue, 30 Mar 2010 03:09:10 GMT


 n Mar 28, 4:24pm, dwilde1 <dwil...@gmail.com> wrote:

UPDATE:

I learned about the log redirection capabilities of adb last night
after I posted:)

Here's the pertinent section from a run (note: I've reduced resolution
to 320x240 also, no joy):


I/ActivityManager( 80): Start proc com.ejf.convince.jenplus for
activity com.ejf.convince.jenplus/.JenPLUS: pid=17738 uid=10075
gids={1006, 3003}
I/jdwp (17738): received file descriptor 10 from ADB
W/System.err(17738): Can't dispatch DDM chunk 46454154: no handler
defined
W/System.err(17738): Can't dispatch DDM chunk 4d505251: no handler
defined
I/WindowManager( 80): Screen status=true, current orientation=-1,
SensorEnabled=false
I/WindowManager( 80): needSensorRunningLp, mCurrentAppOrientation
=-1
I/WindowManager( 80): Enabling listeners
W/ActivityThread(17738): Application com.ejf.convince.jenplus is
waiting for the debugger on port 8100...
I/System.out(17738): Sending WAIT chunk
I/dalvikvm(17738): Debugger is active
I/AlertDialog( 80): [onCreate] auto launch SIP.
I/WindowManager( 80): onOrientationChanged, rotation changed to 0
I/System.out(17738): Debugger has connected
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): waiting for debugger to settle...
I/System.out(17738): debugger has settled (1370)
I/ActivityManager( 80): Displayed activity
com.ejf.convince.jenplus/.JenPLUS: 5186 ms
I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode
I/AudioHardwareMSM72XX( 2696): AUDIO_START: start kernel pcm_out
driver.
W/AudioFlinger( 2696): write blocked for 96 msecs
I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5
I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode
I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5
I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode
I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5
I/OpenCore( 2696): [Hank debug] LN 289 FN CreateNode
I/PlayerDriver( 2696): CIQ 1625 sendEvent state=5
W/AuthorDriver( 2696): Intended width(640) exceeds the max allowed
width(352). Max width is used instead.
W/AuthorDriver( 2696): Intended height(480) exceeds the max allowed
height(288). Max height is used instead.
I/AudioHardwareMSM72XX( 2696): AudioHardware pcm playback is going to
standby.
I/DEBUG (16094): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG (16094): Build fingerprint: 'sprint/htc_heroc/heroc/heroc:
1.5/CUPCAKE/85027:user/release-keys'
I/DEBUG (16094): pid: 17738, tid: 17738 >>>
com.ejf.convince.jenplus <<<
I/DEBUG (16094): signal 11 (SIGSEGV), fault addr 00000018
I/DEBUG (16094): r0 ffffe4c0 r1 ffffe268 r2 41098b48 r3 00000000
I/DEBUG (16094): r4 4349ff70 r5 ab309358 r6 0000a9c8 r7 beb0f448
I/DEBUG (16094): r8 beb0f468 r9 41049dd8 10 41a93b78 fp 00001070
I/DEBUG (16094): ip ad083e5c sp beb0f440 lr ad03dd75 pc
ab3054f4 cpsr 80000030
I


Sponsored Links


MediaRecorder prepare() causes segfault

by dwilde1 » Wed, 31 Mar 2010 01:24:12 GMT


 urther UPDATE: I've tried all combinations of CAMERA and RECORD_*
permissions in the Manifest and also tried reducing frame rate to 10
and resolution to 176x144, and preset the surfaceHolder to that same
resolution, still no joy, I've also started rebooting the phone every
time it crashes. What else haven't I understood or tried? I can't
debug into the prepare() code, and nobody seems to be able to answer
ANY of these MR questions. I'm fully prepared to accept that I'm
missing something, but I was raised -- and hammered during 27 years of
embedded coding -- to believe that a segfault in a VM interpreter is a
really bad (read: embarrassing :) thing to see.

I'd like to understand this and at least point to a fix. My next step
is to see what's involved in importing the rest of the source into my
system.


On Mar 29, 8:40am, dwilde1 <dwil...@gmail.com> wrote:

--



Other Threads

1. Error on AndroidManifest.xml..

Hi, all.

  I'm trying to build the full Cupcake source code,
  And succeeded on my local Linux box.
  But once I copy the same source code to the remote server (Linux
based server)
  it returns the error like as below.

  target R.java/Manifest.java: Development (out/target/common/obj/APPS/
Development_intermediates/src/R.stamp)
  development/apps/Development/AndroidManifest.xml: 74: ERROR Error:
String types not allowed (at 'configChanges' with value 'keyboard|
keyboardHidden|navigation|orientation').
  make: *** [out/target/common/obj/APPS/Development_intermediates/src/
R.stamp] Error 1

  I tried ro delete out folder and 'make clean' also, but failed.

  Please tell me why the same source code return the error like the
above only in the remote server.
  Again, the smae one had been built on my local Linux box (Ubuntu).

  Thanks in advance.
  Shwan.


--~--~---------~--~----~------------~-------~--~----~

2. capture dialer events

Hello,

I'm trying to figure out if there is a way to capture an event from
the Dialer, after I've entered and clicked on the phone number, but
before the call is actually placed? I also want to be able to access
the phone number that was put in?

I'm trying to make a simple call logger application, but I can't seem
to find any examples of how to do this.

any help would be greatly appreciated it.

Thanks!

Mike

--~--~---------~--~----~------------~-------~--~----~

3. Dynamically adding Images to GridView

4. where can i modify ro.kernel.android.gps ?

5. Question about TabHost implementation

6. asking about previous SDK Versions

7. Uninstall built-in app