You are not logged in.

#1 2025-08-10 18:05:18

ILikeCows
Member
Registered: 2025-08-10
Posts: 2

New song on spotify resets volume to 30%

I am using pipewire/wireplumber. I had been having problems previously with the fact that decreasing the "speakers" volume under "outputs" in pavucontrol doesnt really make it quieter but just removes the higher pitches and distorts. In order to get around this I made a script that decreases the voluume of each application instead when I hit the volume keys. That works but however I then ran into a problem of each application (spotify, youtube) would open with different volumes (youtube defaults to 74% and spotify at 30%). I fixed this by making a script to listen for when a new audio sink is made and setting the volume to whatever is already there (if I had spotify open and set to 20%, then youtube would then be set to 20%). However when I go between spotify songs it doesn't register as a new sink but changes its volume to 30% no matter if it was higher or lower before. Perhaps I made this too complicated on myself and am missing something simple but I can't seem to find other posts about this issue.

Please let me know if I left out any important information and I will be happy to provide it.

Thank you

Offline

#2 2025-08-12 09:02:21

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,975

Re: New song on spotify resets volume to 30%

You can configure pipewire to prevent clients from changing (their own) sink volumes, there are commented out examples in the default /usr/share/pipewire/pipewire-pulse.conf you can activate/replicate for misbehaving clients into an /etc/pipewire/pipewire-pulse.d/ snippet or so, see https://bbs.archlinux.org/viewtopic.php … 3#p2208573 (this talks about the mic equivalent block-source-volume, the same is true for block-sink-volume) since spotify and similar are basically chromium/electron, it's likely you can use the chromium catch all I mentioned there to prevent all of these.

As for the incorrect application when doing "card level" volume adjustments, if you want to look into this further, could you post

aplay -l
amixer -c0 #or whatever applies to your real card
pactl list cards
pactl list sinks

wrapped in  [code][/code] tags

Last edited by V1del (2025-08-12 10:03:59)

Offline

#3 2025-08-12 17:42:41

ILikeCows
Member
Registered: 2025-08-10
Posts: 2

Re: New song on spotify resets volume to 30%

Thank you for the reply. I wasn't super sure if I was supposed to but I didn't have any files in my /etc/pipewire/pipewire-pulse.d/ folder so I created one there named adjustQuirkRules.conf and copied what you had posted but instead changing it to say

 
{matches = [ { application.name = "~Chromium.*" } # What does the '~' do?
                       {application.name = "spotify" } 
                       {application.name = "firefox" } 
                     ]
actions = { quirks = [ block-sink-volume ] } }

Additionally, I think I should mention I also made this change in the /usr/share/pipewire/pipewire-pulse.conf file. I also checked that spotify and firefox are both used lowercase in the application.name when running "pactl list sink-inputs"

However, this does not seem to fix my problem but did change it a little bit. Now spotify is set to mute every time a new song is played, regardless of what it was at before. However, firefox (youtube) still defaults to an incredibly loud 74% even with these changes. Here is the output of those commands for hopefully more help.

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 0: ALC285 Analog [ALC285 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
amixer -c1 #not the hdmi one
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB] [on]
  Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 0 [0%] [-65.25dB] [off]
  Front Right: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'Bass Speaker',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [off]
  Front Right: Playback [off]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 39 [62%] [12.00dB] [on]
  Front Right: Capture 39 [62%] [12.00dB] [on]
Simple mixer control 'AMP1 ASP1 TX1 Source',0
  Capabilities: enum
  Items: 'None' 'ASP1RX1' 'ASP1RX2' 'VMON' 'IMON' 'ERRVOL' 'CLASSH' 'VDDBMON' 'VBSTMON' 'DSP1TX1' 'DSP1TX2' 'DSP1TX3' 'DSP1TX4' 'DSP1TX5' 'DSP1TX6' 'DSP1TX7' 'DSP1TX8' 'TEMPMON' 'INTERPOLATOR' 'SDW1RX1' 'SDW1RX2'
  Item0: 'VMON'
Simple mixer control 'AMP1 ASP1 TX2 Source',0
  Capabilities: enum
  Items: 'None' 'ASP1RX1' 'ASP1RX2' 'VMON' 'IMON' 'ERRVOL' 'CLASSH' 'VDDBMON' 'VBSTMON' 'DSP1TX1' 'DSP1TX2' 'DSP1TX3' 'DSP1TX4' 'DSP1TX5' 'DSP1TX6' 'DSP1TX7' 'DSP1TX8' 'TEMPMON' 'INTERPOLATOR' 'SDW1RX1' 'SDW1RX2'
  Item0: 'IMON'
Simple mixer control 'AMP1 ASP1 TX3 Source',0
  Capabilities: enum
  Items: 'None' 'ASP1RX1' 'ASP1RX2' 'VMON' 'IMON' 'ERRVOL' 'CLASSH' 'VDDBMON' 'VBSTMON' 'DSP1TX1' 'DSP1TX2' 'DSP1TX3' 'DSP1TX4' 'DSP1TX5' 'DSP1TX6' 'DSP1TX7' 'DSP1TX8' 'TEMPMON' 'INTERPOLATOR' 'SDW1RX1' 'SDW1RX2'
  Item0: 'ERRVOL'
Simple mixer control 'AMP1 ASP1 TX4 Source',0
  Capabilities: enum
  Items: 'None' 'ASP1RX1' 'ASP1RX2' 'VMON' 'IMON' 'ERRVOL' 'CLASSH' 'VDDBMON' 'VBSTMON' 'DSP1TX1' 'DSP1TX2' 'DSP1TX3' 'DSP1TX4' 'DSP1TX5' 'DSP1TX6' 'DSP1TX7' 'DSP1TX8' 'TEMPMON' 'INTERPOLATOR' 'SDW1RX1' 'SDW1RX2'
  Item0: 'VDDBMON'
Simple mixer control 'AMP1 Posture Number',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 255
  Mono: 0 [0%]
Simple mixer control 'AMP1 Speaker',0
  Capabilities: pvolume pvolume-joined
  Playback channels: Mono
  Limits: Playback 0 - 448
  Mono: Playback 400 [89%] [0.00dB]
Simple mixer control 'AMP2 ASP1 TX1 Source',0
  Capabilities: enum
  Items: 'None' 'ASP1RX1' 'ASP1RX2' 'VMON' 'IMON' 'ERRVOL' 'CLASSH' 'VDDBMON' 'VBSTMON' 'DSP1TX1' 'DSP1TX2' 'DSP1TX3' 'DSP1TX4' 'DSP1TX5' 'DSP1TX6' 'DSP1TX7' 'DSP1TX8' 'TEMPMON' 'INTERPOLATOR' 'SDW1RX1' 'SDW1RX2'
  Item0: 'VMON'
Simple mixer control 'AMP2 ASP1 TX2 Source',0
  Capabilities: enum
  Items: 'None' 'ASP1RX1' 'ASP1RX2' 'VMON' 'IMON' 'ERRVOL' 'CLASSH' 'VDDBMON' 'VBSTMON' 'DSP1TX1' 'DSP1TX2' 'DSP1TX3' 'DSP1TX4' 'DSP1TX5' 'DSP1TX6' 'DSP1TX7' 'DSP1TX8' 'TEMPMON' 'INTERPOLATOR' 'SDW1RX1' 'SDW1RX2'
  Item0: 'IMON'
Simple mixer control 'AMP2 ASP1 TX3 Source',0
  Capabilities: enum
  Items: 'None' 'ASP1RX1' 'ASP1RX2' 'VMON' 'IMON' 'ERRVOL' 'CLASSH' 'VDDBMON' 'VBSTMON' 'DSP1TX1' 'DSP1TX2' 'DSP1TX3' 'DSP1TX4' 'DSP1TX5' 'DSP1TX6' 'DSP1TX7' 'DSP1TX8' 'TEMPMON' 'INTERPOLATOR' 'SDW1RX1' 'SDW1RX2'
  Item0: 'ERRVOL'
Simple mixer control 'AMP2 ASP1 TX4 Source',0
  Capabilities: enum
  Items: 'None' 'ASP1RX1' 'ASP1RX2' 'VMON' 'IMON' 'ERRVOL' 'CLASSH' 'VDDBMON' 'VBSTMON' 'DSP1TX1' 'DSP1TX2' 'DSP1TX3' 'DSP1TX4' 'DSP1TX5' 'DSP1TX6' 'DSP1TX7' 'DSP1TX8' 'TEMPMON' 'INTERPOLATOR' 'SDW1RX1' 'SDW1RX2'
  Item0: 'VDDBMON'
Simple mixer control 'AMP2 Posture Number',0
  Capabilities: volume volume-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 255
  Mono: 0 [0%]
Simple mixer control 'AMP2 Speaker',0
  Capabilities: pvolume pvolume-joined
  Playback channels: Mono
  Limits: Playback 0 - 448
  Mono: Playback 400 [89%] [0.00dB]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Internal Mic',0
  Capabilities: cswitch cswitch-joined cswitch-exclusive
  Capture exclusive group: 0
  Capture channels: Mono
  Mono: Capture [on]
Simple mixer control 'Internal Mic 1',0
  Capabilities: cswitch cswitch-joined cswitch-exclusive
  Capture exclusive group: 0
  Capture channels: Mono
  Mono: Capture [off]
Simple mixer control 'Internal Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Internal Mic Boost',1
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
pactl list cards
Card #47
	Name: alsa_card.pci-0000_65_00.1
	Driver: alsa
	Owner Module: n/a
	Properties:
		api.acp.auto-port = "false"
		api.acp.auto-profile = "false"
		api.alsa.card = "0"
		api.alsa.card.longname = "HD-Audio Generic at 0xdc6c8000 irq 134"
		api.alsa.card.name = "HD-Audio Generic"
		api.alsa.path = "hw:0"
		api.alsa.split-enable = "true"
		api.alsa.use-acp = "true"
		api.dbus.ReserveDevice1 = "Audio0"
		api.dbus.ReserveDevice1.Priority = "-20"
		device.api = "alsa"
		device.bus = "pci"
		device.bus_path = "pci-0000:65:00.1"
		device.description = "Radeon High Definition Audio Controller [Rembrandt/Strix]"
		device.enum.api = "udev"
		device.icon_name = "audio-card-analog-pci"
		device.name = "alsa_card.pci-0000_65_00.1"
		device.nick = "HD-Audio Generic"
		device.plugged.usec = "5796451"
		device.product.id = "0x1640"
		device.product.name = "Radeon High Definition Audio Controller [Rembrandt/Strix]"
		device.subsystem = "sound"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:65:00.1/sound/card0"
		device.vendor.id = "0x1002"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD/ATI]"
		media.class = "Audio/Device"
		spa.object.id = "2"
		factory.id = "15"
		client.id = "46"
		object.id = "47"
		object.serial = "47"
		object.path = "alsa:acp:Generic"
		alsa.card = "0"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xdc6c8000 irq 134"
		alsa.driver_name = "snd_hda_intel"
		alsa.mixer_name = "ATI R6xx HDMI"
		alsa.components = "HDA:1002aa01,00aa0100,00100900"
		alsa.id = "Generic"
		device.string = "0"
	Profiles:
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
		output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5900, available: no)
		output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
		output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (sinks: 1, sources: 0, priority: 800, available: no)
		pro-audio: Pro Audio (sinks: 1, sources: 0, priority: 1, available: yes)
	Active Profile: off
	Ports:
		hdmi-output-0: HDMI / DisplayPort (type: HDMI, priority: 5900, latency offset: 0 usec, availability group: Legacy 1, not available)
			Properties:
				port.type = "hdmi"
				port.availability-group = "Legacy 1"
				device.icon_name = "video-display"
				card.profile.port = "0"
			Part of profile(s): output:hdmi-stereo, output:hdmi-surround, output:hdmi-surround71

Card #48
	Name: alsa_card.pci-0000_65_00.6
	Driver: alsa
	Owner Module: n/a
	Properties:
		api.acp.auto-port = "false"
		api.acp.auto-profile = "false"
		api.alsa.card = "1"
		api.alsa.card.longname = "HD-Audio Generic at 0xdc6c0000 irq 135"
		api.alsa.card.name = "HD-Audio Generic"
		api.alsa.path = "hw:1"
		api.alsa.split-enable = "true"
		api.alsa.use-acp = "true"
		api.dbus.ReserveDevice1 = "Audio1"
		api.dbus.ReserveDevice1.Priority = "-20"
		device.api = "alsa"
		device.bus = "pci"
		device.bus_path = "pci-0000:65:00.6"
		device.description = "Family 17h/19h/1ah HD Audio Controller"
		device.enum.api = "udev"
		device.icon_name = "audio-card-analog-pci"
		device.name = "alsa_card.pci-0000_65_00.6"
		device.nick = "HD-Audio Generic"
		device.plugged.usec = "6652203"
		device.product.id = "0x15e3"
		device.product.name = "Family 17h/19h/1ah HD Audio Controller"
		device.subsystem = "sound"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:65:00.6/sound/card1"
		device.vendor.id = "0x1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		media.class = "Audio/Device"
		spa.object.id = "4"
		factory.id = "15"
		client.id = "46"
		object.id = "48"
		object.serial = "48"
		object.path = "alsa:acp:Generic_1"
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.long_card_name = "HD-Audio Generic at 0xdc6c0000 irq 135"
		alsa.driver_name = "snd_hda_intel"
		alsa.mixer_name = "Realtek ALC285"
		alsa.components = "HDA:10ec0285,10431024,00100002"
		alsa.id = "Generic_1"
		device.string = "1"
	Profiles:
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: yes)
		output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
		output:analog-surround-21+input:analog-stereo: Analog Surround 2.1 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1365, available: no)
		output:analog-surround-21: Analog Surround 2.1 Output (sinks: 1, sources: 0, priority: 1300, available: no)
		output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 1265, available: no)
		output:analog-surround-40: Analog Surround 4.0 Output (sinks: 1, sources: 0, priority: 1200, available: no)
		input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
		pro-audio: Pro Audio (sinks: 1, sources: 1, priority: 1, available: yes)
	Active Profile: output:analog-stereo
	Ports:
		analog-input-internal-mic: Internal Microphone (type: Mic, priority: 8900, latency offset: 0 usec, availability group: Legacy 1, availability unknown)
			Properties:
				port.type = "mic"
				port.availability-group = "Legacy 1"
				device.icon_name = "audio-input-microphone"
				card.profile.port = "0"
			Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21+input:analog-stereo, output:analog-surround-40+input:analog-stereo
		analog-output-speaker: Speakers (type: Speaker, priority: 10000, latency offset: 0 usec, availability group: Legacy 2, not available)
			Properties:
				port.type = "speaker"
				port.availability-group = "Legacy 2"
				device.icon_name = "audio-speakers"
				card.profile.port = "1"
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-21, output:analog-surround-21+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo
		analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, availability group: Legacy 3, available)
			Properties:
				port.type = "headphones"
				port.availability-group = "Legacy 3"
				device.icon_name = "audio-headphones"
				card.profile.port = "2"
			Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo
pactl list sinks
Sink #59
	State: RUNNING
	Name: alsa_output.pci-0000_65_00.6.analog-stereo
	Description: Family 17h/19h/1ah HD Audio Controller Analog Stereo
	Driver: PipeWire
	Sample Specification: s32le 2ch 48000Hz
	Channel Map: front-left,front-right
	Owner Module: 4294967295
	Mute: no
	Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_65_00.6.analog-stereo.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
	Properties:
		alsa.card = "1"
		alsa.card_name = "HD-Audio Generic"
		alsa.class = "generic"
		alsa.components = "HDA:10ec0285,10431024,00100002"
		alsa.device = "0"
		alsa.driver_name = "snd_hda_intel"
		alsa.id = "ALC285 Analog"
		alsa.long_card_name = "HD-Audio Generic at 0xdc6c0000 irq 135"
		alsa.mixer_name = "Realtek ALC285"
		alsa.name = "ALC285 Analog"
		alsa.resolution_bits = "16"
		alsa.subclass = "generic-mix"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.sync.id = "00000000:00000000:00000000:00000000"
		api.alsa.card.longname = "HD-Audio Generic at 0xdc6c0000 irq 135"
		api.alsa.card.name = "HD-Audio Generic"
		api.alsa.path = "front:1"
		api.alsa.pcm.card = "1"
		api.alsa.pcm.stream = "playback"
		audio.channels = "2"
		audio.position = "FL,FR"
		card.profile.device = "3"
		device.api = "alsa"
		device.class = "sound"
		device.icon_name = "audio-card-analog"
		device.id = "48"
		device.profile.description = "Analog Stereo"
		device.profile.name = "analog-stereo"
		device.routes = "2"
		factory.name = "api.alsa.pcm.sink"
		media.class = "Audio/Sink"
		device.description = "Family 17h/19h/1ah HD Audio Controller"
		node.name = "alsa_output.pci-0000_65_00.6.analog-stereo"
		node.nick = "ALC285 Analog"
		node.pause-on-idle = "false"
		object.path = "alsa:acp:Generic_1:3:playback"
		port.group = "playback"
		priority.driver = "1009"
		priority.session = "1009"
		factory.id = "19"
		clock.quantum-limit = "8192"
		client.id = "46"
		node.driver = "true"
		node.loop.name = "data-loop.0"
		library.name = "audioconvert/libspa-audioconvert"
		object.id = "59"
		object.serial = "59"
		node.max-latency = "16384/48000"
		api.alsa.period-size = "1024"
		api.alsa.period-num = "32"
		api.alsa.headroom = "0"
		api.acp.auto-port = "false"
		api.acp.auto-profile = "false"
		api.alsa.card = "1"
		api.alsa.split-enable = "true"
		api.alsa.use-acp = "true"
		api.dbus.ReserveDevice1 = "Audio1"
		api.dbus.ReserveDevice1.Priority = "-20"
		device.bus = "pci"
		device.bus_path = "pci-0000:65:00.6"
		device.enum.api = "udev"
		device.name = "alsa_card.pci-0000_65_00.6"
		device.nick = "HD-Audio Generic"
		device.plugged.usec = "6652203"
		device.product.id = "0x15e3"
		device.product.name = "Family 17h/19h/1ah HD Audio Controller"
		device.subsystem = "sound"
		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:65:00.6/sound/card1"
		device.vendor.id = "0x1022"
		device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
		spa.object.id = "4"
		device.string = "1"
	Ports:
		analog-output-speaker: Speakers (type: Speaker, priority: 10000, availability group: Legacy 2, not available)
		analog-output-headphones: Headphones (type: Headphones, priority: 9900, availability group: Legacy 3, available)
	Active Port: analog-output-headphones
	Formats:
		pcm

Please let me know if something did not come across clearly or more information would be needed. Lastly, I don't think you really addressed it (I did have quite a ramble in my first post) but on the topic of decreasing the master volume giving weird distortion through the speakers, despite it coming from the same audio sink (family 17h/19h/1ah HD audio controller analog stereo) I do not get this distortion through earbuds plugged into the audio jack.

Offline

#4 2025-12-06 23:22:43

MrRabbit
Member
Registered: 2025-12-06
Posts: 1

Re: New song on spotify resets volume to 30%

Found this, in `.config/pipewire` create a new file called `pipwire-pulse.conf` and add/modify the contents below. make sure to restart pipewire after wards for the new config to take effect.

```
pulse.rules = [
    {
        matches = [
            { application.name = "spotify" }
        ]
        actions = { quirks = [ block-sink-volume ] }
    }
]
```

Offline

Board footer

Powered by FluxBB