Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for devices that report incorrect supported types. #53

Closed
wants to merge 1 commit into from

Conversation

edisonw
Copy link

@edisonw edisonw commented Sep 23, 2014

Certain devices can report a codec in the supported list but don't really support it. getCapabilitiesForType will return IllegalArgument and we shouldn't add it to the list.

Certain devices can report a codec in the supported list but don't really support it.  getCapabilitiesForType will return IllegalArgument and we shouldn't add it to the list.
@edisonw
Copy link
Author

edisonw commented Sep 23, 2014

We observed this while testing on certain devices at Vine. (e.g. Samsung GT-I9100 running 4.1.2). The codec that's reported but not supported was " video/x-vnd.on2.vp8" getCapabilities will return IllegalArgument and if trying to use it later OMX will throw a ComponentNotFound error code and crash in native code.

@ojw28
Copy link
Contributor

ojw28 commented Sep 23, 2014

Is "video/x-vnd.on2.vp8" the mimeType that you're passing to the method to cause the crash? What's the name of the decoder (i.e. the value of codecName)?

@edisonw
Copy link
Author

edisonw commented Sep 23, 2014

The name of the decoder that got resolved was something like "OMX.SEC.vp8" The memeType was resolved from a video file.

@ojw28
Copy link
Contributor

ojw28 commented Jan 12, 2015

Although we're seeing a crash when querying OMX.SEC.vp8, it's unclear whether or not it does actually support video/x-vnd.on2.vp8. Did you attempt to play the content using this decoder, and if so did it fail? Just trying to confirm the correct fix (which is either to ignore the decoder, or to hardcode that it does actually support the mime type).

@edisonw
Copy link
Author

edisonw commented Jan 12, 2015

Is video/x-vnd.on2.vp8 supported? Yes.

There are two codecs on the device that declares that it supports the mime type from MediaCodecList:

OMX.SEC.vp8.dec and

OMX.google.vpx.decoder

The first one will throw the illegal argument, but 2nd one works just fine when get returned.

@ojw28
Copy link
Contributor

ojw28 commented Jan 12, 2015

When does OMX.SEC.vp8.dec throw the IllegalArgumentException? I understand it throws it when querying the capabilities (which is what this change guards against), but I was wondering if the decoder works if you just don't query what the capabilities are and try and instantiate the decoder anyway. I'm guessing the decoder is actually able to play VP8 content?

@edisonw
Copy link
Author

edisonw commented Jan 12, 2015

Just tried it by "use it anyway" instead of looking further in that loop.

It turns out, OMX.SEC.vp8.dec simply does not work, so it's probably better to skip it in this specific case, however, of course this is not to say that if failing in the getCapability call is 100% the decision signal to say that the codec is not a working codec.

I/OMXClient(17567): Using client-side OMX mux.
E/ACodec  (17567): Unable to instantiate decoder 'OMX.SEC.vp8.dec'.
E/MediaCodec(17567): Codec reported an error. (omx error 0x80001003, internalError -2147483648)
F/libc    (17567): Fatal signal 11 (SIGSEGV) at 0x00000008 (code=1), thread 17635 (ExoPlayerImplIn)
D/KeyguardViewMediator( 2105): setHidden false
I/DEBUG   ( 1826): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 1826): Build fingerprint: 'samsung/GT-I9100/GT-I9100:4.1.2/JZO54K/I9100XWLSD:user/release-keys'
I/DEBUG   ( 1826): pid: 17567, tid: 17635, name: ExoPlayerImplIn  >>> co.vine.android:trim <<<
I/DEBUG   ( 1826): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000008
I/DEBUG   ( 1826):     r0 00000000  r1 541b3c50  r2 40103c77  r3 4fea9a71
I/DEBUG   ( 1826):     r4 518aef30  r5 4fec51f0  r6 00000000  r7 ffffffed
I/DEBUG   ( 1826):     r8 518afe10  r9 24000001  sl 51897a08  fp 541b3c94
I/DEBUG   ( 1826):     ip 4fec5b30  sp 541b3c00  lr 4fea9a21  pc 5194e9f6  cpsr 00000030
I/DEBUG   ( 1826):     d0  000000000000d224  d1  000000000000d224
I/DEBUG   ( 1826):     d2  0000000000000023  d3  0000000000001054
I/DEBUG   ( 1826):     d4  0000000000001046  d5  000000000000005d
I/DEBUG   ( 1826):     d6  0000000080000000  d7  0000ac443f19999a
I/DEBUG   ( 1826):     d8  0000000000000000  d9  0000000000000000
I/DEBUG   ( 1826):     d10 0000000000000000  d11 0000000000000000
I/DEBUG   ( 1826):     d12 0000000000000000  d13 0000000000000000
I/DEBUG   ( 1826):     d14 0000000000000000  d15 0000000000000000
I/DEBUG   ( 1826):     d16 0000000000000003  d17 000000000000d227
I/DEBUG   ( 1826):     d18 000000000000d227  d19 0000000000000000
I/DEBUG   ( 1826):     d20 0000000000000000  d21 0000000000000000
I/DEBUG   ( 1826):     d22 0000000000000000  d23 0000000000000000
I/DEBUG   ( 1826):     d24 3ff0000000000000  d25 3ff0000000000000
I/DEBUG   ( 1826):     d26 0000000000000000  d27 c018000000000000
I/DEBUG   ( 1826):     d28 0000000000000000  d29 3ff0000000000000
I/DEBUG   ( 1826):     d30 3ff0000000000000  d31 3ff0000000000000
I/DEBUG   ( 1826):     scr 20000011
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): backtrace:
I/DEBUG   ( 1826):     #00  pc 000759f6  /system/lib/libstagefright.so (android::MediaCodec::release()+1)
I/DEBUG   ( 1826):     #01  pc 0000ea1d  /system/lib/libmedia_jni.so (android::JMediaCodec::~JMediaCodec()+16)
I/DEBUG   ( 1826):     #02  pc 0000ea75  /system/lib/libmedia_jni.so (android::JMediaCodec::~JMediaCodec()+4)
I/DEBUG   ( 1826):     #03  pc 0000ef11  /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+40)
I/DEBUG   ( 1826):     #04  pc 0000e1cb  /system/lib/libmedia_jni.so (android::sp<android::JMediaCodec>::~sp()+10)
I/DEBUG   ( 1826):     #05  pc 0000f1c7  /system/lib/libmedia_jni.so
I/DEBUG   ( 1826):     #06  pc 0001df30  /system/lib/libdvm.so (dvmPlatformInvoke+112)
I/DEBUG   ( 1826):     #07  pc 0004d183  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+394)
I/DEBUG   ( 1826):     #08  pc 00027360  /system/lib/libdvm.so
I/DEBUG   ( 1826):     #09  pc 0002bc68  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
I/DEBUG   ( 1826):     #10  pc 0005f8f1  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
I/DEBUG   ( 1826):     #11  pc 0005f91b  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
I/DEBUG   ( 1826):     #12  pc 000544d3  /system/lib/libdvm.so
I/DEBUG   ( 1826):     #13  pc 00012e00  /system/lib/libc.so (__thread_entry+48)
I/DEBUG   ( 1826):     #14  pc 00012558  /system/lib/libc.so (pthread_create+172)
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): stack:
I/DEBUG   ( 1826):          541b3bc0  518979f8  
I/DEBUG   ( 1826):          541b3bc4  4085d4f3  /system/lib/libdvm.so (dvmThrowChainedException(ClassObject*, char const*, Object*)+658)
I/DEBUG   ( 1826):          541b3bc8  42298b50  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   ( 1826):          541b3bcc  416e3870  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   ( 1826):          541b3bd0  4228e6f0  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   ( 1826):          541b3bd4  54ee7060  
I/DEBUG   ( 1826):          541b3bd8  541b3c04  
I/DEBUG   ( 1826):          541b3bdc  4febe045  /system/lib/libmedia_jni.so
I/DEBUG   ( 1826):          541b3be0  1e70000d  
I/DEBUG   ( 1826):          541b3be4  4febe045  /system/lib/libmedia_jni.so
I/DEBUG   ( 1826):          541b3be8  541b3c04  
I/DEBUG   ( 1826):          541b3bec  4febe045  /system/lib/libmedia_jni.so
I/DEBUG   ( 1826):          541b3bf0  1fa00005  
I/DEBUG   ( 1826):          541b3bf4  40861fa9  /system/lib/libdvm.so
I/DEBUG   ( 1826):          541b3bf8  df0027ad  
I/DEBUG   ( 1826):          541b3bfc  00000000  
I/DEBUG   ( 1826):     #00  541b3c00  00000000  
I/DEBUG   ( 1826):          541b3c04  541b3c50  
I/DEBUG   ( 1826):          541b3c08  40103c77  /system/lib/libutils.so (android::CallStack::~CallStack())
I/DEBUG   ( 1826):          541b3c0c  518aef30  
I/DEBUG   ( 1826):          541b3c10  4fec51f0  /system/lib/libmedia_jni.so
I/DEBUG   ( 1826):          541b3c14  4fea9a21  /system/lib/libmedia_jni.so (android::JMediaCodec::~JMediaCodec()+20)
I/DEBUG   ( 1826):     #01  541b3c18  518aef30  
I/DEBUG   ( 1826):          541b3c1c  518aef30  
I/DEBUG   ( 1826):          541b3c20  541b3c50  
I/DEBUG   ( 1826):          541b3c24  4fea9a79  /system/lib/libmedia_jni.so (android::JMediaCodec::~JMediaCodec()+8)
I/DEBUG   ( 1826):     #02  541b3c28  518ad5f0  
I/DEBUG   ( 1826):          541b3c2c  40104f13  /system/lib/libutils.so (android::RefBase::decStrong(void const*) const+42)
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near r1:
I/DEBUG   ( 1826):     541b3c30 541b3c50 541b3c50 1fa00005 4fea91cf  P<.TP<.T.......O
I/DEBUG   ( 1826):     541b3c40 54ee7060 4feaa1cb 00000000 00000000  `p.T...O........
I/DEBUG   ( 1826):     541b3c50 518aef30 408435d4 518979f8 4c45b5f0  0..Q.5.@.y.Q..EL
I/DEBUG   ( 1826):     541b3c60 518979f8 00000000 53dcbd5c 541b3c7c  .y.Q....\..S|<.T
I/DEBUG   ( 1826):     541b3c70 53dcbd50 40836f34 00000000 40861b03  P..S4o.@.......@
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near r2:
I/DEBUG   ( 1826):     40103c54 2300bfe3 47706003 4604b510 6003680b  ...#.`pG...F.h.`
I/DEBUG   ( 1826):     40103c64 220cb12b 435a3004 f7fe3104 4620eba2  +..".0ZC.1.... F
I/DEBUG   ( 1826):     40103c74 4770bd10 6803b508 4293680a b163d10b  ..pG...h.h.B..c.
I/DEBUG   ( 1826):     40103c84 31043004 435a220c eb98f7fe 0001f1d0  .0.1."ZC........
I/DEBUG   ( 1826):     40103c94 2000bf38 2000bd08 2001bd08 b508bd08  8.. ... ... ....
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near r3:
I/DEBUG   ( 1826):     4fea9a50 f7fe0114 6920eb82 f104b118 f7fe0110  ...... i........
I/DEBUG   ( 1826):     4fea9a60 4620eb7c eb90f7fe bd704620 0001b7d0  |. F.... Fp.....
I/DEBUG   ( 1826):     4fea9a70 4604b510 ffcaf7ff f7fe4620 4620eb8c  ...F.... F.... F
I/DEBUG   ( 1826):     4fea9a80 0000bd10 41f0e92d 68084604 4615460e  ....-..A.F.h.F.F
I/DEBUG   ( 1826):     4fea9a90 f8d04698 46083190 4a114611 6812447a  .F...1.F.F.JzD.h
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near r4:
I/DEBUG   ( 1826):     518aef10 2e637661 00636564 00000018 72652d74  avc.dec.....t-er
I/DEBUG   ( 1826):     518aef20 00726f72 00636564 00000028 0000002b  ror.dec.(...+...
I/DEBUG   ( 1826):     518aef30 4fec51f0 518ad5f0 1d20027e 1d200007  .Q.O...Q~. ... .
I/DEBUG   ( 1826):     518aef40 00000000 518ad608 00000000 400d7534  .......Q....4u.@
I/DEBUG   ( 1826):     518aef50 00000028 0000002b 2e584d4f 2e434553  (...+...OMX.SEC.
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near r5:
I/DEBUG   ( 1826):     4fec51d0 00000000 00000000 4fea96d3 4fea96d7  ...........O...O
I/DEBUG   ( 1826):     4fec51e0 4fea96b1 4fea96dd 00000000 00000000  ...O...O........
I/DEBUG   ( 1826):     4fec51f0 4fea9a0d 4fea9a71 40103c77 40103c77  ...Oq..Ow<.@w<.@
I/DEBUG   ( 1826):     4fec5200 40104dd3 40103c77 00000000 00000000  .M.@w<.@........
I/DEBUG   ( 1826):     4fec5210 4feaaafd 4feaab1d 4feaa985 4feaa985  ...O...O...O...O
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near r8:
I/DEBUG   ( 1826):     518afdf0 612e656c 6277726d 636e652e 7265646f  le.amrwb.encoder
I/DEBUG   ( 1826):     518afe00 72656400 00000000 00000000 00000019  .der............
I/DEBUG   ( 1826):     518afe10 400d753c 400d753c 2e387076 00636564  <u.@<u.@vp8.dec.
I/DEBUG   ( 1826):     518afe20 00000018 00000012 00040184 0b000005  ................
I/DEBUG   ( 1826):     518afe30 00000a09 0000002b 00000009 544a8000  ....+.........JT
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near r9:
I/DEBUG   ( 1826):     23ffffe0 ffffffff ffffffff ffffffff ffffffff  ................
I/DEBUG   ( 1826):     23fffff0 ffffffff ffffffff ffffffff ffffffff  ................
I/DEBUG   ( 1826):     24000000 ffffffff ffffffff ffffffff ffffffff  ................
I/DEBUG   ( 1826):     24000010 ffffffff ffffffff ffffffff ffffffff  ................
I/DEBUG   ( 1826):     24000020 ffffffff ffffffff ffffffff ffffffff  ................
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near sl:
I/DEBUG   ( 1826):     518979e8 00000000 00000000 00000000 00000453  ............S...
I/DEBUG   ( 1826):     518979f8 5305285a 53dcbd4c 4c45b3f8 4d40a000  Z(.SL..S..EL..@M
I/DEBUG   ( 1826):     51897a08 421fac60 54ee7060 541b3da8 00000000  `..B`p.T.=.T....
I/DEBUG   ( 1826):     51897a18 541b3ddc 00000012 00000000 408370c0  .=.T.........p.@
I/DEBUG   ( 1826):     51897a28 00000000 00000000 409dc470 53dc8300  ........p..@...S
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near fp:
I/DEBUG   ( 1826):     541b3c74 40836f34 00000000 40861b03 53dcbd4c  4o.@.......@L..S
I/DEBUG   ( 1826):     541b3c84 00000001 422e6828 4dd2e3e5 00000000  ....(h.B...M....
I/DEBUG   ( 1826):     541b3c94 40866187 53dcbd4c 4dd2e3e1 4feaa121  .a.@L..S...M!..O
I/DEBUG   ( 1826):     541b3ca4 51897a08 00000000 00000000 518979f8  .z.Q.........y.Q
I/DEBUG   ( 1826):     541b3cb4 400dea6c 00000000 5305285a 53dcbd38  l..@....Z(.S8..S
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near ip:
I/DEBUG   ( 1826):     4fec5b10 40105015 4000d8f9 40103c77 40103c77  .P.@...@w<.@w<.@
I/DEBUG   ( 1826):     4fec5b20 40104dd3 40103c77 40107bd5 40107afd  .M.@w<.@.{.@.z.@
I/DEBUG   ( 1826):     4fec5b30 5194e9f5 404e7d6d 5194ed41 5194ea7d  ...Qm}N@A..Q}..Q
I/DEBUG   ( 1826):     4fec5b40 5194ea39 5194e3d9 5194e935 5194e835  9..Q...Q5..Q5..Q
I/DEBUG   ( 1826):     4fec5b50 5194e799 5194e62d 5194e5c5 5194e56d  ...Q-..Q...Qm..Q
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): memory near sp:
I/DEBUG   ( 1826):     541b3be0 1e70000d 4febe045 541b3c04 4febe045  ..p.E..O.<.TE..O
I/DEBUG   ( 1826):     541b3bf0 1fa00005 40861fa9 df0027ad 00000000  .......@.'......
I/DEBUG   ( 1826):     541b3c00 00000000 541b3c50 40103c77 518aef30  ....P<.Tw<.@0..Q
I/DEBUG   ( 1826):     541b3c10 4fec51f0 4fea9a21 518aef30 518aef30  .Q.O!..O0..Q0..Q
I/DEBUG   ( 1826):     541b3c20 541b3c50 4fea9a79 518ad5f0 40104f13  P<.Ty..O...Q.O.@
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): code around pc:
I/DEBUG   ( 1826):     5194e9d4 bf0083fe 71756549 0006a712 0005e8b4  ....Ieuq........
I/DEBUG   ( 1826):     5194e9e4 0006a82a 0005be68 0005a1be 0006aa70  *...h.......p...
I/DEBUG   ( 1826):     5194e9f4 6885b537 60c3f44f ee62f7d6 462a490c  7..hO..`..b..I*F
I/DEBUG   ( 1826):     5194ea04 f7d64604 4621ee76 4668ac02 ff35f7dd  .F..v.!F..hF..5.
I/DEBUG   ( 1826):     5194ea14 46682300 3d04f844 f7ff4621 4605fad1  .#hFD..=!F.....F
I/DEBUG   ( 1826): 
I/DEBUG   ( 1826): code around lr:
I/DEBUG   ( 1826):     4fea9a00 0001426a 00014257 00014242 4604b570  jB..WB..BB..p..F
I/DEBUG   ( 1826):     4fea9a10 26004d16 3508447d 69806005 ec08f7fe  .M.&}D.5.`.i....
I/DEBUG   ( 1826):     4fea9a20 ebacf7fe 46056801 238cf8d1 479068e1  .....h.F...#.h.G
I/DEBUG   ( 1826):     4fea9a30 682860e6 6d8368a1 47984628 60a669a0  .`(h.h.m(F.G.i.`
I/DEBUG   ( 1826):     4fea9a40 f104b118 f7fe0118 6960eb88 f104b118  ..........`i....
I/DEBUG   ( 1826): !@dumpstate -k -t -z -d -o /data/log/dumpstate_app_native -m 17567

@ojw28
Copy link
Contributor

ojw28 commented Jan 12, 2015

Agreed. Blacklisting that decoder/device combination seems like the right thing to do. There's another decoder on that device that also fails. Are you aware of any other devices on which this decoder fails consistently?

@edisonw
Copy link
Author

edisonw commented Jan 12, 2015

I don't think I had kept a list, probably should have by just logging it as a crash on Crashlytics, but we found this before we released that feature, so there's never really any crash for it. That device is bad all around on MediaCodec...but that's a separate issue and granted it is a Galaxy S2 and Galaxy S7 is coming out in a few months or so.

The best solution might be just give up on these guys for now, but enforce better CTS tests on the upcoming devices. (I would totally vote to make ExoPlayer demo part of CTS tests..heh)

@andrewlewis
Copy link
Collaborator

@edisonw, we are adding a way to blacklist decoders to address issue #377. I'd be grateful if you could let me know the device fingerprint (output by 'adb shell getprop ro.build.fingerprint') on the phone where you saw this. I will need to compile a list of devices with the issue, so if you now know of any others please tell me about those too. Thanks!

@ojw28
Copy link
Contributor

ojw28 commented Oct 11, 2015

Closing this. We've added functionality to blacklist specific decoder/device combinations. We can add additional combinations to the blacklist as needed/reported.

@ojw28 ojw28 closed this Oct 11, 2015
@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants