Lenovo XT99 BT headset can't work in HFP profile

Bug #2051895 reported by Hui Wang
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HWE Next
New
Undecided
Unassigned
pulseaudio (Ubuntu)
Fix Released
High
Unassigned
Jammy
Fix Released
High
Hui Wang
Mantic
Fix Released
High
Unassigned
Noble
Fix Released
High
Unassigned

Bug Description

[Summary]
When use the ThinkPluse xt99 bluetooth head set to run the test com.canonical.certification::bluetooth/audio_record_playback, it cannot record the sound and playback.
It seems this device cannot switch to Hand free mode in this platform.

[Steps to reproduce]
Connect the ThinkPluse xt99, use the Handfree mode, then try to record some voice.

[Expected result]
The bluetooth headset ThinkPluse xt99 can use as a MIC to input sound.

[Actual result]
The bluetooth headset xt99 cannot work in the Handfree mode.

[Failure rate]
100%

[Impact]
With the current Ubuntu 22.04 oem image, we try to connect the LENOVO
XT99 bt headset and let it work in HFP mode, we select HFP profile
from gnome sound-setting, but the microphone will not auto change to
bt microphone and the bt output could not work too. So this BT headset
could only work in A2DP mode with the current 22.04 OEM image.

And we tried ubuntu 22.04 generic image, mantic image and noble image,
none of them could make the headset work in HFP mode.

[Fix]
Cherry-pick a pulseaudio commit from upstream.

[Test]
I installed ubuntu 22.04 and 23.10 on 2 different Thinkpad laptops, then upgraded the pulseaudio from my ppa (ppa:hui.wang/pa-testing), in theory my change only affects bluetooth audio devices, it will not bring any impact to non-audio bluetooth devices, here I did the test with 7 bluetooth audio devices and 2 non-audio devices:

BT audio devices (pairing, connection, re-connection, playback and capture all worked well):
PLT_BBTGO2 (headset)
Xiaomi Air3 SE (headset)
Crusher Wireless (headset)
SOAIY S18 (sound box)
HK Soho Wireless (headset)
Thinkplus XT99 (headset)
Wl-1000X (headset)

BT non-audio devices (pairing, connection, re-connection, key input all worked well):
BT3.0 Keyboard
The Pinao 2 keyboard

[Where problems could occur]
This change will impact bt headset negotiation process in the pulseaudio,
so the possiblity of regression is limited to bt headset, it could make
the bt headset fail to connect, but this possibility is very low, we tested
the patch with different bt headset and bt speaker, all worked well.

Hui Wang (hui.wang)
affects: linux-oem-6.1 (Ubuntu) → pulseaudio (Ubuntu)
Hui Wang (hui.wang)
Changed in pulseaudio (Ubuntu Jammy):
importance: Undecided → High
Changed in pulseaudio (Ubuntu Mantic):
importance: Undecided → High
Changed in pulseaudio (Ubuntu Noble):
importance: Undecided → High
Changed in pulseaudio (Ubuntu Jammy):
assignee: nobody → Hui Wang (hui.wang)
tags: added: oem-priority originate-from-2045342 sutton
Revision history for this message
Hui Wang (hui.wang) wrote :

sponsor team, this is the debdiff for jammy

thx.

description: updated
Revision history for this message
Hui Wang (hui.wang) wrote :

sponsor team, this is the debdiff for mantic

thx.

Revision history for this message
Hui Wang (hui.wang) wrote :

sponsor team, this is the debdiff for noble

thx.

Changed in pulseaudio (Ubuntu Jammy):
status: New → In Progress
Changed in pulseaudio (Ubuntu Mantic):
status: New → In Progress
Changed in pulseaudio (Ubuntu Noble):
status: New → In Progress
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Hello Hui,

The changes look good to me, but I have a few minor requests:

- Could you please expand the changelog entry and explain what the patch fixes? It doesn't need to be a long text or anything like that; just a small sentence is enough.

- Could you add DEP-3 headers to the patch, please? You can find more information here:

https://dep-team.pages.debian.net/deps/dep3/

but basically, I'm looking for something like:

Origin: upstream, https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/d7dc04e8f5c404b1fa16409f69dcde7c56312f02
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/2051895

I'm unsubscribing ubuntu-sponsors from the bug for now. Please resubscribe it once you've addressed the points above.

Thanks.

Revision history for this message
Hui Wang (hui.wang) wrote :

Please ignore my previous SRU in the #1, #2 and #3.

I will upload updated debdiff according to #4.

thx.

Revision history for this message
Hui Wang (hui.wang) wrote :

Re-subscribe ubuntu-sponsor team and please review my new updated debdiffs:

This is the debdiff for noble.

thx.

Revision history for this message
Hui Wang (hui.wang) wrote :

Sponsor team, this is the debdiff for mantic:

thx.

Revision history for this message
Hui Wang (hui.wang) wrote :

Sponsor team, this is the debdiff for Jammy:

thx.

Revision history for this message
Steve Langasek (vorlon) wrote :

I've sponsored this for noble. For the SRUs, I would like to see a test case explicitly included that says you will regression-test this on other bluetooth pairings on other devices: the patch is not a platform-specific quirk, it is a change to generic bluetooth code, so there should be explicit tests that it does not break other devices.

You mention in "where problems could occur" that you *have* tested the patch; but we should test the actual binaries produced as part of the SRU process, to be certain.

Changed in pulseaudio (Ubuntu Noble):
status: In Progress → Fix Committed
Changed in pulseaudio (Ubuntu Mantic):
status: In Progress → Incomplete
Changed in pulseaudio (Ubuntu Jammy):
status: In Progress → Incomplete
Revision history for this message
Hui Wang (hui.wang) wrote :

OK, will find more bt audio devices to do the test.

Revision history for this message
Hui Wang (hui.wang) wrote :

I applied the patch and built the binary for jammy and mantic in my ppa (https://launchpad.net/~hui.wang/+archive/ubuntu/pa-testing)

I installed ubuntu 22.04 and 23.10 on 2 different Thinkpad laptops, then upgraded the pulseaudio from my ppa (ppa:hui.wang/pa-testing), in theory my change only affects bluetooth audio devices, it will not bring any impact to non-audio bluetooth devices, here I did the test with 7 bluetooth audio devices and 2 non-audio devices:

BT audio devices (pairing, connection, re-connection, playback and capture all worked well):
PLT_BBTGO2 (headset)
Xiaomi Air3 SE (headset)
Crusher Wireless (headset)
SOAIY S18 (sound box)
HK Soho Wireless (headset)
Thinkplus XT99 (headset)
Wl-1000X (headset)

BT non-audio devices (pairing, connection, re-connection, key input all worked well):
BT3.0 Keyboard
The Pinao 2 keyboard

description: updated
Changed in pulseaudio (Ubuntu Mantic):
status: Incomplete → In Progress
Changed in pulseaudio (Ubuntu Jammy):
status: Incomplete → In Progress
Revision history for this message
Lukas Märdian (slyon) wrote :

I confirmed the patch matches the upstream changes and builds find. I see the bug description ([Test] section) was updated to mention pairing of 7 audio and 2 non-audio devices. That pairing test needs to be re-run with the final binaries, once they are build in the archive, as per the usual SRU process.

Sponsoring for Mantic & Jammy, unsubscribing sponsors. The status is already set to "In Progress".

https://launchpad.net/ubuntu/mantic/+queue?queue_state=1&queue_text=pulseaudio
https://launchpad.net/ubuntu/jammy/+queue?queue_state=1&queue_text=pulseaudio

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Hui, or anyone else affected,

Accepted pulseaudio into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:16.1+dfsg1-2ubuntu4.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in pulseaudio (Ubuntu Mantic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-mantic
Changed in pulseaudio (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Hui, or anyone else affected,

Accepted pulseaudio into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:15.99.1+dfsg1-1ubuntu2.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (pulseaudio/1:15.99.1+dfsg1-1ubuntu2.2)

All autopkgtests for the newly accepted pulseaudio (1:15.99.1+dfsg1-1ubuntu2.2) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

libsdl2/2.0.20+dfsg-2ubuntu1.22.04.1 (i386)
pipewire/0.3.48-1ubuntu3 (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#pulseaudio

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (pulseaudio/1:16.1+dfsg1-2ubuntu4.1)

All autopkgtests for the newly accepted pulseaudio (1:16.1+dfsg1-2ubuntu4.1) for mantic have finished running.
The following regressions have been reported in tests triggered by the package:

libopenmpt/0.7.2-1 (i386)
libsdl2/2.28.3+dfsg-2 (i386)
pipewire/0.3.79-2 (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/mantic/update_excuses.html#pulseaudio

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Hui Wang (hui.wang) wrote :

Analysis of autpkgtest failure for Jammy (about comment #15):

1) For libsdl2/2.0.20+dfsg-2ubuntu1.22.04.1 (i386), It is a building failure which has nothing to do with the pulseaudio:

275s + i686-linux-gnu-gcc -o use-pkg-config use-ttf.c
275s use-ttf.c:7:11: fatal error: SDL_ttf.h: No such file or directory
275s 7 | # include <SDL_ttf.h>
275s | ^~~~~~~~~~~
275s compilation terminated.

2) For pipewire/0.3.48-1ubuntu3 (i386), it is the gstreamer1.0-pipewire's issue, it doesn't have the plugin libgstpipewire.so:

1170s autopkgtest [21:40:06]: test gstreamer1.0-pipewire: [-----------------------
1170s + export GST_INSPECT_NO_COLORS=1
1170s + export PAGER=cat
1170s + gst-inspect-1.0 pipewire
1170s No such element or plugin 'pipewire'
1170s autopkgtest [21:40:06]: test gstreamer1.0-pipewire: -----------------------]

So in my opinion, these 2 failure have nothing to do with pulseaudio, probably we should hint them in the tests on i386 enviroment.

Revision history for this message
Hui Wang (hui.wang) wrote :

Analysis of autpkgtest failure for Mantic (about comment #16):

1) For libopenmpt/0.7.2-1 (i386), it is a building erorr which has nothing to do with pulesaudio:

755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: /tmp/ccQalxLn.o: in function `main':
755s pattern-dump-c.c:(.text+0x458): undefined reference to `openmpt_error_func_default'
755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: pattern-dump-c.c:(.text+0x461): undefined reference to `openmpt_log_func_default'
755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: pattern-dump-c.c:(.text+0x473): undefined reference to `openmpt_module_create2'
755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: pattern-dump-c.c:(.text+0x4be): undefined reference to `openmpt_module_get_num_orders'
755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: pattern-dump-c.c:(.text+0x4f8): undefined reference to `openmpt_module_get_order_pattern'
755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: pattern-dump-c.c:(.text+0x509): undefined reference to `openmpt_module_get_num_channels'
755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: pattern-dump-c.c:(.text+0x544): undefined reference to `openmpt_module_get_pattern_row_channel_command'
755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: pattern-dump-c.c:(.text+0x55f): undefined reference to `openmpt_module_get_pattern_row_channel_command'
755s /usr/lib/gcc-cross/i686-linux-gnu/13/../../../../i686-linux-gnu/bin/ld: pattern-dump-c.c:(.text+0x58e): undefined reference to `openmpt_module_destroy'
755s collect2: error: ld returned 1 exit status

2) For libsdl2/2.28.3+dfsg-2 (i386), it is a buliding error which has nothing to do with pusleaudio:

440s use-ttf.c:7:11: fatal error: SDL_ttf.h: No such file or directory
440s 7 | # include <SDL_ttf.h>
440s | ^~~~~~~~~~~
440s compilation terminated.
440s + rm -rf /tmp/tmp.CcXjR8RPS6
440s autopkgtest [21:27:55]: test deprecated-use: -----------------------]
440s deprecated-use FAIL non-zero exit status 1

3) For pipewire/0.3.79-2 (i386), it is a buliding error which has nothing to do with pusleaudio:

1333s + i686-linux-gnu-gcc -otrivial trivial.c -lm
1333s trivial.c:1:10: fatal error: pipewire/pipewire.h: No such file or directory
1333s 1 | #include <pipewire/pipewire.h>
1333s | ^~~~~~~~~~~~~~~~~~~~~
1333s compilation terminated.
1333s autopkgtest [21:42:52]: test libpipewire-0.3-dev: -----------------------]
1333s libpipewire-0.3-dev FAIL non-zero exit status 1

So in my opinion, these 3 failure have nothing to do with pulseaudio, probably we should hint them in the tests on i386 enviroment.

Revision history for this message
Hui Wang (hui.wang) wrote :

verification on mantic:

Install UBUNTU 23.10 on the Lenovo Thinkpad X1C 12Gen, and enable the mantic-propsed from "Software & Updates". By default, the pulseaudio is not installed, in the manic, the pipewire replaced the pulseaudio in the audio stack. I installed the pulseaudio manually by running 'sudo apt-get update; sudo apt install pulseaudio', the pulseaudio 1:16.1+dfsg1-2ubuntu4 was installed and pipewire-alsa was removed. Increased the priority to 510 for all packages in proposed by adding proposed-updates in the /etc/apt/preferences.d/, the upgraded the pulesaudio to 1:16.1+dfsg1-2ubuntu4.1:

non-audio bt devices (pairing, reconnect, functional test all pass):
 - piano2 (bt keyboard)
 - bluetooth laser travel mouse (logic bt mouse)

audio bt devices (pairing, reconect, set a2dp and hsp/hfp, playback and capture, all test pass)
 - xt99 (lenovo thinkplus bt headset)
 - plt_btgo2 (bt headset)
 - soaiy s18 (bt sound bar)
 - i7mini (bt headset)

Verification done for mantic.

tags: added: verification-done-mantic
removed: verification-needed-mantic
Revision history for this message
Hui Wang (hui.wang) wrote :

verification on Jammy:

Enabled the jammy-propsed from "Software & Updates". ran 'sudo apt-get update; sudo apt install pulseaudio', the pulseaudio 1:15.99.1+dfsg1-1ubuntu2.2 was installed, reboot the system:

non-audio bt devices (pairing, reconnect, functional test all pass):
 - piano2 (bt keyboard)
 - bluetooth laser travel mouse (logic bt mouse)

audio bt devices (pairing, reconect, set a2dp and hsp/hfp, playback and capture, all test pass)
 - xt99 (lenovo thinkplus bt headset)
 - plt_btgo2 (bt headset)
 - soaiy s18 (bt sound bar)
 - i7mini (bt headset)

Verification done for Jammy

tags: added: verification-done-jammy
removed: verification-needed-jammy
Timo Aaltonen (tjaalton)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:16.1+dfsg1-2ubuntu4.1

---------------
pulseaudio (1:16.1+dfsg1-2ubuntu4.1) mantic; urgency=medium

  [ Hui Wang ]
  * d/p/0001-backend-native-Handle-multi-AT-commands-in-a-buffer.patch
    - Lenovo Thinkplus XT99 bluetooth headset supports mSBC and could
      issue multi AT commands when negotiating with pulseaudio, but
      pulseaudio couldn't handle multi AT commands when processing one
      buffer, this makes the HFP/HSP mode not work, cherry pick an
      upstream commit to fix this issue. (LP: #2051895)

 -- Hui Wang <email address hidden> Mon, 19 Feb 2024 11:19:58 +0800

Changed in pulseaudio (Ubuntu Mantic):
status: Fix Committed → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Update Released

The verification of the Stable Release Update for pulseaudio has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:15.99.1+dfsg1-1ubuntu2.2

---------------
pulseaudio (1:15.99.1+dfsg1-1ubuntu2.2) jammy; urgency=medium

  [ Hui Wang ]
  * d/p/0001-backend-native-Handle-multi-AT-commands-in-a-buffer.patch
    - Lenovo Thinkplus XT99 bluetooth headset supports mSBC and could
      issue multi AT commands when negotiating with pulseaudio, but
      pulseaudio couldn't handle multi AT commands when processing one
      buffer, this makes the HFP/HSP mode not work, cherry pick an
      upstream commit to fix this issue. (LP: #2051895)

 -- Hui Wang <email address hidden> Mon, 19 Feb 2024 11:08:35 +0800

Changed in pulseaudio (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:16.1+dfsg1-2ubuntu10

---------------
pulseaudio (1:16.1+dfsg1-2ubuntu10) noble; urgency=medium

  * debian/patches/git_tests_alignment.patch:
    - cherrypick an upstream change to fix a test failure with the new
      orc version

 -- Sebastien Bacher <email address hidden> Wed, 03 Apr 2024 10:18:51 +0200

Changed in pulseaudio (Ubuntu Noble):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.