Uncaught exception in MediaCodecBridge::QueueSecureInputBuffer |
||||||
Issue descriptionChrome Version: M52 ToT Device: Nexus 7 v2 OS: Android M Steps to repro: 1. Go to youtube.com 2. Sign in 3. Request desktop site 4. Play a purchased content 04-20 16:44:15.623 19443 19460 W System.err: java.lang.IllegalArgumentException 04-20 16:44:15.623 19443 19460 W System.err: at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method) 04-20 16:44:15.623 19443 19460 W System.err: at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2292) 04-20 16:44:15.623 19443 19460 W System.err: at org.chromium.media.MediaCodecBridge.queueSecureInputBuffer(MediaCodecBridge.java:378) 04-20 16:44:15.623 19443 19460 W System.err: at org.chromium.content.app.ContentMain.nativeStart(Native Method) 04-20 16:44:15.623 19443 19460 W System.err: at org.chromium.content.app.ContentMain.start(ContentMain.java:25) 04-20 16:44:15.623 19443 19460 W System.err: at org.chromium.content.app.ChildProcessService$2.run(ChildProcessService.java:197) 04-20 16:44:15.623 19443 19460 W System.err: at java.lang.Thread.run(Thread.java:818) 04-20 16:44:15.676 19443 19460 F chromium: [FATAL:jni_android.cc(233)] Check failed: false. Please include Java exception stack in crash report 04-20 16:44:15.811 192 192 F DEBUG : backtrace: 04-20 16:44:15.811 192 192 F DEBUG : #00 pc 00041f60 /system/lib/libc.so (tgkill+12) 04-20 16:44:15.811 192 192 F DEBUG : #01 pc 0003faed /system/lib/libc.so (pthread_kill+32) 04-20 16:44:15.811 192 192 F DEBUG : #02 pc 0001c30f /system/lib/libc.so (raise+10) 04-20 16:44:15.811 192 192 F DEBUG : #03 pc 000194c1 /system/lib/libc.so (__libc_android_abort+34) 04-20 16:44:15.811 192 192 F DEBUG : #04 pc 000174ac /system/lib/libc.so (abort+4) 04-20 16:44:15.811 192 192 F DEBUG : #05 pc 0006fd25 /data/app/org.chromium.chrome-1/lib/arm/libbase.cr.so (base::debug::BreakDebugger()+16) 04-20 16:44:15.812 192 192 F DEBUG : #06 pc 00080a67 /data/app/org.chromium.chrome-1/lib/arm/libbase.cr.so (logging::LogMessage::~LogMessage()+562) 04-20 16:44:15.812 192 192 F DEBUG : #07 pc 00065bc3 /data/app/org.chromium.chrome-1/lib/arm/libbase.cr.so (base::android::CheckException(_JNIEnv*)+114) 04-20 16:44:15.812 192 192 F DEBUG : #08 pc 00170d95 /data/app/org.chromium.chrome-1/lib/arm/libmedia.cr.so (media::SdkMediaCodecBridge::QueueSecureInputBuffer(int, unsigned char const*, unsigned int, std::__1::vector<char, std::__1::allocator<char> > const&, std::__1::vector<char, std::__1::allocator<char> > const&, media::SubsampleEntry const*, int, base::TimeDelta const&)+504) 04-20 16:44:15.812 192 192 F DEBUG : #09 pc 001579c5 /data/app/org.chromium.chrome-1/lib/arm/libmedia.cr.so (media::MediaCodecBridge::QueueSecureInputBuffer(int, unsigned char const*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<media::SubsampleEntry, std::__1::allocator<media::SubsampleEntry> > const&, base::TimeDelta const&)+124) 04-20 16:44:15.812 192 192 F DEBUG : #10 pc 000d8c49 /data/app/org.chromium.chrome-1/lib/arm/libmedia.cr.so (media::MediaCodecAudioDecoder::EnqueueInputBuffer(media::MediaCodecAudioDecoder::InputBufferInfo const&)+508) 04-20 16:44:15.812 192 192 F DEBUG : #11 pc 000d8ef9 /data/app/org.chromium.chrome-1/lib/arm/libmedia.cr.so (media::MediaCodecAudioDecoder::QueueOneInputBuffer()+120) 04-20 16:44:15.812 192 192 F DEBUG : #12 pc 000d901f /data/app/org.chromium.chrome-1/lib/arm/libmedia.cr.so (media::MediaCodecAudioDecoder::QueueInput()+78) 04-20 16:44:15.812 192 192 F DEBUG : #13 pc 000da557 /data/app/org.chromium.chrome-1/lib/arm/libmedia.cr.so (media::MediaCodecAudioDecoder::DoIOTask()+10) 04-20 16:44:15.812 192 192 F DEBUG : #14 pc 000da8b3 /data/app/org.chromium.chrome-1/lib/arm/libmedia.cr.so (media::MediaCodecAudioDecoder::Decode(scoped_refptr<media::DecoderBuffer> const&, base::Callback<void (media::DecodeStatus), (base::internal::CopyMode)1> const&)+702)
,
Apr 21 2016
Android build version: MRA47
,
Apr 21 2016
I was able to reproduce the problem on Nexus 6P with Android N (angler-userdebug N NRC84D 2714208 dev-keys)
,
Apr 22 2016
I have the situation where my purchased playback starts at the middle. To reproduce, I need to let it start playing and then scroll to the beginning. In this case the pipeline sends the buffer which seems, indeed, invalid: 04-21 18:25:27.963 11146 11300 V timav : [11146/11300] 18:25:27.963 MojoAudioDecoder::Decode timestamp: 0 duration: 23219 size: 378 side_data_size: 0 is_key_frame: 1 encrypted: 1 discard_padding (ms): (0, 0) decrypt:key_id:'31' iv:'' subsamples:[] The 'decrypt' portion looks invalid, I'd expect key_id to be 16 bytes long and in general look like other buffers, e.g. MojoAudioDecoder::Decode timestamp: 4049978049 duration: 23219 size: 312 side_data_size: 0 is_key_frame: 1 encrypted: 1 discard_padding (ms): (0, 0) decrypt:key_id:'B9A125C2F1D35C818E0F489A97AEE97B' iv:'2DFABA86A2049AD00000000000000000' subsamples:[(clear:7, cypher:305)]
,
Apr 22 2016
Empty IV means the buffer is not encrypted: https://code.google.com/p/chromium/codesearch#chromium/src/media/base/decrypt_config.h&l=46 This is common for Youtube where an encrypted stream has a clear start (unencrypted buffers) for a few seconds. It seems that in MediaCodecAudioDecoder we are checking whether DecryptConfig is present, which is wrong: https://code.google.com/p/chromium/codesearch#chromium/src/media/filters/android/media_codec_audio_decoder.cc&l=420 Instead we should check whether IV or KeyId is empty, the same as what we are doing in MediaDecoderJob: https://code.google.com/p/chromium/codesearch#chromium/src/media/base/android/media_decoder_job.cc&l=278 That being said, I agree relying on empty IV to decide whether a buffer is encrypted isn't very intuitive. Maybe we should add a is_encrypted() method on DecoderBuffer.
,
Apr 22 2016
,
Apr 22 2016
Yes, good catch, thank you. Also https://code.google.com/p/chromium/codesearch#chromium/src/content/common/gpu/media/android_video_decode_accelerator.cc&l=601
,
Apr 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/100cc77fa6654a0198561e6621f6bf10fa9adc3f commit 100cc77fa6654a0198561e6621f6bf10fa9adc3f Author: timav <timav@chromium.org> Date: Fri Apr 22 20:41:20 2016 media: Properly tell whether the buffer is encrypted We need to call MediaCodec method queueSecureInputBuffer() instead of queueInputBuffer() only if both the key and the initialization vector are not empty. BUG= 605341 Review URL: https://codereview.chromium.org/1912213002 Cr-Commit-Position: refs/heads/master@{#389229} [modify] https://crrev.com/100cc77fa6654a0198561e6621f6bf10fa9adc3f/media/base/decrypt_config.h [modify] https://crrev.com/100cc77fa6654a0198561e6621f6bf10fa9adc3f/media/filters/android/media_codec_audio_decoder.cc
,
Apr 22 2016
,
Apr 22 2016
Your change meets the bar and is auto-approved for M51 (branch: 2704)
,
Apr 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/90dcdd907a4050acb00d9c878dafc3402d7c347c commit 90dcdd907a4050acb00d9c878dafc3402d7c347c Author: Tima Vaisburd <timav@chromium.org> Date: Fri Apr 22 21:35:49 2016 [Merged] media: Properly tell whether the buffer is encrypted We need to call MediaCodec method queueSecureInputBuffer() instead of queueInputBuffer() only if both the key and the initialization vector are not empty. BUG= 605341 TBR=timav > Review URL: https://codereview.chromium.org/1912213002 > Cr-Commit-Position: refs/heads/master@{#389229} Review URL: https://codereview.chromium.org/1905423003 . Cr-Commit-Position: refs/branch-heads/2704@{#196} Cr-Branched-From: 6e53600def8f60d8c632fadc70d7c1939ccea347-refs/heads/master@{#386251} [modify] https://crrev.com/90dcdd907a4050acb00d9c878dafc3402d7c347c/media/base/decrypt_config.h [modify] https://crrev.com/90dcdd907a4050acb00d9c878dafc3402d7c347c/media/filters/android/media_codec_audio_decoder.cc
,
Apr 22 2016
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by xhw...@chromium.org
, Apr 21 2016