FedeDP / Clight

A C daemon that turns your webcam into a light sensor. It will adjust screen backlight based on ambient brightness.
GNU General Public License v3.0
709 stars 27 forks source link

[FEATURE REQ] Device support: Samsung Galaxy Book Flex2 #247

Open RubenKelevra opened 2 years ago

RubenKelevra commented 2 years ago

Is your feature request related to a problem? Please describe. My Samsung device got a brightness sensor – which is under Windows only, used to turn on/off the keyboard backlights (which can be adjusted in brightness or turned off completely).

Neither the brightness sensor nor the keyboard backlights (nor the secondary camera of the device) is showing up under Linux – which is kind of strange.

The 720p webcam above the display is working fine for clight, so this ticket isn't about that I'm unable to use clight - it works great! :)

I noticed that the 720p device show's up with 3 possible input devices, which is kind of weird to me:

$ v4l2-ctl --list-devices
720p HD Camera: 720p HD Camera (usb-0000:00:14.0-6):
        /dev/video0
        /dev/video1
        /dev/media0
$ v4l2-ctl --list-devices
720p HD Camera: 720p HD Camera (usb-0000:00:14.0-6):
        /dev/video0
        /dev/video1
        /dev/media0

$ v4l2-ctl -d /dev/video0 --list-ctrls

User Controls

                     brightness 0x00980900 (int)    : min=0 max=127 step=1 default=64 value=64
                       contrast 0x00980901 (int)    : min=0 max=100 step=1 default=50 value=50
                     saturation 0x00980902 (int)    : min=0 max=8 step=1 default=4 value=4
                            hue 0x00980903 (int)    : min=-180 max=180 step=1 default=0 value=0
        white_balance_automatic 0x0098090c (bool)   : default=1 value=1
                          gamma 0x00980910 (int)    : min=100 max=500 step=1 default=300 value=300
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=2 (60 Hz)
      white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=10 default=3400 value=3400 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=8 step=1 default=4 value=4
         backlight_compensation 0x0098091c (int)    : min=0 max=1 step=1 default=0 value=0

Camera Controls

                  auto_exposure 0x009a0901 (menu)   : min=0 max=3 default=3 value=3 (Aperture Priority Mode)
         exposure_time_absolute 0x009a0902 (int)    : min=50 max=10000 step=1 default=166 value=166 flags=inactive
$ v4l2-ctl -d /dev/video1 --list-ctrls
$ v4l2-ctl -d /dev/media0 --list-ctrls
Unable to detect what device /dev/media0 is, exiting.

So just a wild uneducated guess: /dev/video1 is the secondary camera, which needs to be activated (or is just not supported) before using. And /dev/media0 is the brightness sensor?

I'm kind of stuck, so I thought I'm asking for advice here:

The devices I found (which could be related):

lspci

```console # lspci -v [...] 00:12.0 Serial controller: Intel Corporation Tiger Lake-LP Integrated Sensor Hub (rev 20) (prog-if 00 [8250]) DeviceName: Onboard - Other Subsystem: Samsung Electronics Co Ltd Device c194 Flags: bus master, fast devsel, latency 0, IRQ 16, IOMMU group 8 Memory at 603e170000 (64-bit, non-prefetchable) [size=64K] Capabilities: [80] Power Management version 3 Capabilities: [90] Vendor Specific Information: Len=14 Kernel driver in use: intel_ish_ipc Kernel modules: intel_ish_ipc [...] 00:15.0 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #0 (rev 20) DeviceName: Onboard - Other Subsystem: Samsung Electronics Co Ltd Device c194 Flags: bus master, fast devsel, latency 0, IRQ 27, IOMMU group 11 Memory at 4017000000 (64-bit, non-prefetchable) [virtual] [size=4K] Capabilities: [80] Power Management version 3 Capabilities: [90] Vendor Specific Information: Len=14 Kernel driver in use: intel-lpss Kernel modules: intel_lpss_pci 00:15.1 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #1 (rev 20) DeviceName: Onboard - Other Subsystem: Samsung Electronics Co Ltd Device c194 Flags: bus master, fast devsel, latency 0, IRQ 40, IOMMU group 11 Memory at 4017001000 (64-bit, non-prefetchable) [virtual] [size=4K] Capabilities: [80] Power Management version 3 Capabilities: [90] Vendor Specific Information: Len=14 Kernel driver in use: intel-lpss Kernel modules: intel_lpss_pci 00:15.2 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #2 (rev 20) DeviceName: Onboard - Other Subsystem: Samsung Electronics Co Ltd Device c194 Flags: bus master, fast devsel, latency 0, IRQ 29, IOMMU group 11 Memory at 4017002000 (64-bit, non-prefetchable) [virtual] [size=4K] Capabilities: [80] Power Management version 3 Capabilities: [90] Vendor Specific Information: Len=14 Kernel driver in use: intel-lpss Kernel modules: intel_lpss_pci 00:15.3 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #3 (rev 20) DeviceName: Onboard - Other Subsystem: Samsung Electronics Co Ltd Device c194 Flags: bus master, fast devsel, latency 0, IRQ 30, IOMMU group 11 Memory at 4017003000 (64-bit, non-prefetchable) [virtual] [size=4K] Capabilities: [80] Power Management version 3 Capabilities: [90] Vendor Specific Information: Len=14 Kernel driver in use: intel-lpss Kernel modules: intel_lpss_pci [...] ```
**lsusb** ```console # lsusb -v [...] Bus 003 Device 003: ID 2b7e:0134 Generic 720p HD Camera Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.01 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x2b7e idProduct 0x0134 bcdDevice 0.07 iManufacturer 3 Generic iProduct 1 720p HD Camera iSerial 2 200901010001 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x02b3 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 4 USB Camera bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Association: bLength 8 bDescriptorType 11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 14 Video bFunctionSubClass 3 Video Interface Collection bFunctionProtocol 0 iFunction 5 720p HD Camera Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 1 Video Control bInterfaceProtocol 0 iInterface 5 720p HD Camera VideoControl Interface Descriptor: bLength 13 bDescriptorType 36 bDescriptorSubtype 1 (HEADER) bcdUVC 1.00 wTotalLength 0x006b dwClockFrequency 15.000000MHz bInCollection 1 baInterfaceNr( 0) 1 VideoControl Interface Descriptor: bLength 18 bDescriptorType 36 bDescriptorSubtype 2 (INPUT_TERMINAL) bTerminalID 1 wTerminalType 0x0201 Camera Sensor bAssocTerminal 0 iTerminal 0 wObjectiveFocalLengthMin 0 wObjectiveFocalLengthMax 0 wOcularFocalLength 0 bControlSize 3 bmControls 0x0020000a Auto-Exposure Mode Exposure Time (Absolute) VideoControl Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 5 (PROCESSING_UNIT) Warning: Descriptor too short bUnitID 2 bSourceID 1 wMaxMultiplier 0 bControlSize 2 bmControls 0x0000157f Brightness Contrast Hue Saturation Sharpness Gamma White Balance Temperature Backlight Compensation Power Line Frequency White Balance Temperature, Auto iProcessing 0 bmVideoStandards 0x09 None SECAM - 625/50 VideoControl Interface Descriptor: bLength 9 bDescriptorType 36 bDescriptorSubtype 3 (OUTPUT_TERMINAL) bTerminalID 3 wTerminalType 0x0101 USB Streaming bAssocTerminal 0 bSourceID 6 iTerminal 0 VideoControl Interface Descriptor: bLength 27 bDescriptorType 36 bDescriptorSubtype 6 (EXTENSION_UNIT) bUnitID 4 guidExtensionCode {1229a78c-47b4-4094-b0ce-db07386fb938} bNumControls 2 bNrInPins 1 baSourceID( 0) 2 bControlSize 2 bmControls( 0) 0x00 bmControls( 1) 0x06 iExtension 0 VideoControl Interface Descriptor: bLength 29 bDescriptorType 36 bDescriptorSubtype 6 (EXTENSION_UNIT) bUnitID 6 guidExtensionCode {26b8105a-0713-4870-979d-da79444bb68e} bNumControls 4 bNrInPins 1 baSourceID( 0) 4 bControlSize 4 bmControls( 0) 0x38 bmControls( 1) 0x00 bmControls( 2) 0x04 bmControls( 3) 0x00 iExtension 6 Realtek Extended Controls Unit Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 6 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 VideoStreaming Interface Descriptor: bLength 15 bDescriptorType 36 bDescriptorSubtype 1 (INPUT_HEADER) bNumFormats 2 wTotalLength 0x01a9 bEndpointAddress 0x81 EP 1 IN bmInfo 0 bTerminalLink 3 bStillCaptureMethod 1 bTriggerSupport 1 bTriggerUsage 0 bControlSize 1 bmaControls( 0) 0 bmaControls( 1) 0 VideoStreaming Interface Descriptor: bLength 11 bDescriptorType 36 bDescriptorSubtype 6 (FORMAT_MJPEG) bFormatIndex 1 bNumFrameDescriptors 6 bFlags 1 Fixed-size samples: Yes bDefaultFrameIndex 1 bAspectRatioX 0 bAspectRatioY 0 bmInterlaceFlags 0x00 Interlaced stream or variable: No Fields per frame: 1 fields Field 1 first: No Field pattern: Field 1 only bCopyProtect 0 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 1 bmCapabilities 0x01 Still image supported wWidth 1280 wHeight 720 dwMinBitRate 442368000 dwMaxBitRate 442368000 dwMaxVideoFrameBufferSize 1843200 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 2 bmCapabilities 0x01 Still image supported wWidth 640 wHeight 480 dwMinBitRate 147456000 dwMaxBitRate 147456000 dwMaxVideoFrameBufferSize 614400 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 3 bmCapabilities 0x01 Still image supported wWidth 640 wHeight 360 dwMinBitRate 110592000 dwMaxBitRate 110592000 dwMaxVideoFrameBufferSize 460800 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 4 bmCapabilities 0x01 Still image supported wWidth 352 wHeight 288 dwMinBitRate 48660480 dwMaxBitRate 48660480 dwMaxVideoFrameBufferSize 202752 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 5 bmCapabilities 0x01 Still image supported wWidth 320 wHeight 240 dwMinBitRate 36864000 dwMaxBitRate 36864000 dwMaxVideoFrameBufferSize 153600 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 7 (FRAME_MJPEG) bFrameIndex 6 bmCapabilities 0x01 Still image supported wWidth 160 wHeight 120 dwMinBitRate 9216000 dwMaxBitRate 9216000 dwMaxVideoFrameBufferSize 38400 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 13 (COLORFORMAT) bColorPrimaries 1 (BT.709,sRGB) bTransferCharacteristics 1 (BT.709) bMatrixCoefficients 4 (SMPTE 170M (BT.601)) VideoStreaming Interface Descriptor: bLength 27 bDescriptorType 36 bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED) bFormatIndex 2 bNumFrameDescriptors 6 guidFormat {32595559-0000-0010-8000-00aa00389b71} bBitsPerPixel 16 bDefaultFrameIndex 1 bAspectRatioX 0 bAspectRatioY 0 bmInterlaceFlags 0x00 Interlaced stream or variable: No Fields per frame: 2 fields Field 1 first: No Field pattern: Field 1 only bCopyProtect 0 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 1 bmCapabilities 0x01 Still image supported wWidth 1280 wHeight 720 dwMinBitRate 147456000 dwMaxBitRate 147456000 dwMaxVideoFrameBufferSize 1843200 dwDefaultFrameInterval 1000000 bFrameIntervalType 1 dwFrameInterval( 0) 1000000 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 2 bmCapabilities 0x01 Still image supported wWidth 640 wHeight 480 dwMinBitRate 147456000 dwMaxBitRate 147456000 dwMaxVideoFrameBufferSize 614400 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 3 bmCapabilities 0x01 Still image supported wWidth 640 wHeight 360 dwMinBitRate 110592000 dwMaxBitRate 110592000 dwMaxVideoFrameBufferSize 460800 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 4 bmCapabilities 0x01 Still image supported wWidth 352 wHeight 288 dwMinBitRate 48660480 dwMaxBitRate 48660480 dwMaxVideoFrameBufferSize 202752 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 5 bmCapabilities 0x01 Still image supported wWidth 320 wHeight 240 dwMinBitRate 36864000 dwMaxBitRate 36864000 dwMaxVideoFrameBufferSize 153600 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 30 bDescriptorType 36 bDescriptorSubtype 5 (FRAME_UNCOMPRESSED) bFrameIndex 6 bmCapabilities 0x01 Still image supported wWidth 160 wHeight 120 dwMinBitRate 9216000 dwMaxBitRate 9216000 dwMaxVideoFrameBufferSize 38400 dwDefaultFrameInterval 333333 bFrameIntervalType 1 dwFrameInterval( 0) 333333 VideoStreaming Interface Descriptor: bLength 6 bDescriptorType 36 bDescriptorSubtype 13 (COLORFORMAT) bColorPrimaries 1 (BT.709,sRGB) bTransferCharacteristics 1 (BT.709) bMatrixCoefficients 4 (SMPTE 170M (BT.601)) Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 1 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0080 1x 128 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 2 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 3 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 4 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0b00 2x 768 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 5 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x0c00 2x 1024 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 6 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x1380 3x 896 bytes bInterval 1 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 7 bNumEndpoints 1 bInterfaceClass 14 Video bInterfaceSubClass 2 Video Streaming bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 5 Transfer Type Isochronous Synch Type Asynchronous Usage Type Data wMaxPacketSize 0x13fc 3x 1020 bytes bInterval 1 Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 0x0021 bNumDeviceCaps 1 Platform Device Capability: bLength 28 bDescriptorType 16 bDevCapabilityType 5 bReserved 0 PlatformCapabilityUUID {d8dd60df-4589-4cc7-9cd2-659d9e648a9f} CapabilityData[0] 0x00 CapabilityData[1] 0x00 CapabilityData[2] 0x00 CapabilityData[3] 0x0a CapabilityData[4] 0x7e CapabilityData[5] 0x01 CapabilityData[6] 0x5f CapabilityData[7] 0x00 Device Status: 0x0000 (Bus Powered) Bus 003 Device 002: ID 04e8:730b Samsung Electronics Co., Ltd Fingerprint Sensor Device - 730B Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x04e8 Samsung Electronics Co., Ltd idProduct 0x730b bcdDevice 0.00 iManufacturer 1 Cypress iProduct 2 Fingerprint Sensor Device - 730B iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0027 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 2 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 10 Device Status: 0x0001 Self Powered ```
flying-x commented 2 years ago

Did you check the output of ddcutil detect? It might be that the OLED screen doesn't have a backlight that you can control.

I use icc-brightness-gnome-git AUR package from arch to simulate brightness change in software.

FedeDP commented 1 year ago

Hi! I think perhaps Linux does not support neither your brightness sensor nor your keyboard backlight :) Not much we can do i'd say!

spikespaz commented 7 months ago

OLED brightness can be controlled by multiplying each pixel by a brightness factor. This can be done entirely in userspace, for example by GammaStep.

I found another project, wl-gammarelay-rs which should support this use-case, but I currently have an open issue because it doesn't work on my machine.

I think Clight should implement something similar, I would come back because now I also have a device with an ambient light sensor.

FedeDP commented 7 months ago

I think Clight should implement something similar, I would come back because now I also have a device with an ambient light sensor.

Latest Clightd tag supports so-called "software emulated backlight" management for all monitors that are not supported by ddc. Care to try? I am not sure whether it will work (ie: i am not sure whether your display will try to use sysfs method instead. In that case, i might add a new env var to force-enable emulated backlight mode even for internal sysfs displays). For more info: https://github.com/FedeDP/Clightd/wiki/Backlight

Also, in Clightd master i disabled by default the emulated backlight support since it was causing some troubles for me when i attached the laptop to my TV, but afaik it worked fine with internal laptop display or my normal external monitor while developing and testing the feature.

spikespaz commented 7 months ago

For me to use this feature, I would need to be sure it wouldn't try to adjust the (emulated) brightness of two other displays, but rather, only the internal one.

Your concern about it trying to use ACPI sysfs is most likely a problem, test -f /sys/class/backlight/amdgpu_bl0/brightness returns 0 so that fine does exist. Writing a value to the file has no visible effect.

Perhaps configure Clight to use emulated backlight for specific displays?

FedeDP commented 7 months ago

Perhaps configure Clight to use emulated backlight for specific displays?

Yep makes sense! Please can you open a feat req on Clightd? :) Thanks!