tsl0922 / mpv-debug-plugin

A debug tool for mpv script developers
GNU General Public License v2.0
19 stars 4 forks source link

Freezing when Properties tab is expanded #4

Closed YoureMySoul closed 8 months ago

YoureMySoul commented 8 months ago
...
VO: [gpu] 1080x1080 yuv420p
AV: 00:00:00 / 00:01:35 (0%) A-V:  0.007 Cache: 13s/991KB
[vo/gpu/x11] X11 error: BadAlloc (insufficient resources for operation)
[vo/gpu/x11] Type: 0, display: 0x7fe614000dd0, resourceid: 1000040, serial: 177b
[vo/gpu/x11] Error code: b, request code: 95, minor code: 2
[vo/gpu/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7fe614000dd0, resourceid: 1000044, serial: 177c
[vo/gpu/x11] Error code: 9, request code: 95, minor code: 4
[vo/gpu/x11] X11 error: BadPixmap (invalid Pixmap parameter)
[vo/gpu/x11] Type: 0, display: 0x7fe614000dd0, resourceid: 1000044, serial: 1780
[vo/gpu/x11] Error code: 4, request code: 94, minor code: 1
(Paused) AV: 00:00:19 / 00:01:35 (21%) A-V:  0.000 Cache: 75s/5MB

To reproduce the issue:

  1. mpv 'https://www.youtube.com/watch?v=mqgEYRtWMJU'
  2. Launch the plugin.
  3. Expand the Properties tab.
  4. Scroll through the properties using the mouse wheel; at this point, the application may freeze.

Then, I need to use xkill to terminate the frozen plugin.

Environment: uname -r: 6.6.10-arch1-1 OS: archlinux mpv --version: v0.37.0 DE/WM: i3wm

tsl0922 commented 8 months ago

It's expected to happen, because this plugin doesn't cache property values.

It will fetch the property from mpv when the data is rendering (every frame).

YoureMySoul commented 8 months ago

IDK If it helps or not but I have isolated the environment with minimal configuration and ensured that no other scripts or configs interfere. Here is the results:

Then I found a workaround for the YouTube issue:

  1. Play the video with mpv.
  2. Open the plugin with the key.
  3. Expand the Properties tab.
  4. Uncheck the ALL filter option.
  5. Choose the INT64.
  6. Then, choose ALL.
  7. Now, properties are scrollable without crashing

Environment: cmake . && cmake --build .

mkdir /tmp/debug_mpv
cd /tmp/debug_mpv
mkdir scripts
echo '` script-message-to debug show' > input.conf
cp /path/to/debug.so ./scripts/
mpv --config-dir=. "$ANY_YOUTUBE_URL"

Thank you for this useful plugin.

tsl0922 commented 8 months ago

From: https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/observe-all.lua

Note that watching/reading some properties can be very expensive, or require the player to synchronously wait on network (when playing remote files), so you should in general only watch properties you are interested in.

Well, the only way to resolve this issue may be using cache.

YoureMySoul commented 8 months ago

I see that it's expected for remote streams. Thank you for pointing that out. The workaround works for me; I think I can close the issue now.