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

Video Freeze , audio continues on media players #494

Closed
BurhanDanger opened this issue May 14, 2018 · 104 comments

Comments

Projects
None yet
@BurhanDanger
Copy link

commented May 14, 2018

Platform: archlinux x86_64
kern: 4.16.8

GPU, drivers, and screen setup: i915 (intel i5-4210U CPU @ 1.70GHz)
modsettings
i3 on xorg(xorg-server 1.19.6+13+gd0d1a694f-2), mesa 18.0.3-1

Compton version: compton 0.1_beta2.5-11

Steps of reproduction

Run compton with following

compton --backend glx --config /dev/null
[    80.44 ] error    3 BadWindow    request    2 minor    0 serial  65013: "BadWindow (invalid Window parameter)"
[    80.44 ] error    3 BadWindow    request  129 minor    6 serial  65014: "BadWindow (invalid Window parameter)"
[    80.44 ] error    3 BadWindow    request    2 minor    0 serial  65015: "BadWindow (invalid Window parameter)"
[    80.44 ] error    3 BadWindow    request  129 minor    5 serial  65017: "BadWindow (invalid Window parameter)"
[    80.44 ] error    3 BadWindow    request   20 minor    0 serial  65018: "BadWindow (invalid Window parameter)"
[  2800.30 ] error    9 BadDrawable  request   14 minor    0 serial 1180299: "BadDrawable (invalid Pixmap or Window parameter)"
glx_bind_pixmap(0x00c3e4b3): Failed to query Pixmap info.
win_paint_win(0x004000af): Failed to bind texture. Expect troubles.
win_paint_win(0x004000af): Missing painting data. This is a bad sign.
[  2800.31 ] error    4 BadPixmap    request   54 minor    0 serial 1180343: "BadPixmap (invalid Pixmap parameter)"
^C

Play video in mpv or google-chrome (with h/w decode or s/w decode) in fullscreen. After sometime videoframe freezes at a point ,but audio keeps continuing. Whole system doesn't freeze. Switch from fullscreen , video frame syncs to appropriate frame and continues.

Happens randomly. Without compositor video plays smoothly.

Expected behavior

Play video smoothly without freezing video.

@mnivoliez

This comment has been minimized.

Copy link

commented May 25, 2018

The problem happen also with video games.
But, the master version seems to already have resolved the problem.

@ekce

This comment has been minimized.

Copy link

commented May 27, 2018

The master version hasn't been updated in a year. This issue is newer than that and I can reproduce it on all my archlinux computers when building compton from git using the compton-git package in the aur.

@mnivoliez

This comment has been minimized.

Copy link

commented May 27, 2018

Really strange, using the compton-git fix it for me.

@BurhanDanger

This comment has been minimized.

Copy link
Author

commented May 27, 2018

This repo hasn't been updated over a year as you can see. Compton that archlinux packages(that I use) is from yshui. Since compton hasn't been updated for long time it's some dependency (update) that broke compton and compton isn't updated to reflect that change.

I possibly don't have this freeze issue now. It's hard to know since it's random. @ekce Can you try compton with unredir i.e. compton --backend glx --config /dev/null --unredir-if-possible ?

@BurhanDanger

This comment has been minimized.

Copy link
Author

commented May 27, 2018

Possibly related to #477 , #493

@ekce

This comment has been minimized.

Copy link

commented May 28, 2018

@BurhanDanger I'll try it when I get a chance.

A couple things I should have mentioned:

  • My computers are using nvidia proprietary drivers on Arch linux with xfce.
  • The freezes are most noticeable (for me) when using mpv. They are quite random and they don't last very long. Especially with animated content it's sometimes hard to notice the screen is frozen (though now that I'm accustomed to them I notice the freezing almost every time I play a video and forget to disable compton).
  • I've noticed the freezes affecting web browsers as well. Like I'll go to scroll or switch tabs and the browser will act like it's frozen (and in fact I initially thought it was my browser being sluggish for some reason). Making the connection between these freezes and the mpv ones were what eventually led me to test if compton was causing them.
  • Since I initially thought mpv was broken, I tested both git and stable mpv with a bunch of different settings to no avail before I realized the issue was with compton.
  • I do not know how long ago the freezes started. I know I noticed them in March (possibly sooner) but they could have been around much earlier.
  • Disabling compton resolves the issue but unfortunately I get screen tearing without compton so I still use it whenever I'm not watching videos.
  • Once I realized compton was to blame I saw development had stalled and browsed the issues for information. I could've sworn I had already seen an issue describing this problem at least a week before this one was posted (hence why I didn't open one) but it's possible I just saw #396 .
  • I tested a bunch of forks of compton by modifying the compton-git PKGBUILD to target them but they all had the same problem.
@BurhanDanger

This comment has been minimized.

Copy link
Author

commented May 30, 2018

@mnivoliez , the game you mentioned , is it opengl accelerated ?

I've noticed the freezes affecting web browsers as well.

Face this as well. Thought it's chrome being chrome.

@mnivoliez

This comment has been minimized.

Copy link

commented May 30, 2018

@JPenuchot

This comment has been minimized.

Copy link

commented May 31, 2018

Experiencing the same issue on my XPS 13 (9350, i7 6560U, Intel Iris Graphics 540), using i3wm. I noticed that displaying the i3bar (using the super key as) unfreezes the display. I can also provide some more details if you want (logs, etc.).

@osleg

This comment has been minimized.

Copy link

commented Jul 24, 2018

Same issue on XPS 9560 on both intel GPU and on NVIDIA gpu.
That started about half year - 8 month before.
unredir if possible is enabled.
This also happens to non full screen video playback, but super rare. For full screen it happens alot.
Could be that it happens alot for me since I have 4k display... but that's just a wild guess

@nihilazo

This comment has been minimized.

Copy link

commented Jul 26, 2018

This happens to me too. using i3-gaps, nvidia drivers. Same in games too (tried with stepmania and enter the gungeon primarily)

@valsoray17

This comment has been minimized.

Copy link

commented Aug 4, 2018

The same here. Switching backend to xrender helps, but it's a bit choppy experience compared to glx.

@deviantfero

This comment has been minimized.

Copy link

commented Aug 10, 2018

Same here!

@JPenuchot

This comment has been minimized.

Copy link

commented Aug 17, 2018

The last commit is 1 y/o, 18 pull requests that will never be merged, Wayland is around the corner, I don't think Compton is going anywhere now, sadly...

@yshui

This comment has been minimized.

Copy link

commented Aug 17, 2018

@JPenuchot I'm maintaining a bug fix fork. But I can't seem to reproduce this bug...

@BBBob

This comment has been minimized.

Copy link

commented Aug 17, 2018

same in games and video

@yshui

This comment has been minimized.

Copy link

commented Aug 17, 2018

OK, may I ask what window manager do you guys use? Sounds like you are all using i3?

@valsoray17

This comment has been minimized.

Copy link

commented Aug 17, 2018

Yep, i3 on my side

@BBBob

This comment has been minimized.

Copy link

commented Aug 17, 2018

Yep, I am using i3-gaps

@JPenuchot

This comment has been minimized.

Copy link

commented Aug 17, 2018

i3-gaps too

@osleg

This comment has been minimized.

Copy link

commented Aug 18, 2018

AwesomeWM

@deviantfero

This comment has been minimized.

Copy link

commented Aug 18, 2018

@nxnev

This comment has been minimized.

Copy link

commented Aug 18, 2018

Xfwm4

@yshui

This comment has been minimized.

Copy link

commented Aug 18, 2018

Hmm, I was thinking this might be because compton doesn't interact well with i3. But no, it happens with other WM as well.

Now I'm lost, I'm using AwesomeWM, and this problem has never happened to me. I need a way to reproduce this before I can fix this.

@valsoray17

This comment has been minimized.

Copy link

commented Aug 18, 2018

Are there any logs to look for when it happens? Or maybe I can try to troubleshoot it locally, just tell me where to look :) I didn't find any messages in journal nor in .xsession-errors.

@osleg

This comment has been minimized.

Copy link

commented Aug 18, 2018

I doubt there are logs for that.
Also I think that might be caused by resolution, I have 2 machines one 1080p and the other one is 4k and freezes happen on 4k only.
They are quite heavy with YouTube 1080/60 fullscreen videos

@deviantfero

This comment has been minimized.

Copy link

commented Aug 18, 2018

I don't think it really has anything to do with resolution, it happens on both my monitor and my laptop screen 1080p and 720p respectively, anyway, here are my settings (which are pretty basic if I may add)

backend = "glx";
paint-on-overlay = true;
glx-no-stencil = true;
vsync = "opengl-swc";

shadow = false;

unredir-if-possible = true;
unredir-if-possible-exclude = "class_g = 'Chrome'";

shadow-exclude = [
  "name = 'Notification'",
  "_GTK_FRAME_EXTENTS@:c",
  "class_g = 'i3-frame'",
  "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
  "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'",
  "!I3_FLOATING_WINDOW@:c",
  "g:si:VirtualBox" 
];

I'm using an intel internal graphics card, if that works for anything

@3N4N

This comment has been minimized.

Copy link

commented Sep 22, 2018

What is the condition now of this issue?

@yshui

This comment has been minimized.

Copy link

commented Sep 22, 2018

@enanajmain A workaround is in place (which might cause performance problems), and I'm looking into the real cause of the problem.

@valsoray17

This comment has been minimized.

Copy link

commented Sep 22, 2018

Thanks for still looking into it!

@yshui

This comment has been minimized.

Copy link

commented Sep 22, 2018

I think I fully understand it now. Turns out to be a Xlib bug.

Lesson learned: never use Xlib, always use xcb

@yshui

This comment has been minimized.

Copy link

commented Sep 22, 2018

Plan is to switch at least the event handling bit to xcb. Will definitely need some testers.

@JPenuchot

This comment has been minimized.

Copy link

commented Sep 22, 2018

Very cool of you to take care of that issue, thanks a lot

@yshui

This comment has been minimized.

Copy link

commented Sep 22, 2018

Done. Can someone try this branch: yshui/compton@next ?

(Beware that branch has extra changes that contain bugs. If you encounter other problems unrelated to screen freeze, please open a issue on my repo mentioning the name of the branch.)

(This branch is known to crash due to some xlib/xcb interoperability issues)

@3N4N

This comment has been minimized.

Copy link

commented Sep 23, 2018

@yshui I was using Ubuntu 17.10 with compton in their official repo. Yesterday I switched to Ubuntu 18.04. Now, before I went on to install your branch, I wanted to record and test if the problem still persists. I don't know why, but the problem has fixed itself. I've been watching videos on mpv and chromium-browser while constantly pressing f to go in and out of full screen, nothing, no freezing.

The current version on official Ubuntu repo is v0.1~beta2+20150922, which is the latest I think. I don't know what version I was using in Ubuntu 17.10, but I think it was the same.

N.B I think it's worth mentioning that the chromium browser has had a massive upgrade. Maybe that has something to do with it.

@haroldmrt

This comment has been minimized.

Copy link

commented Sep 23, 2018

I am running your next branch, it seems to fix the issue as well.

@yshui

This comment has been minimized.

Copy link

commented Sep 23, 2018

I'm seeing regular crashes on the next branch. So test at will, but don't make the switch just yet.

Edit: I updated the next branch and the problem I was seeing should be fixed.

@JPenuchot

This comment has been minimized.

Copy link

commented Sep 23, 2018

Been running on the next branch for a few hours, so far no crash (Arch Linux, i7 6560U, i3wm).

@valsoray17

This comment has been minimized.

Copy link

commented Sep 24, 2018

Have run the branch for a day. No crashes so far and the glx backend works fine.

@trbKnl

This comment has been minimized.

Copy link

commented Sep 25, 2018

I tried yshui/compton@next this solves the problem for me!
Video does not freeze in full screen anymore.
(Fedora 28, Intel Core i7-8550U, i3-gaps)

I still get these messages:
[ 587.82 ] error 3 BadWindow request 2 minor 0 serial 469375: "BadWindow (invalid Window parameter)"
Don't know whether that is important.

Thanks for making an effort! This was a very frustrating problem, I even switched to sway to try it out, it's great, but the stable branch does not have the features I want yet.

@JPenuchot

This comment has been minimized.

Copy link

commented Sep 25, 2018

Same here, been using it daily for 2 days and got no problem so far. Good work ! Do you have a donation link or something ?

@OrdinaryMagician

This comment has been minimized.

Copy link

commented Sep 25, 2018

Making the switch to that branch on my setup, will see if things work alright.

@yshui

This comment has been minimized.

Copy link

commented Sep 26, 2018

@JPenuchot I would rather have helping hands than donations.

@OrdinaryMagician

This comment has been minimized.

Copy link

commented Sep 26, 2018

Haven't seen ANY freezes so far after a day of use. Thank you~

@BurhanDanger

This comment has been minimized.

Copy link
Author

commented Sep 26, 2018

I'm closing this now since it looks like yshui 's next branch solved this(which also needs testing for regression). Test that and Feel free to comment here or open issue on yshui's fork mentioning which branch you used.

@psychon

This comment has been minimized.

Copy link

commented Sep 27, 2018

I would rather have helping hands than donations.

@yshui What can I help you with specifically? :-)

@yshui

This comment has been minimized.

Copy link

commented Sep 27, 2018

@psychon I composed a short list of things I can think of right now:

https://github.com/yshui/compton/projects/2

@psychon

This comment has been minimized.

Copy link

commented Sep 27, 2018

@yshui Okay, which branch do you want me to work against? "Move to XCB" sounds like something that I can easily do and I touched pixman's API once or twice and might be able to "do stuff with regions".

@yshui

This comment has been minimized.

Copy link

commented Sep 27, 2018

@psychon I'm currently doing the pixman conversion, so maybe you could pick up the xcb conversion?

You can base your work on the next branch.

@valsoray17

This comment has been minimized.

Copy link

commented Sep 28, 2018

I've decided to test the old version of compton one more time. Interestingly I wasn't able to reproduce the issue. It might have something to do with the updated kernel (currently 4.18.8-200.fc28.x86_64). I don't see anything else from graphics stack updated. Just wanted to let you know.

@yshui

This comment has been minimized.

Copy link

commented Sep 28, 2018

@valsoray17 The screen freeze is caused by an extremely timing dependent race condition. The bug can totally be there in the old version (BTW, it's a Xlib bug) but just doesn't manifest.

@valsoray17

This comment has been minimized.

Copy link

commented Sep 28, 2018

Thanks for the explanation, will monitor the old version more

@3N4N

This comment has been minimized.

Copy link

commented Jan 2, 2019

@yshui, I was using next branch of your fork for a week. I just experienced two crashes today. Any idea?

@yshui

This comment has been minimized.

Copy link

commented Jan 2, 2019

@enanajmain please open a bug report

@BurhanDanger BurhanDanger reopened this Jan 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.