google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Sony Bravia: Lagging playback of mpeg-ts/mpeg2/mp2 #1353

Closed stari4ek closed 8 years ago

stari4ek commented 8 years ago

Video playback is bumpy (audio plays well). This video works well on NVidia Shield.

I have many reports about problems with mpeg2 playback on Sony. Sadly I can not reproduce it locally, cause I don't have proper hardware. I know that android doesn't support mpeg2/mp2 out of the box, but there are bundled decoders. On the other hand ExoPlayer has some "dancing" for MTK.* already

Some logging from Demo app:

D MediaCodec: OMX.MTK.VIDEO.DECODER.MPEG2 needRmClient (289) D MediaCodec: OMX.MTK.VIDEO.DECODER.MPEG2 needVdpImgrz (295) I OMXClient: Using client-side OMX mux. D MediaCodec: set mOutputPath = 0 E binder.hwcomposer: [enable_vdp:59][channel=0 ,enable=1] E ACodec : [OMX.MTK.VIDEO.DECODER.MPEG2] storeMetaDataInBuffers failed w/ err -1010 D EventLogger: decoderInitialized [0.61, OMX.MTK.VIDEO.DECODER.MPEG2] I OMXClient: Using client-side OMX mux. D MediaCodec: set mOutputPath = 1024 L(1531) D EventLogger: decoderInitialized [0.63, OMX.MTK.AUDIO.DECODER.DSPMP1] D EventLogger: videoSizeChanged [720, 576, 0, 1.0666667]

Video frame is updated each 5-10 sec, audio plays well.

In my app I see buffering happening all the time (it happens only for specific streams on same network with same live channels provider, so, I'd expect it's not related to network):

DEBUG MediaCodecSelectorWatcher: Decoder for [video/mpeg2] selected: OMX.MTK.VIDEO.DECODER.MPEG2 DEBUG EventLogger: state [1.12, true, B] DEBUG EventLogger: bandwidth [1.12, 514556, 0.82, 4989633] DEBUG EventLogger: decoderInitialized [1.29, OMX.MTK.VIDEO.DECODER.MPEG2] yerImplInternal:Handler] DEBUG MediaCodecSelectorWatcher: Decoder for [audio/mpeg-L2] selected: OMX.MTK.AUDIO.DECODER.DSPMP1 DEBUG EventLogger: decoderInitialized [1.33, OMX.MTK.AUDIO.DECODER.DSPMP1] DEBUG EventLogger: videoSizeChanged [720, 576, 0, 1.0666667] DEBUG DemoPlayerController: First frame drawn to surface DEBUG EventLogger: state [6.16, true, R] DEBUG EventLogger: state [7.84, true, B] DEBUG EventLogger: state [12.85, true, R] DEBUG EventLogger: state [18.74, true, B] DEBUG EventLogger: state [18.96, true, R] DEBUG EventLogger: state [19.00, true, B] DEBUG EventLogger: state [19.03, true, R] DEBUG EventLogger: state [19.05, true, B] DEBUG EventLogger: state [19.06, true, R] DEBUG EventLogger: state [19.07, true, B] DEBUG EventLogger: state [19.12, true, R] DEBUG EventLogger: state [19.13, true, B] DEBUG EventLogger: state [19.19, true, R] DEBUG EventLogger: state [19.20, true, B] DEBUG EventLogger: state [19.23, true, R] DEBUG EventLogger: state [19.23, true, B]

Codecs dump:

Supported codecs: OMX.google.mp3.decoder [audio/mpeg] OMX.google.amrnb.decoder [audio/3gpp] OMX.google.amrwb.decoder [audio/amr-wb] OMX.google.aac.decoder [audio/mp4a-latm] OMX.google.g711.alaw.decoder [] OMX.google.g711.mlaw.decoder [] OMX.google.vorbis.decoder [audio/vorbis] OMX.google.opus.decoder [audio/opus] OMX.google.raw.decoder [audio/raw] OMX.google.aac.encoder [audio/mp4a-latm] OMX.google.amrnb.encoder [audio/3gpp] OMX.google.amrwb.encoder [audio/amr-wb] OMX.google.flac.encoder [] OMX.MTK.AUDIO.DECODER.DSPMP3 [audio/mpeg] OMX.MTK.AUDIO.DECODER.DSPAC3 [audio/ac3, audio/eac3] OMX.MTK.AUDIO.DECODER.DSPAAC [audio/mp4a-latm] OMX.MTK.AUDIO.DECODER.DSPWMA [] OMX.MTK.AUDIO.DECODER.DSPDTS [] OMX.MTK.AUDIO.DECODER.DSPVORBIS [audio/vorbis] OMX.MTK.AUDIO.DECODER.DSPAMRNB [audio/3gpp] OMX.MTK.AUDIO.DECODER.DSPAMRWB [audio/amr-wb] OMX.MTK.AUDIO.DECODER.DSPLPCM [] OMX.MTK.AUDIO.DECODER.DSPMP1 [audio/mpeg-L1, audio/mpeg-L2] OMX.MTK.VIDEO.DECODER.AVC [video/avc] OMX.MTK.VIDEO.DECODER.MPEG2 [video/mpeg2] OMX.MTK.VIDEO.DECODER.MPEG4 [video/mp4v-es] OMX.MTK.VIDEO.DECODER.H263 [video/3gpp] OMX.MTK.VIDEO.DECODER.VP8 [video/x-vnd.on2.vp8] OMX.MTK.VIDEO.DECODER.VC1 [] OMX.MTK.VIDEO.DECODER.VP6 [] OMX.MTK.VIDEO.DECODER.MJPEG [] OMX.MTK.VIDEO.DECODER.HEVC [video/hevc] OMX.MTK.VIDEO.ENCODER.AVC [video/avc] OMX.google.mpeg4.decoder [video/mp4v-es] OMX.google.h263.decoder [video/3gpp] OMX.google.h264.decoder [video/avc] OMX.google.hevc.decoder [video/hevc] OMX.google.vp8.decoder [video/x-vnd.on2.vp8] OMX.google.vp9.decoder [video/x-vnd.on2.vp9] OMX.google.h263.encoder [video/3gpp] OMX.google.h264.encoder [video/avc] OMX.google.mpeg4.encoder [video/mp4v-es] OMX.google.vp8.encoder [video/x-vnd.on2.vp8] Unsupported mimes: video/mp4, video/webm, audio/mp4, audio/webm, audio/true-hd, audio/vnd.dts, audio/vnd.dts.hd, audio/vnd.dts.hd;profile=lbr

ojw28 commented 8 years ago

This looks identical to https://github.com/google/ExoPlayer/issues/1295, which was fixed in ExoPlayer version 1.5.7. The log shows you're using 1.5.6, so I suspect that updating to 1.5.7 or later will resolve this issue for you :).

stari4ek commented 8 years ago

Hi, @ojw28

1295 doesn't fix this issue. It's not related to the stream. All mpeg-2 streams have this issue on Sony, whereis same streams work well on NVidia Shield.

Checked with demo based on 764dc2b86f37b036dd40c3b7bbe46982e7b29e13

Here are links:

I'm trying to get demo's logcat from Sony TV having this issue. I'm waiting for beta testers to send it me back, so I can add it here later.

Should I create new issue or You can re-open this one?

stari4ek commented 8 years ago

According to user's feedback:

05-26 13:49:03.975 19863 19863 I ExoPlayerImpl: Init 1.5.8
05-26 13:49:03.975 19863 19863 D EventLogger: start [0]
05-26 13:49:03.975 19863 19863 D EventLogger: state [0.00, false, P]
05-26 13:49:03.975 19863 19863 D EventLogger: state [0.00, true, P]
05-26 13:49:04.035 19863 23076 W TsExtractor: Unexpected start indicator: expected 368 more bytes
05-26 13:49:04.035 19863 20678 D mali_winsys: new_window_surface returns 0x3000
05-26 13:49:04.050 19863 23077 I OMXClient: Using client-side OMX mux.
05-26 13:49:04.065 19863 23077 D MediaCodec: set mOutputPath = 1024 L(1531)
05-26 13:49:04.130 19863 23075 D MediaCodec: OMX.MTK.VIDEO.DECODER.MPEG2 needRmClient (289)
05-26 13:49:04.130 19863 23075 D MediaCodec: OMX.MTK.VIDEO.DECODER.MPEG2 needVdpImgrz (295)
05-26 13:49:04.135 19863 23083 I OMXClient: Using client-side OMX mux.
05-26 13:49:04.170 19863 23082 D MediaCodec: set mOutputPath = 0
05-26 13:49:04.175 19863 23083 E binder.hwcomposer: [enable_vdp:59][channel=0 ,enable=1] 
05-26 13:49:04.175 19863 23083 E ACodec  : [OMX.MTK.VIDEO.DECODER.MPEG2] storeMetaDataInBuffers failed w/ err -1010
05-26 13:49:05.660 19863 19863 D EventLogger: state [1.69, true, B]
05-26 13:49:05.730 19863 19863 D EventLogger: decoderInitialized [1.75, OMX.MTK.AUDIO.DECODER.DSPMP1]
05-26 13:49:05.730 19863 19863 D EventLogger: state [1.75, true, R]
05-26 13:49:05.730 19863 19863 I Choreographer: Skipped 95 frames!  The application may be doing too much work on its main thread.
05-26 13:49:05.815 19863 19863 D EventLogger: decoderInitialized [1.84, OMX.MTK.VIDEO.DECODER.MPEG2]
05-26 13:49:05.815 19863 19863 D EventLogger: state [1.84, true, B]
05-26 13:49:05.815 19863 19863 D EventLogger: videoSizeChanged [720, 576, 0, 1.0666667]
05-26 13:49:05.815 19863 19863 D EventLogger: state [1.84, true, R]
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.355 19863 23082 E gralloc : unregister FBM buffer
05-26 13:49:31.485 19863 19863 D EventLogger: end [27.51]
stari4ek commented 8 years ago

This issue is confirmed by Manuel Paunet in discussion: https://plus.google.com/109022642737958378223/posts/gi8VzhWGXbA Should be fixed with 6.0 OTA for Sony TV