asus-linux-drivers / asus-wmi-hotkeys-driver

Linux configurable driver for Asus WMI hotkeys. The driver works as middle-man, is listening for key events from specific devices and when is appropriate key event caught then may be handle by own way configured in config file.
GNU General Public License v2.0
28 stars 5 forks source link

Camera shutter #2

Closed aniketfuryrocks closed 9 months ago

aniketfuryrocks commented 1 year ago

First of all thanks for the amazing work that you are doing. Is there any way to get the electronic privacy shutter for webcam to work ?

IMG_20221110_064845

ldrahnik commented 1 year ago

Hello,

I use this script https://github.com/ldrahnik/elementary-os-scripts/blob/master/toggle_camera.sh

Lukas

Alaric323 commented 1 year ago

Following off what aniket was saying (using a similar UN5401R laptop), I would disagree this is offtopic. My shutter is currently shut and cannot be toggled by this repo's scripts; it doesn't toggle the camera on or off at all. Rather, it actually takes photos when using apps like Cheese. The LEDs for the microphone and camera keys also don't turn on. Even though the camera shutter is active, it IS still connected to the device, appearing as a camera option in most apps. This suggests that the camera itself is not linked to the shutter, but the shutter is instead a separate device possibly connected via I2C like the numpad.

I would need to dual boot Windows to disable the shutter. I'm more than willing to help identify devices with some guidance. I may be able to test improvements for the fliplock environment for AMD devices as well.

ldrahnik commented 1 year ago

Hello @Alaric323, at first, thank you for your issue comment. I previously marked this issue as offtopic because the driver in this repository currently only adds possibility rebind keys (not only Fn+ ..), and was not intended to solve in this driver whether the functionality of these keys is proper or not. But might be. I have a laptop where the script that I posted works (atm tested, led and camera is off/on) and is ready to bind to any key but I know that script might differ for other distributions and it is the main reason why not contain these scripts in this repository, so reason why is placed in a separated repository for my custom scripts for Elementary OS.

Depends on what is your problem. Could you please provide more information so I can fully understand how could be added functionality (new code to this driver) helpful to solve your (maybe not only yours) problem?

Alaric323 commented 1 year ago

Sure. It might make this package a bit heavier like the numpad mod, but if it gets stuff working that'd be amazing. There are two main issues I have: Keyboard LEDs and the Camera Shutter.

Like the original poster Akinet above, my laptop features two keys with LEDs embedded into them that indicate their current status, those being the Microphone and Camera keys (the caps lock key as well, but that functions as it should). When I press the microphone key, it DOES disable the microphone in the system, but it does NOT turn on the LED on the key. The little pinholes in the keys are where the LEDs are. 2023-05-25 10 52 33 2023-05-25 10 52 48

The computer also features an integrated privacy shutter on the camera that, while in Windows, activates the moment the camera gets disabled by the keyboard key. It becomes a physical block to let light in, even if something reenables the camera maliciously. It is the orange spot in the photo below. My camera key doesn't work at all, pressing it does not disable/enable the camera, nor raise the shutter. It is always ENABLED, but cannot see anything due to said shutter. 2023-05-25 11 08 52

I'm assuming that these LEDs and the shutter are both controlled by I2C, similar to how the numpad LEDs are controlled. The webcam is connected via USB protocol (and can be seen in the lsusb post below): image

A number of I2C devices exist: image

ldrahnik commented 1 year ago

@Alaric323 Can you please post any video where are these LEDs (microphone/camera) controlled on Windows?

ldrahnik commented 1 year ago

@Alaric323 Keyboard technical doc is required to have or might be enough eavesdrop communication on Windows.

Alaric323 commented 1 year ago

Unfortunately I've removed windows entirely from the laptop as of right now and will need some time to try and dual boot.

In the meantime, knowing Asus hardly anything is available in terms of documentation, and the support page for the laptop lacks anything to do with tech manuals or service guides.

Which makes sniffing the easiest method. Any recommendations for a program to sniff all I2C ports while I prepare a windows install?

ldrahnik commented 1 year ago

@Alaric323 For NumberPad was used this project recommended in Ubuntu feature request of NumberPad driver thread . Julian Oertel succesfully used the tool, report is attached in his comment.

Alaric323 commented 1 year ago

After some time I gave it a shot, but I'm certainly no driver developer and got as far as dumping the DSDT (some experience about that from building hackintoshes). The DSDT had a bunch of errors when trying to compile even though I only made a number change, saying a bunch of the devices had the wrong name.

Bit too over my head for me to continue, unfortunately.

ldrahnik commented 11 months ago

@aniketfuryrocks @Alaric323 I have atleast pushed an attempt of handling micMute key LED which works for my laptop here https://github.com/asus-linux-drivers/asus-wmi-hotkeys-driver/commit/ff24d25285522500b74e4ac7e88713c3e073fa2c. I also found this gsettings /org/gnome/desktop/privacy/disable-microphone which might be changed also. Atm I am now sure how do it configurable in this package because in some laptops it already works.

// specific solution for micMute problem I also found here https://www.reddit.com/r/linuxquestions/comments/l8yh6c/binding_the_micmute_keyboard_led_to_the/ (https://github.com/Dzeri96/Micmute-LED-Pulseaudio-Service)

ldrahnik commented 11 months ago

@aniketfuryrocks For electronic privacy shutter for the webcam needs to be installed windows and Asus driver? and sniffed device communication when it happens on/off.

EDIT: On model UN5401QAB I can negate I have physical block when I press key for disabling camera.

ldrahnik commented 11 months ago

@Alaric323 Camera key LED is probably solved already in branch keyboard_camera_led of screenpad repo. When is kernel patch applied, interface for controlling LED should appear as platform::camera with brightness file (tried on kernel 6.2 but unfortunately without success)

// EDIT: id +1 works for camera led, so on my laptop it is 0x00060079

ldrahnik commented 9 months ago

@Alaric323 @aniketfuryrocks Closed as the current version of the driver in Readme.md describes how to fix LEDS for e.g. camera / micmute keys and even describes how to fix fan key functionality (switching between full fan speed, auto etc.). About camera physical block I would like discussion would continue for example on mail