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

First onVideoSizeChanged callback returns width=-1, height=-1 (Format.NO_VALUE) on Android 4.2 devices with Qualcomm 800 SoC #3007

Closed
gergely-sallai opened this issue Jun 30, 2017 · 4 comments
Assignees

Comments

@gergely-sallai
Copy link

Issue description

First onVideoSizeChanged callback returns width=-1, height=-1 and pixelWidthHeightRatio=-1.0 (Format.NO_VALUE) on Android 4.2 devices with Qualcomm 800 SoC.
The correct Video Size is reported some time (around a few 100 ms) after.
I know this is not a major problem, but still, I'd like to know if this is an intentional behaviour or indeed a bug, as previous ExoPlayer versions (e.g: r1.5.10) did not produce this.

Reproduction steps

Open any HLS, DASH or other videos in the Demo App on a device with Qualcomm 800, running Android 4.2.
I used an LG G2 to verify the issue, but have multiple reports from other devices with the above config.

Link to test content

Any video in the ExoPlayer Demo App.
For example https://tungsten.aaplimg.com/VOD/bipbop_adv_example_v2/master.m3u8

Version of ExoPlayer being used

Confirmed on:

  • r2.2.0
  • r2.4.1
  • r2.4.2
  • dev-v2: a543436

The issue was not present on r1.5.10.

Device(s) and version(s) of Android being used

Android 4.2, 4.2.2
Qualcomm 800 SoC
LG G2, LG G Flex, LG L22, Sony Z1, and others.

A full bug report captured from the device

If a full bug report is needed please let me know.
The relevant events follow:

06-30 16:38:02.973 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: state [0.00, true, I]
06-30 16:38:02.993 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: state [0.02, true, B]
06-30 16:38:04.333 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: sourceInfo [periodCount=1, windowCount=1
06-30 16:38:04.333 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   period [600.00]
06-30 16:38:04.333 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   window [600.00, true, false]
06-30 16:38:04.333 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: ]
06-30 16:38:04.353 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: loading [true]
06-30 16:38:05.823 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: Tracks [
06-30 16:38:05.823 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   Renderer:0 [
06-30 16:38:05.823 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     Group:0, adaptive_supported=YES_NOT_SEAMLESS [
06-30 16:38:05.823 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:0, id=0, mimeType=video/avc, bitrate=2218327, res=960x540, supported=YES
06-30 16:38:05.823 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:1, id=1, mimeType=video/avc, bitrate=8144656, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:2, id=2, mimeType=video/avc, bitrate=6307144, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:3, id=3, mimeType=video/avc, bitrate=4775338, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:4, id=4, mimeType=video/avc, bitrate=3240596, res=1280x720, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:5, id=5, mimeType=video/avc, bitrate=1292926, res=768x432, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:6, id=6, mimeType=video/avc, bitrate=914722, res=640x360, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:7, id=7, mimeType=video/avc, bitrate=541239, res=480x270, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:8, id=8, mimeType=video/avc, bitrate=2439704, res=960x540, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:9, id=9, mimeType=video/avc, bitrate=8366033, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:10, id=10, mimeType=video/avc, bitrate=6528521, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:11, id=11, mimeType=video/avc, bitrate=4996715, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:12, id=12, mimeType=video/avc, bitrate=3461973, res=1280x720, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:13, id=13, mimeType=video/avc, bitrate=1514303, res=768x432, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:14, id=14, mimeType=video/avc, bitrate=1136099, res=640x360, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:15, id=15, mimeType=video/avc, bitrate=762616, res=480x270, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:16, id=16, mimeType=video/avc, bitrate=2247704, res=960x540, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:17, id=17, mimeType=video/avc, bitrate=8174033, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:18, id=18, mimeType=video/avc, bitrate=6336521, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:19, id=19, mimeType=video/avc, bitrate=4804715, res=1920x1080, supported=NO_EXCEEDS_CAPABILITIES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:20, id=20, mimeType=video/avc, bitrate=3269973, res=1280x720, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:21, id=21, mimeType=video/avc, bitrate=1322303, res=768x432, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:22, id=22, mimeType=video/avc, bitrate=944099, res=640x360, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:23, id=23, mimeType=video/avc, bitrate=570616, res=480x270, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     ]
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   ]
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   Renderer:1 [
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     Group:0, adaptive_supported=N/A [
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:0, id=English, mimeType=audio/mp4a-latm, channels=2, sample_rate=48000, language=en, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     ]
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     Group:1, adaptive_supported=N/A [
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:0, id=English, mimeType=audio/ac3, channels=6, sample_rate=48000, language=en, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     ]
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     Group:2, adaptive_supported=N/A [
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:0, id=English, mimeType=audio/eac3, channels=6, sample_rate=48000, language=en, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     ]
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   ]
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   Renderer:2 [
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     Group:0, adaptive_supported=N/A [
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:0, id=1/8219, mimeType=application/cea-608, language=en, supported=YES
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     ]
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     Group:1, adaptive_supported=N/A [
06-30 16:38:05.833 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:0, id=English, mimeType=text/vtt, language=en, supported=YES
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     ]
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   ]
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   Renderer:3 [
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     Group:0, adaptive_supported=N/A [
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [X] Track:0, id=1/21, mimeType=application/id3, supported=YES
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     ]
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     Group:1, adaptive_supported=N/A [
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:       [ ] Track:0, id=1, mimeType=application/id3, supported=YES
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:     ]
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger:   ]
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: ]
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: videoEnabled [2.88]
06-30 16:38:05.843 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: audioEnabled [2.88]
06-30 16:38:05.863 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: audioDecoderInitialized [2.89, OMX.google.aac.decoder]
06-30 16:38:05.863 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: audioFormatChanged [2.89, id=0, mimeType=audio/mp4a-latm, channels=2, sample_rate=48000]
06-30 16:38:05.863 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: audioSessionId [465]
06-30 16:38:06.653 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: videoDecoderInitialized [3.69, OMX.qcom.video.decoder.avc]
06-30 16:38:06.663 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: videoFormatChanged [3.69, id=1/27, mimeType=video/avc, res=960x540]
06-30 16:38:07.203 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: videoSizeChanged [w: -1 x h:-1, unappliedRotationDeg: 0, pixelWHRation: -1.0]
06-30 16:38:07.213 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: renderedFirstFrame [Surface(name=null, identity=646)]
06-30 16:38:08.163 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: state [5.20, true, R]
06-30 16:38:08.183 18988-18988/com.google.android.exoplayer2.demo D/EventLogger: videoSizeChanged [w: 960 x h:540, unappliedRotationDeg: 0, pixelWHRation: 1.0]

@ojw28
Copy link
Contributor

ojw28 commented Jun 30, 2017

Sounds like a bug with the decoder (presumably the OMX.qcom.video.decoder.avc implementation for this SoC). Perhaps the decoder outputs some video buffers before the format, which probably isn't a valid thing to do.

We'll get hold of a device and try and reproduce. It should be pretty easy to provide a workaround (e.g. by just not reporting the size if it hasn't been set yet) if necessary.

@ojw28 ojw28 self-assigned this Jun 30, 2017
@gergely-sallai
Copy link
Author

Yes, I'm doing just that, ignoring any video size updates until it actually makes sense.
I calculate video aspect ratio from the size value, so it can look distorted for a split second.
I decided to report this because r1.5.10 did not have this issue, perhaps in Exoplayer1 MediaCodecRenderer waited for the value to be correct before reporting.

Thanks for looking into this!

ojw28 added a commit that referenced this issue Jul 5, 2017
1. maybeRenotifyVideoSizeChanged should report reported* variables
2. Add check into maybeNotifyVideoSizeChanged to suppress reporting
   in the case that the width and height are still unknown.

Issue: #3007

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160879625
@ojw28
Copy link
Contributor

ojw28 commented Jul 5, 2017

I merged a fix into dev-v2. I wasn't able to reproduce (because I couldn't find a suitable device to test on), so fixed it blind. Please verify if possible.

@ojw28 ojw28 closed this as completed Jul 5, 2017
@gergely-sallai
Copy link
Author

Tested it on an LG G2 (Android 4.2.2, Qualcomm Snapdragon 800), no more negative values reported. Fixed, thanks.

ojw28 added a commit that referenced this issue Jul 19, 2017
1. maybeRenotifyVideoSizeChanged should report reported* variables
2. Add check into maybeNotifyVideoSizeChanged to suppress reporting
   in the case that the width and height are still unknown.

Issue: #3007

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160879625
@google google locked and limited conversation to collaborators Nov 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants