http://bugs.winehq.org/show_bug.cgi?id=24505
Summary: Plants vs Zombies: Low FPS on seeds menu Product: Wine Version: 1.3.3 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: adys.wh@gmail.com
The seeds menu (presented at the start of each game) in Plants vs Zombies GOTY edition (Steam) makes the game lag noticeably.
nvidia 9800gtx+ / 260.xx drivers (official binaries) / xorg 1.9
Happens both on fullscreen and windowed, only tested in virtual desktop. No relevant console output.
http://bugs.winehq.org/show_bug.cgi?id=24505
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |performance CC| |dank@kegel.com
http://bugs.winehq.org/show_bug.cgi?id=24505
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
http://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #1 from Nicky nheart@gmail.com 2010-11-05 06:33:03 CDT --- I can confirm this. It happens both on my p4 2.66 pc with FX 5200 and also on my Eeepc 1201 n (nVidia ION). I think it's processor related, because the slower the processor is, the more noticeable the fps drop is.
http://bugs.winehq.org/show_bug.cgi?id=24505
Jack Mitchell jgm11@le.ac.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #2 from Jack Mitchell jgm11@le.ac.uk 2011-01-13 13:20:56 CST --- *** This bug has been confirmed by popular vote. ***
http://bugs.winehq.org/show_bug.cgi?id=24505
Jack Mitchell jgm11@le.ac.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jgm11@le.ac.uk
--- Comment #3 from Jack Mitchell jgm11@le.ac.uk 2011-01-13 13:38:00 CST --- Archlinux x86_64
Core 2 Duo T7300 2.00Ghz nVidia 8600GS - 260.19.29 Xorg 1.9.2
http://bugs.winehq.org/show_bug.cgi?id=24505
Jan Kalab pitlicek@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pitlicek@gmail.com
--- Comment #4 from Jan Kalab pitlicek@gmail.com 2011-05-05 02:12:41 CDT --- I can confirm this too. But i wouldn't call it lag, it's just noticable fps drop.
nVidia GeForce 9600GT (drivers 270), Ubuntu 10.10 64bit (Xorg from distro).
http://bugs.winehq.org/show_bug.cgi?id=24505
sh shooter0106@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |shooter0106@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=24505
Felix Yan felixonmars@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |felixonmars@gmail.com
--- Comment #5 from Felix Yan felixonmars@gmail.com 2012-05-04 10:17:48 CDT --- I can confirm this too, since stage 1-8. Tested with wine 1.5.3 x86_64.
http://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #6 from Jerome Leclanche adys.wh@gmail.com --- Still in wine-1.7.9.
http://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #7 from Jerome Leclanche adys.wh@gmail.com --- Alright, well with warn+all I'm seeing a lot of "warn:d3d_perf:surface_map Mapping a dynamic surface without WINED3D_MAP_DISCARD." however that appears everywhere in the game, not just on the seeds menu.
+ddraw logs looked identical with and without the perf loss... +d3d_perf yields nothing else interesting. Unchecking "3d acceleration" option still displays the issue so it's probably nothing to do with all that anyway.
http://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #8 from Ken Thomases ken@codeweavers.com --- Is there high CPU usage when it happens? Can you sample or profile the process? (I'm not really familiar with Linux tools for that, but I've heard of oprofile.)
http://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #9 from Jerome Leclanche adys.wh@gmail.com --- (In reply to comment #8) I don't think it has anything to do with CPU. I'm analyzing a +relay at the moment and I'm seeing a lot (a LOT) of this stuff when on the seeds menu which I'm not seeing elsewhere as much.
005f:Call winex11.drv.MsgWaitForMultipleObjectsEx(00000001,0033f82c,ffffffff,00000040,00000000) ret=7ed4e372 0060:Ret winex11.drv.MsgWaitForMultipleObjectsEx() retval=00000000 ret=7ec7e372 0009:Ret gdi32.GdiAlphaBlend() retval=00000001 ret=3f22d80d 0009:Call gdi32.SelectObject(000501fa,012701f3) ret=3f22d825 0009:Ret gdi32.SelectObject() retval=00040204 ret=3f22d825 0009:Call gdi32.SelectObject(000501fa,00040204) ret=3f22d79b 0060:Call window proc 0x40f9c5 (hwnd=0x2013c,msg="PopCapDRM_QueryData",wp=00000004,lp=00000000)
Still trying to figure out what that means.
http://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #10 from Jerome Leclanche adys.wh@gmail.com --- That does seem to be it. I don't know the implications of it, but the PopCapDRM_QueryData spam coincides with the issue...
+message snippet:
trace:message:SPY_ExitMessage (0x30122) L"{DRMProtectRun}" [c065] "PopCapDRM_QueryData" returned 00000001 trace:message:SPY_EnterMessage (0x10088) L"{USurface_2887}" [0113] WM_TIMER dispatched wp=00000000 lp=00000000 trace:message:SPY_EnterMessage (0x10088) DefWindowProc:[0113] WM_TIMER wp=00000000 lp=00000000 trace:message:SPY_ExitMessage (0x10088) DefWindowProc: [0113] WM_TIMER returned 00000000 trace:message:SPY_ExitMessage (0x10088) L"{USurface_2887}" [0113] WM_TIMER returned 00000000 trace:message:SPY_EnterMessage (0x30122) L"{DRMProtectRun}" [c065] "PopCapDRM_QueryData" sent from tid 005d wp=00000004 lp=00000000 trace:message:SPY_ExitMessage (0x30122) L"{DRMProtectRun}" [c065] "PopCapDRM_QueryData" returned 00000001 trace:message:SPY_EnterMessage (0x30122) L"{DRMProtectRun}" [c065] "PopCapDRM_QueryData" sent from tid 005d wp=00000004 lp=00000000 trace:message:SPY_ExitMessage (0x30122) L"{DRMProtectRun}" [c065] "PopCapDRM_QueryData" returned 00000001 trace:message:SPY_EnterMessage (0x30122) L"{DRMProtectRun}" [c065] "PopCapDRM_QueryData" sent from tid 005d wp=00000004 lp=00000000 trace:message:SPY_ExitMessage (0x30122) L"{DRMProtectRun}" [c065] "PopCapDRM_QueryData" returned 00000001 trace:message:SPY_EnterMessage (0x30122) L"{DRMProtectRun}" [c065] "PopCapDRM_QueryData" sent from tid 005d wp=00000004 lp=00000000
http://bugs.winehq.org/show_bug.cgi?id=24505
Thom Thom Thom thomthomthom@ymail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |thomthomthom@ymail.com
--- Comment #11 from Thom Thom Thom thomthomthom@ymail.com --- Duplicates bug #19174: http://bugs.winehq.org/show_bug.cgi?id=19174#c16.
http://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #12 from Jerome Leclanche adys.wh@gmail.com --- (In reply to comment #11) No, this is a different issue. Please keep the discussion to this bug exclusively.
http://bugs.winehq.org/show_bug.cgi?id=24505
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ghilbert12_lhen03@yahoo.com | |.ph
--- Comment #13 from Austin English austinenglish@gmail.com --- *** Bug 23365 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #14 from Thom Thom Thom thomthomthom@ymail.com --- Times when the Crazy Dave character appears are too much slow. The same for the seed choosing screen ... In game there are lag when there are too many flowers or too many zombies ...
There are times when the game runs smoothly on the latest wine (1.7.12).
https://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #15 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.37 or newer) wine? If so, please attach the terminal output in 1.7.37 (see http://wiki.winehq.org/FAQ#get_log).
https://bugs.winehq.org/show_bug.cgi?id=24505
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #16 from joaopa jeremielapuree@yahoo.fr --- No news from the reporter since 4 years. No freely downloadable demo. This bug can b closed as ABANDONNED.
https://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #17 from Felix Yan felixonmars@archlinux.org --- I believe the bug is still present in latest wine. I'll check soon.
https://bugs.winehq.org/show_bug.cgi?id=24505
mrdeathjr28@yahoo.es changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mrdeathjr28@yahoo.es
https://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #18 from sh shooter0106@gmail.com --- Yep, this issue still present in wine-3.11.
https://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #19 from Thom Thom Thom thomthomthom@ymail.com --- It's still present in Wine 3.13.
https://bugs.winehq.org/show_bug.cgi?id=24505
Peter Nowee peter@peternowee.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |peter@peternowee.com
https://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #20 from joaopa jeremielapuree@yahoo.fr --- Does the bug still occurs with wine-5.0-rc1?
https://bugs.winehq.org/show_bug.cgi?id=24505
Guilherme S. oguilherme@protonmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |oguilherme@protonmail.com
--- Comment #21 from Guilherme S. oguilherme@protonmail.com --- I've just tested it under the master branch and the issue still persists: Very low fps in the seeds picking screen. I get from 4 to 10 fps on my GTX 660.
https://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #22 from Guilherme S. oguilherme@protonmail.com --- I've downloaded a "patched" PlantsVsZombies.exe binary from GameCopyWorld (sha256: 48e28b4a6838061d49d4d83fe891320235b0895208e30e199fb21fd89980a672), then I used it as a replacement to the original one from Steam. The performance difference was _immediately_ visible.
I was getting 8 ~ 12 fps in the card picking screen, whilst using the unmodified executable. But now, I'm able to get 65 ~ 70 fps on that same screen. I'm not exactly sure if the patched executable simply removed the DRM stuff, but whatever it's done, it helped _a lot_ performance-wise.
Then, just for fun, I decided to do the same on Windows 10 (which I have on dual boot), just so we could know if it would made a difference there too. To my surprise, the results were pretty much similar to Wine's.
In fact, using the unmodified PlantsVsZombies.exe binary on Windows 10 (build 2004), lead to the same slowdown we experience on Wine (in the card picking screen). If you're curious, I've recorded two videos comparing the performance before and after changing the executables, on both Windows 10 and Arch Linux, running on the exact same machine.
Before you watch the video, keep in mind that I've also used dgVoodoo2 in both OSes, which is basically an awesome program that translates DirectDraw calls into Direct3D 11 ones, so that I'm able to use DXVK and get a little bit more of fps on Wine. Anyway, here are the videos:
Windows - https://www.youtube.com/watch?v=DiW_sE1ehMw Linux - https://www.youtube.com/watch?v=p6tX_qPdth4
Albeit the performance gains were visible, it's still weird to me that a 2D game from 10 years ago, running on a dedicated GPU (granted, a GTX 660 is not exactly the most powerful one), still struggles to get past 60 fps on that particular screen.
But anyway... to summarize, my humble guess is that, this performance problem is indeed DRM-related, as initially suspected by Jerome Leclanche. Unfortunately, my knowledge about Windows APIs and DRMs is pretty much zero, so I won't be able to actually confirm it. :)
But if anyone else wants to give it a try, the game is on sale on Steam right now for only $0.99.
https://bugs.winehq.org/show_bug.cgi?id=24505
--- Comment #23 from Guilherme S. oguilherme@protonmail.com --- Funny thing... So, it turns out that is not even necessary to download the patched executable from GameCopyWorld to achieve better performance.
The original "PlantsVsZombies.exe" (from Steam), already packs this "patched" binary inside itself. They're not exactly the same, however. The one from GameCopyWorld definitely removes some extra DRM stuff, such as Steam API integration.
Anyway, once you launch the game using the original executable, it unpacks and runs this new executable called "popcapgame1.exe", located on C:\ProgramData\PopCap Games\PlantsVsZombies.
However, the original "PlantsVsZombies.exe" doesn't stop running, since it's probably doing a lot of DRM-related checks in background and communicating back and forth with "popcapgame1.exe", thus hurting the game's performance (I'm guessing).
Anyway, if you copy this "popcapgame1.exe" executable and use it as a replacement for the original "PlantsVsZombies.exe", the performance hit is _much less_ severe. And this was observed by me while playing on both Windows 10 and Arch Linux.
So maybe this issue isn't exclusive to Wine...?
It would be great if more people were able to reproduce and confirm everything I said, in order for this bug to be finally closed.
Regards