Crash in getSlotFromBufferLocked

1,464 views
Skip to first unread message

ffxx68

unread,
Mar 8, 2013, 10:56:35 AM3/8/13
to android...@googlegroups.com
Seeking video integration expert's help.

Porting OMX HW codecs to JB for our platform:

 https://groups.google.com/forum/#!topic/renesas-emev-osp/NpJj163nEQ8[1-25-false]

I get the error below, on video playback. When a video it's started from from the "Gallery" app, screen gets black and a message tells "Can't play this video". These are some relevant parts from logcat:

 http://pastebin.com/wWkA1YiG

The issue is a crash in getSlotFromBufferLocked, which I really can't understand the origin:

I/DEBUG   (   73): backtrace:
I/DEBUG   (   73):     #00  pc 00020bc4  /system/lib/libgui.so (android::SurfaceTextureClient::getSlotFromBufferLocked(ANativeWindowBuffer*) const+35)
I/DEBUG   (   73):     #01  pc 00020c3b  /system/lib/libgui.so (android::SurfaceTextureClient::queueBuffer(ANativeWindowBuffer*)+82)
I/DEBUG   (   73):     #02  pc 0002053d  /system/lib/libgui.so (android::SurfaceTextureClient::hook_queueBuffer(ANativeWindow*, ANativeWindowBuffer*)+10)
I/DEBUG   (   73):     #03  pc 000518d3  /system/lib/libstagefright.so
I/DEBUG   (   73):     #04  pc 000529d5  /system/lib/libstagefright.so (android::AwesomePlayer::onVideoEvent()+1252)
I/DEBUG   (   73):     #05  pc 0005040b  /system/lib/libstagefright.so
I/DEBUG   (   73):     #06  pc 00079863  /system/lib/libstagefright.so (android::TimedEventQueue::threadEntry()+354)
I/DEBUG   (   73):     #07  pc 000798a9  /system/lib/libstagefright.so (android::TimedEventQueue::ThreadWrapper(void*)+16)
I/DEBUG   (   73):     #08  pc 00012bb0  /system/lib/libc.so (__thread_entry+48)
I/DEBUG   (   73):     #09  pc 00012308  /system/lib/libc.so (pthread_create+172)


What could it be?
What should i put under debug?

Note how the same HW libs have been succesfully used for ICS integration.

Thanks in advance
Fabio

ffxx68

unread,
Mar 11, 2013, 10:44:59 AM3/11/13
to android...@googlegroups.com
I've narrowed down a bit the place where the failure happens.
It's within frameworks/av/media/libstagefright/AwesomePlayer.cpp:

struct AwesomeNativeWindowRenderer : public AwesomeRenderer {
    AwesomeNativeWindowRenderer(
            const sp<ANativeWindow> &nativeWindow,
            int32_t rotationDegrees)
        : mNativeWindow(nativeWindow) {
        applyRotation(rotationDegrees);
    }

    virtual void render(MediaBuffer *buffer) {
        int64_t timeUs;
        CHECK(buffer->meta_data()->findInt64(kKeyTime, &timeUs));
        native_window_set_buffers_timestamp(mNativeWindow.get(), timeUs * 1000);
        status_t err = mNativeWindow->queueBuffer(
                mNativeWindow.get(), buffer->graphicBuffer().get());


queueBuffer() is crashing here, but I'm in trouble in understanding where to add more debug statements, to narrow the crash even further. Any suggestion?

BTW - is there a debugger available for Android, which can communicate over ADB?

 thanks
 Fabio

ffxx68

unread,
Mar 11, 2013, 11:49:48 AM3/11/13
to android...@googlegroups.com
Yes of course there's a debugger! gdbserver/gdb can make the job, but what process do you suggest to attach to?
I'm running AwesomePlayer, but I don't know which process I should attach to, any of these?

system    251   1     48316  26624 ffffffff 40062b64 S /system/bin/surfaceflinger
u0_a7     540   212   169776 30792 ffffffff 40033a40 S android.process.media
media     732   1     21932  5444  ffffffff 40083b64 S /system/bin/mediaserver
u0_a27    349   212   181864 42360 ffffffff 40033a40 S com.android.systemui



On Friday, 8 March 2013 16:56:35 UTC+1, ffxx68 wrote:

ffxx68

unread,
Mar 14, 2013, 7:33:55 AM3/14/13
to android...@googlegroups.com
Ok - got it. I double checked the patch for ICS and realized I forgot to port one single line.
Inside media/libstagefright/AwesomePlayer.cpp, initRenderer_l(), AwesomeLocalRenderer had to be forced, in place of the default AwesomeNativeWindowRenderer.


On Friday, 8 March 2013 16:56:35 UTC+1, ffxx68 wrote:
Reply all
Reply to author
Forward
0 new messages