title: exoplayer 2.11.* version throws Renderer error in android 5.0/5.1(Lollipop) devices
body: <p>I am using <code>exoplayer</code> for streaming my audio file from <code>firebase storage</code> to my android app. <code>exoplayer</code> works great in android versions which is <code>&gt;= 6.0</code>. But in <code>Android 5.0/5.1(Lollipop)</code> devices, <code>exoplayer</code> throws me a <code>Renderer error</code>.</p>
  <p>Here's the Error i got:</p>
  <pre><code>E/AudioTrack: AudioFlinger could not create track, status: -12
  E/AudioTrack-JNI: Error -12 initializing AudioTrack
  E/android.media.AudioTrack: Error code -20 when initializing AudioTrack.
  E/ExoPlayerImplInternal: Renderer error: index=1, type=audio, format=Format(null, null, null, audio/mpeg, null, -1, null, [-1, -1, -1.0], [2, 32000]), rendererSupport=YES
        com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.audio.AudioSink$InitializationException: AudioTrack init failed: 0, Config(32000, 12, 32000)
          at com.google.android.exoplayer2.BaseRenderer.createRendererException(BaseRenderer.java:359)
          at com.google.android.exoplayer2.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:831)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1590)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:721)
          at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:599)
          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:329)
          at android.os.Handler.dispatchMessage(Handler.java:98)
          at android.os.Looper.loop(Looper.java:135)
          at android.os.HandlerThread.run(HandlerThread.java:61)
       Caused by: com.google.android.exoplayer2.audio.AudioSink$InitializationException: AudioTrack init failed: 0, Config(32000, 12, 32000)
          at com.google.android.exoplayer2.audio.DefaultAudioSink$Configuration.buildAudioTrack(DefaultAudioSink.java:1428)
          at com.google.android.exoplayer2.audio.DefaultAudioSink.initialize(DefaultAudioSink.java:527)
          at com.google.android.exoplayer2.audio.DefaultAudioSink.handleBuffer(DefaultAudioSink.java:608)
          at com.google.android.exoplayer2.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:824)
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1590) 
          at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:721) 
          at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:599) 
          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:329) 
          at android.os.Handler.dispatchMessage(Handler.java:98) 
          at android.os.Looper.loop(Looper.java:135) 
          at android.os.HandlerThread.run(HandlerThread.java:61) 
  I/System.out: Player Error::com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.audio.AudioSink$InitializationException: AudioTrack init failed: 0, Config(32000, 12, 32000)
  E/Render TAG: TYPE_RENDERER: AudioTrack init failed: 0, Config(32000, 12, 32000)
  </code></pre>
  <p>Here's my Code for streaming audio:</p>
  <pre><code>//Setting Up Exoplayer
  private void SetupPlayer(){
  // Create a data source factory.
  dataSourceFactory =
          new DefaultHttpDataSourceFactory(Util.getUserAgent(this
                  , getApplicationInfo().loadLabel(getPackageManager()).toString()));
  loadControl = new DefaultLoadControl.Builder()
          .setBufferDurationsMs(MIN_BUFFER_DURATION, MAX_BUFFER_DURATION, MIN_PLAYBACK_START_BUFFER, MIN_PLAYBACK_RESUME_BUFFER).createDefaultLoadControl();
  
  @DefaultRenderersFactory.ExtensionRendererMode int extensionRendererMode = DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER;
  
  renderersFactory = new DefaultRenderersFactory(this) .setExtensionRendererMode(extensionRendererMode);
  
  // Create a progressive media source pointing to a stream uri.
          mediaSource = new ProgressiveMediaSource.Factory(dataSourceFactory)
          .createMediaSource(Uri.parse(audio_url));
  // Create a player instance.
  simpleExoPlayer =  new SimpleExoPlayer.Builder(this,renderersFactory).setLoadControl(loadControl).build();
  // Prepare the player with the media source.
  simpleExoPlayer.prepare(mediaSource, true, true);
  }
  </code></pre>
  <p>I searched Stack Overflow but unable to find any answers. The version of <code>exoplayer</code> i am using was <code>2.11.8</code>. I don't know how to fix this error. Please help me with some solutions to fix this error in Android 5.0 devices.</p>