Tearing my hair out over new Skylake Z170 build: Audio Passthrough


kyouten

Recommended Posts

Okay, so a few months ago in the summer I was on unraid 6.2 and it was stable as hell, never let me down. Computer died and so I had to give unraid a rest for a few months, but now my PC is back and better than before. However, I have never had so many problems configuring a build.

 

Before I get into everything I'd like to sum of the goal of this post: To get my Intel Sunrise-Point HD Audio Controller (Onboard) to pass through correctly to my Windows 10 VM.

 

As of now, I am passing through a USB 3 controller and a GTX 1070 without issues. I passed through the USB controller with stubbing in my syslinux.cfg , and the 1070 thankfully worked out of the box. After following advice from this thread:

https://lime-technology.com/forum/index.php?topic=50193.15

 

And added the line: modprobe.blacklist=i2c_i801,i2c_smbus to my syslinux.cfg to stub what I believe is the SMBus. In addition to this I turned PCI ACS override on. This worked for a while, but it quickly became apparent that the audio was being delayed on any sort of video playback. So, I did my research, and applied the MSI Fix to both the Audio Controller and the GTX 1070. This did not fix any issues.

 

The other night I was downloading torrents and my cache drive filled to 100% while my VM was running, resulting in a crash of my VM, Plex, and Deluge. After infuriatingly dealing with the mover settings and invoking the mover manually I could boot my Windows 10 VM, but since then I have nearly given up on what to do to get the audio issue fixed. At the moment, the pass through is not working at all, I have ACS override turned off. In any case when I turn the VM on with the Audio Controller attached, it takes a while for the VM to bootup and then it hangs on boot. At the same time, any time I run a Windows VM the Unraid WebUI basically freezes entirely. I can't access Plex or Deluge or the WebUI until the Windows VM either loads completely or is destroyed through virsh in ssh. While the VM is running the WebUIs are very unresponsive and it is infuriating.

 

I have tried stubbing some CPU cores in the syslinux.cfg to the first 3 physical cores + their hyperthreads to leave those for the Windows VM, so the Unraid VM gets 1 physical core + 1 hyperthread. This does not help the WebUI freezing or any VM audio issues in any way.

 

Here's my IOMMU groupings ( ACS Turned Off):

IOMMU group 0
00:00.0 Host bridge [0600]: Intel Corporation Skylake Host Bridge/DRAM Registers [8086:191f] (rev 07)
IOMMU group 1
00:01.0 PCI bridge [0604]: Intel Corporation Skylake PCIe Controller (x16) [8086:1901] (rev 07)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1070] [10de:1b81] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GP104 High Definition Audio Controller [10de:10f0] (rev a1)
IOMMU group 2
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 530 [8086:1912] (rev 06)
IOMMU group 3
00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller [8086:a12f] (rev 31)
IOMMU group 4
00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-H CSME HECI #1 [8086:a13a] (rev 31)
IOMMU group 5
00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-H SATA controller [AHCI mode] [8086:a102] (rev 31)
IOMMU group 6
00:1b.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Root Port #17 [8086:a167] (rev f1)
IOMMU group 7
00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #1 [8086:a110] (rev f1)
IOMMU group 8
00:1c.4 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #5 [8086:a114] (rev f1)
IOMMU group 9
00:1d.0 PCI bridge [0604]: Intel Corporation Sunrise Point-H PCI Express Root Port #9 [8086:a118] (rev f1)
IOMMU group 10
00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-H LPC Controller [8086:a145] (rev 31)
00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-H PMC [8086:a121] (rev 31)
00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-H HD Audio [8086:a170] (rev 31)
00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-H SMBus [8086:a123] (rev 31)
IOMMU group 11
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) I219-V [8086:15b8] (rev 31)
IOMMU group 12
04:00.0 USB controller [0c03]: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller [1b21:1242]

 

And here's a snippet from my Syslinux.cfg:

 

default /syslinux/menu.c32
menu title Lime Technology, Inc.
prompt 0
timeout 50
label unRAID OS
  menu default
  kernel /bzimage
  append vfio-pci.ids=8086:a12f modprobe.blacklist=i2c_i801,i2c_smbus initrd=/bzroot 
  

 

And for good measure, the XML on my Windows VM:

 

<domain type='kvm' id='3'>
  <name>Windows 10</name>
  <uuid>50d9cf9f-afb0-bffb-0c08-ff8e207ed0a9</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>9961472</memory>
  <currentMemory unit='KiB'>9961472</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>6</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='4'/>
    <vcpupin vcpu='4' cpuset='5'/>
    <vcpupin vcpu='5' cpuset='6'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/50d9cf9f-afb0-bffb-0c08-ff8e207ed0a9_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='3' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/Windows 10/vdisk1.img'/>
      <backingStore/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:8c:97:7d'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-3-Windows 10/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'>
      <alias name='input0'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input1'/>
    </input>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x14' function='0x0'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
</domain>

 

I would be forever grateful if someone would help me figure this out. Id be happy to write up some documentation for Skylake users after the fact if it turns out well.  :)

 

If it matters, here's my specs:

 

Unraid 6.3.0 rc6

Asus Z170 Gene Motherboard

6700k Skylake

16 GB 2800mhz (XMP)

2 x 4TB WD Blue

1 x 1TB Seagate SSHD

1 x 1TB Sandisk SSD (Cache, VM Storage)

 

Please let me know if there's any other information I can provide or remedies I can try.

Thanks,

Kyouten

 

Link to comment

Still no progress.. I have tried what feels like everything, but the only time I get any onboard audio to work it gets out of sync. HDMI audio works fine, and the MSI fix makes it so the audio delay goes away, but my speakers aren't digital, they run on analog. Any thoughts or help would be nice

Link to comment

ok.

try this. Dont isolcpu any cpus in your syslinux file.

 

Change the xml to this and see if sound is still as bad

 

<vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu=‘0’ cpuset='2'/>
    <vcpupin vcpu=‘1’ cpuset=‘3’/>
    <vcpupin vcpu=‘2’ cpuset=‘6’/>
    <vcpupin vcpu=‘3’ cpuset=‘7/>
<emulatorpin cpuset=‘1,5’/>
  </cputune>

 

I had an almost identical system to yours before and never had the problems that you are having. But I never passed through the onboad sound. Have you thought of buying a cheap usb sound card maybe?

 

As regards you torrents filling yo the cache maybe try this.

 

1. Dont set the share where you downloads are stored to use the cache drive.

2. Set up a share that is cache enabled that is called "incomplete" or similar.

3. In your torrent/usenet client set the download location of the tempory/incompete files to the cache enabled share just created.

4. Then set the torrent/usenet client's location for the completed files to be on the downloads share that isnt cache enabled.

 

This will make every file as it is downloading got the cache drive so there is no writes to the parity. Once completed it will then be moved

to the array. (Then if file is seeding will be fine coming from the array as the parity drive will not spin up as it is not a write.)

This way your cache will not fill up due to downloads

 

Link to comment

I got errors trying to pass through on board audio as well, didn't try any tweaks to get working. Instead I ordered an hdmi audio extractor from Aliexpress that was delivered yesterday, have not tested yet as need to find power adapter for local power plugs but can report back once tried it.

 

 

Link to comment

Just an observation, if you don't need fancy audio (I'm using mine with a set of basic stereo PC speakers), a cheap USB audio dongle works great with a passed-through USB controller in Windows 10. I bought one off amazon for 10$, and I just came across similar ones on Ebay selling for 1$ :). Might be worth a try...

 

Note: Make sure to passthrough the whole controller. I found just passing through the dongle led to poor sound quality.

Link to comment

ok.

try this. Dont isolcpu any cpus in your syslinux file.

 

Change the xml to this and see if sound is still as bad

 

<vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu=‘0’ cpuset='2'/>
    <vcpupin vcpu=‘1’ cpuset=‘3’/>
    <vcpupin vcpu=‘2’ cpuset=‘6’/>
    <vcpupin vcpu=‘3’ cpuset=‘7/>
<emulatorpin cpuset=‘1,5’/>
  </cputune>

 

I had an almost identical system to yours before and never had the problems that you are having. But I never passed through the onboad sound. Have you thought of buying a cheap usb sound card maybe?

 

As regards you torrents filling yo the cache maybe try this.

 

1. Dont set the share where you downloads are stored to use the cache drive.

2. Set up a share that is cache enabled that is called "incomplete" or similar.

3. In your torrent/usenet client set the download location of the tempory/incompete files to the cache enabled share just created.

4. Then set the torrent/usenet client's location for the completed files to be on the downloads share that isnt cache enabled.

 

This will make every file as it is downloading got the cache drive so there is no writes to the parity. Once completed it will then be moved

to the array. (Then if file is seeding will be fine coming from the array as the parity drive will not spin up as it is not a write.)

This way your cache will not fill up due to downloads

 

Looking at your signature, you don't know how close they are! My build is also in a Fractal Node 804  ;D

 

I figured that the WebUI and other services were getting slowed down from the isolcpu in the syslinux so I already went ahead and deleted the entry in my syslinux.

 

Small update: So, even over HDMI audio running to my monitor, there are still problems. Some programs work fine with no audio distortion (games, youtube video, vlc video player) some video playback programs simply do not work. MPC-HC is my favorite video player which, among other things, can do stuff like offload the frames of video to post process on the GPU and bitstream high definition audio (DTS, Dolby Digital, DTS-HD, etc.).

 

Videos in MPC-HC get out of sync almost immediately and after a while will just play 5 seconds of audio over and over again over the video stream. Using latencymon, I can tell that without even my onboard audio passed through, the HDMI audio is still having serious latency problems. I will try this fix out momentarily, but I don't have high hopes.

 

Also: I think it's worth mentioning that I have a couple of unidentified flying objects in my Device Manager.

Theres:

1. HID Button over Interrupt Driver

2. PCI Device

3. PCI Simple Communications Controller

 

I heard the HID Button was a bug, but I'm curious as to other's thought about these. This is without my onboard audio passed through BTW.

 

Also, thanks for the help so far gents. Ill reply back shortly.

Link to comment

ok.

try this. Dont isolcpu any cpus in your syslinux file.

 

Change the xml to this and see if sound is still as bad

 

<vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu=‘0’ cpuset='2'/>
    <vcpupin vcpu=‘1’ cpuset=‘3’/>
    <vcpupin vcpu=‘2’ cpuset=‘6’/>
    <vcpupin vcpu=‘3’ cpuset=‘7/>
<emulatorpin cpuset=‘1,5’/>
  </cputune>

 

I had an almost identical system to yours before and never had the problems that you are having. But I never passed through the onboad sound. Have you thought of buying a cheap usb sound card maybe?

 

As regards you torrents filling yo the cache maybe try this.

 

1. Dont set the share where you downloads are stored to use the cache drive.

2. Set up a share that is cache enabled that is called "incomplete" or similar.

3. In your torrent/usenet client set the download location of the tempory/incompete files to the cache enabled share just created.

4. Then set the torrent/usenet client's location for the completed files to be on the downloads share that isnt cache enabled.

 

This will make every file as it is downloading got the cache drive so there is no writes to the parity. Once completed it will then be moved

to the array. (Then if file is seeding will be fine coming from the array as the parity drive will not spin up as it is not a write.)

This way your cache will not fill up due to downloads

I tried this and I can't get the XML editor to take the edits. I get this error:

unsupported configuration: CPU topology doesn't match maximum vcpu count

 

Do you have any idea about this? I'm pretty new to VM and unraid in general so id love some education on the matter. As of right now, even with PCI ACS override enabled, the Onboard Audio being passed through will make Windows refuse to boot. I get stuck on the Windows logo after POST. This passthrough is infuriating

 

If it makes any difference, the way Windows refuses to boot is peculiar. It boots and POSTs, then the Windows logo appears. Once this happens the VM goes into the 'paused' state on the VM page for my tower. But the actual HTTP page doesnt actually load completely most of the time, the webpage loads until the Windows Entry in the VM manager, and the webpage is blank below that.

 

The only way to reset my VM in this state is 'destroying' it with virsh over SSH. As soon as the VM is destroyed the HTTP page loads the rest of the way and shows the Windows VM entry. Also the Windows logo stays on my display even though the VM is not running. I suspect that this behavior has to do with this line in the log:

 

2016-12-17T19:15:53.629077Z qemu-system-x86_64: vfio: Cannot reset device 0000:00:14.0, no available reset mechanism.
2016-12-17T19:15:53.629104Z qemu-system-x86_64: vfio: Cannot reset device 0000:00:1f.3, no available reset mechanism.

 

Where one of those PCI devices is my graphics card.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.