You are not logged in.
I have a volume wheel on my keyboard which I mapped to volume controls by putting this in my i3 config
#Volume controls
bindsym XF86AudioRaiseVolume exec amixer -q set Master 5%+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 5%- unmute
bindsym XF86AudioMute exec amixer -q set Master toggleHere's what it does: https://streamable.com/eh3oc
It doesn't happen with the volume keys on my laptop, only with the wheel
Last edited by Shinwoir (2019-03-18 14:16:04)
Offline
can you reproduce the same issue by running these commands on the shell directly? then it's a problem with amixer. (I don't have amixer installed actually... so I can't try.)
otherwise, it could be a race condition, like if that wheel is trigger happy (or the command is just slow), multiple amixer could run in parallel, causing side effects if amixer has no race prevention builtin.
in that case you could use flock to avoid race
bindsym XF86AudioRaiseVolume exec flock -n /tmp/amixer-flock amixer -q set Master 5%+ unmute
bindsym XF86AudioLowerVolume exec flock -n /tmp/amixer-flock amixer -q set Master 5%- unmute
bindsym XF86AudioMute exec flock -n /tmp/amixer-flock amixer -q set Master toggle-n is optional, means ignore command if another is still running, so -n might miss key events
not using -n would introduce delay in processing key events
if you prefer delay you could replace -n with something like -w 0.5 to allow at most half second delays
Last edited by frostschutz (2019-03-18 10:48:53)
Offline
You really also shouldn't change pulseaudio volumes by shoehorning over the compatibility mixer.
Use pulseaudio tools to change your volume:
#Volume controls
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggleSynchronisation of the ALSA volume over to your pulseaudio volume with the ALSA->pulse compat device isn't guaranteed, and there can be all sorts of weird behavior.
Offline
You really also shouldn't change pulseaudio volumes by shoehorning over the compatibility mixer.
Use pulseaudio tools to change your volume:
#Volume controls bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggleSynchronisation of the ALSA volume over to your pulseaudio volume with the ALSA->pulse compat device isn't guaranteed, and there can be all sorts of weird behavior.
I see, I didn't know about all the sinks stuff, and using amixer seemed easier to me. Thanks a lot for the help
Offline