Multimedia volume keys, keyboard grab, SDL fullscreen: interaction issues
#1
Running under Ubuntu Jaunty, with the GNOME desktop manager, code built myself from svn r21184.

My laptop has some "multimedia keys" separate from the main keyboard, e.g. volume up/down/mute. GNOME manages global keyboard shortcuts so that pressing them adjusts the HW volume.

When running XBMC in windowed mode, these multimedia keys still work as expected.

So, when windowed, I can use the multimedia keys to adjust the HW volume, and use +/- to adjust the audio attenuation inside XBMC.

When running XBMC in full-screen mode, it appears that the SDL library performs an XGrabKeyboard (I checked the libsdl source). This prevents the key events for the multimedia keys from reaching GNOME. Instead, XBMC receives them and adjusts its internal audio attenuation. +/- also still adjust XBMC's audio attenuation as expected.

This is a problem for me, because I often have the HW volume set at say 50%, so as to adjust the output of other applications when not running XBMC. If I enter XBMC in full-screen mode with this HW volume setting, there is no longer any way for me to adjust the HW volume, and this in turn puts a cap on the maximum volume I can get out of XBMC.

Is there a way to do one/all of:

a) Get XBMC to manipulate the ALSA/... volume in response to key presses, instead of internal audio attenuation? A quick read of the source code implies not. This would mean +/- and multimedia keys in fullscreen mode would all simply adjust the HW volume. It'd be OK if +/- adjusted XBMC's audio attenuation, but the multimedia keys adjusted the HW volume.

b) Get XBMC to adjust the HW volume to 100% when started, and restore it upon exit. Not sure if/how this would interact-with/depend-upon windowed-vs-fullscreen.

c) Persuade SDL not to grab the keyboard in fullscreen mode, so GNOME interprets the multimedia keys instead of XBMC.

Also:

I notice that GNOME has the ability to set a keyboard shortcut to place a window into "fullscreen" mode (not maximize; this mode actually removes all window borders, GNOME menu bars, etc.) In this mode, XBMC covers the entire screen just like XBMC's own fullscreen mode triggered by \, but SDL isn't in "full-screen" mode. Hence, the keyboard isn't grabbed by SDL. Hence, GNOME sees multimedia key events, and everything works how I want it. Is there any disadvantage to this method of making XBMC full-screen (as opposed to \ key).

Thanks for any tips!
Reply
#2
There's a bug report with some interesting discussion here:
https://bugzilla.redhat.com/show_bug.cgi...&id=590919

Unfortunately, the bug was abandoned a long time ago.. hopefully there's still another bug out there.
Reply

Logout Mark Read Team Forum Stats Members Help
Multimedia volume keys, keyboard grab, SDL fullscreen: interaction issues0