operating-system icon indicating copy to clipboard operation
operating-system copied to clipboard

Virtual Machine at 100% CPU load when passing USB audio device to VM

Open agners opened this issue 7 months ago • 4 comments

Describe the issue you are experiencing

When passing a USB port with a USB audio device plugged-in to the virtual machine, the machine suddenly starts consuming 100% (1 core) after a while. From top running on the HAOS shell it seems that ksoftirq and Pulseaudio are to blame:

    PID USER      PR  NI    VIRT    RES  %CPU  %MEM     TIME+ S COMMAND                                                                                                                                                                                                                                                      
     24 root      20   0    0.0m   0.0m  98.4   0.0     15,06 R [ksoftirqd/1]                                                                                                                                                                                                                                                
 800156 root       9 -11  102.0m  13.4m   4.7   0.7  18:18.66 S pulseaudio --system --disallow-exit --exit-idle-time=-1 --disable-shm -vvv

Looking at the interrupts it seems that they are continously counting up (at a rather high rate of 50k/s):

# cat /proc/interrupts 
           CPU0       CPU1
...
 37:          0 3786165586  PCI-MSIX-0000:07:1b.0   0-edge      xhci_hcd

Restarting the Audio plug-in stops the high CPU load. After a couple of days it suddenly comes back.

This is the Proxmox specific issue reported in https://github.com/home-assistant/plugin-audio/issues/60.

What operating system image do you use?

ova (for Virtual Machines)

What version of Home Assistant Operating System is installed?

15.2.dev20250410

Did the problem occur after upgrading the Operating System?

No

Hardware details

Proxmox 8.4.1 on a Intel NUC10i5FNH.

Steps to reproduce the issue

  1. Use Proxmox
  2. Forward an Audio device to the virtual machine (I've used the port forwarding mechanism, not sure if that is relevant)
  3. Wait for a few days for the problem to appear

Anything in the Supervisor logs that might be useful for us?

No logs coincide with the CPU spike/seem to be related to audio plug-in

Anything in the Host logs that might be useful for us?

No logs coincide with the CPU spike/seem to be related to audio plug-in

System information

System Information

version core-2025.5.0.dev202504220235
installation_type Home Assistant OS
dev true
hassio true
docker true
user root
virtualenv false
python_version 3.13.2
os_name Linux
os_version 6.12.23-haos
arch x86_64
timezone Europe/Zurich
config_dir /config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 15.2.dev20250410
update_channel dev
supervisor_version supervisor-2025.04.1.dev2101
agent_version 1.7.2
docker_version 28.0.4
disk_total 30.8 GB
disk_used 7.3 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization kvm
board ova
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.16.0), Studio Code Server (5.19.1), OpenThread Border Router (2.13.0), MariaDB (2.7.2), VLC (0.3.0), TellStick (2.1.0), Matter Server (7.0.0), Google Assistant SDK (2.5.0), Glances (0.21.1)
Dashboards
dashboards 2
resources 0
views 0
mode storage
Recorder
oldest_recorder_run April 11, 2025 at 7:59 AM
current_recorder_run April 22, 2025 at 9:49 AM
estimated_db_size 11.26 MiB
database_engine sqlite
database_version 3.48.0

Additional information

No response

agners avatar Apr 22 '25 08:04 agners