Virt-manager on Fedora 38 - media intermittent short delays

silverblue host, virt-manager, F38 guest, Kernel 6.2.11-300.fc38.x86_64

audio and video short delays, both incoming and outgoing

I have experienced the same on low bandwidth connections on regular machines in the past, but in this case it is working fine on the host. It is not a network problem.

Here are some examples:

  1. Playing a YouTube video on a guest, there are random very short stops, both for the video and the audio together. If the video is whole screen it happens every couple seconds. If the video is made small on the screen, it does not happen. The quality setting of the video does not matter, rather it is the size of the video. High res, low res, all the same. I am using a captured USB device headset for sound playback. All the video content gets rendered, so playing a video takes longer due to the addition of the little pauses.

  2. participating in a conference call from a guest the out going video from the webcam will sporadically tear and flash. If the meeting app has a video resolution setting, and I lower it enough, then the tearing will stop. Incoming audio will also periodically glitch. No one has complained about the outgoing audio. Using a captured USB headset.

  3. Same as number 1 and 2, but instead of using a captured USB headset, sound goes through the host. In this case sound will be delayed from video sometimes by several
    seconds. But it does not break up. It can make a video call look really funny.

I don’t trust some of these meeting apps so I prefer to run them in a VM. Similarly for general browsing and playing of videos. If this can be made to work, it looks like a very nice sand box solution.

So I am wondering, does the media go through the virtual network, and is there a way to increase its performance? Or is this sort of thing caused by something else?

1 Like

The codecs you installed on the guests too?

Having the pauses on the guest brings up the question of what you are using for graphics – especially since you say that they do not occur with low resolution but do with higher resolution.

It is known that many apps depend upon hardware acceleration for high res graphics and if that is not available then the CPU is tasked with software rendering the graphics, causing pauses and stuttering similar to what you describe. The VM usually has a virtual GPU, and also may be limited in both memory and number of cpus available, which aggravates this condition even more than when running on bare metal with a GPU capable of hardware acceleration.

You might choose to watch the cpu load in the VM when running graphics of this type, as well as memory usage. You might also allocate more resources to that VM.

If the stutters do not occur on the host then it usually would not be network related.

Yes, the problem is graphics performance. The machine has two graphics processors , but VM does not appear to be using them I did the following to get YouTube videos to play:

  1. Under “Video Virtio” select Model: virtio, check mark 3d acceleration.
  2. Under “Display Spice” Type: spice server, listen type: none, OpenGL: checked, drop down: I selected the native graphics processor. The auxiliary high performance processor seems to be owned by the hypervisor.

This fixed YouTube, but not the webcam problem. For meeting apps with a resolution setting I lower the webcam resolution and it works.

I have noticed that the more virtual machines there are, the slower it gets, even when they are sitting idle.

I think the real solution is to take the auxiliary graphics processor from the hypervisor, and then pass it through to the virtual machine. It looks involved, and I haven’t had a break to try that as this machine has become my main work machine.