<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 9, 2016 at 1:07 AM, Abdulla Bubshait <span dir="ltr"><<a href="mailto:abdulla.bubshait@gmail.com" target="_blank">abdulla.bubshait@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am not the only one who has this issue, but if you emulate an audio card you end up with occasional crackling audio output, which is sometimes associated with drops in FPS. <br><br>I know there are ways to pass audio devices to the VM directly, but in many setups it would be preferable to pass the audio to the host. <br><br>Does anyone know the reason the audio has distortion or crackling, and are there any known solutions to the problem?<br></div>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">This seems rather obvious doesn't it?  An emulated audio device is just a blob of code that requires the CPU to run it.  Generating audio, it's highly susceptible to latency issues.  At the same time you're apparently playing a game that consumes significant CPU time.  Total CPU cycles on the system have a fixed limit.  Therefore any time you exceed that limit or get close enough for scheduling latency to become an issue, you can expect the audio emulation to suffer.  This is why bare metal has devices dedicated to various activities.  Solutions are 1) get a faster system, 2) load the system less or maybe more optimally, 3) assign a device to offload the work.</div><div class="gmail_extra"><br></div><div class="gmail_extra">The "more optimally" part of 2) might include pinning vCPUs, pinning the emulator thread, leaving sufficient CPU power unassigned so that the host has enough capacity to run emulation at full speed, reducing host overhead via things like hugepages, etc...</div></div>