You are not logged in.

#1 2017-02-25 09:51:16

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

PulseAudio server sink ID is unreliable

To make the volume key on a ThinkPad T550 work, I set up .xbindkeysrc:

"pactl set-sink-mute 1 false; pactl set-sink-volume 1 -5%"
   XF86AudioLowerVolume

"pactl set-sink-mute 1 false; pactl set-sink-volume 1 +5%"
   XF86AudioRaiseVolume

"pactl set-sink-mute 1 toggle"
   XF86AudioMute

After a recent Arch update, the keys stopped working, and I had to change the sink ID from 1 to 0.

How can a change of IDs be prevented for the future, and/or how can the configuration be made more reliable?

Offline

#2 2017-02-25 12:14:10

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: PulseAudio server sink ID is unreliable

The help of pactl says to use a name, I suppose that should be more reliable than a numeric id unless some part of the name is variable.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2017-02-25 12:44:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,738

Re: PulseAudio server sink ID is unreliable

Yep names should remain stable, they could potentially change if you switch your card profile around often, which usually isn't something you do often. If this is your default sink (and that shouldn't change even if you change the card profile) you could also use @DEFAULT_SINK@ as an identifier as opposed to a sink id or a sink name

Online

#4 2017-02-25 13:39:35

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: PulseAudio server sink ID is unreliable

Thanks for the suggestions! Updated .xbindkeysrc to:

"pactl set-sink-mute @DEFAULT_SINK@ false; pactl set-sink-volume @DEFAULT_SINK@ -5%"
   XF86AudioLowerVolume

"pactl set-sink-mute @DEFAULT_SINK@ false; pactl set-sink-volume @DEFAULT_SINK@ +5%"
   XF86AudioRaiseVolume

"pactl set-sink-mute @DEFAULT_SINK@ toggle"
   XF86AudioMute

"pactl set-source-mute @DEFAULT_SOURCE@ toggle"
   XF86AudioMicMute

For the default microphone, I found that one can use @DEFAULT_SOURCE@. It all works fine now.

Offline

Board footer

Powered by FluxBB