Media Keys in Kubuntu Intrepid x64 don't work correctly

Bug #285056 reported by Lonnie Blansett
This bug report is a duplicate of:  Bug #223412: Global shortcuts don't always work. Edit Remove
16
Affects Status Importance Assigned to Milestone
Ubuntu
Incomplete
Undecided
Unassigned
Nominated for Intrepid by amstan

Bug Description

I'm having some trouble with the media keys on my Dell Inspiron 1420 laptop and I'm running the 64 bit version of Kubuntu Intrepid.

1) The volume keys seem to work to raise or lower the volume and display the OSD, but the volume numbers don't change. So pressing "Volume Up" raises and the volume and displays the starting volume level. This seems to be a configuration issue so it may be easy to fix.

2) Amarok 1.4 comes with this install (since 2.0 is still beta at best) and the "Stop" and "Play/Pause" media keys work just fine even when Amarok is minimized or on a different desktop. However, the "Back" and "Next" media keys only work when Amarok has focus. I've made sure it's "Global Shortcuts" for those keys are set. One possible cause for this is that in Amarok the "Next" button is read as "XF86AudioNext" and the "Back" button is read as "XF86AudioPrev", however, in other native KDE4.1 apps those keys are read as "Media Next" and "Media Previous" respectively. Perhaps KDE4 is handing off the wrong key code to Amarok so it it ignored?

Revision history for this message
Benjamin Kay (benkay) wrote :

I'm having similar trouble on an amd64 machine (a Thinkpad T61) using amarok 2:1.4.10-0ubuntu3 and kde 4:4.1.2-0ubuntu4. The volume buttons (up, down, and mute) work find for me, and the OSD correctly reflects the volume level. My keyboard has a play/pause button, but it only makes Amarok play -- I can't use it to pause music. My keyboard's stop button doesn't work at all. My keyboard's next and previous buttons work, but only if Amarok has window focus.

xev reports my keyboard's buttons as follows:
Volume Mute: XF86AudioMute
Volume Down: XF86AudioLowerVolume
Volume Up: XF86AudioRaiseVolume
Play/Pause: XF86AudioPlay
Stop: XF86AudioLowerVolume
Next: XF86AudioNext
Previous: XF86AudioPrev

Interestingly, pressing the stop button doesn't lower my volume. Here's the full xev output for each button:

Volume Down:
KeyRelease event, serial 31, synthetic NO, window 0x4200001,
    root 0x81, subw 0x0, time 13098721, (365,-173), root:(370,506),
    state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Stop:
KeyPress event, serial 34, synthetic NO, window 0x4200001,
    root 0x81, subw 0x0, time 13128883, (48,-15), root:(53,664),
    state 0x0, keycode 174 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
    XKeysymToKeycode returns keycode: 122
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x4200001,
    root 0x81, subw 0x0, time 13128955, (48,-15), root:(53,664),
    state 0x0, keycode 174 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
    XKeysymToKeycode returns keycode: 122
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Revision history for this message
amstan (amstan) wrote :

I have the same problems.

Kubuntu intrepid 64bit on a hp pavilion dv2000

Revision history for this message
Ze Killer-Whale (ze-killer-whale) wrote :

Got exactly the same problem Benjamin Kay has but on a i686 machine (Inspiron 6400), although I succeeded in remapping the "Play/Pause" button to actually Play/Pause : You've got to go to the Global Shortcuts options in Amarok, remove the shortcut XF86AudioPlay mapped to "Play", save your prefs, and edit the "Play/Pause" shortcut to this same button, it should work!

But the Prev/Next buttons only work when Amarok is focused and the Stop button doesn't work at all and is named "XF86LowerVolume" although it doesn't lowers the volume...

I thought the fault was my laptop but I've got a friend with a multimedia keyboard (don't remember the brand) who has exactly the same problem...

Hope this will soon be fixed because I had no issue with the previous versions and this one is supposed to be "more compatible" with media keys... :s

Revision history for this message
Bertrand G (berteh) wrote :

My problem might be related... eventually... no clue:

when hitting any of the 3 volume control keys (FN+F3, F4, F5) on my Fujitsu Amilo PI 2540, my keyboard completely freezes.

- these 3 keys are respectively labelled with mute, down and up
- the keycodes are well received (using showkey I get codes 113, 114 and 115)
- the gnome actions of mute, lower volume and increase volume are correctly mapped to the XF86AudioMute, XF86AudioLowerVolume and XF86AudioRaiseVolume codes (in control pannel > keyboard shortcuts).

When I hit any of these any further keystroke is ignored (in any app of current X session).
To unfreeze I need to switch to another console (CTRL+ALT+F4) and back to X server... where my keyboard is then back working.

Any hint or question: feel free!
B.

Revision history for this message
shotlivermutton (geelsb) wrote :

I have the exact same problem as Benjamin Kay, only I'm using a MS digitalmedia3000 keyboard.
64 bit Intrepid, HP Workstation x8200
All media keys are mapped globally and correctly in Amarok.

Revision history for this message
j3frea (j3frea) wrote :

I can confirm this problem on my Dell Inspiron 1525 laptop, kubuntu intrepid x64.

I will focus on the stop key since all the others I have had a certain degree of success with.

My stop key is by default the "XF86AudioLowerVolume" and it does lower the volume (which is incredibly annoying because it alters the "front" channel and the actual audio buttons, which I have managed to get working, are linked to PCM so I have to open kmix to increase the volume of "front").

The prev, play and next buttons I managed to get working in Amarok after a lot of playing around. The stop key seems to be hijacked by some other program before it gets to amarok. It shows an OSD but not the same one as is shown by the actual volume keys (which I assume is generated by kmix). For this reason I figure that there must be some other program that can change volume and it is grabbing that input.

xev says that the stop key is number 174. It used to have the keysym "XF86AudioLowerVolume" as I said but I changed that to "XF86AudioStop". I've mucked around with xbindkeys, xmodmap, xev, showkeys, dumpkeys, loadkeys, I installed an old version of kmilo, I've installed keytouch but nothing is fixing this.

Does anyone know if anyone is working on this problem?

Revision history for this message
Petrus Gomes (petrusgomes) wrote :

Same problem here, with Kubuntu Intrepid i386

Volume keys work out-of-the-box with Kmix. but "Media Next" and "Media Previous" dont work with Amarok 2.0.

I have KDE4 on ubuntu intrepid too, and it works there, since Amarok 1.98 (Amarok2 RC)

I've tried a lot of configuration shortcuts, and nothing =(

I'm attaching my ".kde/share/config/kglobalshortcutsrc".

Sorry for "Brazilian English" =D

Revision history for this message
Petrus Gomes (petrusgomes) wrote :

Sorry, I forgot to mention:

My Play/Pause key works nicely as Global Shortcut on Amarok 2

Thanks

Revision history for this message
Petrus Gomes (petrusgomes) wrote :

I haven't seen that you were using amarok 1.4...my problem was with 2.0. Sorry

I solved my problem purging all amarok config files and instaling it again... Now all shortcuts work.

Thanks

Revision history for this message
kenny-x (live-kenny) wrote :

I have the same problem. Has anybody get any clue as to were this might be going wrong. The problem is only for the media keys but when using the original mapping with <meta> + b it all seems to work properly

Revision history for this message
kenny-x (live-kenny) wrote :

I found the problem it has to do with the reverse mapping in xmodmap. So keycodes are just badly mapped it remove to bad mapping fixes the problem with the program xev you can figure out what the bad keycode is.

for instance:

KeyPress event, serial 31, synthetic NO, window 0x4600001,
    root 0x13b, subw 0x0, time 42893225, (360,-81), root:(365,651),
    state 0x10, keycode 172 (keysym 0x1008ff14, XF86AudioPlay), same_screen YES,
    XKeysymToKeycode returns keycode: 162
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

This one maps back to keycode 162 is stead of 172 so removing 162 from your xmodmap fixes the problem

Revision history for this message
Darwin Bautista (baudm) wrote :

Using the Input Actions instead of Global Shortcuts worked for me. This solved the multimedia keys (stop, prev, next) problem in Amarok 2 (needs to be focused for keys to work) and the PrintScreen problem with KSnapshot too.
For Amarok, I used the D-BUS calls: org.kde.amarok /Player org.freedesktop.MediaPlayer.Next (Stop, Prev)

Revision history for this message
Dan Trevino (dantrevino) wrote :

Lonnie, is this still an issue for you?

Revision history for this message
Lonnie Blansett (lonnie) wrote :

No, this is working now. I removed those keys from my xmodmap and rebooted and then they worked!

Revision history for this message
Andreas Zitzelsberger (az82) wrote :

A solution without resorting to xmodmap: Switch "Generic 105-key (Intl) PC" in System > Preferences > Keyboard > Layout - Keyboard model to "evdev keyboard"
(From http://ubuntuforums.org/archive/index.php/t-966519.html). After that all multimedia keys work flawlessly on my Keyboard.

This should be set by default.

Revision history for this message
j3frea (j3frea) wrote :

Okay, I updated KDE a while ago (to 4.2) and the problem is gone.

I also use a polytonic Greek layout and that is working fine (I have set that up since the update). Another problem that I had was that the volume keys were not linking to the correct channel which is now also corrected. I have done a lot of stuff but as far as I can tell, the update is what fixed that stuff.

So for me: Resolved

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.