Skip to content

[BUG][CML][UCM2][HDA]Output device will auto switch from speaker to other source when unplug HDMI external port or headphone #2346

Closed

Description

@libinyang

Describe the bug
Output device will auto switch from speaker to other source when unplug HDMI external port or headphone.

Precondition:
1.Install ubuntu 20.04
UCM2: https://github.com/alsa-project/alsa-ucm-conf(commit: 3e897306)
Alsa-lib: http://sof-ci-storage.sh.intel.com/share/alsa/alsa-lib/latest/libasound2_1.2.3.2-a3ca480/
Pulseaudio: http://sof-ci-storage.sh.intel.com/share/pulseaudio/latest/pulseaudio_13.99.1.1-47d8112/
Gnome: 1:3.36.2-0ubuntu1++testswitch - can download form Canonical:
sudo add-apt-repository ppa:hui.wang/switch-audio
sudo apt-get update
sudo apt install gnome-control-center

To Reproduce

step 1: Boot up system with headphone and HDMI external port both connected
step 2: Open sound setting and select speaker as output device (corner case, as speaker has lowest priority)
step 3: Unplug HDMI external port.
step 4: Check the output device.
Reproduce rate
5/5

Expected result
Output source will stay in speaker.

Actual result
Output source will auto switch to headphone from speaker after unplugged HDMI external port.

Test recipe
Platform: CML laptop with onboard codec ALC3204 in HDA mode
Firmware: (3d8a0ac) https://github.com/thesofproject/sof/commits/master
Kernel: (06accba) https://github.com/thesofproject/linux/commits/topic/sof-dev
Topology: file: tools/topology/sof-hda-generic-2ch.tplg same as firmware
UCM2: https://github.com/thesofproject/alsa-ucm-conf/commits/master (commit: 3e897306)
Pulseaudio: pulseaudio (47d8112)

Activity

  1. self-assigned this
    on Aug 6, 2020
  2. added
    HDAApplies to HD-Audio bus for codec connection
    CMLApplies to Comet Lake platform
    P3Low-impact bugs or features
    on Aug 6, 2020
  3. libinyang commented on Aug 6, 2020

    @libinyang
    Author

    compare to #2126, this bug happens on HDA platform. This should be the pulseaudio issue. As this is a case that customer/user rarely meet, let's put it to P3.

  4. plbossart commented on Aug 11, 2020

    @plbossart
    Member

    Why the HDA label when this happens on a SoundWire platform where HDA is not used at all?

  5. libinyang commented on Aug 12, 2020

    @libinyang
    Author

    @plbossart Thanks for pointing it out. The description is updated

  6. plbossart commented on Sep 3, 2020

    @plbossart
    Member

    @libinyang can we please try and close all those UCM2 issues? There's only few remaining.

  7. libinyang commented on Sep 4, 2020

    @libinyang
    Author

    Sure, I will debug on it.

  8. libinyang commented on Sep 16, 2020

    @libinyang
    Author

    The bug root cause is in pulseaudio. I will file a bug in https://gitlab.freedesktop.org/pulseaudio/pulseaudio. And hopefully I will submit a patch to pulseaudio to fix this issue this week.

    The root cause is: when unplugging the HDMI, it will trigger to call switch_from_port(). It will compare the priority of the ports. This will cause pulseaudio pick up the headphone ahead of speaker. So the active port is changed to headphone. SOF + SDW platform works well because speaker and headphone are in different sinks. The "sink" mechanism makes sure that the speaker won't be switched to headphone. So this bug only happens on SOF + HDA platforms.

  9. libinyang commented on Sep 18, 2020

    @libinyang
    Author
  10. plbossart commented on Sep 30, 2020

    @plbossart
    Member

    @libinyang doesn't look like we have a solution based on the PulseAudio discussions?

  11. libinyang commented on Oct 26, 2020

    @libinyang
    Author

    Tanu gave some comments. I'm confirming with him for his idea.

  12. plbossart commented on Jun 10, 2021

    @plbossart
    Member

    @libinyang @mengdonglin is this issue fixed? It's been 3 quarters already.

  13. libinyang commented on Jun 15, 2021

    @libinyang
    Author

    The bug is already fixed and we can close it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CMLApplies to Comet Lake platformHDAApplies to HD-Audio bus for codec connectionP3Low-impact bugs or featuresUCM2bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions