title: Android Visualizer error only in Android 6.0
body: <p>i've found one issue related with Visualizer that takes place only in Android 6.0 devices. Don't really know why it happens, so any kind of help would be appreciated. Here is the error stack:</p>
  
  <pre><code>AudioEffect: set(): AudioFlinger could not create effect, status: -1
  visualizers-JNI: Visualizer initCheck failed -3
  Visualizer-JAVA: Error code -3 when initializing Visualizer.
  java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -3
  System.err: at android.media.audiofx.Visualizer.&lt;init&gt;(Visualizer.java:218)
  System.err:     at com.xxx.xxxx.customviews.visualizer.VisualizerView.link(VisualizerView.java:101)
  </code></pre>
  
  <p>and here is the code that causes it:</p>
  
  <pre><code>public void link(MediaPlayer player) {
  
      if (player == null) {
  
          throw new NullPointerException("Cannot link to null MediaPlayer");
      }
  
      Equalizer mEqualizer = new Equalizer(0, player.getAudioSessionId());
      mEqualizer.setEnabled(true); // need to enable equalizer
  
  
      try {
  
          int aud = player.getAudioSessionId();
          **mVisualizer = new Visualizer(aud);**
          mVisualizer.setEnabled(false);
          mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1]);
          Visualizer.OnDataCaptureListener captureListener = new Visualizer.OnDataCaptureListener() {
  
              @Override
              public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {
                  updateVisualizer(bytes);
              }
  
              @Override
              public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {
                  updateVisualizerFFT(bytes);
              }
          };
  
          mVisualizer.setDataCaptureListener(captureListener, Visualizer.getMaxCaptureRate() / 2, true, true);
          mVisualizer.setEnabled(true);
          player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
              @Override
              public void onCompletion(MediaPlayer mediaPlayer) {
                  mVisualizer.setEnabled(false);
              }
          });
      }catch(Exception e) {       
  
          e.printStackTrace();        
      } 
  }
  </code></pre>
  
  <p>Any help would be appreciated. Thanks in advance =)</p>