P.S. This forum is not a guide, this is an explanation to my experience on playing osu! inside a virtual machine.
Good day everyone! Note that this topic might get technical, have some words that you don't understand, have inadequate info from my experience that I can't explain, and this topic can get long. Also this is probably my first time posting a very long topic and this may not be as organized with others so bear with me. Anyways, let's get started.
Few weeks ago, I got interested in virtual machine after watching a certain YouTuber who is like the "KVM God". My goal originally was to try out to play games with anti-cheat (which would be Genshin Impact) and probably stick with KVM for a while to feel if there is any difference from native Windows 10 and virtualized Windows 10.
And so I started installing Arch Linux as the host OS to an SSD. But before proceeding, I'll be dropping the important PC specs:
After doing all those parts, I started the game and it ran inside a virtual machine. Again, Genshin Impact has anti-cheat that it wouldn't run inside a virtual machine but it did. With the performance, I saw like very little to no performance impact at all. But note that it has cracking audio issue which happens both on guest (HDMI audio out) and the host (audio passthrough).
Until that time I started thinking about playing osu! inside a virtual machine... (Also the part of the original topic starts)
Ok, I'll start spewing more "technical words" to this topic. I know some of you would ask:
"SilentVoice, why didn't you just install osu! on your Arch Linux using Lutris and use WINE and call it a day?"
Short answer: I tend to break Linux easily (most especially the kernel patch that almost broke my previous installation of Linux).
Long answer:
There are things that you would wanna know some changes to the Linux community.
Recently/several months ago, there was a topic about the new audio/video server of Linux that could replace PulseAudio. And we know that PulseAudio is like the common audio server but this new audio/video server fixes the problem of PulseAudio like the latency and the usage. This is where PipeWire comes in. And I personally use PipeWire that comes with PulseEffects (a system-wide equalizer for Linux). I would love to try playing osu! with WINE but I didn't have time to set it up and since this is getting off-topic, this would be discussed on a different forum.
So with those answers on the side right now, I then proceed install osu! on the VM and download few standard and mania beatmaps. Remember what I said before about audio issue while I was playing Genshin Impact? This was my first hurdle playing osu! inside KVM.
Since I used HDMI audio at that time, there was a problem with the interrupts configured on the registry that makes the crackling sound on the output. I proceeded troubleshoot the problem and set the GPU to use MSI (Message Signaled Interrupts) which was supposedly the fix of the audio crackling issue (which it is) and trying out again, it worked well. But this doesn't fixed the hitsound latency issue that is somewhat present and a very weird bug that causes osu! to froze up for a while midgame and goes on like nothing happened.
Since I was not satisfied with the result, I tried passing through the audio via the manager itself with SPICE and to PipeWire/PulseEffects. Regretted instantly. Audio latency got even worse and the hitsound also sounded very off from the keyboard input to the speakers. SPICE has this like "network remote" way of sending audio to the audio server which explains why the audio had higher latency.
I've kicked things up to a notch where I ordered online a dedicated USB audio exclusively for passing audio from the VM to the speakers. Waited for a few days until I got it. After I got the USB audio I instantly hooked up the device into the VM. To my expectation, I expected that there will be no crackling sound that is present from the two previous attempts and fixes the hitsound latency issue. But it wasn't, there is still an occasional audio crackling issue that is present. This is because of the interrupt issue that is present inside the VM that affects audio only, I don't know if it's because the limitation to my CPU that has only 4 cores and 4 threads.
For more technical info about the interrupt, this is the comparison of the latency using LatencyMon:
Aside with the interrupt latency, the hitsound latency issue almost fixed it, but still noticeable to me.
I was somewhat satisfied with the result of the USB audio but the occasional audio crackling sound made me go dig more information from KVM forums.
This is where I stumbled Scream, a virtual device driver that performs as a discrete audio device. Since I was using PipeWire, this could benefit the audio latency I'm dealing with.
This is also the time I did a reconfiguration on my KVM and the system that fixed a bit of performance and uses only one GPU, which is not your typical thing when doing VM on the host.
Since I didn't have time to setup Scream with IVSHMEM driver, I did the network way of sending the audio stream from the guest to the host. Basically, the host has the Scream receiver which I installed from the Arch User Repository and it listens the audio from the client. After the setup, blacklisting Scream listener from PulseEffects (to prevent any latency delay from the equalizer), I tried it again playing osu! and for the first time in my life I've experienced near real-time or real-time audio latency inside VM. The audio crackling issue was gone, hitsound latency was gone, and the experience after playing with it for few hours it was like I was playing osu! in a native Windows 10 system.
"Cool, now the audio issue was fixed, how's the performance inside the virtual machine?"
To be honest, the frametime that I am seeing while using unlimited frametime, from time to time it jumps from 0.88ms to 1.7ms. When I am on my native Windows 10, the frametime goes around 0.56ms to 0.84ms, 0.51ms being the lowest. Not very much difference depending how you see it but there is a performance hit if the host is doing an activity like user interaction or background apps running.
Conclusion
Should you do this? No
But to those people want to try out...
You need a VT-d and IOMMU capable processor, a decent dedicated GPU, some considerable amount of RAM and hard drive for running a virtual machine, and a spare time.
The advantage of running Windows 10 on a virtual machine is the support of apps that you can't use on Linux which does not work with WINE. And if you don't like dual booting, this is the purpose of using a virtual machine. I don't know if I am the very first osu! player to perform this, who knows.
That's all for now. If someone actually perform this and can optimize it even better than mine, I don't know what to say but, good luck.
Good day everyone! Note that this topic might get technical, have some words that you don't understand, have inadequate info from my experience that I can't explain, and this topic can get long. Also this is probably my first time posting a very long topic and this may not be as organized with others so bear with me. Anyways, let's get started.
Few weeks ago, I got interested in virtual machine after watching a certain YouTuber who is like the "KVM God". My goal originally was to try out to play games with anti-cheat (which would be Genshin Impact) and probably stick with KVM for a while to feel if there is any difference from native Windows 10 and virtualized Windows 10.
And so I started installing Arch Linux as the host OS to an SSD. But before proceeding, I'll be dropping the important PC specs:
- Intel Core i5-6400
- 2 x T-Force Delta 8GB ; 1 x Adata 4GB
- Palit GeForce GTX 1060 6GB
After doing all those parts, I started the game and it ran inside a virtual machine. Again, Genshin Impact has anti-cheat that it wouldn't run inside a virtual machine but it did. With the performance, I saw like very little to no performance impact at all. But note that it has cracking audio issue which happens both on guest (HDMI audio out) and the host (audio passthrough).
Until that time I started thinking about playing osu! inside a virtual machine... (Also the part of the original topic starts)
Ok, I'll start spewing more "technical words" to this topic. I know some of you would ask:
"SilentVoice, why didn't you just install osu! on your Arch Linux using Lutris and use WINE and call it a day?"
Short answer: I tend to break Linux easily (most especially the kernel patch that almost broke my previous installation of Linux).
Long answer:
There are things that you would wanna know some changes to the Linux community.
Recently/several months ago, there was a topic about the new audio/video server of Linux that could replace PulseAudio. And we know that PulseAudio is like the common audio server but this new audio/video server fixes the problem of PulseAudio like the latency and the usage. This is where PipeWire comes in. And I personally use PipeWire that comes with PulseEffects (a system-wide equalizer for Linux). I would love to try playing osu! with WINE but I didn't have time to set it up and since this is getting off-topic, this would be discussed on a different forum.
So with those answers on the side right now, I then proceed install osu! on the VM and download few standard and mania beatmaps. Remember what I said before about audio issue while I was playing Genshin Impact? This was my first hurdle playing osu! inside KVM.
Since I used HDMI audio at that time, there was a problem with the interrupts configured on the registry that makes the crackling sound on the output. I proceeded troubleshoot the problem and set the GPU to use MSI (Message Signaled Interrupts) which was supposedly the fix of the audio crackling issue (which it is) and trying out again, it worked well. But this doesn't fixed the hitsound latency issue that is somewhat present and a very weird bug that causes osu! to froze up for a while midgame and goes on like nothing happened.
Since I was not satisfied with the result, I tried passing through the audio via the manager itself with SPICE and to PipeWire/PulseEffects. Regretted instantly. Audio latency got even worse and the hitsound also sounded very off from the keyboard input to the speakers. SPICE has this like "network remote" way of sending audio to the audio server which explains why the audio had higher latency.
I've kicked things up to a notch where I ordered online a dedicated USB audio exclusively for passing audio from the VM to the speakers. Waited for a few days until I got it. After I got the USB audio I instantly hooked up the device into the VM. To my expectation, I expected that there will be no crackling sound that is present from the two previous attempts and fixes the hitsound latency issue. But it wasn't, there is still an occasional audio crackling issue that is present. This is because of the interrupt issue that is present inside the VM that affects audio only, I don't know if it's because the limitation to my CPU that has only 4 cores and 4 threads.
For more technical info about the interrupt, this is the comparison of the latency using LatencyMon:
- Native Windows 10 = 65-230 μs
- VM Windows 10 = 450-1250+ μs
Aside with the interrupt latency, the hitsound latency issue almost fixed it, but still noticeable to me.
I was somewhat satisfied with the result of the USB audio but the occasional audio crackling sound made me go dig more information from KVM forums.
This is where I stumbled Scream, a virtual device driver that performs as a discrete audio device. Since I was using PipeWire, this could benefit the audio latency I'm dealing with.
This is also the time I did a reconfiguration on my KVM and the system that fixed a bit of performance and uses only one GPU, which is not your typical thing when doing VM on the host.
Since I didn't have time to setup Scream with IVSHMEM driver, I did the network way of sending the audio stream from the guest to the host. Basically, the host has the Scream receiver which I installed from the Arch User Repository and it listens the audio from the client. After the setup, blacklisting Scream listener from PulseEffects (to prevent any latency delay from the equalizer), I tried it again playing osu! and for the first time in my life I've experienced near real-time or real-time audio latency inside VM. The audio crackling issue was gone, hitsound latency was gone, and the experience after playing with it for few hours it was like I was playing osu! in a native Windows 10 system.
"Cool, now the audio issue was fixed, how's the performance inside the virtual machine?"
To be honest, the frametime that I am seeing while using unlimited frametime, from time to time it jumps from 0.88ms to 1.7ms. When I am on my native Windows 10, the frametime goes around 0.56ms to 0.84ms, 0.51ms being the lowest. Not very much difference depending how you see it but there is a performance hit if the host is doing an activity like user interaction or background apps running.
Conclusion
Should you do this? No
But to those people want to try out...
You need a VT-d and IOMMU capable processor, a decent dedicated GPU, some considerable amount of RAM and hard drive for running a virtual machine, and a spare time.
The advantage of running Windows 10 on a virtual machine is the support of apps that you can't use on Linux which does not work with WINE. And if you don't like dual booting, this is the purpose of using a virtual machine. I don't know if I am the very first osu! player to perform this, who knows.
That's all for now. If someone actually perform this and can optimize it even better than mine, I don't know what to say but, good luck.