-
-
Notifications
You must be signed in to change notification settings - Fork 31
[Feature request]: Support Hyprland screen capturing (after its transition away from wlroots) #111
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
Comments
Hello! It doesn't sound like you are missing a dependency or something like that, and there have been people writing in this project who were using wluma on hyprland at the time, so it definitely used to work. Hyprland actually runs on a fork of wlroots, so it's possible that it differs too much from vanilla wlroots today, or that there's a bug somewhere (also possibly in wluma code!). I'll try my luck: @riley-martin do you still use wluma and hyprland? |
Thanks very much for looking into it. (Again, I am really sorry I clicked closed by mistake and so I opened it again) |
I don't use hyprland much anymore. I'd be glad to test it when I get a chance but it might not happen right away. |
Oh great catch, thanks for pointing it out! We can conclude that wluma's We can leave this issue open as a feature request, in case someone from community would like to implement a new capturer for Hyprland (perhaps wait until Hyprland completes their transition away from wlroots first). Thanks @Rishik-Y for spotting the issue and @riley-martin for tracking down the root cause! |
Oh, Right, I totally didn't see that, Thank you, @riley-martin, for checking up on this issue and @maximbaz, for quickly responding to my issue. |
Hey @maximbaz, I have been trying to understand the code and how it works for the past few weeks and have kind of found the exact issue a while back. To better give the info from What I understood. The issue shown on my screen is: Which is the error when it executes
Which is at line 78. I have tried to understand where does the ZwlrExportDmabufManagerV1 initiates from, but it seems that main.rs doesn't have much relation to wlroots, so the first line starts from
Which is on line 8 of wlroots.rs. As @riley-martin stated, Hyprland Had changed the compositor from original wlroots to modified wlroots. I tried to investigate what exactly was modified in the directories and found out that the directories were changed I have thought about changing the file itself, but I know it will instead break my system apart, so I tried finding ways to change the code for Hyprland Users, but the wluma program uses a crate called wlroots-Protocols which gives the program much of its wlroots functionality. I believed that it shouldn't be much of a hassle to fix this, but it turns out there is no crate created for Hyprland Modified wlroots. I tried finding out using other crates whether it would work or not by adding the wlroots-protocol-wlr crate into the Cargo.toml and modified a bit like in line 8 And the program seems to detect it by showing the error in other code instead of that line where I need to modify to suit it with the use wayland-protocols-wlr, but even then I tried asking Chatgpt, and it states that to make a fork of I Have become very obsessed with trying to make this program run on Hyprland. I would really appreciate your thoughts on this, where I am assuming something is wrong, and what I should be doing next. I can understand Rust somewhat since I already know a bit of C/C++, Python, Java and a bit of Haskell. Note: PS: Please don't be too harsh with me; I am just a second-year College student. |
Nice work and analysis, @Rishik-Y! First of all, it looks like the It might be that this change alone fixes wluma for Hyprland, if the only difference they did for now was to get rid of the now obsolete "unstable" version of the |
Thanks for the suggestion @maximbaz, Also I am sorry for my wording if it was not explained by me properly, but what I meant was Here is the attachment of the code for
Here are the files which were supposed to work wluma However I believe is modified by hyprland, Hence not working anymore. I don't know whether it's just me making rookie mistakes, but from what I understood these are the modified wlroots used by Hyprland. |
It looks like the file is actually identical to the wlroots sources 🤔 Don't worry this is definitely not rookie mistakes, from what we see so far it looks like the header files of the |
Oh, I totally didn't Know that. |
Support for wluma on Hyprland has been depreciated after slowly transitioning away from wlroot. The complete information on this can be found here: maximbaz/wluma#111
Hello @maximbaz, So sorry that i keep disturbing you again and again. |
Don't worry, ask as much as you need 😁 The reason is that 0.29 was latest when I wrote that code initially, and migrating to 0.30 was a bit tricky so I never succeeded to make that work 😭 |
That is all to say, if you want to give it a go, please do! |
Thank you very much.
I had initially assumed that you probably chose that specific version probably due to wlr being incorporated in wayland-protocols or having incompatibility issues in further versions (at least, I hoped That was the case so that I would indirectly have a reason not to touch the complicated stuff)
I know I will suffer a lot while figuring things around, |
I just found this project after weeks of searching for something like this. I got a new laptop with an oled screen. It is amazing not to have a light-bulb constantly pointed at my face, but now it is extra annoying when I open a bright webpage. The proper way to fix this would probably be on the firmware's brightness control, but it's closed source, so a hack like this is probably required :( Unfortunately I'm running into this same problem. @maximbaz Which wm do you use? I don't know rust, but I'd like to try to make this work. From what I'm reading here, it seems like it would make sense to try to upgrade the wayland_protocols. Even if it doesn't solve our problem with hyprland, at least we'd have a contribution for this project :) |
I'm using sway, and yeah I agree finishing #86 would be quite awesome, and help is certainly appreciated as I dont know when I can get to it... Splitting upgrade into wayland and not wayland to make it simpler could be a good way to start |
I'm new to wayland. I thought hyprland and sway were different levels and that hyprland was using sway. I've found this program is also grabbing frames with the same rust library, but using the new version: It works on hyprland. From what I understand, the things from the wlroots protocol are being integrated into the wayland protocol with the goal that all compositors use it. So hyprland most likely will try maintain compatibility. I'm trying to use it as reference to update wluma's code, but it's going slowly because I have no idea what I'm doing |
Hi @daniel-sousa-me, Nice to see you here as well trying to help fix the issue. Also Hello @maximbaz In any case, The issue is still persistent, and I am still continuing to find a fix for my laptop. I was just wondering whether updating the version of the toml files truly be a fix for it or should I go in some other route trying other ways instead? |
I think it's not referring to everything depending on wlroots work, they are talking about "apps" here, it might only mention apps that use wlroots to display content. (Not sure, just my guess) wluma doesn't display any GUI, it's capturing the display, so it's probably not in that scope. |
I'm reasonably sure the primary reason for it not working on Hyprland is that the current code uses "unstable" dmabuf protocol (because it was unstable at the time of writing it), and Hyprland after the rewrite only announces the support for the stable one: https://github.com/hyprwm/Hyprland/blob/1fa4b7d79baaad47fde8e72221cd77f569fbfe35/CMakeLists.txt#L307 We should really upgrade |
Hey @maximbaz, I was just looking through your code (trying to understand what each and every code is doing before again touching the wlroot.rs)
Is this the file which was created as a replacement for the original file if it doesn't have write permissions? Even if it is, why and how did the name "brightness_hw_changed" even come? Please Correct me if I am wrong about it. The main concern for me is when I usually remove some stuff from code, it breaks, and I would realise where exactly it is being used, but the thing here is, it works without any issue, with no error or warning. |
This file That code establishes wluma/src/brightness/backlight.rs Lines 103 to 111 in 08b4896
This is to avoid having to periodically check for the current brightness value, which is not very battery-efficient. Hope that helps! |
No, I didn't mean that Inotify is not needed by any means.
I totally understand the need for it. What I don't get here is
Can you clarify whether there may be some people who may get "brightness_hw_changed" and its just in my system that the file "brightness_hw_changed" doesn't appear? Also if the File name is decided by the linux kernal, then why did we hardcode it there with brightness_hw_changed in the code?
Sorry for asking sudden questions; I just wanted to know more about how the program works. 😀 |
I was just referring to |
@Rishik-Y Vulkan driver got released for my hardware, which means I can run and test wluma again 🥳 Have you made some progress on upgrading wayland libs? Otherwise I can now try to take it over 💪 |
I'll close this in favor of #121. Hyprland may or may not support the |
Its Nice that you can finally test wluma again 😊 |
@Rishik-Y please run the latest I'm curious whether your hyprland supports another protocol that I just implemented (it's a bit buggy still). |
Yep, So As you asked i just ran the new wluma.. I dont know whether i need to send the logs here or #121 |
Here is fine, #121 is about a different protocol, not I'm just curious if hyprland supports it at all, or not - in the beginning wluma will now trace-log |
I just ran the latest wluma-main code in my latest Hyprland
|
Run it with config |
Yep just ran it with wlroots 👍️ |
Cool, but just to be sure I understand correctly what you experience, could you please share the logs when you run it with |
Oh sorry I just took a quick glance at the code here in app.rs |
Also here are the logs for
|
Awesome, thanks! So we can conclude that Hyprland didn't implement There's unfortunately a memory leak right now, which I can't catch, so be careful with running Thanks for testing and sharing the logs! |
Very Glad to be useful! 😁 |
I think I fixed the memory leak 🥳 I think it's safe to run wluma for longer periods of time, so it would actually be helpful if you could use the latest code from main branch and report if you stumble upon any issue! |
One particular issue to keep an eye on, is whether you get occasional unexpected zeros in
I can't still find what I am doing wrong, and there's a dirty workaround that should prevent some/most of them... wluma/src/frame/capturer/wayland.rs Lines 429 to 430 in 19ec169
|
Hey @maximbaz, Here are the logs:
I waited for a few seconds hoping it would change but nothing happened |
Very interesting, hmmmm 🤔 Thanks for sharing, will ping you if I get any idea as to what to try... |
Interestingly in your previous log, you did get |
Ok i ran the Latest Commit a couple of times, Log:
But yes one thing is clear prediction value is always zero (tested 10 times) |
Okay thanks, and how about with the latest commit that I just pushed? |
Here the is Logs of previous commit code where there is no such issue (except memory leak)
|
I have tried it as well a couple of times and there is no such issue in this one where its showing 0 as prediction value except at the start of process |
Okay, cool, so we declare this as fixed? Thanks for spotting! If you spot more issues, please report, it's very helpful 🙏 |
Actually one more request @Rishik-Y, could you comment this line out and confirm whether those occasional zeros appear for you or not? wluma/src/frame/capturer/wayland.rs Lines 431 to 432 in 8e81a8f
In other words, is that |
Yep! Where at start the prediction would predict zero for 3 seconds would swap between 0 and 135 (idk why 135) as the prediction value Next for 3 seconds occasional zero's appear and disappear (Swapping between predicted value and 0) And later (Which is after 6 seconds) Commenting and not commenting doesn't seem to make any difference whatsoever. 👍️ |
Yep just tested the latest main, However while running the There is some repeatition over here
I don't think it is a problem as of now but just letting you know that every 3 seconds, in trace its seems to print double ALS however there is no print of double prediction. Here is the LOG:
|
Steps for reproducing the issue
Running
Wluma
on HyprlandThere is no issue, and the wluma works perfectly fine when keeping
capture = "none"
but doesn't really work when keeping
capture = "wlroots"
I was till now stuck in finding out how to set it up exactly properly
but thanks to #40
It was way easier, but one thing I am stuck on is that https://github.com/vega-d had gnome installed which doesn't have wlroots
While I have hyprland installed which I am pretty sure is based on wlroots Compositor
I feel like I am missing something since everything works just right when keeping
capture = "none"
and using my webcam as sensor.Can anybody tell me what exactly is the issue here.
What is the buggy behavior?
What is the expected behavior?
Logs
Version
4.4.0-1
Environment
The text was updated successfully, but these errors were encountered: