Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xbindkeys won't control pulseaudio
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
rayhogenson
n00b
n00b


Joined: 17 Mar 2017
Posts: 4

PostPosted: Fri Mar 17, 2017 3:32 am    Post subject: xbindkeys won't control pulseaudio Reply with quote

Mysterious forces are at play...

Right now my .xbindkeysrc contains
Code:

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

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

"pactl set-sink-mute 1 toggle"
    XF86AudioMute

which I hope would allow me to control my volume in pulseaudio via my keyboard keys.

I experience the following behavior in various scenarios:

When xbindkeys is in my .xprofile, xbindkeys runs successfully as does pulseaudio, but the volume keys have no effect until I
Code:
killall xbindkeys; xbindkeys
Redirecting the output from xbindkeys to a file shows no output at all, no error messages.

When xbindkeys is not in my .xprofile and I run it manually, the volume keys work as I would expect. Note that this works both when I run xbindkeys before pulseaudio --start and the other way around, so I hypothesize that it's not an issue of xbindkeys being run before pulseaudio has a chance to start.

When I put pulseaudio --start before xbindkeys in my .xprofile pulseaudio doesn't start at all! Instead it is not running and when I try to manually start it I get an error message that it fails to start.

I haven't tried putting pulseaudio --start after xbindkeys in my .xprofile but I doubt this would be an illuminating exercise.

Thanks.

Edit: the specific error that pulseaudio gives me when I try to start it in .xprofile then again with pulseaudio --start is
Code:

E: [pulseaudio] main.c: Daemon startup failed.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3728
Location: Austro Bavaria

PostPosted: Fri Mar 24, 2017 1:10 am    Post subject: Reply with quote

These are my self written keybindings for my i3wm + pulseaudio.

Code:
#rise master volume of pulseaudio master
bindsym XF86AudioRaiseVolume exec "amixer set Master unmute; amixer -c 0 set Master 1dB+"

#lower master volume of pulseaudio master
bindsym XF86AudioLowerVolume exec "amixer set Master unmute; amixer -c 0 set Master 1dB-"


How about
Code:
amixer set Master unmute; amixer -c 0 set Master 1dB+
?
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 4009
Location: UK

PostPosted: Fri Mar 24, 2017 2:06 am    Post subject: Reply with quote

There's no need for the sh -c part; xbindkeys command strings are always interpreted via $SHELL.

Pulseaudio startup errors go to syslog, so check there.
_________________
Quantity is not quality.
overlay | runit-scripts
Back to top
View user's profile Send private message
rayhogenson
n00b
n00b


Joined: 17 Mar 2017
Posts: 4

PostPosted: Fri Mar 24, 2017 2:27 am    Post subject: Reply with quote

Using amixer results in the same behavior as pactl.

Thanks for the tip about the sh -c.

My syslog gets
Code:
Mar 23 22:22:37 Geromy root: ACPI event unhandled: button/volumedown VOLDN 00000080 00000000 K
Mar 23 22:22:37 Geromy pulseaudio[6567]: [pulseaudio] module.c: module-combine is deprecated: Please use module-combine-sink instead of module-combine!
Mar 23 22:22:37 Geromy pulseaudio[6567]: [pulseaudio] module-combine.c: We will now load module-combine-sink. Please make sure to remove module-combine from your configuration.
Mar 23 22:22:37 Geromy pulseaudio[6567]: [pulseaudio] main.c: D-Bus name org.PulseAudio1 already taken.
Mar 23 22:22:37 Geromy pulseaudio[6564]: [pulseaudio] main.c: Daemon startup failed.
Mar 23 22:22:37 Geromy pulseaudio[6577]: [pulseaudio] module.c: module-combine is deprecated: Please use module-combine-sink instead of module-combine!
Mar 23 22:22:37 Geromy pulseaudio[6577]: [pulseaudio] module-combine.c: We will now load module-combine-sink. Please make sure to remove module-combine from your configuration.
Mar 23 22:22:37 Geromy pulseaudio[6577]: [pulseaudio] main.c: D-Bus name org.PulseAudio1 already taken.
Mar 23 22:22:37 Geromy pulseaudio[6574]: [pulseaudio] main.c: Daemon startup failed.

written to it whenever I press a volume key. It looks like pulseaudio isn't running and fails to start, which is strange because restarting xbindkeys makes these errors stop, but why would restarting xbindkeys make pulseaudio work properly?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3728
Location: Austro Bavaria

PostPosted: Fri Mar 24, 2017 1:39 pm    Post subject: Reply with quote

maybe an issue with dbus?


have you checked with a "virgin" new user account?
Back to top
View user's profile Send private message
rayhogenson
n00b
n00b


Joined: 17 Mar 2017
Posts: 4

PostPosted: Fri Mar 24, 2017 2:26 pm    Post subject: Reply with quote

The issue also occurs with no difference on a "virgin" new user account.
Back to top
View user's profile Send private message
rayhogenson
n00b
n00b


Joined: 17 Mar 2017
Posts: 4

PostPosted: Thu Apr 13, 2017 1:52 am    Post subject: Reply with quote

My workaround is to not use xbindkeys, but instead have my window manager responsible for assigning these actions to these keys.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum