Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ddcutil): add display manufacturer id #135

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

AndrielFR
Copy link
Contributor

I was having a problem where wluma was not detecting the name of my auxiliary monitor, causing it to return \0, so I made it fallback to the manufactured id to be able to use wluma completely.

Before:

2025-01-20T21:55:47Z DEBUG wluma::brightness::backlight] Using direct write on /sys/class/backlight/amdgpu_bl1 to change brightness value
[2025-01-20T21:55:47Z DEBUG wluma::frame::capturer::wayland] Detected support for linux-dmabuf-v1 protocol
[2025-01-20T21:55:47Z DEBUG wluma::frame::capturer::wayland] Detected support for wlr-export-dmabuf-unstable-v1 protocol
[2025-01-20T21:55:47Z DEBUG wluma::frame::capturer::wayland] Detected support for wlr-screencopy-unstable-v1 protocol
[2025-01-20T21:55:47Z DEBUG wluma::frame::capturer::wayland] Using output 'BOE 0x08D5 (eDP-1)' for config 'BOE'
[2025-01-20T21:55:47Z DEBUG wluma::frame::capturer::wayland] Using wlr-screencopy-unstable-v1 protocol to request frames
[2025-01-20T21:55:51Z DEBUG wluma::brightness::ddcutil] Discovered displays (check_caps=true): ["\0 "]
[2025-01-20T21:55:51Z DEBUG wluma::brightness::ddcutil] Using display ' ' for config 'RTK' (check_caps=true)
[2025-01-20T21:55:51Z INFO  wluma] Continue adjusting brightness and wluma will learn your preference over time.
[2025-01-20T21:55:51Z DEBUG wluma::frame::capturer::wayland] Detected support for linux-dmabuf-v1 protocol
[2025-01-20T21:55:51Z DEBUG wluma::frame::capturer::wayland] Detected support for wlr-export-dmabuf-unstable-v1 protocol
[2025-01-20T21:55:51Z DEBUG wluma::frame::capturer::wayland] Detected support for wlr-screencopy-unstable-v1 protocol
[2025-01-20T21:55:51Z DEBUG wluma::frame::capturer::wayland] Using output 'BOE 0x08D5 (eDP-1)' for config 'RTK'
[2025-01-20T21:55:51Z ERROR wluma::frame::capturer::wayland] Cannot use output 'Invalid Vendor Codename - RTK 0x0101 0x01010101 (HDMI-A-1)' for config 'RTK' because another output was already matched with it, skipping this output.
[2025-01-20T21:55:51Z DEBUG wluma::frame::capturer::wayland] Using wlr-screencopy-unstable-v1 protocol to request frames

Now:

[2025-01-20T22:33:06Z DEBUG wluma::brightness::backlight] Using direct write on /sys/class/backlight/amdgpu_bl1 to change brightness 
value
[2025-01-20T22:33:06Z DEBUG wluma::frame::capturer::wayland] Detected support for linux-dmabuf-v1 protocol
[2025-01-20T22:33:06Z DEBUG wluma::frame::capturer::wayland] Detected support for wlr-export-dmabuf-unstable-v1 protocol
[2025-01-20T22:33:06Z DEBUG wluma::frame::capturer::wayland] Detected support for wlr-screencopy-unstable-v1 protocol
[2025-01-20T22:33:06Z DEBUG wluma::frame::capturer::wayland] Using output 'BOE 0x08D5 (eDP-1)' for config 'BOE'
[2025-01-20T22:33:06Z DEBUG wluma::frame::capturer::wayland] Using wlr-screencopy-unstable-v1 protocol to request frames
[2025-01-20T22:33:09Z DEBUG wluma::brightness::ddcutil] Discovered displays (check_caps=true): ["RTK "]
[2025-01-20T22:33:09Z DEBUG wluma::brightness::ddcutil] Using display 'RTK ' for config 'RTK' (check_caps=true)
[2025-01-20T22:33:09Z INFO  wluma] Continue adjusting brightness and wluma will learn your preference over time.
[2025-01-20T22:33:10Z DEBUG wluma::frame::capturer::wayland] Detected support for linux-dmabuf-v1 protocol
[2025-01-20T22:33:10Z DEBUG wluma::frame::capturer::wayland] Detected support for wlr-export-dmabuf-unstable-v1 protocol
[2025-01-20T22:33:10Z DEBUG wluma::frame::capturer::wayland] Detected support for wlr-screencopy-unstable-v1 protocol
[2025-01-20T22:33:10Z DEBUG wluma::frame::capturer::wayland] Using output 'Invalid Vendor Codename - RTK 0x0101 0x01010101 (HDMI-A-1)
' for config 'RTK'
[2025-01-20T22:33:10Z DEBUG wluma::frame::capturer::wayland] Using wlr-screencopy-unstable-v1 protocol to request frames

Updated the `find_display_by_name` function in `ddcutil.rs` to handle cases where the display's `model_name` starts with a null character. In such cases, the `manufacturer_id` is used instead. This ensures more accurate display information.
src/brightness/ddcutil.rs Outdated Show resolved Hide resolved
@maximbaz maximbaz changed the title fix(ddcutil): handle null character in display model name fix(ddcutil): add display manufacturer id Jan 20, 2025
@maximbaz maximbaz merged commit 45c61c2 into maximbaz:main Jan 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants