title: Audio recording through Genymotion with Soundflower driver
body: <p>I'm having an interesting problem trying to record audio from an app (for automation purposes):</p>
  
  <p>My system is:</p>
  
  <pre><code>Mac mini OS X Yosemite
  I'm running Genymotion 
  VirtualBox with the following Audio settings:
  Host Audio Driver: CoreAudio
  Audio Controller: ICH AC97
  Sound driver is Soundflower (Input Soundflower (2ch), Output Soundflower (2ch))
  </code></pre>
  
  <p>I am initiating a VoIP call through my own client using Twilio.
  So essentially my flow is like this:  I open the app on Genymotion, make a call to some number where someone answers and speaks, this sound is going from output to input via Soundflower and I'm recording it in Audacity (1 channel mono recording).</p>
  
  <p>This scenario works <strong><em>sometimes</em></strong> - every other call, more or less, doesn't produce any sound.  Pretty much every second or third recording is empty.</p>
  
  <p>Trying to pin down the problem I have done the following:</p>
  
  <ol>
  <li>Played sound on Genymotion in some other sound app (like youtube) and recorded that in Audacity - this always works.</li>
  <li>I tried using Twilio demo app to make the call (with my own backend service) and this also seems to always work (same jar and so files from Twilio in my client and in their demo app). </li>
  </ol>
  
  <p>This leads me to believe the problem is somehow related to my client app.</p>
  
  <p>When I have a call with sound that <strong>works</strong> I see this in adb logcat:</p>
  
  <pre><code>E/genymotion_audio(  464): get_next_buffer() pcm_read error -16
  E/genymotion_audio(  464): get_next_buffer() pcm_read error -16
  E/genymotion_audio(  464): get_next_buffer() pcm_read error -16
  E/genymotion_audio(  464): get_next_buffer() pcm_read error -16 
  </code></pre>
  
  <p>when I have a call with sound that <strong>doesn't work</strong> I see this adb logcat:</p>
  
  <pre><code>W/AudioFlinger(  464): write blocked for 10238 msecs, 2 delayed writes, thread 0xb58ba000
  </code></pre>
  
  <p>When I googled about the AudioFlinger error it seemed to be related to cases when someone tried to play audio with a high sample rate, but my case is different since it's voip so the sample rate is probably 8khz.</p>
  
  <p>Wondering if anyone has encountered a similar problem / has any thoughts on how to pin this down further?</p>
  
  <p>Edit: Additional things I've tried:</p>
  
  <ol>
  <li><p>Windows 8 + Genymotion  - same scenario recording with Audacity.  (Oracle VirtualBox Audio is HostDriver: Windows DirectSound and Controller: ICH AC97).  Instead of Soundflower I used VB Virtual Cable Driver for windows.
  It works perfectly.</p></li>
  <li><p>On the Mac - replaced Soundflower with WavTap driver - still the same problem.</p></li>
  </ol>