You are not logged in.

#1 2021-04-11 08:13:01

zegkljan
Member
Registered: 2017-12-30
Posts: 60

[SOLVED] Pipewire/pulseaudio does not remember output device port

Ever since the replacement of pulseaudio by pipewire, the output device port setting is not retained over logins. I have one sound device which has, according to pavucontrol, two ports: Speakers (which are the laptop's built-in speakers) and Headphones (which is the laptop's combo jack). I want this set to Headphones. I set it in pavucontrol and it works. However, whenever I log in again, including the "login" when returning from locked screen, this changes back to Speakers and I have to manually go to pavucontrol and switch back to Headphones. This also happens when a condenser mic (which has its own batteries) that is already connected is turned on by its own switch.

The "Headphones" port is marked as unplugged although the jack is firmly plugged in and the output works just fine. I had other problems regarding the single combo jack my laptop has. I had to use hdajackretask to make the external mic work but this was so much long ago I don't remember the details.

I'm running GNOME 40.0.

I would be very glad if someone could help me resolve this issue. It's not at all critical but extremely annoying.

Last edited by zegkljan (2021-07-28 05:58:52)

Offline

#2 2021-04-11 09:10:42

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

I did not upgraded since 2 weeks, has pipewire forcedly replaced pulseaudio?
If not, why don't just stick with pulseaudio?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#3 2021-04-11 09:26:58

zegkljan
Member
Registered: 2017-12-30
Posts: 60

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

kokoko3k wrote:

I did not upgraded since 2 weeks, has pipewire forcedly replaced pulseaudio?
If not, why don't just stick with pulseaudio?

While a viable solution, I'd rather fix the issue than run away. It should work, so I'd like to make it work. Maybe it is a manifestation of a bug in pipewire(-pulse) discovering of which might help the developers make the thing better. Or it might help someone else struggling with the same issue that for some reason cannot revert back to pulseaudio.

Offline

#4 2021-04-11 10:08:06

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

pipewire is probably "intelligent" and detects that nothing is plugged in, so it switches ports. You should try to fix the jack detection or find a way to disable it for your card I think.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2021-04-11 11:57:00

Flemur
Member
Registered: 2012-05-24
Posts: 72

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

Disclaimer: I'm learning(?) pipewire and haven't tried this yet*!  Make backups first...

You might try

pw-cat -p --list-targets

(or [c]pw-cli ls Node[/c])
then

pw-metadata 0 default.audio.sink.name <the name from pw-cat output>

For example, on my simple setup* I get

$ pw-cat -p --list-targets 
Available targets ("*" denotes default): alsa_output.pci-0000_00_0e.0.analog-stereo
*	39: description="Built-in Audio Analog Stereo" prio=1009

Then:
$ pw-metadata 0 default.audio.sink.name alsa_output.pci-0000_00_0e.0.analog-stereo

(* I tried it but I only have one output and it was already the default, so that didn't change, or break, anything.)


"If you do not change direction, you may end up where you are heading." -- L.T.

Offline

#6 2021-07-28 02:08:40

freeqaz
Member
Registered: 2021-07-28
Posts: 3

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

I'm just bumping this thread because I'm having this exact same issue. It's really frustrating because whenever my screen auto locks, after a few minutes of inactivity, my audio switches to my laptop's speakers instead of the plugged in speakers. It's driving me nuts while cooking or doing anything else!

If I find a solution, I'll post back here. But if anybody has any help to aid, I would sincerely appreciate it! Thank you.

Offline

#7 2021-07-28 02:19:02

freeqaz
Member
Registered: 2021-07-28
Posts: 3

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

This fixed it for me: https://wiki.archlinux.org/title/PipeWi … _reconnect

I may have to do that every time I move my laptop, but that's good enough for me!

Offline

#8 2021-07-28 05:58:13

zegkljan
Member
Registered: 2017-12-30
Posts: 60

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

I solved it by playing around with hdajackretask. I found a configuration that makes pipewire/pulse/alsa/whatever detect the jack states correctly. It will probably be different for different hardware. For my laptop (Acer TravelMate TMP648-MG-554H) I set the following for Realtek ALC282:

  • Black Mic, Left side; Pin ID: 0x18 -> Override, Microphone

  • Pink Mic, Right side; Pin ID: 0x19 -> Override, Not connected

  • Black Headphone, Right side; Pin ID: 0x1b -> Override, Headphone

Marking as solved.

Offline

#9 2021-07-28 16:52:12

freeqaz
Member
Registered: 2021-07-28
Posts: 3

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

I'll try your fix @zegkljan.

I realized that my fix probably did nothing -- my audio still switches to the internal laptop speakers on lock. When I run `systemctl suspend` and then resume, it works fine and my audio doesn't switch. It's only when I'm AFK and my machine auto-locks that the audio jumps.

Also, that Arch Wiki link has the pipewire-media-session in the wrong place. For me, it seems to be living in `~/.config/pipewire/media-session.d`. I noticed because, upon reboot, that folder the wiki tells to you delete (`~/.config/pipewire-media-session/*`) is never restored.

I'll write back if I'm still experiencing this issue. Fingers crossed that `hdajackretask` works though!

Offline

#10 2021-11-08 19:24:52

Topsy
Member
Registered: 2021-11-03
Posts: 3

Re: [SOLVED] Pipewire/pulseaudio does not remember output device port

I found another solution - increase your headphones priority in

/usr/share/alsa-card-profile/mixer/paths/analog-output-headphones.conf

, so pipewire chose them when list of available profiles changes (HDMI display connect/disconnect in my case).

Offline

Board footer

Powered by FluxBB