0

I am working on stagefright to decode and display mp4 file in android 4.0.4 with hardware codec.

Currently I am testing in Motorola Xoom device with android 4.0.4. I was able to decode and display the files for all resolutions fast enough for my requirement

but at the end of the decoding i.e for the last frame it crashes with the following error

08-27 12:24:53.500: A/OMXCodec(2677): 
frameworks/base/media/libstagefright/OMXCodec.cpp:2037 
CHECK_EQ( (int)bufInfo->mStatus,(int)OWNED_BY_NATIVE_WINDOW) failed: 0 vs. 2
08-27 12:24:53.500: A/libc(2677): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)

When I checked the code of omxcodec this happens when the codec tries to dequeue native window buffer on release of the mediabuffer object which in turn calls the signalBufferReturned() function of omxcodec. But not getting how to solve this...
I have tried it in karbonnA9+ also where it is working fine currently..

Can someone give a solution or a suggestion.....

Kevin K
  • 589
  • 2
  • 7
  • 28
  • If you can enable logs in `OMXCodec` and push a custom `libstagefright.so` into the device, I would recommend one experiment for you. After the buffer is dequeued successfully and the corresponding `bufInfo` is available as here:http://androidxref.com/4.0.4/xref/frameworks/base/media/libstagefright/OMXCodec.cpp#2028, please print the `bufInfo->mStatus`. – Ganesh Sep 01 '14 at 00:03
  • Before `dequeueBufferFromNativeWindow` is called, please check if the status is updated successfully or not as here: http://androidxref.com/4.0.4/xref/frameworks/base/media/libstagefright/OMXCodec.cpp#4040 . Ideally, there shouldn't be an error, but I am not sure if any customization went in which is creating this issue. – Ganesh Sep 01 '14 at 00:07
  • @Ganesh Thanks for your reply. But I have a doubt in pushing my libstagefright.so. I have the AOSP code downloaded from the developer site. If I replace this listafefright.so in my device(motorola xoom), Will it work since there can be some customizations from the mobile manufacurers.. – Kevin K Sep 01 '14 at 04:54
  • Unless we get the actual android tree, I presume this is the only way out. Please take a backup of the existing `libstagefright.so` by pulling the same through `adb pull` before updating with the newer library through `adb push`. – Ganesh Sep 01 '14 at 09:06
  • @Ganesh I did push the libstagefright.so via adb push but could not see any logs printed in logcat. (I added some logs). Should I restart the device after placing my .so file ?? – Kevin K Sep 02 '14 at 09:31
  • 1
    The steps to be followed are `adb shell remount`, `adb shell push libstagefright.so /system/lib`, `adb shell sync`, `adb shell stop media`, `adb shell start media` and rerun the experiments. I presume you have uncommented the logging macro at the start of the file. With this you should be able to get your logs – Ganesh Sep 02 '14 at 16:12
  • @Ganesh Actually after rooting the device I replaced the libstagefright.so and again I replaced the previous one which I kept back up. Then once I restarted it kept looping some where with the moto logo on screen. Then I explored and flashed Cynogenmod custom rom but now I came to know that it is Jellybean rom.... Is there a way to get the official ics Rom for my Motorola Xoom MZ601... – Kevin K Sep 03 '14 at 05:46
  • @Ganesh Ok I got 4.0.4 rom in my device. I will check your suggestions now.... – Kevin K Sep 03 '14 at 07:38
  • @Ganesh I replaced the libstagefright.so just as you told but with the new lib the media server is not restarting when I do adb start media command after stop. And my application also crashes in the first step of omxclint.connect. The media server starts as soon as I replace the old lib(original). What else can I do ????. [**here**](http://pastebin.com/CJU0apnm) is my logs and the sequence is 1. I replaced my lib then adb stop media 2.adb start media (no change in the log) 3.Replaced the old lib 4. Got a fatal signal and the media server started again. 5.Did an adb stop and start of media. – Kevin K Sep 03 '14 at 12:16
  • @Ganesh what else can I try on this ???? – Kevin K Sep 04 '14 at 06:37

0 Answers0