<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 09/06/16 08:35, Philip Abernethy
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAKjY0RijLgG7M749-YOUVm+9E-T2Q6Ox4f9ZP9pthcBECzaQNQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <p dir="ltr">I actually have this problem with passed through
        audio. I could improve there situation by fiddling with the
        sample frequency and size in the audio settings. Currently
        running at 192000Hz and 24 bit.<br>
        My first instinct was to blame it on me skimping on the CPU,
        because I got me a quad core i5 instead of the octa core i7.</p>
      <p dir="ltr">Philip</p>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Thu, 9 Jun 2016 09:08 Abdulla Bubshait, <<a
            moz-do-not-send="true"
            href="mailto:abdulla.bubshait@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:abdulla.bubshait@gmail.com">abdulla.bubshait@gmail.com</a></a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote">
          <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>
          _______________________________________________<br>
          vfio-users mailing list<br>
          <a moz-do-not-send="true" href="mailto:vfio-users@redhat.com"
            target="_blank">vfio-users@redhat.com</a><br>
          <a moz-do-not-send="true"
            href="https://www.redhat.com/mailman/listinfo/vfio-users"
            rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/vfio-users</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
vfio-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:vfio-users@redhat.com">vfio-users@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/vfio-users">https://www.redhat.com/mailman/listinfo/vfio-users</a>
</pre>
    </blockquote>
    <p>My onboard audio was almost completely unusable when I first
      started out, but I got it to work great with the following </p>
    <p>export QEMU_AUDIO_DRV=alsa<br>
      export QEMU_ALSA_ADC_BUFFER_SIZE=1024
      QEMU_ALSA_ADC_PERIOD_SIZE=256<br>
      export QEMU_ALSA_DAC_BUFFER_SIZE=1024
      QEMU_ALSA_DAC_PERIOD_SIZE=256<br>
      export QEMU_AUDIO_DAC_FIXED_SETTINGS=1<br>
      export QEMU_AUDIO_DAC_FIXED_FREQ=44100
      QEMU_AUDIO_DAC_FIXED_FMT=S16 QEMU_AUDIO_ADC_FIXED_FREQ=44100
      QEMU_AUDIO_ADC_FIXED_FMT=S16<br>
      export QEMU_AUDIO_DAC_TRY_POLL=1 QEMU_AUDIO_ADC_TRY_POLL=1<br>
      export QEMU_AUDIO_TIMER_PERIOD=50</p>
    <p>qemu-system-.......<br>
    </p>
    <p>Have barely had a crackle since I switched to a lower time period
      and lined up the qemu audio timer period with the alsa timer
      period (so it's windows start / end together so are less sensitive
      to timer jitter). Pulse audio always worked great as an
      alternative but there was (and still is when I just tried) a bug
      with random time delays on the microphone with pulse audio.</p>
    <p>If that doesn't work you can send me the contents of
      /proc/asound/timers and I'll work out a window size for you. On
      some linux kernels you might find modprobe snd_timer gets you a
      better timer. ALSA has quite a lot of kernel options around timers
      and buffers.<br>
    </p>
    <p>buildacct@Poople-PC:~$ more /proc/asound/timers <br>
      G0: system timer : 3333.333us (10000000 ticks)<br>
      P0-0-0: PCM playback 0-0-0 : SLAVE<br>
      P0-0-1: PCM capture 0-0-1 : SLAVE<br>
      P0-1-0: PCM playback 0-1-0 : SLAVE<br>
      P0-2-1: PCM capture 0-2-1 : SLAVE<br>
      P0-3-0: PCM playback 0-3-0 : SLAVE<br>
      P0-7-0: PCM playback 0-7-0 : SLAVE<br>
    </p>
    <p>Good luck - it's still a little twitchy even with the above, but
      removing the audio device from windows system manager and scanning
      for changes often fixes it on the 1 time in 20 I boot and it
      doesn't work. It's still possible to make it crackle by putting
      heavy load on both host and client.</p>
    <p>Or you can use the passthrough audio from your graphics card of
      course.<br>
    </p>
    <p>Regards,</p>
    <p>D<br>
    </p>
  </body>
</html>