<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    I have everything working except the sound from the guest. I am
    using pulseaudio and it works out of the box for everything else
    except having the sound from the vm. <br>
    <br>
    I reinstalled pulseaudio and pulseaudio-alsa to be sure I have a
    clean install<br>
    <br>
    I follow the guide here <a
      href="https://wiki.archlinux.org/index.php/PulseAudio#QEMU"><a class="moz-txt-link-freetext" href="https://wiki.archlinux.org/index.php/PulseAudio#QEMU">https://wiki.archlinux.org/index.php/PulseAudio#QEMU</a></a><br>
    <br>
    When I run the command <br>
    <pre> qemu-system-x86_64 -audio-help | awk '/Name: pa/' RS=

</pre>
    I get <br>
    <blockquote><samp>Name: pa</samp><samp></samp><br>
      <samp></samp><samp>Description: <a class="moz-txt-link-freetext" href="http://www.pulseaudio.org/">http://www.pulseaudio.org/</a></samp><samp></samp><br>
      <samp></samp><samp>Theoretically supports many playback voices</samp><samp></samp><br>
      <samp></samp><samp>Theoretically supports many capture voices</samp><samp></samp><br>
      <samp></samp><samp>Options:</samp><samp></samp><br>
      <samp></samp><samp>  QEMU_PA_SAMPLES: integer, default = 4096</samp><samp></samp><br>
      <samp></samp><samp>    buffer size in samples</samp><samp></samp><br>
      <samp></samp><samp>  QEMU_PA_SERVER: string, default = (not set)</samp><samp></samp><br>
      <samp></samp><samp>    server address</samp><samp></samp><br>
      <samp></samp><samp>  QEMU_PA_SINK: string, default = (not set)</samp><samp></samp><br>
      <samp></samp><samp>    sink device name</samp><samp></samp><br>
      <samp></samp><samp>  QEMU_PA_SOURCE: string, default = (not set)</samp><samp></samp><br>
      <samp></samp><samp>    source device name</samp><br>
    </blockquote>
    Then I add in my xml the following options<br>
    <blockquote><samp>  <qemu:commandline></samp><samp></samp><br>
      <samp></samp><samp>    <qemu:env name='QEMU_AUDIO_DRV'
        value='pa'/></samp><samp></samp><br>
      <samp></samp><samp>    <qemu:env name='QEMU_PA_SINK'
        value='alsa_output.pci-0000_00_1b.0.analog-stereo'/></samp><samp></samp><br>
      <samp></samp><samp>    <qemu:env name='QEMU_PA_SOURCE'
        value='input'/></samp><samp></samp><br>
      <samp></samp><samp>  </qemu:commandline></samp><br>
    </blockquote>
    <br>
    The value of QEMU_PA_SINK is obtained with the command<br>
    <samp>    pacmd list-sinks | grep -e 'name:' -e 'index'</samp><br>
    <br>
    <br>
    In qemu.conf I uncomment the following options<br>
    <blockquote><code>vnc_allow_host_audio = 1<br>
        nographics_allow_host_audio = 1</code><code><br>
      </code></blockquote>
    <code></code><code></code>The only weird thing about my
    configuration is that I started to use libvirt as root user. I then
    switch to be able to use it as user. However myy vm is still on the
    root system but I can launch it as user without password (I didn't
    find the way to move the vm to the qemu user-session)<br>
    <br>
    When I launch the VM I don't have sound (even in the vm everything
    works with the AC97 installed on win10 64) and I get the following
    output:<br>
    <samp><br>
    </samp>
    <blockquote><samp>pulseaudio: pa_context_connect() failed</samp><samp></samp><br>
      <samp></samp><samp>pulseaudio: Reason: Connection refused</samp><samp></samp><br>
      <samp></samp><samp>pulseaudio: Failed to initialize PA
        contextaudio: Could not init `pa' audio driver</samp><samp></samp><br>
      <samp></samp><samp>pulseaudio: pa_context_connect() failed</samp><samp></samp><br>
      <samp></samp><samp>pulseaudio: Reason: Connection refused</samp><samp></samp><br>
      <samp></samp><samp>pulseaudio: Failed to initialize PA
        contextaudio: Could not init `pa' audio driver</samp><samp></samp><br>
      <samp></samp><samp>alsa: Could not initialize ADC</samp><samp></samp><br>
      <samp></samp><samp>alsa: Failed to open `default':</samp><samp></samp><br>
      <samp></samp><samp>alsa: Reason: Device or resource busy</samp><samp></samp><br>
      <samp></samp><samp>alsa: Could not initialize ADC</samp><samp></samp><br>
      <samp></samp><samp>alsa: Failed to open `default':</samp><samp></samp><br>
      <samp></samp><samp>alsa: Reason: Device or resource busy</samp><samp></samp><br>
      <samp></samp><samp>audio: Failed to create voice `ac97.pi'<br>
      </samp></blockquote>
    <samp></samp><br>
    <code></code>And I am lost there :(<br>
    <br>
    Thank you in advance for any help :)<br>
    <br>
    Feadurn<br>
    <br>
  </body>
</html>