AAC decoder error
We are encountering AAC decoder error with our live streams. This causes the video playback to freeze at the position where error is encountered.
We are using the same URLs that were mentioned in issue #295 (via mail to olly.exoplayer [at] gmail.com). I saw a similar issue #210. The ticket has been closed there since URLs were not provided.
Do you see this across all of your test streams, or only some of them? If so, which? How long does it take to fail? I haven't been able to reproduce so far, although I do think I saw this a few times last week with your streams (not with any others).
FYI, this message indicates that bad data is being fed into the AAC decoder, although doesn't tell us whether that's because your stream is fundamentally bad, or because ExoPlayer is doing something wrong when it pulls the AAC samples out:
W/SoftAAC2(6459): AAC decoder returned error 16388, substituting silence
This message is usually just a follow-on from the AAC decoder error, although note a single occurrence of this message may be expected each time the player switches from one quality stream to another:
E/AudioTrack(6459): Discontinuity detected [expected 18586666, got 18885333]
p.s. It would really help if you had a test stream that runs 24/7. Only being able to debug at certain times of day is a pretty awkward.
I'm sorry i'm unable to give full time active link right now. I will request my team for this.
Today I encountered them on Stream 2, 5 and 9 from that list of streams. Usually It takes a minute or two to fail but sometimes it takes longer. And when it fails I get multiple occurances of the AAC decoder error. The log is same as mentioned in issue #210. This error does not make a call to DemoPlayer.Listener.onError callback
Also sometimes i get following errors when the playback stops. Maybe they are related to decoder error. I do get call to onError for following error.
- 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): Internal track renderer error. 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 404 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:455) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:401) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at android.os.Handler.dispatchMessage(Handler.java:98) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at android.os.Looper.loop(Looper.java:136) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at android.os.HandlerThread.run(HandlerThread.java:61) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): Caused by: com.google.android.exoplayer.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 404 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.upstream.HttpDataSource.open(HttpDataSource.java:264) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.upstream.UriDataSource.open(UriDataSource.java:66) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.hls.TsChunk.load(TsChunk.java:106) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:206) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 02-23 19:06:40.890: E/ExoPlayerImplInternal(5638): at java.lang.Thread.run(Thread.java:841)
- 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): Internal runtime error. 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): java.lang.ArrayIndexOutOfBoundsException: length=96; index=-24 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.text.eia608.Eia608Parser.getChar(Eia608Parser.java:174) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.text.eia608.Eia608Parser.parse(Eia608Parser.java:155) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.text.eia608.Eia608TrackRenderer.maybeParsePendingSample(Eia608TrackRenderer.java:239) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.text.eia608.Eia608TrackRenderer.doSomeWork(Eia608TrackRenderer.java:144) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:401) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at android.os.Handler.dispatchMessage(Handler.java:98) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at android.os.Looper.loop(Looper.java:136) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at android.os.HandlerThread.run(HandlerThread.java:61) 02-23 19:20:22.740: E/ExoPlayerImplInternal(5638): at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
I believe this is happening due to discontinuity in the steam or bad data? If so the playback should resume after stream is normal. I can make the player restart playin on error callback but AAC decoder error i can't handle.
- I'll continue to try and reproduce the audio problem. The second of the additional errors suggests bad data, so it's possible that both the audio problem and this issue have the same root cause. If it turns out you are serving bad data, that's something you'll need to fix on the serving side.
- The first of the additional errors indicates your content server is responding with a 404 when we try and request the next media chunk. We automatically try and switch to the different available streams when this happens, so if a failure has occurred your content server likely responded 404 for the given chunk across all the different streams you provide in the master playlist. We don't currently have robustness in place against this kind of failure. To be honest, I'm not sure we should add it, either. Sure, it's possible to carry on playback having missed that chunk, but that's always going to be a bad experience for the user. I think it's reasonable for us to expect the serving side to not do this, and if it does do this, you should fix it.
How can we very if bad data is being served? We use the same stream in iOS's AVPlayer and we find it is working. Is there any tool against which we can verify this?
The 404 handling seems correct and right error callback method (DemoPlayer.Listener.onError) is called. We can leave this upto the user if they want to restart the playback after error has occured. But AAC decoder error does not call error callback method. I would like to be notified after series of decoder error.
I suspect there are tools, and you can probably find them on the internet. I don't have first hand knowledge to be able to recommend one tool over another, but this seems like a good place to start:
https://developer.apple.com/library/ios/technotes/tn2235/_index.html
Thank you for the link. I will check this and update my findings.
I was able to watch these streams for quite some time today without being able to reproduce the issues you describe. If you do further tests, make sure you're using the latest build of ExoPlayer, just in case something changed that fixed this.
I see you have updated the library recently. I will test with this. But yesterday i was testing and i could still encounter the issue. I also used the validator tool check the stream and i can see i have many warnings but no errors. Can i send you the result at olly.exoplayer [at] gmail.com so you can see if there is anything alarming with the log?
Do you see network errors prior to the issue? It's possible that we're not resuming our loading from the correct position in all cases. A full bug report shortly after seeing the issue, that shows what comes before it, would be useful (capture with "adb bugreport > my_bugreport.txt").
I don't I encounter a network issue when this happens. I have mailed you the bug report. Pls have a look.
@ojw28 I am also having this problem (log attache below). After some debugging, I suspect that what happens is that audio is dropped, and this causes the position to advance. The MediaCodec video buffers are totally consumed, and attempting to get a new buffer will return -1. It seems like the best behavior is that the Video ChunkSampleSource will indicate Discontinuity and flush all of those buffers.
08-18 17:07:01.240 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:04.620 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:07.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:10.660 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:13.160 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:16.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:19.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:22.120 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:25.680 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:28.180 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:31.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:34.620 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:37.150 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:39.910 493 497 D dalvikvm: GC_CONCURRENT freed 2272K, 21% free 10102K/12780K, paused 6ms+5ms, total 77ms 08-18 17:07:40.620 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:43.140 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:46.110 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:49.140 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:52.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:55.120 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:07:55.610 801 804 D dalvikvm: GC_CONCURRENT freed 635K, 36% free 2637K/4084K, paused 1ms+3ms, total 26ms 08-18 17:07:58.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:00.010 862 862 D EpgObserver: updateEpg() 08-18 17:08:00.010 862 862 D EpgObserver: TaskInitEpg.onPreExecute() 08-18 17:08:00.980 862 862 D EpgObserver: TaskInitEpg() has succeeded! resultCount=222 08-18 17:08:00.980 862 862 D EpgObserver: onEpgDataChanged() 08-18 17:08:00.980 862 862 D EpgObserver: getAccurateEpgItem epgItem[channelId: 637, mediaId: 503538, title: Т/с "Сэм и Кэт", 1 сезон, 3 с., scheduledStartTime: 1439906100000, scheduledEndTime: 1439907600000] 08-18 17:08:01.620 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:04.630 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:07.110 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:10.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap
08-18 17:08:13.120 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:16.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:19.630 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:22.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:25.250 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:28.620 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:31.130 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap 08-18 17:08:32.470 862 20839 W SoftAAC2: AAC decoder returned error 16394, substituting silence 08-18 17:08:32.470 862 20839 W SoftAAC2: AAC decoder returned error 16394, substituting silence 08-18 17:08:32.690 862 20827 E AudioTrack: Discontinuity detected [expected 7196904863667, got 7196905076667] 08-18 17:08:32.720 862 20839 W SoftAAC2: Not enough bits, bytesValid 0 08-18 17:08:32.720 862 20839 W SoftAAC2: AAC decoder returned error 4098, substituting silence 08-18 17:08:32.730 862 20839 W SoftAAC2: AAC decoder returned error 16394, substituting silence 08-18 17:08:32.730 862 20839 W SoftAAC2: AAC decoder returned error 16386, substituting silence 08-18 17:08:32.730 862 20839 W SoftAAC2: AAC decoder returned error 16388, substituting silence 08-18 17:08:32.730 862 20839 W SoftAAC2: AAC decoder returned error 16390, substituting silence 08-18 17:08:32.860 862 20839 W SoftAAC2: AAC decoder returned error 16388, substituting silence 08-18 17:08:32.860 862 20839 W SoftAAC2: AAC decoder returned error 16390, substituting silence 08-18 17:08:33.070 862 20827 E AudioTrack: Discontinuity detected [expected 7196905439334, got 7196905674667] 08-18 17:08:33.200 862 20839 W SoftAAC2: AAC decoder returned error 16394, substituting silence 08-18 17:08:33.200 862 20839 W SoftAAC2: AAC decoder returned error 16394, substituting silence 08-18 17:08:33.330 862 20839 W SoftAAC2: AAC decoder returned error 16388, substituting silence 08-18 17:08:33.330 862 20839 W SoftAAC2: AAC decoder returned error 16386, substituting silence 08-18 17:08:33.370 862 20827 E AudioTrack: Discontinuity detected [expected 7196905994667, got 7196906207667] 08-18 17:08:33.540 862 20839 W SoftAAC2: AAC decoder returned error 16388, substituting silence 08-18 17:08:33.540 862 20839 W SoftAAC2: AAC decoder returned error 16388, substituting silence 08-18 17:08:34.190 862 20831 W ContainerMediaChunk: Ignoring unexpected seekMap
Closing due to inactivity. It's unclear whether this is still an issue, and we weren't able to reproduce. Please file a new issue containing all of the information requested in the issue template if you still see this using ExoPlayer 1.5.8 or later.