You are not logged in.

#1 2018-06-09 08:45:35

Webbeh
Member
Registered: 2012-07-08
Posts: 44

[Solved] [Bluetooth] Mouse stops working after a random amount of time

Arch - default kernel v. 4.16.13-2, everything up to date.

I was having exactly the same problem as in this thread : https://ubuntuforums.org/showthread.php?t=2159645

My mouse disconnects at every session and won't want to reconnect, whatever I try, without having to reboot the computer.
Disconnecting & reconnecting, re-pairing the mouse, nothing worked.

dmesg's output :

[  912.557942] Bluetooth: hci0 corrupted ACL packet
[  912.557990] Bluetooth: hci0 ACL packet for unknown connection handle 12
[  921.829716] Bluetooth: hci0 corrupted ACL packet
[  921.829751] Bluetooth: hci0 ACL packet for unknown connection handle 12
[  933.857641] Bluetooth: hci0 corrupted ACL packet
[  933.857680] Bluetooth: Frame is too short (len 1)
[  945.556674] Bluetooth: hci0 corrupted ACL packet
[  945.556801] Bluetooth: hci0 ACL packet for unknown connection handle 12
[  945.556805] Bluetooth: hci0 ACL packet for unknown connection handle 1

A solution has been found by "obadz" : https://ubuntuforums.org/showthread.php … st12926730
It consists in disabling the autosuspend for bluetooth devices altogether.


Here's the script :

# Prevents the Bluetooth USB card from getting reset which disconnects the mouse
BTUSB_DEV="8087:07dc"
BTUSB_BINDING="$(lsusb -d "$BTUSB_DEV" |
    cut -f 1 -d : |
    sed -e 's,Bus ,,' -e 's, Device ,/,' |
    xargs -I {} udevadm info -q path -n /dev/bus/usb/{} |
    xargs basename)"


echo "Disabling autosuspend for Bluetooth USB Soundcard: $BTUSB_BINDING..."
echo -1 > "/sys/bus/usb/devices/$BTUSB_BINDING/power/autosuspend_delay_ms"

(all credits for this script go to "obadz" on the ubuntu forums).

In that script, replace the USB device identifier by your own bluetooth USB device ID.


Obadz put that script in the rc.d folder, but since Arch uses Systemd, I've made a systemd unit that works with it.

[Unit]
Description=Disable autosuspend for bluetooth devices
Requires=bluetooth.target
After=bluetooth.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/bt
NotifyAccess=main

[Install]
WantedBy=multi-user.target                    

You obviously need to set your own script's path in the ExecStart location.


Hope it will work for you too !

Offline

Board footer

Powered by FluxBB