Problem with audio passthrough in virtual mac

Hi

Im trying to get audio working in my virtual mac. Everything except audio is currently working.

The audio device sits in its own iommu grup and can be seen here

tonny@tonny-System-Product-Name** : **/home/osx/OSX-KVM** $ ./ls-iommu.sh | grep "Group 24"
IOMMU **Group 24** 09:00.4 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller [1022:1487]

i pass it via boot grub config like this (together with disply adaptor)

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=on iommu=pt vfio-pci.ids=1002:731f,1002:ab38,1022:1487 video=efifb:off"

i also load the applealc kernel module in config.plist like this

		<dict>
			<key>Arch</key>
			<string>x86_64</string>
			<key>BundlePath</key>
			<string>AppleALC.kext</string>
			<key>Comment</key>
			<string>Audio patches</string>
			<key>Enabled</key>
			<true/>
			<key>ExecutablePath</key>
			<string>Contents/MacOS/AppleALC</string>
			<key>MaxKernel</key>
			<string></string>
			<key>MinKernel</key>
			<string>12.0.0</string>
			<key>PlistPath</key>
			<string>Contents/Info.plist</string>
		</dict>

but osx still shows no audio devices.

i have no sound in ubuntu when i boot up, so i gues the passthrough is working, osx simply does not se the audio device.

any help is much apriciated. Thank you very much for this excelent forum btw.

  • Tonny

i just checked to se the applealc is actually loaded, and it seems so

tonny@tonnys-iMac-Pro ~ % kextstat | grep -i alc
Executing: /usr/bin/kmutil showloaded
No variant specified, falling back to release
   50    0 0                  0x169000   0x169000   as.vit9696.AppleALC (1.5.4) 8C9B5F07-7F19-3BED-B331-B4827F402569 <48 14 8 6 5 3 2 1>

Digging in the log (found the commands via applealc homepage) i get this

Filtering the log data using "process == "kernel" AND (composedMessage CONTAINS "AppleALC" OR composedMessage CONTAINS "Lilu")"
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp                       (process)[PID]    
2020-12-30 06:16:04.541523-0800  localhost kernel[0]: calling mpo_policy_init for Lilu
2020-12-30 06:16:04.554159-0800  localhost kernel[0]: Security policy loaded: Lilu Kernel Extension 1.4.9 (Lilu)
2020-12-30 06:16:08.654054-0800  localhost kernel[0]: (Lilu) AppleALC       alc: @ error: no layout-id property found in configuration
2020-12-30 06:16:45.452232-0800  localhost kernel[0]: (Lilu) AppleALC       alc: @ failed to obtain device info for analog controller (1)
2020-12-30 06:34:52.599146-0800  localhost kernel[0]: calling mpo_policy_init for Lilu
2020-12-30 06:34:52.611741-0800  localhost kernel[0]: Security policy loaded: Lilu Kernel Extension 1.4.9 (Lilu)
2020-12-30 06:34:56.111126-0800  localhost kernel[0]: (Lilu) AppleALC       alc: @ error: no layout-id property found in configuration
2020-12-30 06:35:02.454734-0800  localhost kernel[0]: (Lilu) AppleALC       alc: @ failed to obtain device info for analog controller (1)
2020-12-30 15:06:52.907818+0000  localhost kernel[0]: (Lilu) AppleALC       alc: @ error: no layout-id property found in configuration
2020-12-30 15:06:52.907918+0000  localhost kernel[0]: (Lilu) Lilu      user: @ disabling user patcher on request!
2020-12-30 15:07:04.459803+0000  localhost kernel[0]: (Lilu) AppleALC       alc: @ failed to obtain device info for analog controller (1)
2020-12-30 07:08:52.979305-0800  localhost kernel[0]: (Lilu) AppleALC       alc: @ error: no layout-id property found in configuration
2020-12-30 07:08:52.979894-0800  localhost kernel[0]: (Lilu) Lilu      user: @ disabling user patcher on request!
2020-12-30 07:09:05.459027-0800  localhost kernel[0]: (Lilu) AppleALC       alc: @ failed to obtain device info for analog controller (1)
2021-01-01 07:16:01.887586-0800  localhost kernel[0]: (Lilu) AppleALC       alc: @ error: no layout-id property found in configuration
2021-01-01 07:16:01.887714-0800  localhost kernel[0]: (Lilu) Lilu      user: @ disabling user patcher on request!
2021-01-01 07:16:12.105642-0800  localhost kernel[0]: (Lilu) AppleALC       alc: @ failed to obtain device info for analog controller (1)
2021-01-01 07:29:24.749125-0800  localhost kernel[0]: (Lilu) Lilu      user: @ disabling user patcher on request!
2021-01-01 07:31:18.822476-0800  localhost kernel[0]: (Lilu) Lilu      user: @ disabling user patcher on request!
2021-01-01 07:33:58.572545-0800  localhost kernel[0]: (Lilu) Lilu      user: @ disabling user patcher on request!
2021-01-04 17:27:43.021806+0100  localhost kernel[0]: (Lilu) AppleALC       alc: @ error: no layout-id property found in configuration
2021-01-04 17:27:43.022600+0100  localhost kernel[0]: (Lilu) Lilu      user: @ disabling user patcher on request!

so i gues i need some kind of layout id, any suggestions on how to get that setup correctly ?

i tried mounting the efi folder and adding alcid=11 to boot arguments. Now the virtual machine cannot start. I will have to figure out how to mount the efi partition from within ubuntu somehow

ok so i managed to reset the EFI via redownloading the osx-kvm repos and just reploace my xml configs and disks and base system and osx can now boot again.

I cannot figureout if it was the alcid=11 that prevneted the boot.