{"action":"created","issue":{"url":"https://api.github.com/repos/google/ExoPlayer/issues/754","labels_url":"https://api.github.com/repos/google/ExoPlayer/issues/754/labels{/name}","comments_url":"https://api.github.com/repos/google/ExoPlayer/issues/754/comments","events_url":"https://api.github.com/repos/google/ExoPlayer/issues/754/events","html_url":"https://github.com/google/ExoPlayer/issues/754","id":104383485,"number":754,"title":"ExoPlayer crashes while trying to play mp4 with 5.1 channel audio","user":{"login":"artnalban","id":14083605,"avatar_url":"https://avatars.githubusercontent.com/u/14083605?v=3","gravatar_id":"","url":"https://api.github.com/users/artnalban","html_url":"https://github.com/artnalban","followers_url":"https://api.github.com/users/artnalban/followers","following_url":"https://api.github.com/users/artnalban/following{/other_user}","gists_url":"https://api.github.com/users/artnalban/gists{/gist_id}","starred_url":"https://api.github.com/users/artnalban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artnalban/subscriptions","organizations_url":"https://api.github.com/users/artnalban/orgs","repos_url":"https://api.github.com/users/artnalban/repos","events_url":"https://api.github.com/users/artnalban/events{/privacy}","received_events_url":"https://api.github.com/users/artnalban/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-02T00:59:44Z","updated_at":"2015-09-02T11:21:46Z","closed_at":null,"body":"Hello,\r\n\r\nThis media\r\n```\r\nhttp://pmd307538tn.download.theplatform.com.edgesuite.net/PDK_(VMS)/641/646/The_Amazing_Spider-Man_2_Trailer_1_5.1-480p-HDTN.mp4\r\n```\r\nhas 5.1 channel audio, ExoPlayer crashes while trying to play it with this exception\r\n```\r\nW/AudioPolicyManager(  184): getOutput() could not find output for stream 3, samplingRate 48000,format 150994944, channels 3f, flags 1\r\nE/AudioTrack(  766): Could not get audio output for stream type -1, usage 1, sample rate 48000, format 0x9000000, channel mask 0x3f, flags 0x1\r\nE/AudioTrack-JNI(  766): Error -22 initializing AudioTrack\r\nE/android.media.AudioTrack(  766): Error code -20 when initializing AudioTrack.\r\nE/ExoPlayerImplInternal(  766): Internal track renderer error.\r\nE/ExoPlayerImplInternal(  766): com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.audio.AudioTrack$InitializationException: AudioTrack init failed: 0, Config(48000, 252, 144000)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.MediaCodecAudioTrackRenderer.processOutputBuffer(MediaCodecAudioTrackRenderer.java:274)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.MediaCodecTrackRenderer.drainOutputBuffer(MediaCodecTrackRenderer.java:846)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:502)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:401)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203)\r\nE/ExoPlayerImplInternal(  766):      at android.os.Handler.dispatchMessage(Handler.java:98)\r\nE/ExoPlayerImplInternal(  766):      at android.os.Looper.loop(Looper.java:135)\r\nE/ExoPlayerImplInternal(  766):      at android.os.HandlerThread.run(HandlerThread.java:61)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)\r\nE/ExoPlayerImplInternal(  766): Caused by: com.google.android.exoplayer.audio.AudioTrack$InitializationException: AudioTrack init failed: 0, Config(48000, 252, 144000)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.audio.AudioTrack.checkAudioTrackInitialized(AudioTrack.java:721)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.audio.AudioTrack.initialize(AudioTrack.java:289)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.audio.AudioTrack.initialize(AudioTrack.java:263)\r\nE/ExoPlayerImplInternal(  766):      at com.google.android.exoplayer.MediaCodecAudioTrackRenderer.processOutputBuffer(MediaCodecAudioTrackRenderer.java:269)\r\nE/ExoPlayerImplInternal(  766):      ... 8 more\r\nE/ExoEventLogger(  766): internalError [0.39, audioTrackInitializationError]\r\nE/ExoEventLogger(  766): com.google.android.exoplayer.audio.AudioTrack$InitializationException: AudioTrack init failed: 0, Config(48000, 252, 144000)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.audio.AudioTrack.checkAudioTrackInitialized(AudioTrack.java:721)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.audio.AudioTrack.initialize(AudioTrack.java:289)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.audio.AudioTrack.initialize(AudioTrack.java:263)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.MediaCodecAudioTrackRenderer.processOutputBuffer(MediaCodecAudioTrackRenderer.java:269)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.MediaCodecTrackRenderer.drainOutputBuffer(MediaCodecTrackRenderer.java:846)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:502)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:401)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203)\r\nE/ExoEventLogger(  766):     at android.os.Handler.dispatchMessage(Handler.java:98)\r\nE/ExoEventLogger(  766):     at android.os.Looper.loop(Looper.java:135)\r\nE/ExoEventLogger(  766):     at android.os.HandlerThread.run(HandlerThread.java:61)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)\r\nE/ExoEventLogger(  766): playerFailed [0.39]\r\nE/ExoEventLogger(  766): com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.audio.AudioTrack$InitializationException: AudioTrack init failed: 0, Config(48000, 252, 144000)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.MediaCodecAudioTrackRenderer.processOutputBuffer(MediaCodecAudioTrackRenderer.java:274)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.MediaCodecTrackRenderer.drainOutputBuffer(MediaCodecTrackRenderer.java:846)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:502)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:401)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203)\r\nE/ExoEventLogger(  766):     at android.os.Handler.dispatchMessage(Handler.java:98)\r\nE/ExoEventLogger(  766):     at android.os.Looper.loop(Looper.java:135)\r\nE/ExoEventLogger(  766):     at android.os.HandlerThread.run(HandlerThread.java:61)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)\r\nE/ExoEventLogger(  766): Caused by: com.google.android.exoplayer.audio.AudioTrack$InitializationException: AudioTrack init failed: 0, Config(48000, 252, 144000)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.audio.AudioTrack.checkAudioTrackInitialized(AudioTrack.java:721)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.audio.AudioTrack.initialize(AudioTrack.java:289)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.audio.AudioTrack.initialize(AudioTrack.java:263)\r\nE/ExoEventLogger(  766):     at com.google.android.exoplayer.MediaCodecAudioTrackRenderer.processOutputBuffer(MediaCodecAudioTrackRenderer.java:269)\r\nE/ExoEventLogger(  766):     ... 8 more\r\nD/ExoEventLogger(  766): state [0.40, false, I]\r\n```\r\n\r\nThe same media plays in Android standard MediaPlayer but with no audio. Is there any way to mix channels into stereo (or whatever is supported by device) or at least don't let ExoPlayer to fail and play video only like MediaPlayer does.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/google/ExoPlayer/issues/comments/137036252","html_url":"https://github.com/google/ExoPlayer/issues/754#issuecomment-137036252","issue_url":"https://api.github.com/repos/google/ExoPlayer/issues/754","id":137036252,"user":{"login":"ojw28","id":7881572,"avatar_url":"https://avatars.githubusercontent.com/u/7881572?v=3","gravatar_id":"","url":"https://api.github.com/users/ojw28","html_url":"https://github.com/ojw28","followers_url":"https://api.github.com/users/ojw28/followers","following_url":"https://api.github.com/users/ojw28/following{/other_user}","gists_url":"https://api.github.com/users/ojw28/gists{/gist_id}","starred_url":"https://api.github.com/users/ojw28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojw28/subscriptions","organizations_url":"https://api.github.com/users/ojw28/orgs","repos_url":"https://api.github.com/users/ojw28/repos","events_url":"https://api.github.com/users/ojw28/events{/privacy}","received_events_url":"https://api.github.com/users/ojw28/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T11:21:46Z","updated_at":"2015-09-02T11:21:46Z","body":"The audio track is AC-3, which most Android devices don't support for on-device playback. See Andrew's reply to #620 for a description of the scenarios in which AC-3 is expected to work. AndroidTV devices also commonly provide AC-3 support. I tested your media on a Sony AndroidTV I had and playback is good there.\r\n\r\nIf you control the formats on the server side, then for mobile devices not connected to an A/V receiver you'd be best off fetching a version of the stream with a regular stereo audio track. If you deliver multi-channel audio it'll just get down-mixed to stereo anyway for output, wasting bandwidth and CPU. If you really want to deliver multi-channel for some other reason, multi-channel AAC should work.\r\n\r\nOf course, if you don't control the source media, you may not be able to choose what format it's delivered in."}}