WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.36k stars 175 forks source link

wlsunset 0.4.0 unable to adjust gamma on wayfire 0.8.1 #2343

Open je-vv opened 4 months ago

je-vv commented 4 months ago

Describe the bug

When running wayfire 0.8.1 and wlsunset 0.4.0, wlsunset is no longer able to adjust the screen gamma.

Doing:

killall wlsunset && wlsunset &

With wayfire running as:

WAYLAND_DEBUG=1 wayfire

Produces the output:

[2338848.869]  -> wl_display@1.get_registry(new id wl_registry@2)
[2338848.875]  -> wl_display@1.sync(new id wl_callback@3)
[2338849.181] wl_display@1.delete_id(3)
[2338849.189] wl_registry@2.global(1, "wl_shm", 1)
[2338849.193] wl_registry@2.global(2, "wl_drm", 2)
[2338849.197] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4)
[2338849.200] wl_registry@2.global(4, "wl_compositor", 6)
[2338849.203] wl_registry@2.global(5, "wl_subcompositor", 1)
[2338849.206] wl_registry@2.global(6, "wl_data_device_manager", 3)
[2338849.210] wl_registry@2.global(7, "zwp_primary_selection_device_manager_v1", 1)
[2338849.213] wl_registry@2.global(8, "zwlr_data_control_manager_v1", 2)
[2338849.216] wl_registry@2.global(9, "zwlr_output_manager_v1", 4)
[2338849.219] wl_registry@2.global(10, "zwlr_output_power_manager_v1", 1)
[2338849.224] wl_registry@2.global(11, "xdg_wm_base", 3)
[2338849.227] wl_registry@2.global(12, "zwlr_layer_shell_v1", 4)
[2338849.230] wl_registry@2.global(13, "xwayland_shell_v1", 1)
[2338849.233] wl_registry@2.global(14, "zwp_tablet_manager_v2", 1)
[2338849.235] wl_registry@2.global(15, "wl_seat", 8)
[2338849.238] wl_registry@2.global(16, "zwlr_screencopy_manager_v1", 3)
[2338849.241] wl_registry@2.global(17, "zwlr_gamma_control_manager_v1", 1)
[2338849.245]  -> wl_registry@2.bind(17, "zwlr_gamma_control_manager_v1", 1, new id [unknown]@4)
[2338849.248] wl_registry@2.global(18, "zwlr_export_dmabuf_manager_v1", 1)
[2338849.251] wl_registry@2.global(19, "zxdg_output_manager_v1", 3)
[2338849.254] wl_registry@2.global(20, "wp_drm_lease_device_v1", 1)
[2338849.257] wl_registry@2.global(21, "zwlr_input_inhibit_manager_v1", 1)
[2338849.260] wl_registry@2.global(22, "ext_idle_notifier_v1", 1)
[2338849.263] wl_registry@2.global(23, "zwp_idle_inhibit_manager_v1", 1)
[2338849.265] wl_registry@2.global(24, "org_kde_kwin_server_decoration_manager", 1)
[2338849.269] wl_registry@2.global(25, "zxdg_decoration_manager_v1", 1)
[2338849.273] wl_registry@2.global(26, "zwp_virtual_keyboard_manager_v1", 1)
[2338849.276] wl_registry@2.global(27, "zwlr_virtual_pointer_manager_v1", 2)
[2338849.278] wl_registry@2.global(28, "zwp_pointer_gestures_v1", 3)
[2338849.281] wl_registry@2.global(29, "zwp_relative_pointer_manager_v1", 1)
[2338849.284] wl_registry@2.global(30, "zwp_pointer_constraints_v1", 1)
[2338849.287] wl_registry@2.global(31, "wp_presentation", 1)
[2338849.290] wl_registry@2.global(32, "wp_viewporter", 1)
[2338849.293] wl_registry@2.global(33, "zxdg_exporter_v1", 1)
[2338849.296] wl_registry@2.global(34, "zxdg_importer_v1", 1)
[2338849.299] wl_registry@2.global(35, "zxdg_exporter_v2", 1)
[2338849.301] wl_registry@2.global(36, "zxdg_importer_v2", 1)
[2338849.304] wl_registry@2.global(37, "wp_fractional_scale_manager_v1", 1)
[2338849.307] wl_registry@2.global(38, "wp_single_pixel_buffer_manager_v1", 1)
[2338849.310] wl_registry@2.global(40, "wl_output", 4)
registry: adding output 40
[2338849.315]  -> wl_registry@2.bind(40, "wl_output", 4, new id [unknown]@5)
[2338849.318] wl_registry@2.global(41, "zwlr_foreign_toplevel_manager_v1", 3)
[2338849.321] wl_registry@2.global(42, "gtk_shell1", 3)
[2338849.324] wl_registry@2.global(43, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[2338849.327] wl_registry@2.global(44, "zwf_shell_manager_v2", 2)
[2338849.329] wl_callback@3.done(500)
[2338849.332]  -> zwlr_gamma_control_manager_v1@4.get_gamma_control(new id zwlr_gamma_control_v1@3, wl_output@5)
[2338849.335]  -> wl_display@1.sync(new id wl_callback@6)
[2338849.413] wl_display@1.delete_id(6)
[2338849.418] wl_output@5.geometry(0, 0, 530, 300, 0, "HP Inc.", "HP V24i", 0)
[2338849.422] wl_output@5.mode(1, 1920, 1080, 60000)
[2338849.425] wl_output@5.scale(2)
[2338849.427] wl_output@5.name("HDMI-A-3")
[2338849.429] wl_output@5.description("HP Inc. HP V24i 1CR20308TZ (HDMI-A-3)")
[2338849.431] wl_output@5.done()
[2338849.432] zwlr_gamma_control_v1@3.gamma_size(1024)
[2338849.456] wl_callback@6.done(500)
calculated sun trajectory: midnight sun
setting temperature to 6500 K
[2338849.554]  -> zwlr_gamma_control_v1@3.set_gamma(fd 7)

But the gamma never get to change, :(

Is there anything else you might need, that I can share?

To Reproduce

Use wlsunset 0.4.0 and wayfire 0.8.1 (latest release) and you'll notice no gamma adjusting happens at all.

Expected behavior

Gamma correction should happen, I should see less blue (a bit higher temp / more red).

Screenshots or stacktrace

N/A

Wayfire version

wayfire 0.8.1 wlsunset 0.4.0

je-vv commented 4 months ago

BTW, I can't remember when this started happening. I recall gama adjusting with wlsunset was working fine.

ammen99 commented 4 months ago

I have unfortunately had some issues like this where I had to restart my computer :) (it was a driver bug probably)

Unfortunately it works here for me so it is hard to say what is going on, maybe try looking at Wayfire's log (stdout), I'd expect a wlroots error potentially.

je-vv commented 4 months ago

A full output when wayfire is running with WAYLAND_DEBUG=1 is available on the gist:

https://gist.github.com/je-vv/d5f88397ca09b996e39e55ee78f8cd6e

I don't see something in the log that helps me, but I understand little about that output any ways...

As mentioned, it was working just fine. Not sure what broke, neither when, :( Restarting the computer doesn't help...

ammen99 commented 4 months ago

As mentioned, it was working just fine. Not sure what broke, neither when, :( Restarting the computer doesn't help...

:(

Any chance of trying another compositor with the same wlroots version, so that we can try tracking down where the bug is happening?

je-vv commented 4 months ago

ohh, I'll see if I can on the weekend. I'm not familiar with tiling, so there are no many options, there's labwc, which I never tried since I don't like the openbox xml config and it's using wlroots0.17, same as wayfire...

I'll see what I can do...

ammen99 commented 4 months ago

I'm not familiar with tiling, so there are no many options

You don't need to do much, just open sway & a terminal and type your wl-sunset command. But ofc feel free to try labwc as well, it doesn't matter, the point is to check whether wayfire or wlroots or some component in the kernel is the issue.

I guess you could also try updating wayfire to -git and wlroots to latest release (0.17.2, idk which version you are on), but I don't think there have been any bug fixes so I doubt this will fix the issue, but who knows ..

mark-herbert42 commented 2 months ago

Tried with wlroots 17.4 seems to be working fine. - was able to adjust color temperature with manual mode (wlsunset -T) several times in a row.

je-vv commented 2 months ago

Although I was not able to do almost nothing with labwc, I included wlsunset in its autostart config, and it did nothing. I also used then labwc -s 'wlsunset -T 10000' and other values, and nothing... I don't know if that means it's a wlroots issue rather than a compositor one... And if that were the case, if it'd be better to release wayfire and all other components (plugins, configs, wf-shell, and so on) for a newer wlroots version. On Arch 0.17.4 is the version used, which actually corresponds to wlroots latest release: https://gitlab.freedesktop.org/wlroots/wlroots/-/releases

mark-herbert42 commented 2 months ago

wlsunset works fine for me. Well - it does what it should do. But - for me it causes a lot of glitches and artifacts when playing videos in firefox/youtube with AMD hardware vaapi. So I have removed it from my setup so far. Seems that it is not ready for productive use.

ammen99 commented 2 months ago

wlsunset works fine for me. Well - it does what it should do. But - for me it causes a lot of glitches and artifacts when playing videos in firefox/youtube with AMD hardware vaapi. So I have removed it from my setup so far. Seems that it is not ready for productive use.

Is this happening when the video is playing fullscreen? It might be helpful to disable direct scanout in this case, otherwise definitely a weird driver bug.

je-vv commented 2 months ago

Mark, is that with wayfire on wlroots 17.4?

For me it was working flawlessly with wayfire until it all of a sudden stopped working with the versions I posted. But I didn't try wayfire built with wlroots 17.4...