Bug 1221702 - Bluetooth headphones not reconnecting upon logging in
Summary: Bluetooth headphones not reconnecting upon logging in
Status: NEW
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Sound (show other bugs)
Version: Leap 15.6
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Antonio Larrosa
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 12:22 UTC by Krzysztof Chmielewski
Modified: 2024-05-24 20:06 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
tiwai: needinfo? (kjchmielewski)


Attachments
hwinfo (2.48 MB, text/plain)
2024-03-19 12:22 UTC, Krzysztof Chmielewski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Chmielewski 2024-03-19 12:22:44 UTC
Created attachment 873633 [details]
hwinfo

I installed opensuse leap 15.6 beta on my laptop using official ISO, then I installed the pipewire-pulseaudio package. Next, I paired Bluetooth headphones in the Bluetooth settings, and the output device was correctly added in the sound settings.

The problem is that after logging out or restarting the system, the headphones do not automatically connect if they are turned on all the time. I have to turn off and turn on the headphones' power again, or initiate connection manually for them to connect and become available as an output device in the sound settings.

Is this expected beheviour? In leap version 15.5, this works as I expect, that is, after logging out or restarting, the Bluetooth connection disconnects, but upon logging in, the devices are automatically connected, even if they are continuously powered on and there is no need to turn them on again, or reconnect manually.
Comment 1 Takashi Iwai 2024-03-19 14:40:18 UTC
Could you test with the latest kernel in OBS Kernel:SLE15-SP6 repo?
  http://download.opensuse.org/repositories/Kernel:/SLE15-SP6/pool/

There have been similar reports, and they confirmed that the issue is gone with the latest kernel.
Comment 2 Krzysztof Chmielewski 2024-03-19 15:51:28 UTC
I installed kernel in OBS Kernel:SLE15-SP6 repo, but the issue is still there.

I shared a video that better shows what the problem is:
https://drive.google.com/file/d/1exnMeSRchynV6WGmpAWizn1TJuHvzmYp/view?usp=drive_link
Comment 3 Takashi Iwai 2024-03-19 16:06:06 UTC
Then it looks rather like a user-space issue.  I checked quickly my test laptop with Leap 15.6 and XFCE, and BT headset keeps working after re-login.

Are you using pulseaudio?  Or pipewire?

Also, install pavucontrol, and check whether the BT device is picked up as the primary device, too.
Comment 4 Krzysztof Chmielewski 2024-03-19 16:37:46 UTC
I'm using pipewire.

I installed pavucontrol, the BT device is picked up as the primary device when BT connection is established.
Comment 5 Takashi Iwai 2024-03-19 17:02:31 UTC
OK, then let's put the pipewire package maintainer into the loop, too.
Comment 6 Krzysztof Chmielewski 2024-03-19 17:06:15 UTC
I also installed XFCE, and the behavior is identical; after logging in, I have to re-establish the connection using blueman-manager in this case.
Comment 7 Takashi Iwai 2024-03-19 18:54:00 UTC
To verify whether it's a kernel regression or not, could you try to install the old Leap 15.5 kernel onto your 15.6 system, boot with it and test the behavior?
Comment 8 Krzysztof Chmielewski 2024-03-19 20:26:54 UTC
I installed Leap 15.5 kernel 5.14.21-150500.55.52-default, and booted with it.

It didn't change anything, I have to reconnect BT headphones manually, unless I switch them off and on again. 

Devices are paired, but upon logging out, the connection is closed and is not automatically re-established upon logging back in.
Comment 9 Krzysztof Chmielewski 2024-03-19 22:32:54 UTC
It works as it used to work in leap 15.5 when I downgraded pipewire and wireplumber to the versions from repositories for leap 15.5 (certain additional packages downgraded due to dependencies)

altair:/var/log # zypper pa --installed-only --repo Packman |  grep i+
i+ | Packman    | libpipewire-0_3-0         | 0.3.64-150500.3.7.pm.1                  | x86_64
i+ | Packman    | pipewire                  | 0.3.64-150500.3.7.pm.1                  | x86_64
i+ | Packman    | pipewire-alsa             | 0.3.64-150500.3.7.pm.1                  | x86_64
i+ | Packman    | pipewire-lang             | 0.3.64-150500.3.7.pm.1                  | noarch
i+ | Packman    | pipewire-libjack-0_3      | 0.3.64-150500.3.7.pm.1                  | x86_64
i+ | Packman    | pipewire-modules-0_3      | 0.3.64-150500.3.7.pm.1                  | x86_64
i+ | Packman    | pipewire-pulseaudio       | 0.3.64-150500.3.7.pm.1                  | x86_64
i+ | Packman    | pipewire-spa-plugins-0_2  | 0.3.64-150500.3.7.pm.1                  | x86_64
i+ | Packman    | pipewire-spa-tools        | 0.3.64-150500.3.7.pm.1                  | x86_64
i+ | Packman    | pipewire-tools            | 0.3.64-150500.3.7.pm.1                  | x86_64

altair:/var/log # zypper pa --installed-only --repo leap_15.5 |  grep i+
i+ | leap 15.5 | chrony                     | 4.1-150400.19.4                                | x86_64
i+ | leap 15.5 | dosfstools                 | 4.1-3.6.1                                      | x86_64
i+ | leap 15.5 | irqbalance                 | 1.9.2-150500.1.3                               | x86_64
i+ | leap 15.5 | libvdpau_va_gl1            | 0.4.2-bp155.4.8                                | x86_64
i+ | leap 15.5 | libwireplumber-0_4-0       | 0.4.13-150500.1.2                              | x86_64
i+ | leap 15.5 | ntfs-3g                    | 2022.5.17-150000.3.16.1                        | x86_64
i+ | leap 15.5 | ntfsprogs                  | 2022.5.17-150000.3.16.1                        | x86_64
i+ | leap 15.5 | numactl                    | 2.0.14.20.g4ee5e0c-150400.1.24                 | x86_64
i+ | leap 15.5 | os-prober                  | 1.76-150100.4.2.1                              | x86_64
i+ | leap 15.5 | pavucontrol                | 5.0-150400.1.8                                 | x86_64
i+ | leap 15.5 | shim                       | 15.7-150300.4.16.1                             | x86_64
i+ | leap 15.5 | wireplumber                | 0.4.13-150500.1.2                              | x86_64
i+ | leap 15.5 | wireplumber-audio          | 0.4.13-150500.1.2                              | noarch
i+ | leap 15.5 | wireplumber-lang           | 0.4.13-150500.1.2                              | noarch
Comment 10 Takashi Iwai 2024-03-20 06:40:43 UTC
Thanks for confirmation!  Then I toss this bug to Antonio.
Comment 11 Antonio Larrosa 2024-03-20 07:27:26 UTC
Thanks, Takashi :)

Krzysztof, can you try adding the 15.6 repository from the multimedia:libs project in obs and install the pipewire and wireplumber packages from there? The versions currently there (pipewire 1.0.4 and wireplumber 0.5.0) are the versions that will be in the final 15.6 so it would be great if you could test them. Please tell me if you want instructions on how to install those packages.
Comment 12 Krzysztof Chmielewski 2024-03-20 20:42:20 UTC
I added OBS multimedia:libs repository https://download.opensuse.org/repositories/multimedia:/libs/15.6/ and upgraded pipewire and wireplumber to the versions below:

i+ | obs multimedia:libs | libpipewire-0_3-0              | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire                       | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire-alsa                  | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire-lang                  | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire-libjack-0_3           | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire-modules-0_3           | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire-pulseaudio            | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire-spa-plugins-0_2       | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire-spa-tools             | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | pipewire-tools                 | 1.0.4-lp156.193.11                    
i+ | obs multimedia:libs | wireplumber                    | 0.5.0-lp156.1.1                       
i+ | obs multimedia:libs | wireplumber-audio              | 0.5.0-lp156.1.1                       
i+ | obs multimedia:libs | wireplumber-lang               | 0.5.0-lp156.1.1                       

I tested with the kernels 5.14.21 from leap 15.5 and 6.4.0 from leap 15.6, also with GNOME and XFCE.

For these versions of Pipewire and WirePlumber, the effect is the same/incorrect as for versions included in Leap 15.6, i.e. after logging in, I must manually initiate the connection using the applet if the headphones were powered on during that time. If I turn on the power after logging in, the connection is established automatically.
Comment 13 Krzysztof Chmielewski 2024-05-24 20:06:36 UTC
I figured out the issue. 

It seems it's a feature not a bug :-)

I created ~/.config/wireplumber/wireplumber.conf.d/bluetooth.conf containing :

[...]
monitor.bluez.rules = [
  ## The list of monitor rules

# This rule example allows changing properties on all Bluetooth devices.
{
  matches = [
    {
      ## This matches all bluetooth devices.
      device.name = "~bluez_card.*"
    }
  ]
  actions = {
    update-props = {
      ## Auto-connect device profiles on start up or when only partial
      ## profiles have connected. Disabled by default if the property
      ## is not specified.
      bluez5.auto-connect = [ a2dp_sink a2dp_source ] 
 #
 #       ## Hardware volume control (default: [ hfp_ag hsp_ag a2dp_source ])
 #       bluez5.hw-volume = [ hfp_hf hsp_hs a2dp_sink hfp_ag hsp_ag a2dp_source ]
 #
 #       ## LDAC encoding quality
 #       ## Available values: auto (Adaptive Bitrate, default)
 #       ##                   hq   (High Quality, 990/909kbps)
 #       ##                   sq   (Standard Quality, 660/606kbps)
 #       ##                   mq   (Mobile use Quality, 330/303kbps)
 #       bluez5.a2dp.ldac.quality = "auto"
 #
 #       ## AAC variable bitrate mode
 #       ## Available values: 0 (cbr, default), 1-5 (quality level)
 #       bluez5.a2dp.aac.bitratemode = 0
 #
 #       ## Opus Pro Audio encoding mode: audio, voip, lowdelay
 #       bluez5.a2dp.opus.pro.application = "audio"
 #       bluez5.a2dp.opus.pro.bidi.application = "audio"
    }
  }
}

setting property: bluez5.auto-connect = [ a2dp_sink a2dp_source ] 
causes desired behavior, headphones are automatically connecting upon logging into user session, when they are already paired and powered on. 

I think this setting was enabled by default in leap 15.5, because I did not set it previously for sure.

Otherwise everything seems to work as expected.