You are not logged in.
The problem is that my notebook wakes up almost immediately if my Bluetooth headset is connected and will continue to do so until I disconnect the headset.
I usually suspend via KDE shortcut for sleep, but even by manually issuing
systemctl suspend
the result is the same.
My headset Sony MDR-XB950bt has bluetooth v3.0,
Notebook has Bluetooth 4.2 via 'Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)'
Also I have used this to fix my headset's A2dp issues Bluetooth Pairing on Dual boot of Windows & Linux Mint/Ubuntu - Stop having to Pair Devices because every time I used windows/linux I needed to remove/add headset as a new device.
My network controller is here on pci
03:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)
And it's seems disabled here:
cat /proc/acpi/wakeup
Device S-state Status Sysfs node
PEG0 S4 *disabled pci:0000:00:01.0
PEGP S4 *disabled pci:0000:01:00.0
PEG1 S4 *disabled
PEGP S4 *disabled
PEG2 S4 *disabled
PEGP S4 *disabled
RP03 S3 *disabled pci:0000:00:1c.2
PXSX S3 *disabled pci:0000:03:00.0
RP05 S3 *disabled pci:0000:00:1c.4
PXSX S3 *disabled pci:0000:04:00.0
GLAN S4 *disabled
XHC S3 *enabled pci:0000:00:14.0
XDCI S4 *disabled
HDAS S4 *disabled pci:0000:00:1f.3
Thanks for your help in advance. I'll be happy to provide any information needed.
Last edited by lundibundi (2018-06-09 17:48:48)
Offline
Cross-check lsusb to ensure BT isn't wired via USB - you usually get an extra entry for wifi and BT.
In case, you could try to unbind the device. Also rfkilling BT in a sleep hook in /usr/lib/systemd/system-sleep/ might work.
Offline
Well, I'm not sure if it is, I have this 24f0:0142 and this 8087:0a2b Intel Corp. which may be the one but I'm not sure how to check. Can you suggest a way of doing that?
I also found net adapter's
subsystem_vendor 0x8086
subsystem_device 0x0010
and
vendor 0x8086
device 0x24fd
But those seem to be only PCI IDs
lsusb 3m
Bus 004 Device 003: ID 0451:8140 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 004 Device 002: ID 0451:8140 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 008: ID 0c45:6340 Microdia Camera
Bus 003 Device 006: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 003 Device 005: ID 1532:0024 Razer USA, Ltd Mamba
Bus 003 Device 007: ID 24f0:0142
Bus 003 Device 004: ID 058f:6254 Alcor Micro Corp. USB Hub
Bus 003 Device 003: ID 04a9:2676 Canon, Inc. LBP2900
Bus 003 Device 002: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 006: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 002: ID 13d3:5755 IMC Networks
Bus 001 Device 004: ID 04f3:0903 Elan Microelectronics Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
As for the second suggestion, yeah, setting up sleep hook will probably work, but I'd like to have my headphones reconnected after suspend and this is kinda hacky, so I'll use it in case nothing else works.
Last edited by lundibundi (2018-06-07 21:38:40)
Offline
Type "8087:0a2b" into google… (w/ quotes)
Since you unlikely(?) want to block usb from acpi wakeup, I'd go for the sleep hook. You can handle the resume there just fine (unblocking the rfkill or re-binding the device, whatever works itfp)
The BIOS probably wakes on BT events because of BT keyboards and why the headset fires permanently, I've no idea.
Offline
Thanks for your help.
So I ended up with this solution
systemd-service
[Unit]
Description=Bluetooth sleep hook
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=-/usr/local/bin/on-sleep-bluetooth.sh 'sleep'
ExecStop=-/usr/local/bin/on-sleep-bluetooth.sh 'wakeup'
[Install]
WantedBy=sleep.target
And a script
#!/bin/bash
DEVICE_MAC=10:4F:A8:3C:00:BB
STATE_FILE=/tmp/bt-device-$DEVICE_MAC-suspend
function get_device_status {
echo `bt-device -i $1 | rg -o 'Connected: (\d?)' -r '$1'`
}
function read_file_or {
echo `cat $1 2> /dev/null || echo $2`
}
function status_change {
if [ "$1" == "sleep" ]; then
local device_status=`get_device_status $DEVICE_MAC`
echo $device_status > $STATE_FILE
if [ "$device_status" = "1" ]; then
<<<"disconnect $DEVICE_MAC" bluetoothctl &> /dev/null
sleep 3
fi
elif [ "$1" == "wakeup" ]; then
local device_status=`get_device_status $DEVICE_MAC`
local was_active=`read_file_or $STATE_FILE "0"`
if [ "$was_active" == "1" ]; then
<<<"connect $DEVICE_MAC" bluetoothctl &> /dev/null
fi
fi
}
status_change $1
If anyone knows of a better solution I'll gladly accept.
Offline