You are not logged in.

#1 2017-03-21 15:21:33

d3cfitz
Member
From: Sydney
Registered: 2017-03-21
Posts: 8

Lag on volume key input

Ok so complete newbie to the forums here, I literally just created an account to ask this because i couldn't find anything similar elsewhere.

There is about a 2 second delay when changing volume via an openbox key binding (using pactl set-sink-volume), but if I have pavucontrol open it's pretty much instant. I'm wondering if there's a more robust way to control volume that doesn't have this delay.

My other XF86 keybindings work flawlessly including the mute, it's just volume up and volume down that have a 2 second delay (but only if pavucontrol isn't open).

Last edited by d3cfitz (2017-03-21 15:36:31)

Offline

#2 2017-03-23 04:57:17

frank604
Member
From: BC, Canada
Registered: 2011-04-20
Posts: 1,212

Re: Lag on volume key input

I'll assume you are using arch linux?  Can you try with amixer to see if the issue is present instead of pactl ?

Offline

#3 2017-03-23 05:22:12

d3cfitz
Member
From: Sydney
Registered: 2017-03-21
Posts: 8

Re: Lag on volume key input

Yes I'm running Arch with openbox on a T450s

It seems alsa doesn't know where stuffs at caus "amixer -q sset Master 5%+" gives me "amixer: Unable to find simple control 'Master',0" I assume that's because pulse audio has locked the card for itself since everything PA - related is working beautifully except for the lag thing. I also tried "amixer -q -D pulse sset Master 10%+" but no luck.

My solution for now is to just have pavucontrol autostart and hidden away in the depths of openbox desktops, but a workaround would be nice

EDIT: I can control volume via alsamixer cli but the delay is still there, in fact i can visually see it because the alsa bars have the same delay

EDIT2: might not've been clear but controlling volume via alsamixer cli and directional keys work with no delay but having it open doesnt have the same magical delay banishing effect as pavucontrol

Last edited by d3cfitz (2017-03-23 05:30:26)

Offline

#4 2017-03-23 05:25:28

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Lag on volume key input

amixer shall work with pulse.
Do you have pulseaudio-alsa installed?

Offline

#5 2017-03-23 05:27:42

d3cfitz
Member
From: Sydney
Registered: 2017-03-21
Posts: 8

Re: Lag on volume key input

Ok so rookie error, i didnt have pulseaudio-alsa installed so now amixer works but the delay is still there, same as pactl

Offline

#6 2017-03-23 05:37:21

d3cfitz
Member
From: Sydney
Registered: 2017-03-21
Posts: 8

Re: Lag on volume key input

Something of note: when controlling volume via directional keys with alsamixer on intel pch (my main sound card) its without delay but selecting the pulseaudio card and controlling it the same way has the delay. So the delay is obviously coming from pulseaudio.

Offline

#7 2017-03-23 05:44:49

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Lag on volume key input

post your /etc/asound.conf

Offline

#8 2017-03-23 06:08:01

d3cfitz
Member
From: Sydney
Registered: 2017-03-21
Posts: 8

Re: Lag on volume key input

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

# vim:set ft=alsaconf:

Last edited by d3cfitz (2017-03-23 06:11:18)

Offline

#9 2017-03-23 06:26:57

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Lag on volume key input

This looks good.
What happens with, (as you have pulseaudio-alsa now)

amixer -q -c 0 sset Master 2%+
or
amixer -q -D pulse sset Master 10%+

Offline

#10 2017-03-23 06:36:25

d3cfitz
Member
From: Sydney
Registered: 2017-03-21
Posts: 8

Re: Lag on volume key input

amixer -q -D pulse sset Master 10%+ same as pactl (delay)
amixer -q -c 0 sset Master 2%+ unable to find simple control maser
amixer -q sset Master 2%+ same as pactl (delay)

both of the ones that work are instant when i have pavucontrol open

Offline

#11 2017-03-23 06:49:25

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Lag on volume key input

My last attempt, as I couldn't think of anything else

rm -r ~/.pulse ~/.pulse-cookie ~/.config/pulse

reboot and check

Note: pulse will recreate configuration on reboot.

Offline

#12 2017-05-05 14:02:04

Boris Bolgradov
Member
From: Bulgaria
Registered: 2008-07-27
Posts: 185

Re: Lag on volume key input

I'm having exactly the same issue.

As additional note:
When I have only spotify running - there's a delay. When I'm playing a video on youtube (or have pavucontrol open as OP did) the delay is gone. A few seconds after I close the youtube tab the delay comes back.

It's like pulseaudio doesn't detect a client and doesn't respond to volume changes immediately to save resources?

Edit: It's not a laptop issue. Multimedia and Games would be more appropriate place for this thread.

Last edited by Boris Bolgradov (2017-05-05 14:05:34)

Offline

#13 2017-05-05 14:59:00

d3cfitz
Member
From: Sydney
Registered: 2017-03-21
Posts: 8

Re: Lag on volume key input

As a crude workaround I've simply got pavucontrol to startup iconified and hidden on boot so I just forget about it. I'm not fussed anymore but would be interested to know what causes this.

Can't remember why I put this in laptop issues, might've been my first thought. Pretty new to the forums so if there's a way to move it feel free.

Offline

Board footer

Powered by FluxBB