Comments (3)
Thank you @jrouleau for the detailed explanation.
Sorry, I should have mentioned that I had subsequently gotten my system working. I previously had the kernel parameter btusb.enable_autosuspend=n
, but after changing the =n
to =0
, it now works as expected. I think I had previously found advice to use =n
somewhere, but this didn't seem to work. Now, even without bluetooth-autoconnect
, it seems to autoconnect fine in KDE Plasma.
Thanks again.
from bluetooth-autoconnect.
Does this currently not work with pipewire at all? I'm on Arch Linux using pipewire, pipewire-pulse, and wireplumber, and it doesn't seem to work for me. I installed the package, enabled and started bluetooth-autoconnect.service
, then tried the following, but it didn't seem to work.
$ systemctl --user enable --now pulseaudio-bluetooth-autoconnect
Unit /usr/lib/systemd/user/pulseaudio-bluetooth-autoconnect.service is added as a dependency to a non-existent unit pulseaudio.service.
My Bluetooth headset didn't automatically connect next time I tried.
I then tested modifying the pulseaudio-bluetooth-autoconnect.service
, changing all references of pulseaudio.service
to pipewire.service
. I started the service, but it immediately completed.
$ systemctl --user status pulseaudio-bluetooth-autoconnect
β pulseaudio-bluetooth-autoconnect.service - Bluetooth autoconnect service for pipewire
Loaded: loaded (/usr/lib/systemd/user/pulseaudio-bluetooth-autoconnect.service; enabled; preset: enabled)
Active: inactive (dead) since Mon 2022-08-15 15:23:06 AEST; 20h ago
Duration: 85ms
Process: 3262118 ExecStart=/usr/bin/bluetooth-autoconnect (code=exited, status=0/SUCCESS)
Main PID: 3262118 (code=exited, status=0/SUCCESS)
CPU: 77ms
Aug 15 15:23:06 my-hostname systemd[1098]: Started Bluetooth autoconnect service for pipewire.
The service file contains the following:
ExecStart=/usr/bin/bluetooth-autoconnect
So I tested running this manually. Again it just completes immediately. I'm not really sure if this is the command we should be running, so I tested bluetooth-autoconnect -d
instead. This indeed stayed open⦠but my headset didn't automatically connect next time I tried.
On further testing, I should note that bluetooth-autoconnect
and bluetooth-autoconnect -d
do work if have recently used Bluetooth. However, after not using Bluetooth for a while, the latter does not work at least. Perhaps relevant, I do have Bluetooth's auto-suspend disabled.
$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-linux root=UUID=<redacted> rw loglevel=3 cryptdevice=UUID=<redacted>:cryptroot:allow-discards root=/dev/mapper/cryptroot btusb.enable_autosuspend=n
from bluetooth-autoconnect.
This script is effectively the same as runnning bluetoothctl connect <device_mac>
for every paired+trusted device either as a oneshot with bluetooth-autoconnect
or whenever an adapter powers on with bluetooth-autoconnect -d
. This will not magically connect devices that do not announce themselves or are brought in from out of range. Oneshot attempts can be triggered manually whenever you like with bluetooth-autoconnect
(e.g. I have the bluetooth icon on my bar trigger bluetooth-autoconnect
when clicked for manual "scanning"). The daemon mode is used to connect when an adapter is powered on: pimarily during boot or when resuming from sleep/hibernation.
The pulseaudio-bluetooth-autoconnect
service is intended to be a oneshot script that triggers a connection attempt after pulseaudio is started as headsets fail to connect prior to the audio system running and is only relevant during boot. A similar oneshot service would likely be needed for pipewire to autoconnect during boot. I do not have any systems running pipewire so I am unable to test this at this time.
Again, this script is effectively just a wrapper around bluetoothctl connect <device_mac>
. Other than providing a convenience service to run itself after pulseaudio starts (manually running bluetooth-autoconnect
once after boot would have the same effect), it has nothing to do with which audio system you use. Issues connecting to your devices (i.e. bluetooth-autoconnect
says connecting to device ...
but the connection fails) are outside the scope of what we can support here. If a connection attempt is not made, ensure that the device is both paired and trusted and that the adapter is connected and powered on.
from bluetooth-autoconnect.
Related Issues (19)
- Missing dependency HOT 1
- Any success running bluetooth-autoconnect on Raspberry PI OS Lite bullseye? HOT 3
- Delayed restart after suspend/sleep HOT 2
- Reconnecting after resuming from sleep/suspend
- Installation issue HOT 2
- re-connect not working HOT 1
- Issue when trying to reconnect. HOT 1
- Only connect if the device is not alrready connected HOT 2
- feat: add command line args to include or exclude specific devices HOT 1
- build: package for nixos
- Device doesn't automatically reconnect if it is taken out of range HOT 2
- Add option for daemon to make periodic atempts to reconnect HOT 2
- Displayed name of bluetooth-autoconnect in ps / pstree HOT 1
- Only attempts to connect once at startup HOT 2
- /usr/bin/env: invalid option -- 'S'
- Debian Package HOT 2
- Autoconnect not restored HOT 2
- ioctl_is_connected() Can't get HIDP connection info HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bluetooth-autoconnect.