Need your help with testing new cool addon

Doesn’t work here;

My keyboard (provided with VOL up, VOL down, VOL mute keys):
Logitech Y-SAE71 SK-2930.

Bad news is good too.
If I’ll give you little app to see key codes, would you agree to run it and print result here?

Download latest repo and build it (or just take GetPressedKeyCodeUtility.zip from there).

You’ll find GetPressedKeyCodeUtility, which will show scan codes of pressed keys. Print here codes for volUP, volDown and volMute keys.

[quote=armanx64]Bad news is good too.
If I’ll give you little app to see key codes, would you agree to run it and print result here?
[/quote]

Well, firstly i installed “GetPressedKeyCodeUtility” but when I press media keys on my keyboard, such utility doesn’t show any code in its window; then (MediaKeysHandler was still present in /boot/system/non-packaged/add-ons/input_server/filters) I rebooted Haiku: at the next reboot both mouse and keyboard was dead/unresponsive: I had to force the shutdown using the power button on my computer (luckily I do a daily backup of my system! :slight_smile: )

Strange behavior. You can use bootable usb flash with Haiku live to remove filter.
After filter removal please try again with key codes utility ― that’s still important.
Thank you for any help.

Even mouse stopped working? Strange, strange…
I can try to fix, but porting feature directly into volume control to commit as patch for Haiku is more important now.

Giova84, can you try to get codes again without addon installed? I need your keyboard codes, that’s important.

Hi Armanx,

When I launch such utility and I press my media keys on my keyboard, it doesn’t show any code; it only shows codes for the “normal” keys.

Kind regards.

Are you removed addon?
If yes and you only see another key codes — your keyboard using something tricky (maybe it contains another virtual USB device with proprietary Logitech protocol), so there’s no easy way to get key pressings.
If addon still installed, it can cause troubles with key detection so please remove and try again.

Also I’ve updated addon; now it must work with standard USB-HID scancodes too.

Integration into desklink failed — Barrett advice about BMessageFilter for demo app works only in a scope of window and when I’ve tried to integrate it into desklink, Deskbar crashes. I’ll return to it in the future, but now working addon is enough. As example Keymap Switcher still provided as addon too.

[quote=armanx64]Are you removed addon?
If yes and you only see another key codes — your keyboard using something tricky (maybe it contains another virtual USB device with proprietary Logitech protocol), so there’s no easy way to get key pressings.
If addon still installed, it can cause troubles with key detection so please remove and try again.
[/quote]

I removed your addon days ago from my system, when I replied here, since it causes a total freeze of my keyboard and mouse (maybe, in my case, such addon jammed the input_server?)

Anyway, if this can help/encourage you, I also use this keyboard on BeOS (my keyboard is provided with PS/2 connector), and on BeOS I have an old keyboard mapping addon (I have this file since about fifteen years, maybe I downloaded it on BeBits :slight_smile: ) and on BeOS I am able to use the media keys, thanks to this addon: however it doesn’t work at all on Haiku, because also this old addon freeze the input_server.

In my opinion, however, is better to place such addon in /boot/home/config/non-packaged/add-ons/input_server/filters because if something will fails as in my case, is enough to boot Haiku with the option “disable user addons” to easily remove the addon, instead of install Haiku on an usb stick.

P.S: such directory is valid since is reported by the output of the command

finddir B_USER_NONPACKAGED_ADDONS_DIRECTORY

However I am not sure if this directory exist by default in Haiku: on my system is present, but maybe I created this directory by myself.

Dear Giova, thank you for help.
I’ll try on my PC with /boot/home/config… and report if it’ll works. Usually I’m using Haiku on USB flash drive to fix things which I broke.
Troubles with jamming input_server can be caused by strange behavior (or just I misunderstood?) of filter mechanism. Please try again with the latest version of addon and report if something changes.

Also, I’m understanding you correct that on BeOS you already have mediakeys working using another addon?

P.S> I’ve got an idea. Are you running one of the latest revision of Haiku?

I am sorry.
At this point I have no idea why another addon works with your KB on BeOS and why on Haiku you can’t even get keycodes.
Maybe an error hidden deep in Haiku, who knows…

Hi Arman,

I update Haiku at least once a week, so I always run one of the latest nightly; on BeOS I use the same keyboard, and there ,thanks to another addon, I have working media keys; I tried again, on Haiku, with the latest version of your addon but again no luck :frowning:

1 Like

I think your KB simulates at least two KBs at same time — that’s can be reason why Haiku can’t detect your mediakeys. I see somewhere that BeOS can work with multiple KBs and Haiku can’t.
Anyway, thank you.

Multiple keyboards work just fine (for example you can use your laptop keyboard + an external USB one). The “problem” is they all share the same keybaord layout, so you can’t have french azerty on the laptop + spanish qwerty on the external keyboard, for example.

The problem with media keys is simply that the keycodes are not mapped to anything and I think they are not accessible at all in our keymap files. We should add this, and it should not be a very difficult change.

Nope. I mean situation when one physical KB represented as multiple KBs.
Currently addon works just fine, 'cause I’m using B_UNMAPPED_KEY_DOWN .
The trouble of Giova is that on his KB this event not raises nor returns nothing — see testing utility on same repo.

I think I’ve done my best with addon and if we want something better, we must start with desklink — at least it need command line args to change volume level.
I’ve tried, but got fail. When I’ll have another free time, I’ll start again.

This seems like a really cool addon, but for me it crashes the media_addon_server on boot (it didn’t work before boot either)

In syslog I have a traceback:

KERN: malloc() of 1841829962 bytes asked KERN: vm_soft_fault: va 0x85dc9000 not covered by area in address space KERN: vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x85dc905a, ip 0x1ad6f1f, write 0, user 1, thread 0x376 KERN: vm_page_fault: thread "media_addon_server" (886) in team "media_addon_server" (886) tried to read address 0x85dc905a, ip 0x1ad6f1f ("???" +0x1ad6f1f) KERN: debug_server: Thread 886 entered the debugger: Segment violation KERN: stack trace, current PC 0x1ad6f1f _PrintToStream__C8BMessagePCc + 0x1bb: KERN: (0x727b0318) 0x1ad72d2 _PrintToStream__C8BMessagePCc + 0x56e KERN: (0x727b07d8) 0x1ad6d4e PrintToStream__C8BMessage + 0x26 KERN: (0x727b0808) 0x5774f5 _LoadSettings__15MultiAudioAddOn + 0xed KERN: (0x727b08c8) 0x576a49 __15MultiAudioAddOnl + 0x71 KERN: (0x727b08f8) 0x57698d make_media_addon + 0x31 KERN: (0x727b0938) 0x13fc20d _LoadAddOn__Q38BPrivate5media18DormantNodeManagerPCclPP11BMediaAddOnPl + 0xad KERN: (0x727b0968) 0x13fb3f5 GetAddOn__Q38BPrivate5media18DormantNodeManagerl + 0xa9 KERN: (0x727b0a08) 0x15e40dc _AddOnAdded__16MediaAddonServerPCcx + 0x64 KERN: (0x727b0ac8) 0x15e2d55 AddOnEnabled__Q216MediaAddonServer14MonitorHandlerPCQ38BPrivate7Storage17add_on_entry_info + 0xd9 KERN: (0x727b0b58) 0x15ea532 _EntryCreated__Q38BPrivate7Storage19AddOnMonitorHandlerRQ38BPrivate7Storage17add_on_entry_info + 0x14a KERN: (0x727b0b98) 0x15ea373 _HandlePendingEntries__Q38BPrivate7Storage19AddOnMonitorHandler + 0x227 KERN: (0x727b0dc8) 0x15e8658 MessageReceived__Q38BPrivate7Storage19AddOnMonitorHandlerP8BMessage + 0x2c KERN: (0x727b0df8) 0x1ad34b7 DispatchMessage__7BLooperP8BMessageP8BHandler + 0x5b KERN: (0x727b0e28) 0x1ac8e45 DispatchMessage__12BApplicationP8BMessageP8BHandler + 0x4e9 KERN: (0x727b1028) 0x1ad4d39 task_looper__7BLooper + 0x205 KERN: (0x727b1068) 0x1ac77be Run__12BApplication + 0x6e KERN: (0x727b10a8) 0x15e5b36 main + 0x7e KERN: (0x727b10d8) 0x15e2b23 _start + 0x5b KERN: (0x727b1108) 0x22c5b98 runtime_loader + 0x134 KERN: debug_server: Killing team 886 (/system/servers/media_addon_server)

If I try to run the server manually after boot I get:

MediaAddonServer::InstantiatePhysialInputsAndOutputs GetFlavorAt failed for index 0! started node 0 fSettings BMessage('mfil') { type items = BMessage(0x0) { type = string("Sounds", 7 bytes) item[0] = string("Beep", 5 bytes) item[1] = string("Error notification", 19 bytes) item[2] = string("Important notification", 23 bytes) item[3] = string("Information notification", 25 bytes) item[4] = string("Key down", 9 bytes) item[5] = string("Key repeat", 11 bytes) item[6] = string("Key up", 7 bytes) item[7] = string("Mouse down", 11 bytes) item[8] = string("Mouse up", 9 bytes) item[9] = string("Progress notification", 22 bytes) item[10] = string("Startup", 8 bytes) item[11] = string("Window activated", 17 bytes) item[12] = string("Window close", 13 bytes) item[13] = string("Window minimized", 17 bytes) item[14] = string("Window open", 12 bytes) item[15] = string("Window restored", 16 bytes) item[16] = string("Window zoomed", 14 bytes) Kill Thread

This turned out to be a completely different issue that just happened to appear at the same time.

However, the utility doesn’t work for me. When I use the utilty to get key presses, nothing happens when I press the volume up/down keys (accessed through fn+F3/F4 on my laptop)

Thank you guys, when I’ll find a little time, I’ll dig into it.
In other hand, I’m C++ (and Haiku API too) newbie, so errors can be caused by me.
Currently all works on my PC with Microsoft Keyboard 2000, so it’s little hard to find fault point.

I updated utility for getting keycodes, so please try anain.
Just run it (after dowload or fetching+compilation), press media keys and write codes there.
I hope this will help us with addon, 'cause without right keycodes for your KBs I was unable to make it working.

https://bitbucket.org/ArmanHayots/mediakeyshandler/ - hg repo
https://bitbucket.org/ArmanHayots/mediakeyshandler/downloads/GetPressedKeyCodeUtility.zip - binary