If you put in headphones, audio is delayed by a few milliseconds
Describe the issue
If you connect a pair of headphones (I tested this with wireless headphones, though it may also occur with wired headphones), and you try to change the volume through pavucontrol, the audio inside the VM is delayed a few milliseconds after the appropriate action is taken. For example, audio won't sync in videos, and if you pause a video, the audio keeps playing for a short moment.
Configuration
- UTM Version: 4.3.4
- macOS Version: 11
- Mac Chip (Intel, M1, ...): M1
Crash log
Debug log
Upload VM
Try switching the audio backed to CoreAudio
Do I have to restart the VM first?
Yeah after changing it
Sorry for taking so long to get back. This problem does occur if CoreAudio is enabled. Note that the delay only shows up if pavucontrol is opened.
It feels like a guest issue?
I mean, maybe? I didn't have this issue with the other QEMU fork, so maybe it's a SPICE thing.
CoreAudio backend doesn’t go through SPICE. Are you using QEMU 7.2.0?
This happens with 4.3.4 and 4.3.5.
Something I did not notice before: if you close pavucontrol, after a few seconds, it switches back to the default "mode". After the initial pavucontrol call, there seem to be two "modes" --- one, the default, where audio is delayed by ~1 sec. If you open pavucontrol, then it switches to the other mode, where audio is delayed by ~50 ms. This second mode is temporary and will switch in a few seconds once pavucontrol is closed. Both modes sound "different" --- one is not clearly worse than the other in terms of quality, but they definitely sound different.
If pavucontrol is open when the headphones are disconnected, then there is no sound in the VM until pavucontrol is exited.
This doesn't happen anymore with recent versions of QEMU, so I guess this issue can be closed.
What version of QEMU? Can you keep it open until QEMU is updated in UTM?
I'm not sure which release it was --- I'm on HEAD right now (I'm using a thin wrapper over QEMU).
Hi!
FYI I'm experiencing the same issue and (I have the impression) it becomes worse over time:
- Host: MacBook Pro M4 (Sequoia 15.1)
- Guest: Debian Trixie ARM64 (incl. qemu-guest-agent and spice-vdagent)
- UTM: Version 4.6.4 (107) (installed via Homebrew)
- Sound Device: virtio-sound-pci
- Sound Backend: "Default", "SPICE"
Switching the backend away from SPICE to coreaudio made the latency become much lower (not go away)! I installed pavucontrol just for this ticket and it seems to not switch to any low bitrate mode when using coreaudio (albeit the sound shortly stutters). With the default backend (SPICE), it does, though! The latency then isn't good with and without pavucontrol.
BTW: I had to explicitly close the VM window (the VM was already shut down) between switching sound backend, because otherwise starting the VM hangs.