androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.72k stars 413 forks source link

ExoPlayer's decoder failed, causing the phone to freeze. #1873

Closed holopekochan closed 1 day ago

holopekochan commented 1 week ago

My phone oftenly get freezing when watching video or GIFs. After doing a logcat, it turns out there is a problem from ExoPlayer with OMXNodeInstance inside qcom.decoder.avc. Is it possible to tell what causes the issue with this from the error below? I’d appreciate any suggestions on how to fix this issue.

I tried to search for code -62, but it seems like an unknown code. I cannot find anything useful in Exoplayer repo issues.

Phone Model: Razor Phone 2 Phone CPU: Qualcomm SDM845 Snapdragon 845 Phone OS: LineageOS 21 (Android 14) Display: IPS LCD, 120Hz Resolution:1440 x 2560 pixels

I also suspect the issue with the codec configuration for video/avc, but I cannot figure out if it is problem with EXOPlayer, the codec configuration or hardware issue.

These few lines causes the problem

11-09 19:43:03.807  1422 12879 E OMXNodeInstance: fillBuffer::storeFenceInMeta(0xea0e0034:qcom.decoder.avc, 0x48 [8@0xed547830 fc=23]) ERROR: ??(0xffffffc2)
11-09 19:43:03.807  1422 12879 W android.hardware.media.omx@1.0-service: Unrecognized status value: -62
11-09 19:43:03.820 10840 11371 E MediaCodecVideoRenderer: Video codec error
11-09 19:43:03.820 10840 11371 E MediaCodecVideoRenderer:   android.media.MediaCodec$CodecException: Error 0xffffffc2
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal: Playback error
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:   com.google.android.exoplayer2.j: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.640015, -1, null, [498, 276, 10.0, null], [-1, -1]), format_supported=YES

log

11-09 19:43:00.183  3828  5156 I Forest_TTNetDepender: [KeyInfo:fetchResource] msg = result of cache: true 
11-09 19:43:00.184  3828  5156 I Forest_TTNetDepender: [KeyInfo:fetchResource] msg = result of cache: true 
11-09 19:43:00.193  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:00.193  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:00.194  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:00.194  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:00.194 10840 11371 D MediaCodec: keep callback message for reclaim
11-09 19:43:00.197 10840 11381 D SurfaceUtils: connecting to surface 0x70da213ae0, reason connectToSurface
11-09 19:43:00.197 10840 11381 I MediaCodec: [OMX.qcom.video.decoder.avc] setting surface generation to 11100199
11-09 19:43:00.197 10840 11381 D SurfaceUtils: disconnecting from surface 0x70da213ae0, reason connectToSurface(reconnect)
11-09 19:43:00.197 10840 11381 D SurfaceUtils: connecting to surface 0x70da213ad0, reason connectToSurface(reconnect-with-listener)
11-09 19:43:00.201  1422 12879 E OMX-VDEC-1080P: Extension: OMX.google.android.index.AndroidNativeBufferConsumerUsage not implemented
11-09 19:43:00.202 10840 11382 D SurfaceUtils: set up nativeWindow 0x70da213ae0 for 512x368, color 0x7fa30c06, rotation 0, usage 0x20402900
11-09 19:43:00.202 10840 11381 D SurfaceUtils: disconnecting from surface 0x70da222950, reason disconnectFromSurface
11-09 19:43:00.202 10840 11381 E Surface : freeAllBuffers: 10 buffers were freed while being dequeued!
11-09 19:43:00.221 10840 11371 D MediaCodec: keep callback message for reclaim
11-09 19:43:00.226  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:00.226  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:00.229  1422 12879 E OMX-VDEC-1080P: Does not handle dataspace request
11-09 19:43:00.229  1422 12879 E OMXNodeInstance: getConfig(0xea0e0034:qcom.decoder.avc, ??(0x7f000062)) ERROR: UnsupportedSetting(0x80001019)
11-09 19:43:00.232  3485  6204 I DPMJ    : |REQ:RCVR| DPM creating socket
11-09 19:43:00.234  1422 11399 E OMX-VDEC-1080P: Extension: OMX.google.android.index.AndroidNativeBufferConsumerUsage not implemented
11-09 19:43:00.235 10840 11382 D SurfaceUtils: set up nativeWindow 0x70da213ae0 for 512x288, color 0x7fa30c06, rotation 0, usage 0x20402900
11-09 19:43:00.244  1422 12879 E OMX-VDEC-1080P: Does not handle dataspace request
11-09 19:43:00.244  1422 12879 E OMXNodeInstance: getConfig(0xea0e0034:qcom.decoder.avc, ??(0x7f000062)) ERROR: UnsupportedSetting(0x80001019)
11-09 19:43:00.263  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:00.263  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:00.617  1607 12290 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:00.625  1607 12290 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:00.695  1607 12290 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:00.695  1607 12290 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:00.696  1607 12290 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:00.696  1607 12290 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:00.726  1607 12290 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:00.733  1607 12290 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:00.775     0     0 I CPU7    : update max cpu_capacity 764
11-09 19:43:00.886  1607 12290 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:01.290  1607  1646 W ActivityManager: Stopping service due to app idle: u0a214 -1m20s260ms com.instagram.android/com.facebook.rti.push.service.FbnsService
11-09 19:43:01.292  1607  1646 D OomAdjuster: Not killing cached processes
11-09 19:43:01.402  1607  3947 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:01.461  1607  3947 D CompatibilityChangeReporter: Compat change id reported: 161145287; UID 10214; state: ENABLED
11-09 19:43:01.528  1607  1985 D CompatibilityChangeReporter: Compat change id reported: 265195908; UID 10214; state: ENABLED
11-09 19:43:01.529  1607 12290 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:01.806 10840 12761 D SurfaceUtils: connecting to surface 0x70da20b2a0, reason connectToSurface
11-09 19:43:01.806 10840 12761 I MediaCodec: [OMX.qcom.video.decoder.avc] setting surface generation to 11100200
11-09 19:43:01.806 10840 12761 D SurfaceUtils: disconnecting from surface 0x70da20b2a0, reason connectToSurface(reconnect)
11-09 19:43:01.806 10840 12761 D SurfaceUtils: connecting to surface 0x70da20b290, reason connectToSurface(reconnect-with-listener)
11-09 19:43:01.807  1422  1486 E OMX-VDEC-1080P: Extension: OMX.google.android.index.AndroidNativeBufferConsumerUsage not implemented
11-09 19:43:01.807 10840 12762 D SurfaceUtils: set up nativeWindow 0x70da20b2a0 for 256x288, color 0x7fa30c06, rotation 0, usage 0x20402900
11-09 19:43:01.807 10840 12761 D SurfaceUtils: disconnecting from surface 0x70da1f8010, reason disconnectFromSurface
11-09 19:43:01.807 10840 12761 E Surface : freeAllBuffers: 10 buffers were freed while being dequeued!
11-09 19:43:01.814 10840 12476 D MediaCodec: keep callback message for reclaim
11-09 19:43:01.833  1607 12290 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:01.833  1607 12290 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:01.833  1607 12290 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:01.833  1607 12290 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:01.836 10840 12476 D MediaCodec: keep callback message for reclaim
11-09 19:43:01.841  1607 12290 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:01.841  1607 12290 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:01.842  1607 12290 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:01.842  1607 12290 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:01.843  1607 12290 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:01.843  1607 12290 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:01.929     0     0 W         : IRQ6 no longer affine to CPU4
11-09 19:43:02.047  1348  1444 I ThermalEngine: ACTION: CPU - Setting CPU[4] to 7
11-09 19:43:02.404  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:02.404  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:02.406  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:02.406  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:02.610 10840 12476 D MediaCodec: keep callback message for reclaim
11-09 19:43:02.612  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:02.612  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:02.613  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:02.613  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:02.614 10840 12761 D SurfaceUtils: connecting to surface 0x70da2118d0, reason connectToSurface
11-09 19:43:02.614 10840 12761 I MediaCodec: [OMX.qcom.video.decoder.avc] setting surface generation to 11100201
11-09 19:43:02.614 10840 12761 D SurfaceUtils: disconnecting from surface 0x70da2118d0, reason connectToSurface(reconnect)
11-09 19:43:02.614 10840 12761 D SurfaceUtils: connecting to surface 0x70da2118c0, reason connectToSurface(reconnect-with-listener)
11-09 19:43:02.617  1422  1486 E OMX-VDEC-1080P: Extension: OMX.google.android.index.AndroidNativeBufferConsumerUsage not implemented
11-09 19:43:02.617 10840 12762 D SurfaceUtils: set up nativeWindow 0x70da2118d0 for 256x288, color 0x7fa30c06, rotation 0, usage 0x20402900
11-09 19:43:02.617 10840 12761 D SurfaceUtils: disconnecting from surface 0x70da20b2a0, reason disconnectFromSurface
11-09 19:43:02.618 10840 12761 E Surface : freeAllBuffers: 10 buffers were freed while being dequeued!
11-09 19:43:02.651 10840 12476 D MediaCodec: keep callback message for reclaim
11-09 19:43:02.662  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:02.662  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:02.665  1422  1486 E OMX-VDEC-1080P: Does not handle dataspace request
11-09 19:43:02.665  1422  1486 E OMXNodeInstance: getConfig(0xe9be0034:qcom.decoder.avc, ??(0x7f000062)) ERROR: UnsupportedSetting(0x80001019)
11-09 19:43:02.670  1422 12879 E OMX-VDEC-1080P: Extension: OMX.google.android.index.AndroidNativeBufferConsumerUsage not implemented
11-09 19:43:02.671 10840 12762 D SurfaceUtils: set up nativeWindow 0x70da2118d0 for 640x352, color 0x7fa30c06, rotation 0, usage 0x20402900
11-09 19:43:02.684  1422  1486 E OMX-VDEC-1080P: Does not handle dataspace request
11-09 19:43:02.685  1422  1486 E OMXNodeInstance: getConfig(0xe9be0034:qcom.decoder.avc, ??(0x7f000062)) ERROR: UnsupportedSetting(0x80001019)
11-09 19:43:02.694  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:02.694  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:02.722     0     0 E         : [drm:_sde_encoder_phys_cmd_wait_for_ctl_start:1274] [sde error]enc25 intf1 ctl start interrupt wait failed
11-09 19:43:02.722     0     0 E         : [drm:sde_kms_wait_for_commit_done:1125] [sde error]wait for commit done returned -110
11-09 19:43:02.762     0     0 E         : charging_check_work
11-09 19:43:02.839  1094  1164 I SDM     : HWEventsDRM::HandlePanelDead: Received panel dead event
11-09 19:43:03.178  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:03.178  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:03.179  1607  3947 D MediaMetricsManagerService: failed to get player_metrics_app_blocklist from DeviceConfig
11-09 19:43:03.180  1607  3947 V MediaMetricsManagerService: Logging level blocked: Failed to get PLAYER_METRICS_APP_BLOCKLIST.
11-09 19:43:03.240  1607  3947 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:03.237     0     0 I CPU5    : update max cpu_capacity 792
11-09 19:43:03.394  1607  3947 D FileUtils: Rounded bytes from 8043532288 to 16000000000
11-09 19:43:03.648  1607  3947 D ConnectivityService: Returning BLOCKED NetworkInfo to uid=10273
11-09 19:43:03.664   959 13454 I resolv  : GetAddrInfoHandler::run: {102 102 102 983142 10273 0}
11-09 19:43:03.664   959 13454 I resolv  : GetAddrInfoHandler::run: network access blocked
11-09 19:43:03.807  1422 12879 E OMXNodeInstance: fillBuffer::storeFenceInMeta(0xea0e0034:qcom.decoder.avc, 0x48 [8@0xed547830 fc=23]) ERROR: ??(0xffffffc2)
11-09 19:43:03.807  1422 12879 W android.hardware.media.omx@1.0-service: Unrecognized status value: -62
11-09 19:43:03.808 10840 11382 W com.discord: Unrecognized status value: -62
11-09 19:43:03.808 10840 11382 E ACodec  : signalError(omxError 0x80001001, internalError -62)
11-09 19:43:03.810 10840 11382 W ACodec  : not dequeuing from native window due to fatal error
11-09 19:43:03.811 10840 11382 W ACodec  : not dequeuing from native window due to fatal error
11-09 19:43:03.811 10840 11382 W ACodec  : not dequeuing from native window due to fatal error
11-09 19:43:03.812 10840 11382 W ACodec  : not dequeuing from native window due to fatal error
11-09 19:43:03.812 10840 11382 W ACodec  : not dequeuing from native window due to fatal error
11-09 19:43:03.812 10840 11381 E MediaCodec: Codec reported err 0xffffffc2/-62 (Timer expired), actionCode 0, while in state 6/STARTED
11-09 19:43:03.812 10840 11382 W ACodec  : not dequeuing from native window due to fatal error
11-09 19:43:03.813 10840 11381 D SurfaceUtils: disconnecting from surface 0x70da213ae0, reason disconnectFromSurface
11-09 19:43:03.813 10840 11381 E Surface : freeAllBuffers: 4 buffers were freed while being dequeued!
11-09 19:43:03.820 10840 11371 E MediaCodecVideoRenderer: Video codec error
11-09 19:43:03.820 10840 11371 E MediaCodecVideoRenderer:   android.media.MediaCodec$CodecException: Error 0xffffffc2
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal: Playback error
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:   com.google.android.exoplayer2.j: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.640015, -1, null, [498, 276, 10.0, null], [-1, -1]), format_supported=YES
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.t0.handleMessage(SourceFile:380)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:103)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at android.os.Looper.loopOnce(Looper.java:232)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:317)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:85)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:   Caused by: r9.g: Decoder failed: OMX.qcom.video.decoder.avc
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at r9.i.o0(SourceFile:5)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at i8.u.y(SourceFile:155)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at r9.i.y(SourceFile:1)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.t0.q(SourceFile:97)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       at com.google.android.exoplayer2.t0.handleMessage(SourceFile:249)
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:       ... 4 more
11-09 19:43:03.824 10840 11371 E ExoPlayerImplInternal:   Caused by: android.media.MediaCodec$CodecException: Error 0xffffffc2

media_codec.xml

    <Decoders>
       <!-- Video Hardware  -->
        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
            <Quirk name="requires-allocate-on-input-ports" />
            <Quirk name="requires-allocate-on-output-ports" />
            <Limit name="size" min="96x96" max="4096x2304" />
            <Limit name="alignment" value="2x2" />
            <Limit name="block-size" value="16x16" />
            <Limit name="blocks-per-second" min="24" max="2073600" />
            <Limit name="bitrate" range="1-120000000" />
            <Limit name="frame-rate" range="1-480" />
            <Feature name="adaptive-playback" />
            <Limit name="concurrent-instances" max="16" />
            <Limit name="performance-point-4096x2304" value="30" />
            <Limit name="performance-point-4096x2160" value="60" />
            <Limit name="performance-point-3840x2160" value="60" />
            <Limit name="performance-point-1920x1088" value="240" />
            <Limit name="performance-point-1280x720" value="480" />
        </MediaCodec>
        ....

media_code_performance.xml

 <Decoders>
        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="101-221" />
            <Limit name="measured-frame-rate-720x480" range="98-217" />
            <Limit name="measured-frame-rate-1280x720" range="98-216" />
            <Limit name="measured-frame-rate-1920x1088" range="76-167" />
        </MediaCodec>
icbaker commented 1 day ago

This sounds like an issue with your device (and/or its OS), rather than the media3 support library.

Android phones (and all subsequent official builds) have to pass CTS tests to ensure the APIs they expose behave as expected - this includes behaviour like video decoding.

I believe LineageOS is not an offical build for your device, so it seems relatively likely that your device + OS combination has not passed CTS - so it seems quite plausible that some functionality like video decoding might be broken (or have edge cases where it doesn't work as expected, as you're seeing).

I'm going to close this issue, because I'm afraid supporting OS + device combos that haven't passed CTS is beyond the scope of this support library - I suggest reporting the issue to LineageOS instead.