core: Bluetooth integration causes high CPU usage
The problem
System CPU usage is consistently high when the bluetooth integration is enabled. I tested with Bluetooth enabled and disabled.
I’m running Home Assistant OS on Proxmox, with an Intel 9260 Bluetooth adapter passed through as a USB device. As reported by Proxmox, the CPU usage (of the VM) shows 12-15% hourly average with bluetooth enabled, and 3-5% with bluetooth disabled.
What version of Home Assistant Core has the issue?
2022.11.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Bluetooth
Link to integration documentation on our website
https://www.home-assistant.io/integrations/bluetooth/
Diagnostics information
No response
Example YAML snippet
None. Enabling the Bluetooth integration causes this issue to occur.
Anything in the logs that might be useful for us?
No relevant log messages
Additional information
Diagnostics of bluetooth suggests it has discovered over 30 different devices.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (14 by maintainers)
It looks like its the dbus overhead that’s causing the higher cpu as bluetoothd, pulseaudio, and home assistant are all heavy dbus users talking to dbus-broker. At 7000 advertisements per minute, thats going to be a lot to process for any system (even with my desk littered with test bluetooth devices, my Odroid n2+ is only processing ~4500-5000/min).
dbus-broker is the fastest dbus option out there so it there likely isn’t anything we can do to improve the performance.
It is a bit surprising though that an RPI4b can process more advertisements and end up with a lower cpu % calculation so there might be something else going on with the system
Its also possible you might have a single device that is flooding your system with advertisements. You might take a look at running
bluetoothctland see if you can pin point a specific device.