You are not logged in.

#1 2019-11-17 23:29:24

SurlyCycler
Member
Registered: 2019-10-26
Posts: 47

[Solved]Gnome - Bluetooth autoconnect and Daemons on login

I have been puttering around with a bluetooth headset problem for a bit.

I finally got autoconnect to function but discovered one other problem.

I discovered that when I turn my headset on at boot you will hear them connect. This is prior to logging into my profile.
however, when I log into my profile on gnome I loose the connection. and it acts up again

But, when I restart bluetooth.service the "problem goes away" and the system will function as it is supposed to
ie I can turn on and off and on again your bluetooth headset and it will autoconnect correctly


Im wondering if there is something that shuts off the bluetooth.service when i login?

i think if i wrote a bash script that says "systemctl restart bluetooth.service " might fix the problem temporarily
Or maybe i should look at how the daemon functions at login?

any thoughts?

Last edited by SurlyCycler (2019-12-07 01:20:06)

Offline

#2 2019-11-18 08:19:47

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,790

Re: [Solved]Gnome - Bluetooth autoconnect and Daemons on login

GDM starts it's own pulseaudio which takes control of your headset, you have to prevent it from starting it's own pulse, see https://wiki.archlinux.org/index.php/Bl … e_with_GDM and/or https://bbs.archlinux.org/viewtopic.php … 4#p1864544

Offline

#3 2019-11-18 20:17:45

SurlyCycler
Member
Registered: 2019-10-26
Posts: 47

Re: [Solved]Gnome - Bluetooth autoconnect and Daemons on login

Hi and thank you for replying

I had a chance to read through the articles you provided. They were very informative.
However, they had more to do with not being able to play sound.
I do have sound and my drivers working.

I should have clarified in the initial post that i dont have pulseaudio-bluetooth installed.

installed on laptop

pulseaudio-modules-bt (aur) >> fixes a2dp LDAC drivers (and other a2dp drivers)

bluetooth-autoconnect (aur) >> fixes autoconnecting problems when bluetooth.service is working

The last problem is for login. it always requires a systemctl restart bluetooth. Especially when i  logout then login or suspend then login.
Its a bit annoying but they are not unusable.

Offline

#4 2019-11-18 21:24:07

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,790

Re: [Solved]Gnome - Bluetooth autoconnect and Daemons on login

I know, but your headset is "logically" registered to GDMs pulseaudio. When you restart the bluetooth service you disconnect the headset and reconnect it to the correct pulse instance from your own user. You just said it's unusable until you disconnect, which very much sounds like these symptoms.

Offline

#5 2019-11-18 22:25:15

SurlyCycler
Member
Registered: 2019-10-26
Posts: 47

Re: [Solved]Gnome - Bluetooth autoconnect and Daemons on login

I think i hear what your saying. it does seem like two things trying to control the headset. and it does make sence.

when i tried the pulseaudio socket; it simply woundnt run (following the instruction set).
I do get that. the socket listens but doesnt act until it hears that it needs to activate.

Maybe pulseaudio-module-bt has something set up i dont see.

Im going to keep looking into this direction. and thank you again for helping.

Offline

#6 2019-11-20 00:36:33

SurlyCycler
Member
Registered: 2019-10-26
Posts: 47

Re: [Solved]Gnome - Bluetooth autoconnect and Daemons on login

Solved the issue altogether... at least for me.

Unpair headset
$ bluetoothctl
[bluetooth] remove <headset mac_id>
[bluetooth] exit

install
git clone https://aur.archlinux.org/pulseaudio-modules-bt-git.git  aur
git clone https://aur.archlinux.org/libldac.git                                 aur
git clone https://aur.archlinux.org/bluetooth-autoconnect.git        aur

------------------------------------------------------
FOR PULSE AUDIO
modify /etc/pulse/default.pa to state the following after section "### Automatically suspend sinks/sources that become idle for too long"

# automatically switch to newly-connected devices 
load-module module-switch-on-connect
load-module module-bluetooth-policy
load-module module bluez5-device
load-module module-bluetooth-discover a2dp_config="ldac_eqmid=sq"

##and at the very bottom
### Make some devices default
set-default-sink alsa_output.pci-0000_03_00.6.analog-stereo
set-default-source alsa_input.pci-0000_03_00.6.analog-stereo

------------------------------------------------------
FOR GDM SORTS OUT SOCKET/DAEMON CONFLICT BETWEEN PULSE AND BLUETOOTH

sudo -u gdm mkdir -p /var/lib/gdm/.config/systemd/user 
sudo -u gdm ln -s /dev/null /var/lib/gdm/.config/systemd/user/pulseaudio.socket

------------------------------------------------------
ADD YOUR HEADSET

bluetoothctl
power on
agent on
default-agent
scan on
pair XX:XX:XX:XX:XX:XX < your headphones "ID"
trust XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
scan off
exit

-------------------------------------------------------
CREATE GROUP IN ORDER TO JOIN HARDWARE AND USER

sudo groupadd pulse-users
sudo chown -R root:pulse-users /usr/bin/pulseaudio
sudo usermod -a -G pulse-users $USER
sudo chmod 650 /usr/bin/pulseaudio
and reboot

If there are problems, dont hesitate to ask for direction. I can post my entire default.pa configuration if required.

Last edited by SurlyCycler (2019-12-07 01:18:07)

Offline

Board footer

Powered by FluxBB