Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Disable autosuspend for bluetooth device 8087:07dc
# ==> see http://ubuntuforums.org/showthread.php?t=2159645&page=6&p=12926730#post12926730
# ==> this is almost a direct copy of the solution presented there. Thanks, obadz! :)
# (aka http://ubuntuforums.org/member.php?u=923361)
#
# Include this somewhere it gets called at boot, for optimal effect; e.g. /etc/rc.local
# Prevents the Bluetooth USB card from autosuspending, which (as of this edit) borks it
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 device: $BTUSB_BINDING..."
echo -1 > "/sys/bus/usb/devices/$BTUSB_BINDING/power/autosuspend_delay_ms"
#! /bin/sh
# unblock our bluetooth on resume. This appears to be necessary for certain
# Intel bluetooth interfaces.
case $1 in
suspend|suspend_hybrid|hibernate)
# No need to do anything here, AFAICT
:
;;
resume|thaw)
rfkill unblock bluetooth
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment