thumbfast icon indicating copy to clipboard operation
thumbfast copied to clipboard

Bug Report: "Subprocess failed: killed" Error in mpv 0.39.0

Open gaesa opened this issue 1 year ago • 1 comments

Description:

After the commit 0aebcbcc19b3f476fbb9eeb78c7327dc3932b983 in mpv, the thumbfast plugin encounters an error message when exiting the player or switching the currently playing file.

Error Message: [thumbfast] Subprocess failed: killed

Steps to Reproduce:

  1. Ensure you have the latest version of mpv and thumbfast.
  2. Start the mpv player and load a video file.
  3. Either exit the player or switch the currently playing file.
  4. Observe the error message in the logs.

Environment:

  • mpv Version: [0.39.0]
  • thumbfast Version: [latest git]
  • Operating System: [Arch Linux]

Additional Information:

  • This error seems to be related to the new logging mechanism introduced in the commit mentioned above.
  • The error message appears with a higher probability when exiting the player or switching the currently playing file.

Expected Behavior:

No "Subprocess failed" message should appear.

gaesa avatar Sep 25 '24 08:09 gaesa

I also see this message, but for my case, the whole feature was not working prior to the current last release of MPV; to simplify, there is now an explicit message reporting thumbfast was not successful, which was implicit in release 0.38. Just a slight modification in steps to reproduce, the feature needs to be launched to see its error at the end.

I didn’t report back then because I tried to understand if my system was the issue. But now I see I am not the only user with this issue. I still have no idea how to get a proper report for this.

thican avatar Sep 26 '24 21:09 thican

Yup, can confirm this as well. (on exit, if thumbfast was started)

C:\> mpv X:\F.S12E10.mkv
   cplayer: Playing: X:\F.S12E10.mkv
   cplayer:  ● Video  --vid=1               (hevc 1280x720 23.976 fps) [default]
   cplayer:  ● Audio  --aid=1  --alang=eng  (eac3 6ch 48000 Hz) [default]
   cplayer:  ● Subs   --sid=1  --slang=eng  'English [SDH]' (ass)
   cplayer: AO: [wasapi] 48000Hz stereo 2ch float
   cplayer: VO: [gpu-next] 1280x720 yuv420p10
osd/libass: fontselect: Using default font family: (mpv-osd-symbols, 400, 0) -> ArialMT, 0, ArialMT
statusline: AV: 00:00:05 / 00:24:46 (0%) A-V:  0.001 DS: 2.5/0 Dropped: 1 Cache: 1481s/250MB
[+------------------------------------------------------------------------------------------------------] 
thumbfast: Subprocess failed: killed
   cplayer: Exiting... (Quit)
Windows 10 Pro 22H2

mpv v0.39.0-26-gc3d9243a Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Sep 29 2024 00:06:06
libplacebo version: v7.349.0 (v7.349.0-13-ga018ab0-dirty)
FFmpeg version: N-117251-g6ec6b0790
FFmpeg library versions:
   libavcodec      61.20.100
   libavdevice     61.4.100
   libavfilter     10.5.100
   libavformat     61.8.100
   libavutil       59.40.100
   libswresample   5.4.100
   libswscale      8.4.100

Samillion avatar Oct 04 '24 02:10 Samillion

Based on my recent experience, it seems likely that this issue could be related to mpv logging process exits when it terminates subprocesses. For example, if a plugin spawns a process and mpv exits before the subprocess completes—such as when a user presses q, Ctrl+c, or plays a very short video—mpv appears to kill the subprocesses, which is expected behavior. However, after a recent commit introduced the following log entry:

if (res->error < 0)
    mp_err(log, "Subprocess failed: %s\n", mp_subprocess_err_str(res->error));

it seems that mpv may log an error like:

[plugin_name] Subprocess failed: killed

even when mpv itself is the one terminating the subprocess, leading to a non-zero return code.

While this is just an assumption, from the plugin's perspective, this isn't something that can be controlled, so it might be worth considering reporting this upstream to mpv. Perhaps they could check the killed_by_us flag to avoid logging it as an error, or alternatively, downgrade the log severity from an error to a warning.

gaesa avatar Oct 15 '24 11:10 gaesa

Fixed in https://github.com/mpv-player/mpv/pull/15102 I will not spend time on a workaround for the commit that introduced this message and made its way into 0.39.0. Sorry for those who use tagged releases of mpv, they're not stable enough that you'd want to use them over master anyway.

po5 avatar Oct 15 '24 20:10 po5