KVM / Audio Interface Passthrough

Any discussion that doesn't fit into any of the other categories goes here.
Post Reply
wisecar
Posts: 22
Joined: Mon Feb 27, 2023 9:54 am

KVM / Audio Interface Passthrough

Post by wisecar »

Just wondered if anyone here has tried passing through an audio interface to a guest in KVM? I've been considering switching to Linux for a while but it'd be really nice if I could say, run a Windows VM with Cubase and connect my interface to it.

Not expecting particularly good performance and not planning to do anything particularly extravagant, but it'd be nice to at least have the option.
User avatar
flatrute
Posts: 307
Joined: Sat Dec 17, 2022 11:32 am
Location: Thành phố Hồ Chí Minh, Việt Nam
Contact:

Re: KVM / Audio Interface Passthrough

Post by flatrute »

If I remember, the passthrough capability is for PCI devices, right? So if the interface uses PCI connection the process would be as if you were doing GPU passthrough. All I know is that I have successfully done a USB and GPU passthrough into a bhyve VM in FreeBSD before. Also could this post be in Software section, perhaps? Pinging Matt...
Last edited by flatrute on Thu Mar 02, 2023 3:50 am, edited 1 time in total.
It turns out leaving an Internet identity behind is hard MikeBruh

My username is read as "flatorte".

[deleted] posts index

Avatar source
wisecar
Posts: 22
Joined: Mon Feb 27, 2023 9:54 am

Re: KVM / Audio Interface Passthrough

Post by wisecar »

Probably should be in the software section - apologies.

In my case it is a Thunderbolt card and if memory serves I'm lucky in that I *think* it *should* at least be in its own IOMMU group but I'll need to try again when I have a moment and investigate.

I've seen people reporting issues with latency etc but I also have doubts as to how many of the people who've had issues actually tried it, versus those just making assumptions.
User avatar
flatrute
Posts: 307
Joined: Sat Dec 17, 2022 11:32 am
Location: Thành phố Hồ Chí Minh, Việt Nam
Contact:

Re: KVM / Audio Interface Passthrough

Post by flatrute »

wisecar wrote: Mon Feb 27, 2023 6:39 pm Probably should be in the software section - apologies.

In my case it is a Thunderbolt card and if memory serves I'm lucky in that I *think* it *should* at least be in its own IOMMU group but I'll need to try again when I have a moment and investigate.

I've seen people reporting issues with latency etc but I also have doubts as to how many of the people who've had issues actually tried it, versus those just making assumptions.
So Matt responded by...leaving this post here as it is? It does not matter anyway...

I think a bit of system background here should help in case of Technical Supporttm Thuink
It turns out leaving an Internet identity behind is hard MikeBruh

My username is read as "flatorte".

[deleted] posts index

Avatar source
User avatar
MattKC
Site Admin
Posts: 323
Joined: Mon Aug 22, 2022 1:05 am
Contact:

Re: KVM / Audio Interface Passthrough

Post by MattKC »

wisecar wrote: Mon Feb 27, 2023 6:39 pm Probably should be in the software section - apologies.
Strictly perhaps, but I don't think it's that big of a deal - it doesn't not fit in General.
wisecar wrote: Mon Feb 27, 2023 6:39 pm In my case it is a Thunderbolt card and if memory serves I'm lucky in that I *think* it *should* at least be in its own IOMMU group but I'll need to try again when I have a moment and investigate.

I've seen people reporting issues with latency etc but I also have doubts as to how many of the people who've had issues actually tried it, versus those just making assumptions.
Not 100% certain about Thunderbolt, I don't have any Thunderbolt devices so I have no personal experience. My interface is USB which is very easy to passthrough, but I think Thunderbolt can probably be passed through as a PCI-e device?

There will always be a certain degree of latency in a virtual machine since it's running at the whims of the host OS rather than having full control of the hardware, however with KVM there are definitely things you can do to mitigate that. If you run into issues, take a look at this section of the Arch wiki which goes over performance tuning your VM for maximum performance. Also, not sure if you're planning to do this, but a passed through GPU would obviously help immensely with mitigating VM overhead.
wisecar
Posts: 22
Joined: Mon Feb 27, 2023 9:54 am

Re: KVM / Audio Interface Passthrough

Post by wisecar »

MattKC wrote: Mon Feb 27, 2023 6:51 pm Not 100% certain about Thunderbolt, I don't have any Thunderbolt devices so I have no personal experience. My interface is USB which is very easy to passthrough, but I think Thunderbolt can probably be passed through as a PCI-e device?

There will always be a certain degree of latency in a virtual machine since it's running at the whims of the host OS rather than having full control of the hardware, however with KVM there are definitely things you can do to mitigate that. If you run into issues, take a look at this section of the Arch wiki which goes over performance tuning your VM for maximum performance. Also, not sure if you're planning to do this, but a passed through GPU would obviously help immensely with mitigating VM overhead.
Spent the morning installing Arch and trying. Installation process was uh, liberating, as someone who hasn't tried Arch before.

Passing through the Thunderbolt interface actually worked perfectly as far as I could tell, though I haven't tested anything particularly extravagant yet.

The bigger issue I've had is that the interface I was hoping to use for Linux - a Focusrite Scarlett 18i20, hasn't been playing ball. Or rather, it did work, initially it worked perfectly in fact, but then it seemed to uh, fall over a bit. I'm not entirely convinced that the issue isn't the interface itself rather than anything with Linux as it seems "iffy" with Windows and macOS as well, will investigate later when I have more free time.
User avatar
damy
Posts: 16
Joined: Sun Jan 01, 2023 9:10 pm
Location: EU

Re: KVM / Audio Interface Passthrough

Post by damy »

I personally passthrough my whole front usb with a small (usb) dac and no issues so far
Image
wisecar
Posts: 22
Joined: Mon Feb 27, 2023 9:54 am

Re: KVM / Audio Interface Passthrough

Post by wisecar »

damy wrote: Wed Mar 01, 2023 10:52 pm I personally passthrough my whole front usb with a small (usb) dac and no issues so far
Legend - possibly reaching a bit but did you ever try any music production software?

I suspect the people telling me in the past that it wouldn't work perhaps hadn't actually tried it.
User avatar
damy
Posts: 16
Joined: Sun Jan 01, 2023 9:10 pm
Location: EU

Re: KVM / Audio Interface Passthrough

Post by damy »

wisecar wrote: Thu Mar 02, 2023 3:38 pm Legend - possibly reaching a bit but did you ever try any music production software?

I suspect the people telling me in the past that it wouldn't work perhaps hadn't actually tried it.
It should work in theory since you give the whole USB controller to the vm, so it shouldn't be an issue.
I actually use FL Studio with my headsets dac some time to time, but on Linux (with Wine to be exact)
Image
Post Reply