[Bug 60045] New: quartz/winegstreamer: WMV2 video hangs with infinite "Failed to push qos event to pad qz_sink_0", click-to-skip unresponsive
http://bugs.winehq.org/show_bug.cgi?id=60045 Bug ID: 60045 Summary: quartz/winegstreamer: WMV2 video hangs with infinite "Failed to push qos event to pad qz_sink_0", click-to-skip unresponsive Product: Wine Version: 11.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: quartz Assignee: wine-bugs@list.winehq.org Reporter: abcfy2@163.com Target Milestone: --- Distribution: --- Created attachment 81504 --> http://bugs.winehq.org/attachment.cgi?id=81504 Full debug log: WINEDEBUG=+quartz,+winegstreamer + GST_DEBUG=queue2:6,GST_EVENT:6,GST_PADS:6 Wine version: wine-11.13 (also reproduced on 11.12) Distribution: CachyOS Linux (Arch-based), kernel 7.1.3-2-cachyos GStreamer: 1.28.5 (gst-libav, gst-plugins-{good,bad,ugly} all installed) A Chinese game (曹操传 modern mod "云荒逍遥传") uses MCI/quartz to play WMV2 intro videos (Logo.wmv, Mov001.wmv, Mov002.wmv). Under Wine: 1. The game window appears black. 2. Console floods with "Failed to push qos event to pad qz_sink_0" (~33/sec). 3. Clicking does nothing — cannot skip intro. 4. Eventually access violation (c0000005) in the video thread. Video file details (confirmed by ffprobe): - Container: ASF (.wmv) - Video: WMV2 (WMV2 / 0x32564D57), yuv420p, 30fps - Audio: WMAv2, 44100Hz, 128kbps Key evidence from WINEDEBUG=+quartz,+winegstreamer + GST_DEBUG=queue2:6: - image_presenter_PresentImage IS called successfully with valid timestamps. - image_presenter_StartPresenting is a stub! (fixme: ... stub!) - quartz perform_qos calculates ~33ms jitter (normal for 30fps) and calls wg_parser_stream_notify_qos. - This leads to push_event(qos_event, pad="qz_sink_0") in dlls/winegstreamer/unixlib.c:234. - gst_pad_push_event() returns FALSE — the upstream queue2 / stepper element does not accept the QoS event. - queue2 retries indefinitely → error flood → Wine message queue never dispatches WM_LBUTTONDOWN → skip-by-click never fires. GStreamer itself decodes the file perfectly: $ gst-launch-1.0 filesrc location=Logo.wmv ! decodebin ! videoconvert ! fakesink → Preroll → Play → EOS in ~2 seconds, no errors. Workaround: removing the .wmv files from the game directory lets the game fall through to the main menu (file-not-found path works). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60045 Feng Yu <abcfy2@163.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |ArchLinux -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60045 --- Comment #1 from Ken Sharp <imwellcushtymelike@gmail.com> --- Can this game be downloaded? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60045 --- Comment #2 from Feng Yu <abcfy2@163.com> --- (In reply to Ken Sharp from comment #1)
Can this game be downloaded?
Sure. Here you are: https://drive.google.com/file/d/1u4X7pxFt1qoAA3tbsQKmtvT22_dCFDRq/view?usp=s... Just extract and run `game.exe`. And by the way, there are a lot of "曹操传" mod games written by the same engine, so they also have this issue. Please help. Thank you. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60045 --- Comment #3 from Rafał Mużyło <galtgendo@o2.pl> --- (In reply to Feng Yu from comment #2)
(In reply to Ken Sharp from comment #1)
Can this game be downloaded?
Sure. Here you are: https://drive.google.com/file/d/1u4X7pxFt1qoAA3tbsQKmtvT22_dCFDRq/ view?usp=sharing
Just extract and run `game.exe`.
...on 11.12 here, the videos are played, but weirdly.. The playback is in a window, that's separate from the main window. 'err:seh:dispatch_user_callback ignoring exception c0000005' still happens. There's also 'err:virtual:virtual_setup_exception stack overflow 1216 bytes addr 0x7bcdd5a9 stack 0xb60b40 (0xb60000-0xb61000-0xd60000)'. That playback window doesn't disappear once videos finish. (PS: using expected locale seems to only fix the window titlebar) Once videos finish, the main window still doesn't seem to behave correctly, but it's hard to tell the exact details due to the language barrier - the iconbar items are active, but it's difficult to tell what are they supposed to do. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60045 --- Comment #4 from Feng Yu <abcfy2@163.com> --- If you have a Windows machine or VM, then you can test the correct behaviours. When click the video, the video should be skipped, then the game menu should be appeared. But when execute with wine, click video is not working, and the video cannot be skipped(But delete the video `Logo.wmv` could workaround this bug). Thanks. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60045 brandow <brandowlucas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brandowlucas@gmail.com --- Comment #5 from brandow <brandowlucas@gmail.com> --- Created attachment 81525 --> http://bugs.winehq.org/attachment.cgi?id=81525 candidate patch I found three separate Wine issues behind the detached playback window, broken click-to-skip, and incorrect playback notifications. The attached game is Chinese and should be launched with LC_ALL=zh_CN.UTF-8. Some characters in the toolbox bar still appear as empty boxes, but this is likely a locale or font issue rather than part of the Wine playback bug. The GStreamer QoS error is unrelated to mouse input. Click-to-skip works after fixing the MCI HWND query even while the QoS event is rejected: ERROR WINE dlls/winegstreamer/unixlib.c:241:push_event: Failed to push qos event 0x7fd8f0001520 to pad qz_sink_0. 1. The borderless owned playback popup becomes X11-managed The game opens the video with MCI_DGV_OPEN_PARENT, MCI_DGV_OPEN_WS, and WS_POPUP. The resulting video window is therefore a borderless owned popup rather than a child window. The game positions that popup over its main client area: trace:mciqtz:create_window device 0x1, flags 0x30200, style 0x80000000, parent 0001005E, created window 000600EA. SetWindowPos(000600EA, 0, 640, 383, 640, 400, 0) Wine initially creates the X11 window as override-redirect, but is_window_managed() promotes any activated window to a managed window: /* activated windows are managed */ if (!(swp_flags & (SWP_NOACTIVATE | SWP_HIDEWINDOW))) return TRUE; if (hwnd == get_active_window()) return TRUE; The transition is visible in the trace: trace:x11drv:window_set_managed window 0x600ea/2c0000f, requesting override-redirect 1 -> 0 Once managed, the popup can be positioned independently of its owner. The playback appears detached, and moving the main window can leave the video behind. Borderless owned popups without WS_EX_APPWINDOW should remain application-positioned: if (style & WS_POPUP) { if (style & WS_SYSMENU) return TRUE; if (fullscreen) return TRUE; if (!(ex_style & WS_EX_APPWINDOW) && NtUserGetWindowRelative(hwnd, GW_OWNER)) return FALSE; } Because unmanaged popups bypass window-manager owner stacking, their X11 windows must also follow owner focus transitions: if (activate && data->desired_state.wm_state != WithdrawnState) XMapRaised(data->display, data->whole_window); else if (!activate) XUnmapWindow(data->display, data->whole_window); This preserves the requested WS_POPUP and HWND behavior while keeping the video aligned with its owner and hiding it correctly on Alt-Tab. 2. MCI_DGV_STATUS_HWND is not implemented Immediately after opening and positioning the video, the game requests status item 0x4001, MCI_DGV_STATUS_HWND: trace:quartz:VideoWindow_SetWindowPosition graph 011033A8, left 0, top 0, width 640, height 400. trace:quartz:VideoWindow_put_Visible graph 011033A8, visible -1. fixme:mciqtz:MCIQTZ_mciStatus Unknown command 00004001 Wine returns MCIERR_UNRECOGNIZED_COMMAND, so the game stores a null video HWND. It passes the returned HWND to GetWindowThreadProcessId(), installs a WH_GETMESSAGE hook on that thread, and skips the intro only when the hook receives WM_LBUTTONDOWN for the same HWND. Returning the current explicit or default video window fixes the input: case MCI_DGV_STATUS_HWND: lpParms->dwReturn = (DWORD_PTR)wma->parent; break; After this change, clicking the video makes the game close the current MCI device and advance immediately. 3. MCI notifications use device ID zero MCIQTZ_mciNotify() and the playback notification thread use wma->notify_devid: mciDriverNotify(old, wma->notify_devid, MCI_NOTIFY_SUCCESSFUL); notify_devid is never initialized. Since WINE_MCIQTZ is zero-initialized, MM_MCINOTIFY messages contain device ID zero in lParam instead of the actual MCI device ID. WINE_MCIQTZ already stores the initialized device ID in wma->wDevID. Using that member for every notification fixes the value: mciDriverNotify(old, wma->wDevID, MCI_NOTIFY_SUCCESSFUL); I have attached a candidate patch implementing the fixes described above. It keeps borderless owned popups application-positioned and synchronized with their owner during focus changes, implements MCI_DGV_STATUS_HWND, and sends the correct MCI device ID in MM_MCINOTIFY messages. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60045 --- Comment #6 from Feng Yu <abcfy2@163.com> --- (In reply to brandow from comment #5)
Created attachment 81525 [details] candidate patch
I found three separate Wine issues behind the detached playback window, broken click-to-skip, and incorrect playback notifications.
The attached game is Chinese and should be launched with LC_ALL=zh_CN.UTF-8. Some characters in the toolbox bar still appear as empty boxes, but this is likely a locale or font issue rather than part of the Wine playback bug.
The GStreamer QoS error is unrelated to mouse input. Click-to-skip works after fixing the MCI HWND query even while the QoS event is rejected:
ERROR WINE dlls/winegstreamer/unixlib.c:241:push_event: Failed to push qos event 0x7fd8f0001520 to pad qz_sink_0.
1. The borderless owned playback popup becomes X11-managed
The game opens the video with MCI_DGV_OPEN_PARENT, MCI_DGV_OPEN_WS, and WS_POPUP. The resulting video window is therefore a borderless owned popup rather than a child window. The game positions that popup over its main client area:
trace:mciqtz:create_window device 0x1, flags 0x30200, style 0x80000000, parent 0001005E, created window 000600EA. SetWindowPos(000600EA, 0, 640, 383, 640, 400, 0)
Wine initially creates the X11 window as override-redirect, but is_window_managed() promotes any activated window to a managed window:
/* activated windows are managed */ if (!(swp_flags & (SWP_NOACTIVATE | SWP_HIDEWINDOW))) return TRUE; if (hwnd == get_active_window()) return TRUE;
The transition is visible in the trace:
trace:x11drv:window_set_managed window 0x600ea/2c0000f, requesting override-redirect 1 -> 0
Once managed, the popup can be positioned independently of its owner. The playback appears detached, and moving the main window can leave the video behind.
Borderless owned popups without WS_EX_APPWINDOW should remain application-positioned:
if (style & WS_POPUP) { if (style & WS_SYSMENU) return TRUE; if (fullscreen) return TRUE; if (!(ex_style & WS_EX_APPWINDOW) && NtUserGetWindowRelative(hwnd, GW_OWNER)) return FALSE; }
Because unmanaged popups bypass window-manager owner stacking, their X11 windows must also follow owner focus transitions:
if (activate && data->desired_state.wm_state != WithdrawnState) XMapRaised(data->display, data->whole_window); else if (!activate) XUnmapWindow(data->display, data->whole_window);
This preserves the requested WS_POPUP and HWND behavior while keeping the video aligned with its owner and hiding it correctly on Alt-Tab.
2. MCI_DGV_STATUS_HWND is not implemented
Immediately after opening and positioning the video, the game requests status item 0x4001, MCI_DGV_STATUS_HWND:
trace:quartz:VideoWindow_SetWindowPosition graph 011033A8, left 0, top 0, width 640, height 400. trace:quartz:VideoWindow_put_Visible graph 011033A8, visible -1. fixme:mciqtz:MCIQTZ_mciStatus Unknown command 00004001
Wine returns MCIERR_UNRECOGNIZED_COMMAND, so the game stores a null video HWND. It passes the returned HWND to GetWindowThreadProcessId(), installs a WH_GETMESSAGE hook on that thread, and skips the intro only when the hook receives WM_LBUTTONDOWN for the same HWND.
Returning the current explicit or default video window fixes the input:
case MCI_DGV_STATUS_HWND: lpParms->dwReturn = (DWORD_PTR)wma->parent; break;
After this change, clicking the video makes the game close the current MCI device and advance immediately.
3. MCI notifications use device ID zero
MCIQTZ_mciNotify() and the playback notification thread use wma->notify_devid:
mciDriverNotify(old, wma->notify_devid, MCI_NOTIFY_SUCCESSFUL);
notify_devid is never initialized. Since WINE_MCIQTZ is zero-initialized, MM_MCINOTIFY messages contain device ID zero in lParam instead of the actual MCI device ID.
WINE_MCIQTZ already stores the initialized device ID in wma->wDevID. Using that member for every notification fixes the value:
mciDriverNotify(old, wma->wDevID, MCI_NOTIFY_SUCCESSFUL);
I have attached a candidate patch implementing the fixes described above. It keeps borderless owned popups application-positioned and synchronized with their owner during focus changes, implements MCI_DGV_STATUS_HWND, and sends the correct MCI device ID in MM_MCINOTIFY messages.
Yes. This game will use `simsun` font, which is the default font of old Chinese Windows Edition (previous windows 7) So you can put simsun.ttf ( https://github.com/StellarCN/scp_zh/blob/master/fonts/SimSun.ttf ) into $WINEPREFIX/drive_c/windows/Fonts/ , then the characters should be appeared. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla