Roar: Guest to Host audio streaming for virtualized macOS setups

I wanted to share something I hacked on the other night, since it might be useful for the few of you who run macOS on KVM/QEMU.

Since the iOS development toolchain is only available for Apples fruity OS I do run macOS in a virtual machine on my Ryzen system. It works great with a passed through RX480, but the recent Fedora 33 release broke my virtual audio again. For my Windows guests I followed Geoffreys recommendation and gave Scream a try, with great success. Scream just streams raw PCM samples from the Windows Sound System over UDP, which a receiver application on the Host can pick up and play back through PulseAudio. Now I needed a similar solution for macOS that preferably works with the Scream receiver.

Given how simple the UDP based protocol of Scream is, I thought maybe I could build this myself. You can find the source, as well as setup instructions over on GitHub:

Its mostly derived from libsoundio’s recording example but just sinking to a UDP stream instead of a file. But different from Scream for Windows, this is not a native sound driver and does require a loopback driver like BlackHole or SoundFlower to access the system sound output.
There is nothing macOS specific about this application, since libsoundio supports many sound systems. However on Windows guests Scream is much nicer and all Linux sound systems support network sinks natively.

Let me know what you guys think, if you found it helpful or have any problems with it.

3 Likes