Last active
November 30, 2022 10:48
-
-
Save rsrchboy/9748149 to your computer and use it in GitHub Desktop.
Disable autosuspend for bluetooth device 8087:07dc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ==> 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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