Player gets stuck in the "loading" state after seekToNext/Prev MediaItem
Version
Media3 1.3.1
More version details
Tested on:
- 1.1.0
- 1.3.1
- release-1.4.0-rc01
Devices that reproduce the issue
- Pixel 8 Pro (Android 15) - AP31.240517.022
- Pixel Fold (Android 14) - AP2A.240705.004
- Pixel 7 Pro (Android 14) - AP2A.240705.004
- Pixel 6a (Android 14) - AP2A.240605.024
- I guess, any Android 14+ device with Google Tensor (not sure)
Devices that do not reproduce the issue
- Pixel 4a 5G (Android 14) - UP1A.231105.001.B2
- Pixel 5 (Android 14) - UP1A.231105.001
- Samsung s23 ultra (Android 14)
- Samsung s22 ultra (Android 14)
- Oneplus 7 Pro (Android 13)
Reproducible in the demo app?
Yes
Reproduction steps
I see that the problem only occurs when I switch between two HLS videos with different aspect ratios (from vertical to horizontal)
It is easier to test using the sample app: https://github.com/Stronger197/ExoIssue but you can also reproduce this in "demo-session" app by replacing the source links.
Sample app:
- Open the app
- Click "next" until the 3rd video appears
- Check the media playback notification (infinite loading)
Media3 demo app:
- Insert the provided links into "demo-session app" to play them as playlist (via catalog.json for example)
- Click "next" until the 3rd video appears
- Infinite loading
Expected result
Playlist is playing normally
Actual result
The video gets stuck in the "EventLogger: loading" state. But when I minimize the app, playback resumes as normal.
Videos:
https://github.com/androidx/media/assets/21480083/fda99f9b-4a9d-4fa0-b5ea-73789a9eb75f
https://github.com/androidx/media/assets/21480083/69bd65a6-59b2-4dd8-ad5a-b7ade62b6e93
Logcat:
EventLogger androidx.media3.demo.session D loading [eventTime=15.72, mediaPos=2.10, window=1, period=1, false]
EventLogger androidx.media3.demo.session D positionDiscontinuity [eventTime=17.09, mediaPos=0.00, window=2, reason=SEEK, PositionInfo:old [mediaItem=1, period=1, pos=3470], PositionInfo:new [mediaItem=2, period=2, pos=0]]
EventLogger androidx.media3.demo.session D mediaItem [eventTime=17.10, mediaPos=0.00, window=2, reason=SEEK]
MediaCodec androidx.media3.demo.session D keep callback message for reclaim
CCodecConfig androidx.media3.demo.session I query failed after returning 15 values (BAD_INDEX)
EventLogger androidx.media3.demo.session D tracks [eventTime=17.10, mediaPos=0.00, window=2
EventLogger androidx.media3.demo.session D ]
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 1073743886.
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 1610614798.
EventLogger androidx.media3.demo.session D state [eventTime=17.10, mediaPos=0.00, window=2, BUFFERING]
TrafficStats androidx.media3.demo.session D tagSocket(178) with statsTag=0xffffffff, statsUid=-1
CCodecBuffers androidx.media3.demo.session D [c2.android.aac.decoder#893:1D-Output.Impl[N]] Client returned a buffer it does not own according to our record: 0
CCodecBuffers androidx.media3.demo.session D [c2.android.aac.decoder#893:1D-Output.Impl[N]] Client returned a buffer it does not own according to our record: 1
CCodecBuffers androidx.media3.demo.session D [c2.android.aac.decoder#893:1D-Output.Impl[N]] Client returned a buffer it does not own according to our record: 2
MediaCodec androidx.media3.demo.session D keep callback message for reclaim
EventLogger androidx.media3.demo.session D isPlaying [eventTime=17.10, mediaPos=0.00, window=2, false]
CCodecConfig androidx.media3.demo.session I query failed after returning 20 values (BAD_INDEX)
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 1342179345.
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 2415921170.
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 1610614798.
EventLogger androidx.media3.demo.session D videoDisabled [eventTime=17.13, mediaPos=0.00, window=1, period=1]
EventLogger androidx.media3.demo.session D videoSize [eventTime=17.14, mediaPos=0.00, window=1, period=1, 0, 0]
EventLogger androidx.media3.demo.session D audioDisabled [eventTime=17.14, mediaPos=0.00, window=1, period=1]
EventLogger androidx.media3.demo.session D positionDiscontinuity [eventTime=17.14, mediaPos=0.00, window=2, reason=SEEK_ADJUSTMENT, PositionInfo:old [mediaItem=2, period=2, pos=0], PositionInfo:new [mediaItem=2, period=2, pos=0]]
EventLogger androidx.media3.demo.session D loading [eventTime=17.14, mediaPos=0.00, window=2, period=2, true]
EventLogger androidx.media3.demo.session D audioTrackReleased [eventTime=17.14, mediaPos=0.00, window=2, period=2, 2,12,44100,false,false,56704]
TrafficStats androidx.media3.demo.session D tagSocket(179) with statsTag=0xffffffff, statsUid=-1
EventLogger androidx.media3.demo.session D timeline [eventTime=17.33, mediaPos=0.00, window=2, period=2, periodCount=4, windowCount=4, reason=SOURCE_UPDATE
EventLogger androidx.media3.demo.session D period [39.67]
EventLogger androidx.media3.demo.session D period [5503.12]
EventLogger androidx.media3.demo.session D period [32.83]
EventLogger androidx.media3.demo.session D ...
EventLogger androidx.media3.demo.session D window [39.67, seekable=true, dynamic=false]
EventLogger androidx.media3.demo.session D window [5503.12, seekable=true, dynamic=false]
EventLogger androidx.media3.demo.session D window [32.83, seekable=true, dynamic=false]
EventLogger androidx.media3.demo.session D ...
EventLogger androidx.media3.demo.session D ]
MediaCodec androidx.media3.demo.session D keep callback message for reclaim
CCodecConfig androidx.media3.demo.session I query failed after returning 15 values (BAD_INDEX)
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 1073743886.
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 1610614798.
MediaCodec androidx.media3.demo.session D keep callback message for reclaim
CCodecConfig androidx.media3.demo.session I query failed after returning 20 values (BAD_INDEX)
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 1342179345.
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 2415921170.
Codec2Client androidx.media3.demo.session W query -- param skipped: index = 1610614798.
EventLogger androidx.media3.demo.session D videoEnabled [eventTime=17.39, mediaPos=0.00, window=2, period=2]
EventLogger androidx.media3.demo.session D audioEnabled [eventTime=17.39, mediaPos=0.00, window=2, period=2]
EventLogger androidx.media3.demo.session D tracks [eventTime=17.39, mediaPos=0.00, window=2, period=2
EventLogger androidx.media3.demo.session D group [
EventLogger androidx.media3.demo.session D [X] Track:0, id=0, mimeType=video/avc, container=application/x-mpegURL, bitrate=173000, codecs=avc1.42c01f, res=88x144, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:1, id=1, mimeType=video/avc, container=application/x-mpegURL, bitrate=173000, codecs=avc1.42c01f, res=88x144, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:2, id=2, mimeType=video/avc, container=application/x-mpegURL, bitrate=376000, codecs=avc1.42c01f, res=136x240, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:3, id=3, mimeType=video/avc, container=application/x-mpegURL, bitrate=376000, codecs=avc1.42c01f, res=136x240, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:4, id=4, mimeType=video/avc, container=application/x-mpegURL, bitrate=502000, codecs=avc1.42c01f, res=208x360, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:5, id=5, mimeType=video/avc, container=application/x-mpegURL, bitrate=502000, codecs=avc1.42c01f, res=208x360, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:6, id=6, mimeType=video/avc, container=application/x-mpegURL, bitrate=488000, codecs=avc1.4d401f, res=272x480, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:7, id=7, mimeType=video/avc, container=application/x-mpegURL, bitrate=488000, codecs=avc1.4d401f, res=272x480, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:8, id=8, mimeType=video/avc, container=application/x-mpegURL, bitrate=845000, codecs=avc1.640029, res=408x720, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:9, id=9, mimeType=video/avc, container=application/x-mpegURL, bitrate=845000, codecs=avc1.640029, res=408x720, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:10, id=10, mimeType=video/avc, container=application/x-mpegURL, bitrate=1625000, codecs=avc1.640029, res=608x1080, supported=YES
EventLogger androidx.media3.demo.session D [X] Track:11, id=11, mimeType=video/avc, container=application/x-mpegURL, bitrate=1625000, codecs=avc1.640029, res=608x1080, supported=YES
EventLogger androidx.media3.demo.session D ]
EventLogger androidx.media3.demo.session D group [
EventLogger androidx.media3.demo.session D [X] Track:0, id=0, mimeType=audio/mp4a-latm, container=application/x-mpegURL, codecs=mp4a.40.2, supported=YES
EventLogger androidx.media3.demo.session D ]
EventLogger androidx.media3.demo.session D group [
EventLogger androidx.media3.demo.session D [X] Track:0, id=ID3, mimeType=application/id3, supported=YES
EventLogger androidx.media3.demo.session D ]
EventLogger androidx.media3.demo.session D Metadata [
EventLogger androidx.media3.demo.session D HlsTrackMetadataEntry
EventLogger androidx.media3.demo.session D ]
EventLogger androidx.media3.demo.session D ]
EventLogger androidx.media3.demo.session D downstreamFormat [eventTime=17.47, mediaPos=0.00, window=2, period=2, id=10, mimeType=null, container=application/x-mpegURL, bitrate=1625000, codecs=avc1.640029, mp4a.40.2, res=608x1080]
EventLogger androidx.media3.demo.session D videoInputFormat [eventTime=17.48, mediaPos=0.00, window=2, period=2, id=10, mimeType=video/avc, bitrate=1625000, codecs=avc1.640029, res=608x1080, color=BT601/Limited range/SDR SMPTE 170M/8/8]
EventLogger androidx.media3.demo.session D audioInputFormat [eventTime=17.48, mediaPos=0.00, window=2, period=2, id=1/15, mimeType=audio/mp4a-latm, codecs=mp4a.40.2, channels=2, sample_rate=44100]
CCodecBufferChannel androidx.media3.demo.session D [c2.exynos.h264.decoder#400] Ignoring stale input buffer done callback: last flush index = 102, frameIndex = 102
EventLogger androidx.media3.demo.session D audioTrackInit [eventTime=17.51, mediaPos=0.00, window=2, period=2, 2,12,44100,false,false,56704]
TrafficStats androidx.media3.demo.session D tagSocket(221) with statsTag=0xffffffff, statsUid=-1
BufferPoolAccessor2.0 androidx.media3.demo.session D bufferpool2 0xb40000703df8c698 : 0(0 size) total buffers - 0(0 size) used buffers - 166/174 (recycle/alloc) - 5/162 (fetch/transfer)
BufferPoolAccessor2.0 androidx.media3.demo.session D evictor expired: 1, evicted: 1
EventLogger androidx.media3.demo.session D timeline [eventTime=18.42, mediaPos=0.00, window=2, period=2, periodCount=4, windowCount=4, reason=SOURCE_UPDATE
EventLogger androidx.media3.demo.session D period [39.67]
EventLogger androidx.media3.demo.session D period [5503.12]
EventLogger androidx.media3.demo.session D period [32.83]
EventLogger androidx.media3.demo.session D ...
EventLogger androidx.media3.demo.session D window [39.67, seekable=true, dynamic=false]
EventLogger androidx.media3.demo.session D window [5503.12, seekable=true, dynamic=false]
EventLogger androidx.media3.demo.session D window [32.83, seekable=true, dynamic=false]
EventLogger androidx.media3.demo.session D ...
EventLogger androidx.media3.demo.session D ]
EventLogger androidx.media3.demo.session D loading [eventTime=19.19, mediaPos=0.00, window=2, period=2, false]
Media
I hope this link hasn't expired :) Play one after another as playlist
https://bl.rutube.ru/route/2ff1f14bfebbe5634d278c648cc6de86.m3u8?guids=b90d44fe-f06e-4c7f-a581-c7116d1a473c_608x1080_1519012_D39667_B1314619A192000_F30A44100_avc1.640029_mp4a.40.2,0ce1b425-a61f-40af-8910-963a9b184e93_136x240_361044_D39667_B289700A64200_F30A44100_avc1.42c01f_mp4a.40.2,9617f7f1-55cf-492e-b587-f422553a6522_408x720_940485_D39667_B736087A192000_F30A44100_avc1.640029_mp4a.40.2,88b6838a-9bcb-46f0-b722-4f9b593ffbd7_208x360_501465_D39667_B430120A64200_F30A44100_avc1.42c01f_mp4a.40.2,60f244aa-3163-435b-b8cf-74d35be010f5_816x1440_2249244_D39667_B2044856A192000_F30A44100_avc1.640034_mp4a.40.2,f22360d9-dd6c-4c35-a936-b359c08f96e6_88x144_172858_D39667_B101511A64200_F30A44100_avc1.42c01f_mp4a.40.2,a1f7dca1-eb55-4827-9e2d-2ed3450e1605_272x480_568444_D39667_B431229A128119_F30A44100_avc1.4d401f_mp4a.40.2&sign=vP2Vz8QlYBIODz-wdpuvlQ&expire=2020699397&guarantee=7&scheme=https&minimal_long_temperature=300000
https://bl.rutube.ru/route/c2cf2d92119ccab132ad699458451fce.m3u8?guids=87e6d49e-1696-49bb-a453-47f02e3828b3_256x144_371448_D6765360_B236316A64000_F25A44100_avc1.42c01f_mp4a.40.2,ef7dfe4e-f9b0-40d2-b551-fc11a6aa90a8_432x232_642613_D6765360_B507481A64000_F25A44100_avc1.42c01f_mp4a.40.2,d42dab1b-3865-4519-9417-f878d196f742_640x360_1084340_D6765360_B949208A64000_F25A44100_avc1.42c01f_mp4a.40.2,548fa999-fce5-4c71-a37b-ca533f36b05b_856x480_1232930_D6765360_B968230A128000_F25A44100_avc1.4d401f_mp4a.40.2,519407aa-7bf6-490b-aa2f-d70c242466f5_1280x720_2070581_D6765360_B1677879A192000_F25A44100_avc1.640029_mp4a.40.2,14da8ad5-f497-42e9-9ab4-5b8c873e53e8_1920x1080_3890152_D6765360_B3497450A192000_F25A44100_avc1.640029_mp4a.40.2&sign=rq6XzKCy5PYfIyXf_9_8tA&expire=2020699377&guarantee=6&scheme=https&minimal_long_temperature=300000
https://bl.rutube.ru/route/192d0fe316aa7a2ab770ce578f5a7540.m3u8?guids=ddc15d68-e53e-48f9-bae6-e031da021cc2_256x144_568311_D5503120_B433178A64000_F25A44100_avc1.42c01f_mp4a.40.2,00192241-2eda-422b-b84d-3438cb624c72_432x232_1045583_D5503120_B910450A64000_F25A44100_avc1.42c01f_mp4a.40.2,62c27499-607b-48d2-9689-feb56c82e354_640x360_1776586_D5503120_B1641453A64000_F25A44100_avc1.42c01f_mp4a.40.2,6b0e22b1-7b74-4332-95a4-1bf526f5f902_1920x1080_5616400_D5503120_B5223696A192000_F25A44100_avc1.640029_mp4a.40.2,9963f111-6b1a-4fb5-86ae-2b715b9a6a08_856x480_1862389_D5503120_B1597687A128000_F25A44100_avc1.4d401f_mp4a.40.2,57d0d863-19e5-4db1-bc75-8b85da6a4741_1280x720_3024962_D5503120_B2632259A192000_F25A44100_avc1.640029_mp4a.40.2&sign=hEvSYkYZIJPQaUvRW3XFDA&expire=2020699353&guarantee=6&scheme=https&minimal_long_temperature=300000
https://bl.rutube.ru/route/4c9da41e277d036cb6bffc17a01ed1d9.m3u8?guids=058d4f53-8f85-4ffe-8857-16ea89398fca_272x480_488270_D33025_B385337A96000_F30A44100_avc1.4d401f_mp4a.40.2,47efff58-a2ff-458d-a339-9e4f0b0af650_88x144_173302_D33025_B102546A64155_F30A44100_avc1.42c01f_mp4a.40.2,461c6f6f-d208-45c2-b598-8ec62f2f5cbe_208x360_502295_D33025_B433457A64155_F30A44100_avc1.42c01f_mp4a.40.2,6e745cc6-105b-4219-886f-bcebf012870b_408x720_845200_D33025_B744348A96000_F30A44100_avc1.640029_mp4a.40.2,a7f732b6-9422-40fd-9789-1e1fd5e55f87_608x1080_1625210_D33025_B1528911A96000_F30A44100_avc1.640029_mp4a.40.2,dbf26a41-ec66-4f6b-a54f-a2bfc4c01d0a_136x240_376925_D33025_B307357A64155_F30A44100_avc1.42c01f_mp4a.40.2&sign=cqHoZkCOPkFCmkua5GP6eg&expire=2020699329&guarantee=6&scheme=https&minimal_long_temperature=300000
Bug Report
- [X] You will email the zip file produced by
adb bugreportto [email protected] after filing this issue.
Hi @Stronger197,
I tried reproducing this issue in the demo-session app by adding the above provided urls to catalog.json file but was unable to reproduce the issue.
Can you also clarify what do you mean by infinite loading in the notification?
I was able to click next and play all the 4 videos fine using the links above. Please the screen recording attached.
https://github.com/user-attachments/assets/4158120b-c979-4743-a283-a411b870121d
Please feel free to provide extra information to replicate this issue and I would be happy to assist.
Hi @rohitjoins,
Can you also clarify what do you mean by infinite loading in the notification?
Player just gets stuck in the "loading" state and doesn't play content (but the buffering progress is shown on the timebar). Please check the logs (especially the time) that I have listed below.
LOADING --> 2024-07-13 21:55:06.397 31811-31811 EventLogger androidx.media3.demo.session D loading [eventTime=63.63, mediaPos=0.00, window=3, period=3, false]
2024-07-13 21:55:07.215 31811-31930 BufferPoolAccessor2.0 androidx.media3.demo.session D bufferpool2 0xb40000798b398368 : 0(0 size) total buffers - 0(0 size) used buffers - 89/97 (recycle/alloc) - 5/85 (fetch/transfer)
2024-07-13 21:55:07.215 31811-31930 BufferPoolAccessor2.0 androidx.media3.demo.session D evictor expired: 1, evicted: 1
2024-07-13 21:55:10.216 31811-31930 BufferPoolAccessor2.0 androidx.media3.demo.session D bufferpool2 0xb40000798b369d18 : 5(40960 size) total buffers - 0(0 size) used buffers - 837/860 (recycle/alloc) - 34/784 (fetch/transfer)
2024-07-13 21:55:10.216 31811-31930 BufferPoolAccessor2.0 androidx.media3.demo.session D evictor expired: 1, evicted: 1
2024-07-13 21:55:11.216 31811-31930 BufferPoolAccessor2.0 androidx.media3.demo.session D bufferpool2 0xb40000798b3a8d58 : 8(58720256 size) total buffers - 0(0 size) used buffers - 116/124 (recycle/alloc) - 5/115 (fetch/transfer)
2024-07-13 21:55:11.216 31811-31930 BufferPoolAccessor2.0 androidx.media3.demo.session D evictor expired: 1, evicted: 1
STILL NO RESPONSE --> 2024-07-13 21:55:47.483 31811-31811 EventLogger androidx.media3.demo.session D playWhenReady [eventTime=104.72, mediaPos=0.00, window=3, period=3, false, USER_REQUEST]
STILL NO RESPONSE --> 2024-07-13 21:55:48.155 31811-31811 EventLogger androidx.media3.demo.session D playWhenReady [eventTime=105.39, mediaPos=0.00, window=3, period=3, true, USER_REQUEST]
STILL NO RESPONSE --> 2024-07-13 21:55:54.035 31811-31811 EventLogger androidx.media3.demo.session D playWhenReady [eventTime=111.27, mediaPos=0.00, window=3, period=3, false, USER_REQUEST]
STILL NO RESPONSE --> 2024-07-13 21:55:55.917 31811-31811 EventLogger androidx.media3.demo.session D playWhenReady [eventTime=113.15, mediaPos=0.00, window=3, period=3, true, USER_REQUEST]
Also please see the attached screen recording
https://github.com/user-attachments/assets/1adf5fee-4f1a-4421-86f5-a6c14a757a6e
Pixel Fold (Android 14) AP2A.240705.004
Debug apk: demo-session-debug.zip
Can you please tell me device model, OS version, build number you tested on? Because I think this might be a device/OS specific issue. We reproduced it on 4 different pixels, but can't reproduce on Pixel 4a (5G) Android 14 (UP1A.231105.001.B2) for example.
Please let me know what other information can I provide that might be helpful to you?
I've also updated the original comment:
- Added build number for some phones.
- Added Pixel 4a 5g into the "Devices that do not reproduce the problem" section.
Pixel 6 pro Android 14 BuildNumber AP2A.240605.024
Same
Hi @rohitjoins,
A small update, maybe it will be useful: I took the pixel 6 pro and flashed a lot of factory images. So, the problem occurs when I switched from Android 13 (latest release) to Android 14 (first release)
Pixel 6 Pro TQ3A.230901.001 (Latest Android 13 release) and below Not reproducible
https://github.com/user-attachments/assets/19049799-8a48-426c-bdec-97b5f9790d72
Pixel 6 Pro UP1A.231005.007 (First Android 14 release) and above Reproducible
https://github.com/user-attachments/assets/70f8778f-0ef8-41fb-8bd2-8143fa473256
Hi @Stronger197,
I was actually testing this on Pixel 4A, which doesn't seem to have the issue. I'll try reproducing this with other devices and will update here. Thank you for providing detailed information.
I tried to replicate this. I switched my pixel from a qpr2 android 13 to qpr2 android 14 and I couldn't reproduce the same.
Hi @rohitjoins
Do you have any updates?
Hi!
@marcbaechinger @tonihei maybe one of you can help me, if you have Pixel with Tensor chip? 🥹
Thanks!
Hi @Stronger197,
I haven't got around looking at this issue again. Will try to look into it and do a root cause analysis.
@rohitjoins I can reproduce this with any Pixel which has a Tensor SoC and Android 14. Could it be that this is also a h264 driver issue like in #997?
Would be nice to get it prioritized. Pixel 6 and later generations make up a large proportion of the devices used on my client's platform.
Hi @rohitjoins, Maybe you have any updates?
@rohitjoins I can also reproduce this on my Pixel 7 Pro and Pixel 8 Pro. Do you have any updates?