You are not logged in.

#1 2020-11-11 09:19:40

vivore
Member
Registered: 2020-11-11
Posts: 2

[SOLVED] PulseAudio changes volume when switching sink

My computer has two sound devices:
* An USB soundbar
* A basic jack headset, connected to the chassis.

Both devices are detected and work, but I'm not able to get a decent default volume on both when starting my computer.

I've tried setting it in ~/.config/pulse/default.pa

.include /etc/pulse/default.pa
set-sink-volume alsa_output.pci-0000_00_1f.3.analog-stereo 0x8000 # 50%
set-sink-volume alsa_output.usb-Dell_DELL_PROFESSIONAL_SOUND_BAR_AE515-00.analog-stereo 0x4000 # 25

but it does not work as expected:

$ pacmd list-sinks | grep -E 'index:|name:|volume:'
  * index: 0
        name: <alsa_output.usb-Dell_DELL_PROFESSIONAL_SOUND_BAR_AE515-00.analog-stereo>
        volume: front-left: 16384 /  25% / -36.12 dB,   front-right: 16384 /  25% / -36.12 dB # This one is fine
        base volume: 54094 /  83% / -5.00 dB
    index: 1
        name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
        volume: front-left: 49145 /  75% / -7.50 dB,   front-right: 49145 /  75% / -7.50 dB # Would have expected 50% here
        base volume: 65536 / 100% / 0.00 dB

To make things worse, changing the default sink to headset breaks the soundbar volume too:

$ pacmd set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo
$ pacmd list-sinks | grep -E 'index:|name:|volume:'
    index: 0
        name: <alsa_output.usb-Dell_DELL_PROFESSIONAL_SOUND_BAR_AE515-00.analog-stereo>
        volume: front-left: 9619 /  15% / -50.00 dB,   front-right: 9619 /  15% / -50.00 dB # ???
        base volume: 54094 /  83% / -5.00 dB
  * index: 1
        name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
        volume: front-left: 49145 /  75% / -7.50 dB,   front-right: 49145 /  75% / -7.50 dB
        base volume: 65536 / 100% / 0.00 dB

I see nothing really suspicious on PulseAudio logs. First startup attempt failed, probably because some sound device was not ready, but after that everything looks okay:

Nov 11 09:58:24 grandpatapon systemd[1713]: Starting Sound Service...
Nov 11 09:58:24 grandpatapon pulseaudio[1727]: No sink found by this name or index.
Nov 11 09:58:24 grandpatapon pulseaudio[1727]: Failed to initialize daemon due to errors while executing startup commands. Source of commands: /home/francis/.config/pulse//default.pa
Nov 11 09:58:24 grandpatapon systemd[1713]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 09:58:24 grandpatapon systemd[1713]: pulseaudio.service: Failed with result 'exit-code'.
Nov 11 09:58:24 grandpatapon systemd[1713]: Failed to start Sound Service.
Nov 11 09:58:24 grandpatapon systemd[1713]: pulseaudio.service: Scheduled restart job, restart counter is at 1.
Nov 11 09:58:24 grandpatapon systemd[1713]: Stopped Sound Service.
Nov 11 09:58:24 grandpatapon systemd[1713]: Starting Sound Service...
Nov 11 09:58:25 grandpatapon systemd[1713]: Started Sound Service.
Nov 11 09:58:25 grandpatapon pulseaudio[1749]: GetManagedObjects() failed: org.freedesktop.systemd1.NoSuchUnit: Unit dbus-org.bluez.service not found.

But if I manually restart the PA service from my session (systemctl --user restart pulseaudio), everything works (including changing sound device). So I am lost. Something is probably interfering?

Extra notes:
* I use Gnome. After reading a few GDM-related error reports, I've disabled PA in GDM, but that did not solve my issue.
* I have not customized any ALSA setting, nor modified anything in /etc/pulse.

What am I missing? Any pointers? Thanks!

Last edited by vivore (2020-11-12 08:55:29)

Offline

#2 2020-11-11 20:04:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,168

Re: [SOLVED] PulseAudio changes volume when switching sink

I'm assuming a mishap with a concurrently running pipewire. Does

systemctl --user mask pipewire pipewire.socket --now

help?

Last edited by V1del (2020-11-12 09:12:05)

Offline

#3 2020-11-12 08:55:14

vivore
Member
Registered: 2020-11-11
Posts: 2

Re: [SOLVED] PulseAudio changes volume when switching sink

It works, thanks a lot!

Offline

Board footer

Powered by FluxBB