When I turn on my headphones, my oled deck turns on. Neat, but unwanted when I’m using my headphones for other things, like my zoom meeting for work causing Dave the Diver sounds to come out of my headphones. How can I turn that off without disabling Bluetooth every time I put the deck to sleep?

  • rotopenguin
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    1 year ago

    Try putting a script like this in /lib/systemd/system-sleep/. Make sure it is executable.

    #!/bin/sh
    
    case $1 in
    	pre)
    		bluetoothctl power off
    		;;
    
    	post)
    		bluetoothctl power on
    		;;
    esac
    

    What I said before, looks like a dead end.

    Start with “cat /proc/acpi/wakeup” and “lspci”. My LCD deck doesn’t have the new BT chip with wakeup, but I think it might go like this

    Look at lspci, find the Bluetooth there (Maybe it’s just part of the wifi?). Note its PCI address, and find a value in /proc/acpi/wakeup that corresponds to that. Take the name from the first column of /proc/acpi/wakeup, and do something like “echo GPPn | sudo tee /proc/acpi/wakeup” . If this works, then you’ll want to (a) make a slightly more permanent version of this per the arch wiki, and (b) remember to undo that when Valve finally gets around to doing a proper control for this.

    https://wiki.archlinux.org/title/Power_management/Wakeup_triggers

    • twistypencil@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      I do not see a BT device in lspci, and the Network Adapter PCI address doesn’t show i /proc/acpi/wakeup,

      I tried to create a systemd unit file that would issue an rfkill on bluetooth on suspend, and then re-enable it on resume, but that didn’t work either. Interestingly, if I do systemctl stop bluetooth the bluetooth service stops, and then immediate starts again!

      (A)(root@steamdeck deck)# lspci
      00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Root Complex
      00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
      00:01.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] VanGogh PCIe GPP Bridge
      00:01.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] VanGogh PCIe GPP Bridge
      00:01.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] VanGogh PCIe GPP Bridge
      00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
      00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Internal PCIe GPP Bridge to Bus
      00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Internal PCIe GPP Bridge to Bus
      00:08.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Internal PCIe GPP Bridge to Bus
      00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 71)
      00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
      00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Data Fabric; Function 0
      00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Data Fabric; Function 1
      00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Data Fabric; Function 2
      00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Data Fabric; Function 3
      00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Data Fabric; Function 4
      00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Data Fabric; Function 5
      00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Data Fabric; Function 6
      00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] VanGogh Data Fabric; Function 7
      01:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. OM3PDP3 NVMe SSD (rev 01)
      02:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)
      03:00.0 Network controller: Qualcomm Technologies, Inc QCNFA765 Wireless Network Adapter (rev 01)
      04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Device 1435 (rev ae)
      04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller
      04:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] VanGogh PSP/CCP
      04:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] VanGogh USB0
      04:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] VanGogh USB1
      04:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor (rev 50)
      05:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Raven/Raven2 PCIe Dummy Function (rev 61)
      06:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] VanGogh SecUSB
      
      (A)(root@steamdeck deck)# cat /proc/acpi/wakeup 
      Device  S-state   Status   Sysfs node
      GPP0      S4    *disabled
      GPP1      S4    *enabled   pci:0000:00:01.2
      GPP2      S4    *enabled   pci:0000:00:01.3
      GPP3      S4    *enabled   pci:0000:00:01.4
      GPP4      S4    *disabled
      GPP5      S4    *disabled
      GP17      S4    *enabled   pci:0000:00:08.1
      XHC0      S4    *enabled   pci:0000:04:00.3
                      *disabled  platform:dwc3.1.auto
      XHC1      S4    *enabled   pci:0000:04:00.4
      GP19      S4    *enabled   pci:0000:00:08.3
      XHC2      S4    *disabled  pci:0000:06:00.0
      ```*___*
      • rotopenguin
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Oop. Look up. I changed the parent post, maybe this time it’ll work?