title: Android's SoundPool stutters, lags, sometimes doesn't play at all
body: <h2>Use case</h2>
  
  <p>I've got 68 piano samples, each approx. 174 kB, Ogg data, Vorbis audio, stereo, s16, 44100 Hz, 352 kb/s, 4 seconds.</p>
  
  <p>I need to <strong>simultaneously</strong> play different combinations of them (musical term: <em>harmonic chords/intervals</em>), e.g. <code>1st + 7th</code>, <code>14th + 22nd</code> etc.</p>
  
  <p>Also: current "playback" needs an option to stop it after <code>t</code> milliseconds.</p>
  
  <h2>What I've tried</h2>
  
  <p>An obvious solution seems to be to use a <code>SoundPool</code>. After setting <code>maxStreams = 20</code>, I <code>.load()</code> all the samples to it. With every play request a thread (really: Scala's <code>future</code>) is created that awaits given <code>t millis</code> and then stops all sounds.</p>
  
  <p>It <strong>seems</strong> to work... usually.</p>
  
  <h2>The problem</h2>
  
  <ul>
  <li><p>This <code>SoundPool</code>, when playing 2 (or more) sounds <em>simultaneously</em>, sometimes won't start them exactly at the same time, slight difference in their start times certainly can be heard. Most of the time, however, it's OK.</p></li>
  <li><p>There's also a problem with stopping... sometimes a pair "lasts" longer, but again, usually it ends at the time I want it to.</p></li>
  <li><p>Finally, what's <strong>really</strong> weird: every <code>.play()</code> that is a <em>first one</em> after either:</p>
  
  <ul>
  <li>turned off (or even <em>dimmed</em> only!) display or</li>
  <li>application launch...</li>
  </ul>
  
  <p>...<strong>won't produce a sound</strong>!</p></li>
  </ul>
  
  <h2>Question</h2>
  
  <p>Does Android provide us with a <em>more reliable</em> (in terms of <em>timing consistency</em>) sound pool implementation to use?</p>
  
  <p>Would it perhaps work better if I created 68 threads, one for each sound?... I don't think so.</p>