dec05eba / gpu-screen-recorder-issues

GPU Screen Recorder issue tracker
20 stars 0 forks source link

[BUG] Regression: Recording from portals is broken. #68

Closed jackmio32 closed 5 days ago

jackmio32 commented 1 week ago

Describe the bug I decided to update gpu-screen-recorder because why not, but after doing git pull and recompiling, recording from portals is broken with a corrupted video output and massive log spam.

To Reproduce I ran it with all of the default settings specified for the systemd unit, except for -w portal

Screenshots A screenshot from a broken recording

Desktop (please complete the following information):

Additional context DRM info: drm_info.txt GPU Screen Recorder's systemd unit log: journalctloutput.txt I cannot attach a full quality video, as the file is too large even when shortened to 1/2 a second.

dec05eba commented 1 week ago

That error comes from the driver itself.. hmm. Did you try if the same thing happens with obs if you enable vaapi in obs and use portal capture? I dont believe anything has been changed in gpu screen recorder portal code for a while so I dont think its a new issue in gpu screen recorder(?). Can you also try if the same thing happens if you record monitor instead of portal?

jackmio32 commented 1 week ago

That error comes from the driver itself.. hmm. Did you try if the same thing happens with obs if you enable vaapi in obs and use portal capture?

It doesn't happen in OBS, when I have saved a recording as you described.

I dont believe anything has been changed in gpu screen recorder portal code for a while so I dont think its a new issue in gpu screen recorder(?).

Well, I was able to record gameplay clips as normal yesterday, and this only started happening today after I updated and edited the systemd unit config back to what it was before I updated, then saved a recording to sanity check that I had everything configured correctly.

Can you also try if the same thing happens if you record monitor instead of portal?

As in, recording with -w screen? Or by specifying a monitor e.g. -w "HDMI-A-1|1920x1080"

dec05eba commented 1 week ago

Yes -w screen. I tried to reproduce it myself but couldn't. Your systemd config isn't just -w portal, it also includes hevc codec. Please stop the systemd service and record like this instead: gpu-screen-recorder -w portal -f 60 -o video.mp4 and also try: gpu-screen-recorder -w screen -f 60 -o video.mp4.

I cant reproduce the issue myself on arch on amd.

jackmio32 commented 1 week ago

Okay so, -w portal gives the broken output as described originally, and -w screen gives a normal output, but also gives me the error described in the title of #50.

dec05eba commented 1 week ago

Ok hmm. Can you do git checkout on the commit you were on previous and reinstall gpu screen recorder and try recording again? and which commit was that? if you remember

jackmio32 commented 1 week ago

I had to dig through backups to find the folder I compiled it in before, as I had rm -rfed and recloned the compile directory as a troubleshooting step. As for the commit, this is the output of git log --no-walk on the untouched old compile directory: gitlog.txt

I will also try compiling from the old commit and see if it works.

dec05eba commented 1 week ago

Oh thats very old..

dec05eba commented 1 week ago

I have a guess why it doesn't work, I can push a commit that you can try. But I dont want to keep that change as without it the performance is better. It's related to what you mentioned about #50

jackmio32 commented 1 week ago

Compiling from the old commit and running it with gpu-screen-recorder -w portal -f 60 -o video.mp4 resulted in desired behavior.

Oh thats very old..

Well, I was following the idea of "If it ain't broke, don't fix it", and got myself into this mess when I stopped doing that lol

jackmio32 commented 1 week ago

I have a guess why it doesn't work, I can push a commit that you can try. But I dont want to keep that change as without it the performance is better. It's related to what you mentioned about #50

I could try it, but I do want to clarify that the error I mentioned being in #50 did not corrupt/break the video output for me, and happened when ran with -w screen, not with -w portal.

dec05eba commented 1 week ago

Yeah I understand, but in this case it might not have failed when it should have and continued. There are cases when the amd gpu driver just fails without reporting things as a failure.

Anyways, I pushed a commit. Can you pull the latest changes, reinstall and try recording with portal again?

jackmio32 commented 1 week ago

Issue fixed on the latest commit.

dec05eba commented 1 week ago

Well damn.. hmm, not sure what to do about that. I want to keep the code that was before for performance reasons. So its the amd driver that craps itself in some cases.. it looks like it completely breaks vaapi. I have actually reported the same error message to valve before as it happened on steam deck. It was an amd gpu driver bug at that time that was fixed.

dec05eba commented 1 week ago

Ok, can you try one last thing? for git pull and reinstall again but this time record with: gpu-screen-recorder -w portal -f 60 -cursor no -o video.mp4

jackmio32 commented 1 week ago

Ok, can you try one last thing? for git pull and reinstall again but this time record with: gpu-screen-recorder -w portal -f 60 -cursor no -o video.mp4

Gives same broken output as originally reported.

jackmio32 commented 1 week ago

On a side note, recording with -w screen does still give the error described in #50 (but without breaking the video output) on both the latest commit I pulled just now, and the one before it which I pulled earlier at your request, but never when using -w portal

dec05eba commented 1 week ago

If possible can you try the flatpak version gpu screen recorder? flatpak includes a newer version of mesa which possibly fixes the issue you have. I want to see if its specifically an issue with your mesa version on kubuntu.

jackmio32 commented 1 week ago

Flatpak version seems to work fine, but the weird part about all of this to me is the fact that the old commit works.

dec05eba commented 1 week ago

The test commit I pushed before that you tested that works is pretty much the same as the old commit. Since that works in the flatpak then its pretty much guaranteed a bug in the amd driver (mesa) on your system (or possibly ffmpeg version). Can you run ffmpeg -version > ffmpeg.log and eglinfo > eglinfo.log and upload the ffmpeg.lgo and eglinfo.log files here? I can add an exception in the code that if the mesa version is old then it uses the old method which doesn't cause the amd driver bug.

dec05eba commented 1 week ago

AMD drivers have tons of bugs, so this is nothing unusual. Just have to add another exception for known broken versions.

jackmio32 commented 1 week ago

eglinfo.log ffmpeg.log

jackmio32 commented 1 week ago

I am going to add the kisak-mesa PPA and update my mesa drivers from it, and report back if the issue is fixed.

dec05eba commented 1 week ago

Hmm your mesa version isn't that old, it's from 2024-06-06. Your ffmpeg version however is from 2023-12-30.

jackmio32 commented 1 week ago

I am going to add the kisak-mesa PPA and update my mesa drivers from it, and report back if the issue is fixed.

Fixed on kisak-mesa drivers.

dec05eba commented 1 week ago

lol hmmm

dec05eba commented 1 week ago

Thanks. Can you try one last thing? I pushed a change. Can you pull the latest version and reinstall gpu screen recorder again and try recording with portal again? with the default mesa version in kubuntu that you had before. Thanks for testing again :+1: If this doesn't fix it then I'll add a mesa version check to the code.

jackmio32 commented 1 week ago

I can remove the PPA and downgrade, will hope it doesn't break anything.

jackmio32 commented 1 week ago

Downgraded drivers, pulled and reinstalled, and gpu-screen-recorder -w portal -f 60 -o video.mp4 gives a broken output like originally reported.

dec05eba commented 1 week ago

Ok thanks. I'll add a version check then :+1:

dec05eba commented 1 week ago

I added a version check now. Can you update to the latest version of gpu screen recorder and try portal capture? it should work on both the old and new version of mesa driver now. I added a version check specifically for the version you had as I dont know the exact version that has the issue.

dec05eba commented 5 days ago

The issue has been fixed. Re-open this issue if it doesn't work with the latest version.