Bluetooth autoconnect

  • Maybe just a myself-reminder. but I have saved a gist with the udev rules needed for letting my LE box to autoswitch the output audio device on bluetooth connected device.


    The outcome is:
    BT connected -> pulse active (A2DP output)
    BT disconnected -> alsa active (HDMI output)


    Feel free to comment or suggest improvements.

  • If you (we) figure out how to autodetect the MAC address this could be something we bundle in to the distro?


  • If you (we) figure out how to autodetect the MAC address this could be something we bundle in to the distro?


    Possibly, however it may be semi-hacky.


    Would be nice to have an option in the LibreELEC-settings to enable/disable the function


  • What is the purpose of this? How the pulse and alsa can active together? Why the HDMI output when BT connected?

    RPI3 1GB, Z4 RK3368 1GB, MINI MX-G 2GB, Mini M8S II (coreelec.org 9.2.1), H96 Pro (coreelec.org 9.2.1), ODORID N2 (coreelec.org 9.2.1), VIM3 PRO (coreelec.org 9.2.1), Beelink GT King (coreelec.org 9.2.1), Denon AVR-X2600H, LG 60SJ810V
    pel.hu

  • The purpose is to switch audio output to pulse/BT when a specific device (selected by MAC address) is connected.

  • Pelican: there was a typo. Just an output is active at a moment


    lrusak: a GUI configurable behaviour would be priceless. At the bluetooth screen, it could be chosen if this autoswitch would run, thus, the MAC address will be known, addressing chewitt idea

  • Just to say I use this with audioprofilesswitcher, so instead of pointing to your bluetoothHandler.sh I use a couple of shell scripts to switch audio profiles.
    eg as simple as

    Code
    [code]
    #!/bin/sh
    
    
    /usr/bin/kodi-send --action="RunScript(script.audio.profiles,1)"


    [/code]
    It works great for me, many thanks for documenting it.


  • Maybe this works better?

    Edited once, last by Bloksel ().