Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.0, 5.11.1
-
None
-
debian testing amd64
ubuntu bionic armhl
Description
Hi
When i run a BLE scann the cpu usage increase
for exemple on a Core(TM) i5-4430 debian testing
top return
584 message+ 20 0 59772 5732 2956 S 6.3 0.0 1:11.62 dbus-daemon 22142 simon 20 0 885068 84180 56608 S 4.6 0.5 0:01.12 bouchoniqati3 (my app) 13909 root 20 0 56356 5740 5040 S 2.6 0.0 0:02.84 bluetoothd 6.3+4.6+2.6= 13.5% of cpu use
on a colibri IMX6ULL (arm cpu) ubuntu bionic / self build QT
top say bluetoothd+dbus-daemon+bouchoniqati3 use 30% of cpu but the computer are realy slow then i think he use more of 30% or he use to many memory bandwidth
My ble code are
discoveryAgent=new QBluetoothDeviceDiscoveryAgent(); discoveryAgent->setLowEnergyDiscoveryTimeout(0); //for ever discoveryAgent->stop(); discoveryAgent->start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod);
(I do not have connect any signal for this test)
for compare if i run
sudo hcitool lescan --duplicates > /dev/null
top return
25299 root 20 0 10836 1104 1000 S 0.3 0.0 0:00.05 hcitool 22243 simon 20 0 805748 66292 55068 S 0.7 0.4 0:26.01 konsole
dbus-daemon and bouchoniqati3 IS not visible in top (0% cpu use)
If i remove
discoveryAgent->start(QBluetoothDeviceDiscoveryAgent::LowEnergyMethod);
the cpu usage remains below 1%
if i have a small number of bluetooth device the cpu usage decrease (the top value are with 9 devices ~90 adevertisement in 1seconde)
Thanks you for your job
I append a capture of dbus with dbus-monitor --system
You can watch he call org.freedesktop.DBus.Properties; member=Get every 0.0005 seconde
method call time=1530104976.146511 sender=:1.3593 -> destination=org.bluez serial=9659 path=/org/bluez/hci0/dev_B0_B4_48_E9_B3_82; interface=org.freedesktop.DBus.Properties; member=Get string "org.bluez.Device1" string "Address" method return time=1530104976.146527 sender=:1.3510 -> destination=:1.3593 serial=11518 reply_serial=9659 variant string "B0:B4:48:E9:B3:82"