[SRU] pulseaudio: the headset-mic or heapdhone-mic could not be selected automatically if there is no internal mic

Bug #1908167 reported by Hui Wang
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HWE Next
Fix Released
Undecided
Unassigned
OEM Priority Project
Fix Released
Undecided
Unassigned
pulseaudio (Ubuntu)
Fix Released
High
Hui Wang
Focal
Fix Released
High
Hui Wang
Groovy
Fix Released
High
Hui Wang
Hirsute
Fix Released
High
Hui Wang

Bug Description

[Impact]
On the Dell AIO machines, there is no internal mic, after plugging a
headset, users expect the headset-mic or headphone-mic could be selected
automatically. But with the current rule, the headset-mic/headphone-mic will not be selected automatically and even users manually select them, they will not show up in the gnome sound setting, and users could not record sound by headset-mic/headphone-mic.

[Fix]
backport a patch from pulseaudio mergerequest, the patch is going to be
merged to pulseaudio 14.1. This patch could be backported to hirsute without any change, but need to be changed if backport it to groovy and focal.

[Test]
With the old pulseaudio (prior to 1:13.99.1-1ubuntu3.10), plugging in a headset to the problematic Dell AIO machine will not automatically select headset-mic/headphone-mic, and they also do not show up in Gnome sound settings, leading to failure to record any sound.

With the new proposed package, on those Dell AIO, plug a headset, open the gnome sound setting, the headset-mic is selected automatically, use the headset-mic to record the sound, the sound could be recorded and the sound quality is good.

[Where problems could occur]
This patch could change the policy of audio device switching, it will not
affect all audio devices, but only the devices which has AVAIL_UNKNOWN available status, that means it has possibility to introduce the regression on headphone-mic ,headset-mic, internal mic and internal speaker's switching since they all has AVAIL_UNKNOWN status. For example, after unpluging the headset, the input device will not switch to internal mic automatically or after unplug the headphone, the output device will not switch to internal speaker automatically. But this possibility is very low, we have tested the patch on many Dell and Lenovo machines, all worked well.

Hui Wang (hui.wang)
Changed in pulseaudio (Ubuntu):
importance: Undecided → High
status: New → In Progress
Changed in pulseaudio (Ubuntu Focal):
importance: Undecided → High
Changed in pulseaudio (Ubuntu Groovy):
importance: Undecided → High
Changed in pulseaudio (Ubuntu Focal):
status: New → In Progress
Changed in pulseaudio (Ubuntu Groovy):
status: New → In Progress
assignee: nobody → Hui Wang (hui.wang)
Changed in pulseaudio (Ubuntu Focal):
assignee: nobody → Hui Wang (hui.wang)
Hui Wang (hui.wang)
tags: added: oem-priority originate-from-1895332 somerville
Revision history for this message
Hui Wang (hui.wang) wrote :

This is the debdiff for hirsute, thx.

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

This is the debdiff for groovy, thx.

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

This is the debdiff for focal, thx.

summary: - pulseaudio: the headset-mic or heapdhone-mic could not be selected
+ [SRU] pulseaudio: the headset-mic or heapdhone-mic could not be selected
automatically if there is no internal mic
Hui Wang (hui.wang)
description: updated
description: updated
Changed in pulseaudio (Ubuntu Hirsute):
status: In Progress → Fix Committed
Changed in pulseaudio (Ubuntu Groovy):
status: In Progress → Fix Committed
Changed in pulseaudio (Ubuntu Focal):
status: In Progress → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Hui, or anyone else affected,

Accepted pulseaudio into groovy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:13.99.2-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-groovy to verification-done-groovy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-groovy. 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.

tags: added: verification-needed verification-needed-groovy
tags: added: verification-needed-focal
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Hui, or anyone else affected,

Accepted pulseaudio into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:13.99.1-1ubuntu3.9 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-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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
Timo Aaltonen (tjaalton) wrote :

failed to build on riscv64

============================================
   pulseaudio 13.99.1: src/test-suite.log
============================================

# TOTAL: 36
# PASS: 35
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: volume-test
=================

Running suite(s): Volume
Attenuation of sample 1 against 32767: -90.3087 dB
Smallest possible attenuation > 0 applied to 32767: 0
max deviation: 150895, number of times over 1:10626
0%: Checks: 1, Failures: 1, Errors: 0
tests/volume-test.c:151:F:volume:volume_test:0: Assertion 'md <= 1' failed
FAIL volume-test (exit status: 1)

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

@Timo,

The change in this SRU will not affect volume-test. Maybe need a re-upload on riscv64 and see if this failure could be reproduced (not 100% fail, with a fail rate)?

tags: added: originate-from-1901838
Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote :

Verify on Dell CID 202010-28345

1. boot into Ubuntu focal
2. check sound settings
3. Input Device is empty
4. plug the headset
5. Input Device is still empty
6. enable proposed channel
7. $ sudo apt install pulseaudio
8. $ apt policy pulseaudio
pulseaudio:
  Installed: 1:13.99.1-1ubuntu3.9
  Candidate: 1:13.99.1-1ubuntu3.9
  Version table:
 *** 1:13.99.1-1ubuntu3.9 500
        500 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1:13.99.1-1ubuntu3.8 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     1:13.99.1-1ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
9. $ sudo reboot
10. after boot into Ubuntu focal
11. open sound settings
12. plug headset
13. can see "Headset Microphone - Built-in-Audio" in "Input Device" field.

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Kai-Chuan Hsieh (kchsieh) wrote :

Verify on Dell CID 202010-28345

1. boot into Ubuntu groovy
2. check sound settings
3. Input Device is empty
4. plug the headset
5. Input Device is still empty
6. enable proposed channel
7. $ sudo apt install pulseaudio
8. $ apt policy pulseaudio
pulseaudio:
  Installed: 1:13.99.2-1ubuntu2.2
  Candidate: 1:13.99.2-1ubuntu2.2
  Version table:
 *** 1:13.99.2-1ubuntu2.2 500
        500 http://tw.archive.ubuntu.com/ubuntu groovy-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1:13.99.2-1ubuntu2.1 500
        500 http://tw.archive.ubuntu.com/ubuntu groovy-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu groovy-security/main amd64 Packages
     1:13.99.2-1ubuntu1 500
        500 http://tw.archive.ubuntu.com/ubuntu groovy/main amd64 Packages
9. $ sudo reboot
10. after boot into Ubuntu groovy
11. open sound settings
12. plug headset
13. can see "Headset Microphone - Built-in-Audio" in "Input Device" field.

tags: added: verification-done verification-done-groovy
removed: verification-needed verification-needed-groovy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:14.0-1ubuntu2

---------------
pulseaudio (1:14.0-1ubuntu2) hirsute; urgency=medium

  * d/p/0001-switch-on-port-available-Switch-to-headset-or-mic-on.patch
    - Fix the headset-mic/headphone-mic selection on the machines without
      internal mic (lp: #1908167)

 -- Hui Wang <email address hidden> Tue, 15 Dec 2020 15:48:42 +0800

Changed in pulseaudio (Ubuntu Hirsute):
status: Fix Committed → Fix Released
Hui Wang (hui.wang)
tags: removed: verification-done verification-done-focal verification-done-groovy
Revision history for this message
Hui Wang (hui.wang) wrote :

Please hold to release this SRU for groovy and focal, the original fixing patch is for pulseaudio-14.1, I changed the patch and backported it to groovy and focal, today I found the backported patch could introduce the regression similar to this one: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1043.

So please hold to release the SRU for groovy and focal, I will fix it in a new version.

thx.

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

Groovy:

the version 1:13.99.2-1ubuntu2.2 introduced a regression: after unplug the headphone, the speakers can't be auto selected. This issue is similar to https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1043

upstream has a fix for it: eaa6d5d6c1a7 (switch-on-port-available: Fix switching away from unplugged headphones), so as this fix does, I changed the 0703-switch-on-unknown.patch to move the code to port_available_hook_callback() in the ubuntu2.3.

Please help upload ubuntu2.3 debdiff. Thanks.

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

Focal:

the version 1:13.99.1-1ubuntu3.9 introduced a regression: after unplug the headphone, the speakers can't be auto selected. This issue is similar to https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1043

upstream has a fix for it: eaa6d5d6c1a7 (switch-on-port-available: Fix switching away from unplugged headphones), so as this fix does, I changed the 0703-switch-on-unknown.patch to move the code to port_available_hook_callback() in the ubuntu3.10.

Please help upload ubuntu3.10 debdiff. Thanks.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

sponsored both

description: updated
Revision history for this message
Robie Basak (racb) wrote :

I asked on IRC for confirmation that the regression fix has landed in Hirsute.

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

@Robie,

The Hirsute doesn't have this regression since I cherry-picked the upstream patch to Hirsute, all needed patches are in the Hirsute already. But for groovy and focal, the patch can't be applied to them without changing, so I backported the patch to groovy and focal, the regression is introduced when backporting.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Hui, or anyone else affected,

Accepted pulseaudio into groovy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:13.99.2-1ubuntu2.3 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-groovy to verification-done-groovy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-groovy. 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.

tags: added: verification-needed verification-needed-groovy
tags: added: verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Hui, or anyone else affected,

Accepted pulseaudio into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:13.99.1-1ubuntu3.10 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-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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:13.99.2-1ubuntu2.3)

All autopkgtests for the newly accepted pulseaudio (1:13.99.2-1ubuntu2.3) for groovy have finished running.
The following regressions have been reported in tests triggered by the package:

openjdk-8/8u275-b01-0ubuntu1~20.10 (armhf)

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/groovy/update_excuses.html#pulseaudio

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

Thank you!

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

The failed autopkgtests in the #20 is not a real regression, please visit https://autopkgtest.ubuntu.com/packages/o/openjdk-8/groovy/armhf, we could see this testcase often fails by random chance.

And the change in this SRU doesn't affect openjdk, it only do some change in a c file.

thx.

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

tested the groovy -proposed package on a lenovo machine (internal mic + internal spk) and a dell machine (only internal spk):

Installed groovy on the machine, enable the -proposed ppa, run 'sudo apt dist-upgrade', check the pulseaudio version is 1:13.99.2-1ubuntu2.3:
On the lenovo machine, plug a headset, the output changes to headphone and input changes to headset-microphone, output and input all works well, unplug the headset, the output changes back to spk and input changes back to internal mic. This fixed the regression of 1:13.99.2-1ubuntu2.2

On the Dell machine, plug a headset, the output changes to headphone and input changes to headset-microphone, output and input all works well, unplug the headset, the output changes back to spk and input changes back to blank. This fixed the regression of 1:13.99.2-1ubuntu2.2 and fixed the issue of "the headset-mic or heapdhone-mic could not be selected automatically if there is no internal mic" in the 1:13.99.2-1ubuntu2.1

verified done on groovy.

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

tested the focal -proposed package on a lenovo machine (internal mic + internal spk) and a dell machine (only internal spk):

Installed 20.04 on the machine, enable the -proposed ppa, run 'sudo apt dist-upgrade', check the pulseaudio version is 1:13.99.1-1ubuntu3.10:
On the lenovo machine, plug a headset, the output changes to headphone and input changes to headset-microphone, output and input all works well, unplug the headset, the output changes back to spk and input changes back to internal mic. This fixed the regression of 1:13.99.1-1ubuntu3.9

On the Dell machine, plug a headset, the output changes to headphone and input changes to headset-microphone, output and input all works well, unplug the headset, the output changes back to spk and input changes back to blank. This fixed the regression of 1:13.99.1-1ubuntu3.9 and fixed the issue of "the headset-mic or heapdhone-mic could not be selected automatically if there is no internal mic" in the 1:13.99.1-1ubuntu3.8

verified done on focal.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:13.99.2-1ubuntu2.3

---------------
pulseaudio (1:13.99.2-1ubuntu2.3) groovy; urgency=medium

  * d/p/0703-switch-on-unknown.patch
    - The 0703-switch-on-unknown.patch was introduced from the version of
      ubuntu2.2, this patch could bring a regression similar to this one:
      https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1043,
      so just like the commit eaa6d5d6c1a7 (switch-on-port-available: Fix
      switching away from unplugged headphones), change the
      0703-switch-on-unknown.patch to move the code to
      port_available_hook_callback().
      (LP: #1908167)

 -- Hui Wang <email address hidden> Tue, 05 Jan 2021 02:39:04 +0000

Changed in pulseaudio (Ubuntu Groovy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) 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:13.99.1-1ubuntu3.10

---------------
pulseaudio (1:13.99.1-1ubuntu3.10) focal; urgency=medium

  * d/p/0703-switch-on-unknown.patch
    - The 0703-switch-on-unknown.patch was introduced from the version of
      ubuntu3.9, this patch could bring a regression similar to this one:
      https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1043,
      so just like the commit eaa6d5d6c1a7 (switch-on-port-available: Fix
      switching away from unplugged headphones), change the
      0703-switch-on-unknown.patch to move the code to
      port_available_hook_callback().
      (LP: #1908167)

 -- Hui Wang <email address hidden> Tue, 05 Jan 2021 11:10:50 +0800

Changed in pulseaudio (Ubuntu Focal):
status: Fix Committed → Fix Released
Rex Tsai (chihchun)
tags: added: originate-from-1910630 sutton
Changed in oem-priority:
status: New → Fix Released
Timo Aaltonen (tjaalton)
Changed in hwe-next:
status: New → 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.