HDMI audio on macOS 10.14.6 KVM


Recommended Posts

Successfully passed through an rx570 to VM, running 4k glass smooth.  

 

However, can not for the life of me get HDMI audio passed through.  maxOS only recognizes soundflower emulated devices which won't output to monitor speakers.

 

Been trying for a month, so any advice greatly appreciated.  

 

Thanks!

 

Link to comment
  • 1 month later...

I'm trying to get HDMI passthrough audio to work too and no luck so far.

Here's my device XML:

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x1' multifunction='on'/>
    </hostdev>

and the Nvidia card from lspci:

06:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050] (rev a1)
06:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)

Sound doesn't come through the remote desktop. Windows 10, however, does come through. Using Google remote desktop to access the VMs.

  • Like 1
Link to comment
  • 2 months later...

@Leoyzen i wanted to thank you for your tip. I've been messing around with this for months and your advise solved it. This is my relevant xml part

 

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom file='/mnt/user/isos/vbios/Sapphire_RX570_8192_171019.rom'/>
      <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x09' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x1'/>
    </hostdev>

I'm running macox catalina with an amdrx570. I passed the bios and I'm not sure if it's necessary or not, but the result is it works and i have sound.

 

 

Link to comment
  • 3 years later...

I like to confirm that changing to same bus, but different function works.

Unraid 6.11.5, MacOS Big Sur. AMD 3600X, MSI Radeon RX560.

This is my XML file.

  <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <rom file='/mnt/disk1/isos/vbios/msi.rx.areoitx.oc.rom'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x0a' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x1'/>

 

hostdev upper part is the graphic.

vbios is dumped by gpu-z from techpowerup. vbios dump by spaceinvader youtube instruction doesn't work.

I added the line multifunction='on'. It's not added by default.

 

hostdev lower part is the HDMI sound from the same graphic card.

The bus was a different one, function was function='0x0', same as graphic.

So I changed to make sure bus is the same 0x05, and change the sound function to 0x1.

function='0x0'  << graphic function

function='0x1'  << sound function

 

 

I currently assign 3 cores/6 threads, which works fine. If I want to change to more core. eg. 4 core/8 threads , run the script "1_macinabox_helper"  (from spaceinvader instruction and template) from the User Scripts in the Settings.

This is a part in the "1_macinabox_helper" script:

# leave set to "no" when your core count is standard
# set to "yes" if boot hangs on the apple logo due to you assigned a non standard amount of cores to the vm
REMOVETOPOLOGY="yes"

<<Try with both removetopology set to yes and no.

 

Several issues happen:

1/ the above edits that I made so that graphic and sound functions work now got changed.

graphic part is assigned to bus 0x04,

multifunction='on' is removed

sound part is assigned to bus 0x05.

 

It's annoyed to go back to XML view to change these back to previously known working, as above. Now there's another issue:

2/ if assigning both graphic and sound to bus 0x04, screen is black.

.assigning both to bus 0x04, screen is still black.

.assigning both to bus 0x05, screen is still black.

.assigning both to bus 0x01 or 0x02 or 0x03, it will conflict with other devices

.to bus 0x00, slot 0x09 (using slot 9 to avoid the conflict with other devices which take up slot 1, 2, 3 ...), it runs, the screen is on, but booting is stuck at Apple logo.

 

Side note: it happens the same with Debian Linux/Ubuntu, had to change to bus 0x00, 0x01, 0x02, or 0x03 for graphic to be output to the screen.

 

I'm feeling that any bus above bus 0x03 will not work, just like the VM has only a limit number of buses, up to bus 0x03. I don't know how to change this.

Only bus 0x00 will allow to use many slot other than slot 0x00.

Bus 0x01 and above will only allow to use 1 slot, which is slot 0x00.

 

Any input would be appreciated.

 

 

 

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.