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

long delay on present the window with Amd Ryzen 7840hs [archlinux, Celluloid 0.26] #909

Open
rtgiskard opened this issue Nov 12, 2023 · 10 comments

Comments

@rtgiskard
Copy link

rtgiskard commented Nov 12, 2023

There is always a long delay(4~8s) when open a the window since I have moved to archlinux,

two cases to open celluloid:
. run celluloid without any args or any media file, long delay on popup window
. right click video file, open with celluloid, seconds of delay before display the window.

desktop: gnome on wayland

how do I debug this?

@gnome-mpv
Copy link
Collaborator

Are you using an Nvidia GPU? If so, this might be the problem.

@rtgiskard
Copy link
Author

Are you using an Nvidia GPU? If so, this might be the problem.

I'm using Amd ryzen r7 7840HS, with the integrated radeon 780M. Not seems to be related to the driver, just update the description to clarify the case, there is delay event without open any media file.

And I have tried to play video files directly with mpv, there are cases that might be related (though not likely as I think):
. mpv --vo=gpu --hwdec=vaapi $media_file, no delay and accelerated with hw-codec
. mpv --vo=gpu --hwdec=auto $media_file, several seconds before popup the window

however, when open celluloid with the same mpv.conf (same codec params), there will be delays on open celluloid for both of the two cases, with or without open media files.

@gnome-mpv
Copy link
Collaborator

If you launch Celluloid by running celluloid --mpv-gpu-hwdec-interop=vaapi, does the delay go away?

@rtgiskard
Copy link
Author

rtgiskard commented Nov 16, 2023

If you launch Celluloid by running celluloid --mpv-gpu-hwdec-interop=vaapi, does the delay go away?

I'm now on the office, the desktop I'm using is running with intel i915, seems to be consistent with the same behavior of mpv. when mpv.conf set with

vo=gpu
hwdec=auto

Both celluloid and mpv will have delay of about 1s on open media files. When the delay happens with celluloid, the player window is present, only the content is black which is reasonable.

If set config with hwdec=vaapi, both of them launch and play immediately.

This seems not to be the case for my other mini-pc. The delay always happens before celluloid present the player window, and media allways begin to play on window present even with hwdec=auto.

That mini-PC is not here at the time, I'll have double check after return home.

The two desktop share nearly the same environment, both user configurations and installed softwares.

@rtgiskard
Copy link
Author

I'm guessing there might be a block of dbus call or simillar things on launch the player window, as there be a similar dbus warning (#905) print in the terminal when open celluloid

@rtgiskard
Copy link
Author

rtgiskard commented Nov 16, 2023

Now I'm on my mini-PC with AMD Ryzen 7 7840HS w/ Radeon 780M Graphics.

The issue seems to be hardware related, even though mpv itself works well with it.

  1. hwdec, vo is not likely to be related to the issue.
  2. the player window present in about 4~8s with or without open media files.
  3. run celluloid with media files, there'll be warning (Calling org.gnome.SessionManager.Inhibit failed: GDBus.Error:org.gnome.SessionManager.GeneralError: Invalid inhibit flags #905) right before popup the window.

So not found any issue likely to be related, the window itself should not rely on any other things which might delay the launch, just not sure how to debug it, maybe latter this weekend.

@rtgiskard
Copy link
Author

If you launch Celluloid by running celluloid --mpv-gpu-hwdec-interop=vaapi, does the delay go away?

Well, this indeed makes a difference! just wondering why it is independent of the config in mpv.conf.

@rtgiskard
Copy link
Author

@gnome-mpv hello, is there any related doc for --mpv-gpu-hwdec-interop, not seems to found related code, if the fix is not going to be arrived soon, I'd like to have some try sooner or later, as it really cause trouble for my weekends on using my GTR7 (the mini-PC) 😂

@rtgiskard rtgiskard changed the title there is long delay on display the window [archlinux, Celluloid 0.26] long delay on display the window with Amd Ryzen 7840hs [archlinux, Celluloid 0.26] Nov 26, 2023
@rtgiskard rtgiskard changed the title long delay on display the window with Amd Ryzen 7840hs [archlinux, Celluloid 0.26] long delay on present the window with Amd Ryzen 7840hs [archlinux, Celluloid 0.26] Nov 26, 2023
@gnome-mpv
Copy link
Collaborator

hello, is there any related doc for --mpv-gpu-hwdec-interop

The option corresponds to --gpy-hwdec-interop in mpv. You can find the documentation here.

if the fix is not going to be arrived soon,

I have a "fix" that I'm working on where I make Celluloid wait until the window becomes visible before initializing mpv. It's going to take the same amount of time before you can play something, but at least it should be less noticeable this way.

@rtgiskard
Copy link
Author

rtgiskard commented Nov 26, 2023

hello, is there any related doc for --mpv-gpu-hwdec-interop

The option corresponds to --gpy-hwdec-interop in mpv. You can find the documentation here.

Thanks a lot! After checking the code, find it's just another mpv config option, then tried to set it along with vo and hwdec in mpv.conf, libmpv seems to be using gpu-hwdec-interop rather than hwdec for mpv.

if the fix is not going to be arrived soon,

I have a "fix" that I'm working on where I make Celluloid wait until the window becomes visible before initializing mpv. It's going to take the same amount of time before you can play something, but at least it should be less noticeable this way.

This is actually an issue for libmpv, delay the initializing of mpv is not enough, all the celluloid instances seems to be blocked during the initialization, not only on window present, but also after close the menu window.

Maybe a note for similar cases in readme is enough to be a fix.

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

No branches or pull requests

2 participants