I have Asrock Deskmini X300 (AMD) with old Intel 3160 WiFi + BT card, which I mostly use for Bluetooth headphones.
Since I bought it the Bluetooth has been extremely problematic. With any device I tried it randomly disconnected after a few minutes to a few hours, without any error. Only my sound device switched back to speakers. Also you couldn't turn off or on BT anymore, and computer needed a restart. This was not a problem when testing on Windows, so I knew the hardware is OK.
I suspected power management is at fault, but disabling any PCI-E power management using powertop
didn't help. I tried investigating Bluez and kernel issues, no luck.
Today I finally found out that on Intel cards Wi-Fi is connected with PCI-E, and the BT using USB. So I used lsusb
to find what device name my BT is, and then in powertop
I disabled Autosuspend for unknown USB device 3-2.1 (8087:07dc)
. And it fixed the problem!
And to make that stick over reboots I created /etc/systemd/system/BT_disable_PM.service
:
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/home/jacek/bin/BT_PM.sh
[Install]
WantedBy=multi-user.target
And /home/jacek/bin/BT_PM.sh
:
#!/bin/sh
echo 'on' > '/sys/bus/usb/devices/3-2.1/power/control';
Could power management be disabled for this device on the kernel level, so others don't have to do this fix?