# Volume button doesn't work

## mhelvens

Hey everyone,

I have a Logitech Cordless Desktop Pro keyboard. It has two volume buttons. In KDE, the `volume down' button works. But the `volume up' button does not. They both worked once upon a time. Not sure how long ago that was.

This just seems a bit strange to me. I'd like to fix it. Where would you suggest I start?

Thanks!

----------

## opentaka

 *Michiel_H wrote:*   

> 
> 
> This just seems a bit strange to me. I'd like to fix it. Where would you suggest I start?
> 
> 

 

a bit of reading.. say, http://gentoo-wiki.com/HOWTO_Use_Multimedia_Keys ?

----------

## mhelvens

I've read it, but I'm not quite there yet.

There is an application that seems to already intercept the three volume keys, including the "raise volume" key. "lower volume" and "mute" work correctly and bring up a rectangular gray dialog with the new volume status. The "raise volume" button must also be intercepted by this application, because I can't map any of the three buttons to another function.

That is: I can try (using KDE Configure Shortcuts), and the keysyms for all three work correctly, but they still keep their old function (including the "raise volume" button, which does nothing).

How can I find out which application is intercepting these keys, and stop it (I'll use my own mapping)?

Edit: It seems that KMix is the app that's intercepting them. However, not all of them. If I kill KMix and press "lower volume", KMix restarts to handle it (which is strange, because I emptied KMix's global shortcut list). However, not if I press "raise volume".

I need to find out which app IS intercepting that key. Any help would be appreciated.

----------

## mhelvens

It's not solved yet. But after removing the global shortcuts from KMix and restarting the PC, the XF86AudioLowerVolume and XF86AudioMute keysims are no longer being intercepted by KMix, and they work correctly. It seems some other program is intercepting the XF86AudioRaiseVolume keysim and doing nothing with it. How can I find out which program that is?

Clarification: The "Configure Shortcuts" dialog does recognize the "raise volume" button as XF86AudioRaiseVolume, so the problem is somewhere within KDE, I'd say.

----------

## opentaka

 *Michiel_H wrote:*   

> It's not solved yet. But after removing the global shortcuts from KMix and restarting the PC, the XF86AudioLowerVolume and XF86AudioMute keysims are no longer being intercepted by KMix, and they work correctly. It seems some other program is intercepting the XF86AudioRaiseVolume keysim and doing nothing with it. How can I find out which program that is?
> 
> Clarification: The "Configure Shortcuts" dialog does recognize the "raise volume" button as XF86AudioRaiseVolume, so the problem is somewhere within KDE, I'd say.

 

I am not aware of ways to find which program is using the particular key shortcut outside of KDE package. And you could run xev(emerge xev) and press the "raise volume" button and see what that button is recognized into, and maybe define it with xmodmap.

----------

## mhelvens

Well, here is the xev output for that button:

```
KeyPress event, serial 31, synthetic NO, window 0x3600001,

    root 0x155, subw 0x0, time 33699243, (873,-792), root:(877,179),

    state 0x0, keycode 176 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,

    XKeysymToKeycode returns keycode: 175

    XLookupString gives 0 bytes:

    XmbLookupString gives 0 bytes:

    XFilterEvent returns: False
```

The problem is at a higher level. KDE seems to work in a first-come first-served way with these global shortcuts. And some unknown program got there first and claimed XF86AudioRaiseVolume. Strange, it should be easy to figure out which program it is. KDE must keep a file with this information somewhere.

----------

## opentaka

 *Michiel_H wrote:*   

>  KDE must keep a file with this information somewhere.

 

perhaps

```
find ~/.kde/share/config -print0 | xargs -0 cat | grep XF86AudioRaiseVolume
```

might hit something?

----------

## mhelvens

It hit exactly one file. It was the place where I put the XF86AudioRaiseVolume I WANT to intercept. So no help...  :Sad: 

----------

## mhelvens

One last attempt to bump this thread up.

I looked at the process-list, and considered all KDE apps that were running. None of them seems to intercept the XF86AudioRaiseVolume key. I'm at the end of my rope. Maybe I'll just have to learn to live with the fact that one of my volume buttons doesn't work?  :Razz: 

----------

## opentaka

how about forcingly xmodmapping the key to execute 

```
amixer sset PCM 2+
```

 ? It's better than nothing at least  :Wink: 

----------

## Mark Clegg

Similar things happening here...

At some point in the past, the volume buttons both worked, but the mute button didn't. Now, (after many updates, so I'm not sure which) the mute button works, but the volume buttons don't.

Pressing any of them, results in KDE displaying it's on screen message (OSD), but the volume buttons will only toggle the display between 0 and 11% (and don't affect the volume).

The keys are producing the correct keysyms XF86Audio... etc, as proved by the OSD messages (and testing with xev).

I believe the core problem is that the wrong audio channels are being selected by whatever application is catching these keys.

Just out of curiosity - what sound card are you using? I'm using snd_hda_intel, which I believe at the hardware level, doesn't have a concept of "Master" channel, although you can select this via KMix. Maybe whatever process is catching the keys doesn't use KMix's setting for the Master channel?

----------

## peper0

I've had some problems with volume control too. After many tries I noticed that KMilo is responsible for handling these keys... Maybe that help you (kcontrol, KDE components -> Service Manager -> startup services)?

----------

## bunder

 *peper0 wrote:*   

> I've had some problems with volume control too. After many tries I noticed that KMilo is responsible for handling these keys... Maybe that help you (kcontrol, KDE components -> Service Manager -> startup services)?

 

you have to be careful with kmilo on some machines... for some reason it will assume one of the volume buttons is being held down and won't let you change the volume... but i think this only affects dell machines.  ymmv.

cheers

----------

## mhelvens

I stopped kmilo there. But the raise-volume button is still intercepted by something.

Edit: And so, it seems, is raise-volume combined with a modifier key...

----------

## oc666

 *Mark Clegg wrote:*   

> Similar things happening here...
> 
> At some point in the past, the volume buttons both worked, but the mute button didn't. Now, (after many updates, so I'm not sure which) the mute button works, but the volume buttons don't.
> 
> Pressing any of them, results in KDE displaying it's on screen message (OSD), but the volume buttons will only toggle the display between 0 and 11% (and don't affect the volume).
> ...

 

Double thread

----------

## Mark Clegg

 *oc666 wrote:*   

> Double thread

 

... which is why I posted a link in that thread back to this one.

----------

## wadelius

Hi,

I've had similar problems, only diffirence being that Kmix has intercepted my XF86AudioMute. I'm not really a Gentoo user, I use Mandriva, but while reading this thread I realised there is a possibility to work around the problem. So I registered to tell you.

What you can do is connect the keys that are not working to some other XF86Audio* name with xmodmap, for example XF86AudioPlay. Then using xbindkeys you can attatch the functionality you want to XF86AudioPlay. This means you can not use XF86AudioPlay to Play, but if you do not have that button it is not a problem. I followed the instructions from this HowTo: http://ubuntuforums.org/showthread.php?t=254474 except that I changed XF86AudioMute to XF86AudioPlay and the "PCM" channel to "Front". Now Kmix won't intercept because it does not know I press the Mute button.

Hope this helps!

Wadelius

----------

## oc666

 *wadelius wrote:*   

> ...I changed XF86AudioMute to XF86AudioPlay and the "PCM" channel to "Front"...

 

How did you changed the "PCM" channel to "Front"? (I think this is my problem)

----------

## wadelius

I followed the Howto I provided a link to. There you create (or modify if it exists) a .xbindkeysrc file in your home directory and insert your keybindings in it. What you should do is change PCM to Front or whatever your channel is called in the .xbindkeysrc file. The howto says you should insert:

"amixer sset PCM 5-"

XF86AudioLowerVolume

"amixer sset PCM 5+"

XF86AudioRaiseVolume

"amixer set PCM toggle"

XF86AudioMute

But I inserted:

"amixer sset Front 5-"

XF86AudioLowerVolume

"amixer sset Front 5+"

XF86AudioRaiseVolume

"amixer set Front toggle"

XF86AudioPlay

So it is amixer that does the actual changing of the settings, so you need to have that installed. Just type the commands (for example "amixer sser Front 5-") and see if they work. I have tried both sset and set and both work. I think the channel "Front" can have other names, to get the names of your channels just type amixer in the terminal. It will give you details on all the channels amixer can change. Just follow the instructions in the Howto and make sure to run "xmodmap {full path}/.Xmodmap" and "xbindkeys" on startup.

//

  Jonathan

----------

## oc666

 *wadelius wrote:*   

> I followed the Howto I provided a link to. There you create (or modify if it exists) a .xbindkeysrc file in your home directory and insert your keybindings in it. What you should do is change PCM to Front or whatever your channel is called in the .xbindkeysrc file. The howto says you should insert:
> 
> "amixer sset PCM 5-"
> 
> XF86AudioLowerVolume
> ...

 

How could I do this to all users?

----------

## wadelius

Don't know how to do it all at once, but you could easily copy the same files to each user and make sure they all run the commands at startup. There is probably some smarter way to do it but I don't know how   :Confused: .

//

  Jonathan

----------

## bjlockie

 *Mark Clegg wrote:*   

> Similar things happening here...
> 
> At some point in the past, the volume buttons both worked, but the mute button didn't. Now, (after many updates, so I'm not sure which) the mute button works, but the volume buttons don't.
> 
> Pressing any of them, results in KDE displaying it's on screen message (OSD), but the volume buttons will only toggle the display between 0 and 11% (and don't affect the volume).
> ...

 

I get exactly the same behaviour.

I upgraded my motherboard and use the snd_hda_intel now.

My guess is because there is no master channel.

Did it work with snd_hda_intel before?

I upgraded to xorg-7.3 also.

It seems to have bugs.  :Sad: 

----------

## oc666

I just downgrade xorg-7.3 to xorg-7.2 because those bugs, specially synaptics, but also lock lids.

----------

## oc666

What exactly control the osd of the volume when I press the multimedia keys?

----------

## Mark Clegg

For info...  I've now upgraded to KDE 3.5.8 and found that the buttons (vol+, vol- and mute) are now all working correctly.

----------

