Kernel+Userland: Better media keys support#26678
Kernel+Userland: Better media keys support#26678bplaat wants to merge 11 commits intoSerenityOS:masterfrom
Conversation
spholz
left a comment
There was a problem hiding this comment.
I only skimmed the last WindowServer commit, as I'm not particularly knowledgeable about GUI stuff.
Base/etc/group
Outdated
| lookup:x:10:anon | ||
| window:x:13:anon | ||
| users:x:100:anon | ||
| users:x:100:anon,window |
There was a problem hiding this comment.
This seems wrong. The users group should (I think) be for normal users, and not include systems users, like window.
There was a problem hiding this comment.
You are right, I have chosen a different approach:
- Add
SocketGroupoption to SystemServer - AudioServer running as user creates the audio socket with the audio group and permission 0660
windowuser is part of the audio group and can connect
| }; | ||
| // clang-format on | ||
|
|
||
| // clang-format off |
There was a problem hiding this comment.
Same here, did you test this? And where did you get these mappings from? OSDev wiki?
In QEMU on linux at least only volume control keys work (and only with the SDL display backend).
There was a problem hiding this comment.
They are from https://wiki.osdev.org/PS/2_Keyboard, and all audio keys work with PS/2 in my tests in qemu x86_64 on macOS
0e2735d to
f32a3a8
Compare
|
@spholz thanks for the review, I've addressed all of your points where I could. As you probably know, I'm not really a kernel developer and I really don't know anything about USB HID specs, but hopefully you can maybe fix that on top of this work, to make it better in the future. |
Also add volume overlay which visualizes volume changes
This PR improves media key support across the entire OS.
At the kernel level, it enhances media key handling in the USB HID, PS/2, and virtio input drivers, ensuring more reliable detection of key events. On the user space side, all media applications now respond to the Play/Pause media key.
Additionally, the WindowManager is now integrated with the AudioServer. It handles volume up/down and mute key presses, and displays a volume overlay to provide user feedback.
One limitation remains: since the AudioServer runs under the desktop user while the WindowServer runs as root / window group, the system currently determines the active user session by querying the first open window. This approach works but is not ideal and could be improved in the future.
Demo video
media-keys-sped-up.mp4
This video is sped up, I used qemu monitor to enter media keys that was quite slow so video is a bit weird but it shows the working in GUI of entered media keys