Why speaker changing into headphones automatically when I have no headphones connected?

This same issue occured with pipewire when I was using ubuntu and elementary os too. What is casing this and how to fix this? Is this a pipewire related issue or just random linux issue that I will face even if I use arch? Urgent help needed.

I’m using Fedora 35 on a Dell Inspiron 15 3501 (4 gb)

Hi, try to install sudo dnf install pavucontrol. After that, open and maximize the app window so we can see all available tab. Click the configuration.

On configuration tab → “Built-in Audio” select something mentioning “Duplex” if available (if not available, you can try with any setting listed there). After that select tab Output Devices and try to plug and unplug your headphone jack and see if it correctly change.

Isn’t pavucontrol for pulse? And my headphone works and after plugging and unplugging it gets fixed and then this again starts.

Yes, but it also work for pipewire/wireplumber. Look like pavucontrol work directly to ALSA configuration (but don’t quote me on that).

Screenshot from 2022-01-22 18-02-24
I have not connected any headphones and still it keeps showing headphones. And your solution didn’t work out because duplex was already there and it says (speaker unavailable).

I don’t know exactly on how to fix it. Bellow are just some check for trial and error.

Would you like to post the result of cat ~/.local/state/wireplumber/default-* here?

default-nodes]
default.configured.audio.sink=bluez_output.56_33_DF_AD_36_F6.a2dp-sink
[default-profile]
alsa_card.pci-0000_00_1f.3=output:analog-stereo
[default-routes]
alsa_card.pci-0000_00_1f.3:output:analog-output-headphones:channelMap=FL;FR;
alsa_card.pci-0000_00_1f.3:output:analog-output-headphones:channelVolumes=1.0;1.0;
alsa_card.pci-0000_00_1f.3:output:analog-output-headphones:latencyOffsetNsec=0
alsa_card.pci-0000_00_1f.3:output:analog-output-speaker:channelMap=FL;FR;
alsa_card.pci-0000_00_1f.3:output:analog-output-speaker:channelVolumes=1.0;1.0;
alsa_card.pci-0000_00_1f.3:output:analog-output-speaker:latencyOffsetNsec=0
alsa_card.pci-0000_00_1f.3:profile:output:analog-stereo=analog-output-speaker;
alsa_card.pci-0000_00_1f.3:profile:output:analog-stereo+input:analog-stereo=analog-output-speaker;
alsa_card.pci-0000_00_1f.3:profile:pro-audio=analog-output-speaker;
bluez_card.56_33_DF_AD_36_F6:output:headset-output:channelMap=FL;FR;
bluez_card.56_33_DF_AD_36_F6:output:headset-output:channelVolumes=0.17263048887253;0.17263048887253;
bluez_card.56_33_DF_AD_36_F6:output:headset-output:latencyOffsetNsec=0
bluez_card.56_33_DF_AD_36_F6:profile:a2dp-sink-sbc=headset-output;

here you go

I think I know now. First, please close all window except your terminal. Then please follow bellow guide:

# Run `wpctl status` and take a note of Audio -> Sinks as bellow:
[rizal@fedora ~]$ wpctl status
....
Audio
 ├─ Devices:
 │      45. Built-in Audio                      [alsa]
 │      46. High Definition Audio Controller    [alsa]
 │  
 ├─ Sinks:
 │  *   50. Built-in Audio Analog Stereo        [vol: 0.45]
....

# Take a note the ID number of your `Analog Stereo` or any name obvious 
# from the list of your `Sinks` list instead of something mentioning `Bluez`.
# Then run as bellow. From example above the ID number is 50.
[rizal@fedora ~]$ wpctl set-default 50

# Check again if what I quoted above (the part [default-nodes])are changes.

If you’re not sure, please just post the result of wpctl status here.

[farmim@fedora ~]$ wpctl status
PipeWire 'pipewire-0' [0.3.43, farmim@fedora, cookie:4109309622]
 └─ Clients:
        31. WirePlumber                         [0.3.43, farmim@fedora, pid:6011]
        32. WirePlumber [export]                [0.3.43, farmim@fedora, pid:6011]
        51. GNOME Shell Volume Control          [0.3.43, farmim@fedora, pid:5861]
        52. GNOME Volume Control Media Keys     [0.3.43, farmim@fedora, pid:6171]
        53. xdg-desktop-portal                  [0.3.43, farmim@fedora, pid:6090]
        54. libcanberra                         [0.3.43, farmim@fedora, pid:6171]
        55. Mutter                              [0.3.43, farmim@fedora, pid:5861]
        57. wpctl                               [0.3.43, farmim@fedora, pid:20834]
        59. gsd-power                           [0.3.43, farmim@fedora, pid:6172]

Audio
 ├─ Devices:
 │      40. Built-in Audio                      [alsa]
 │      67. OneDer V3                           [bluez5]
 │  
 ├─ Sinks:
 │  *   61. OneDer V3                           [vol: 0.86]
 │      90. Built-in Audio Analog Stereo        [vol: 1.00]
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:

Video
 ├─ Devices:
 │      38. Integrated_Webcam_HD: Integrate     [v4l2]
 │      39. Integrated_Webcam_HD: Integrate     [v4l2]
 │  
 ├─ Sinks:
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  *   41. Integrated_Webcam_HD  Integrate    
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:

it shows this

Please close all window except the terminal first. Run wpctl set-default 90. After that check again with wpctl status if the * sign move to 90. Built-in Audio Analog Stereo [vol: 1.00].

Audio
 ├─ Devices:
 │      40. Built-in Audio                      [alsa]
 │      67. OneDer V3                           [bluez5]
 │  
 ├─ Sinks:
 │      61. OneDer V3                           [vol: 0.86]
 │  *   90. Built-in Audio Analog Stereo        [vol: 1.00]
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:

It moves to “90. Built-in Audio Stereo” as you said

Test again with plug and unplug your devices. It should (hopefully) be work as you expected.

No result still. Laptop internal sound stops working after a while only bluetooth device and externel speakers work… Could it be some kind of kernel bug or device bug?

Should be not since the device recognized. Then we need further test.

Please run aplay -lL lowercase L and uppercase L and post the result here.

Also you need to disconnect any external speaker and your bluetooth to test it.

[farmim@fedora ~]$ aplay -lL
null
    Discard all samples (playback) or generate zero samples (capture)
pipewire
    PipeWire Sound Server
default
    Default ALSA Output (currently PipeWire Media Server)
sysdefault:CARD=PCH
    HDA Intel PCH, CS8409/CS42L42 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, CS8409/CS42L42 Analog
    Front output / input
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, CS8409/CS42L42 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, CS8409/CS42L42 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, CS8409/CS42L42 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, CS8409/CS42L42 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, CS8409/CS42L42 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, CS8409/CS42L42 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, HDMI 0
    HDMI Audio Output
hdmi:CARD=PCH,DEV=1
    HDA Intel PCH, HDMI 1
    HDMI Audio Output
hdmi:CARD=PCH,DEV=2
    HDA Intel PCH, HDMI 2
    HDMI Audio Output
hdmi:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 3
    HDMI Audio Output
hdmi:CARD=PCH,DEV=4
    HDA Intel PCH, HDMI 4
    HDMI Audio Output
hdmi:CARD=PCH,DEV=5
    HDA Intel PCH, HDMI 5
    HDMI Audio Output
hdmi:CARD=PCH,DEV=6
    HDA Intel PCH, HDMI 6
    HDMI Audio Output
hdmi:CARD=PCH,DEV=7
    HDA Intel PCH, HDMI 7
    HDMI Audio Output
hdmi:CARD=PCH,DEV=8
    HDA Intel PCH, HDMI 8
    HDMI Audio Output
hdmi:CARD=PCH,DEV=9
    HDA Intel PCH, HDMI 9
    HDMI Audio Output
hdmi:CARD=PCH,DEV=10
    HDA Intel PCH, HDMI 10
    HDMI Audio Output
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CS8409/CS42L42 Analog [CS8409/CS42L42 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 12: HDMI 6 [HDMI 6]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 13: HDMI 7 [HDMI 7]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 14: HDMI 8 [HDMI 8]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 15: HDMI 9 [HDMI 9]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 16: HDMI 10 [HDMI 10]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 17: HDMI 11 [HDMI 11]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Please run:

aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav

If you get the sound from your speaker, continue with bellow guide.

Please open file cat /usr/share/pipewire/pipewire.conf and read at the very top comment on how to create local configuration.

After you creating a copy of pipewire.conf in ~/.config/pipewire/pipewire.conf , find at the very bottom file as below:

    # This creates a single PCM source device for the given
    # alsa device path hw:0. You can change source to sink
    # to make a sink in the same way.
    #{ factory = adapter
    #    args = {
    #        factory.name           = api.alsa.pcm.source
    #        node.name              = "alsa-source"
    #        node.description       = "PCM Source"
    #        media.class            = "Audio/Source"
    #        api.alsa.path          = "hw:0"
    #        api.alsa.period-size   = 1024
    #        api.alsa.headroom      = 0
    #        api.alsa.disable-mmap  = false
    #        api.alsa.disable-batch = false
    #        audio.format           = "S16LE"
    #        audio.rate             = 48000
    #        audio.channels         = 2
    #        audio.position         = "FL,FR"
    #    }
    #}

Then edit it as below:

    # This creates a single PCM source device for the given
    # alsa device path hw:0. You can change source to sink
    # to make a sink in the same way.
    { factory = adapter
        args = {
            factory.name           = api.alsa.pcm.sink
            node.name              = "Internal Speaker"
            node.description       = "PCM Internal Speaker"
            media.class            = "Audio/Sink"
            api.alsa.path          = "hw:0,0"
            audio.channels         = 2
            audio.position         = "FL,FR"
        }
    }

After that, close all windows and leave only the terminal and run both command bellow:

systemctl --user restart pipewire
systemctl --user restart wireplumber

After that open Gnome setting on Audio device. There should be new device shown from the drop down menu selector (device name should be “Internal Speaker” on there).

[farmim@fedora ~]$ aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav
aplay: main:831: audio open error: Device or resource busy

the first command says device or resource busy

It’s ok. Just close all window (browser, media player, or anything else) except the terminal and wait a moment. Then try again.

aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

it says this but no sound unfortunately

Please check with alsamixer, press F6 to select card (other than HDMI), then press F5.

Check from the volume bar if Speaker are muted with [MM] sigh. Use arrow to select the volume bar and press m from keyboard to unmute it (adjust the volume with up/down arrow).

Try again with:

speaker-test -l 1 -c 2

# If you get the noise sound, then continue with
speaker-test -D plughw:0,0 -l -c 2

If now you get the sound, you can continue to create pipewire.conf above. But if not work, please create a bug report to bugzilla.redhat.com/