http://bugs.winehq.org/show_bug.cgi?id=22533
Summary: Half Life: loading screen rendering is wrong Product: Wine Version: 1.1.43 Platform: x86-64 OS/Version: Linux Status: NEW Severity: minor Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: austinenglish@gmail.com
Created an attachment (id=27624) --> (http://bugs.winehq.org/attachment.cgi?id=27624) screenshot
See attached screenshot. Terminal output is minimal: fixme:win:EnumDisplayDevicesW ((null),0,0x32e298,0x00000000), stub! fixme:x11drv:X11DRV_desktop_SetCurrentMode Cannot change screen BPP from 32 to 16 fixme:mci:MCI_Break (0102) vkey 001B stub ALSA lib ../../../src/pcm/pcm.c:7234:(snd_pcm_recover) underrun occured fixme:mci:MCI_Break (0102) vkey 001B stub ALSA lib ../../../src/pcm/pcm.c:7234:(snd_pcm_recover) underrun occured fixme:win:LockWindowUpdate (0x30052), partial stub! fixme:win:LockWindowUpdate ((nil)), partial stub! fixme:win:LockWindowUpdate (0x30052), partial stub! fixme:win:LockWindowUpdate ((nil)), partial stub!
http://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #1 from Vitaliy Margolen vitaliy@kievinfo.com 2010-04-29 22:38:08 --- Yeah, it's been there for ages.
http://bugs.winehq.org/show_bug.cgi?id=22533
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wylda@volny.cz
--- Comment #2 from Wylda wylda@volny.cz 2010-06-01 12:02:13 ---
If it can help some how, that misrendered graphics is actually video file played inside game. It's ./valve/media/logo.avi with following parameters:
logo.avi: RIFF (little-endian) data, AVI, 640 x 100, 24.00 fps, video: RLE 8bpp
http://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #3 from Wylda wylda@volny.cz 2010-06-01 12:03:51 ---
Forgot to mention... still present in wine-1.2-rc2-51-gbbd93e5.
http://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #4 from Bruno Jesus 00cpxxx@gmail.com 2013-02-24 13:44:48 CST --- Is this still an issue in the latest development version of wine?
http://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #5 from Austin English austinenglish@gmail.com 2013-04-17 20:35:36 CDT --- (In reply to comment #4)
Is this still an issue in the latest development version of wine?
Yes, still in wine-1.5.28-66-g6899279
http://bugs.winehq.org/show_bug.cgi?id=22533
Gethyn ThomasQuail xylem2020@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |xylem2020@gmail.com
--- Comment #6 from Gethyn ThomasQuail xylem2020@gmail.com --- This issue is still present in 1.7.19 and is more about how the menu can incorrectly render AVIs.
https://bugs.winehq.org/show_bug.cgi?id=22533
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://www.fileplanet.com/1 | |0360/download/Half-Life:-Up | |Link-Demo
--- Comment #7 from Jeff Zaroyko jeffz@jeffz.name --- wine-1.9.3-217-g0f8a0fd - Still present.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #8 from Gethyn ThomasQuail xylem2020@gmail.com --- Hello all, I believe I have found the library that causes this bug. One of the VB related libraries (comdlg32.dll) seems to have something unimplemented relating to AVI playback. When you copy this library from a trusted Windows install, place it in the same folder as hl.exe, and add it to the library list as "Native" in winecfg, the AVIs behave exactly as they do on Windows. In fact, Wine normally plays AVIs through the menu that should not actually play and this fixes that. Many modders, and even Valve, used junk AVIs to not have an animated title but Wine plays them through the menu when it shouldn't. I do not know more than that, so I hope someone who knows what their doing can fix this bug.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #9 from Bruno Jesus 00cpxxx@gmail.com --- The problem here is that the avi files from the game are compressed in RLE but they don't have a palette. So wine allocates a 0 colors palette and uses it blindly.
Actually I think this was done on purpose and Windows probably rejects such videos too. I think that because when I make wine msrle codec to report error in such situations the video is correctly played as if the application is doing the work.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #10 from Bruno Jesus 00cpxxx@gmail.com --- But since mplayer can play it there is probably some trick wine needs to implement to do the same. Maybe using a system default palette. Or maybe computing the colors used in other way because mplayer complains about a lot of unknown bytes in the header (which can potentially be the palette).
https://bugs.winehq.org/show_bug.cgi?id=22533
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #11 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 53885 --> https://bugs.winehq.org/attachment.cgi?id=53885 better than nothing patch
This patch improves things a bit. Now the output is consistent in every run but the colors are not exact yet.
https://bugs.winehq.org/show_bug.cgi?id=22533
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #53885|0 |1 is obsolete| |
--- Comment #12 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 53886 --> https://bugs.winehq.org/attachment.cgi?id=53886 little better patch
Ignore the last attempt. This looks better, but I don't have Windows to compare at the moment.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #13 from Gethyn ThomasQuail xylem2020@gmail.com ---
From what I can see so far, this patch is absolutely perfect! None of the
problems I reported with stock wine are happening anymore. Thanks a bunch!
Just curious, do you have TFC installed for HL? There seems to be another Wine bug where TFC's AVI looks corrupted or something. There's a bunch of lines where there shouldn't be.
https://bugs.winehq.org/show_bug.cgi?id=22533
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch Summary|Half Life: loading screen |Half Life: loading screen |rendering is wrong |rendering is wrong (msrle32 | |does not handle frames with | |0 biClrUsed)
--- Comment #14 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Gethyn ThomasQuail from comment #13)
From what I can see so far, this patch is absolutely perfect! None of the problems I reported with stock wine are happening anymore. Thanks a bunch!
Thanks for testing the patch, it requires some tests and also to check what happens for bit count higher than 8 so it will take some time to be merged in wine.
Just curious, do you have TFC installed for HL? There seems to be another Wine bug where TFC's AVI looks corrupted or something. There's a bunch of lines where there shouldn't be.
I have Half-Life Anthology at home but I'm traveling and cannot test it now but you can create a new bug and we can check from logs to see if there is any hint. Specially what codec is used in the videos, which probably for longer videos will not be RLE.
You can open a new bug and attach a +mciavi,+msvideo,+msrle32,+iccvid,+msvidc32 log from the first seconds of video playing (the log will be long and repetitive). The log will also have information about what codec is used.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #15 from Gethyn ThomasQuail xylem2020@gmail.com --- (In reply to Bruno Jesus from comment #14)
Thanks for testing the patch, it requires some tests and also to check what happens for bit count higher than 8 so it will take some time to be merged in wine.
Argh, I'm sorry it turns out my test was using another library from winetricks I forgot to uninstall. The library was installed in the system32 folder so it fooled me into thinking I wasn't loading anymore of the copied Windows libraries. It should be clean now though, only use Wine libraries and your patch.
Any who, in this test the main AVI from HL is a lot better than default. There's a bunch of these gray areas on the background. Which is interesting because some other AVIs used in mods do this on Windows and in Wine.
I encourage you to keep going as if you figure out why this gray issue occurs, I think the AVI will look perfect.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #16 from Bruno Jesus 00cpxxx@gmail.com --- No problem, anyway the problem the patch fixes is real and the new bug about the other videos will still be useful.
Two screenshots from good and bad rendering would be useful because currently the bug only has a bad screenshot.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #17 from Gethyn ThomasQuail xylem2020@gmail.com --- Created attachment 53897 --> https://bugs.winehq.org/attachment.cgi?id=53897 Screenshot with new patch
So here is the requested screenshot showing how it compares with the new patch to the game ran under Windows. As you can see, it has this weird gray pixels in the background but that seems to be the only problem.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #18 from Gethyn ThomasQuail xylem2020@gmail.com --- Created attachment 53899 --> https://bugs.winehq.org/attachment.cgi?id=53899 Screenshot showing possible relation to current bug
Here's another screenshot of a comparison. Now please note, this one in particular appears without this patch on stock Wine. HOWEVER, I think it might be relevant to this bug seeing as the new patch produces this effect with the main AVI used by Half-Life. This mod's (They Hunger) AVI video file info according to ffprobe:
Video: msrle ([1][0][0][0] / 0x0001), pal8, 640x100, 24 fps, 24 tbr, 24 tbn, 24 tbc
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #19 from Gethyn ThomasQuail xylem2020@gmail.com --- One last comment, just want to note that the above They Hunger screenshot might look fine under my Windows virtual machine because it is in 16-bit mode. The menu might appear the way it does on Wine on a normal Windows install because the user will probably have it in 32-bit mode.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #20 from Bruno Jesus 00cpxxx@gmail.com --- Thanks for the screenshot. This bug has 2 different problems. The first is the garbage palette and the second is about the painting of the video frame over the game background which generates the gray rubbish. This second problem I have no idea.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #21 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 53911 --> https://bugs.winehq.org/attachment.cgi?id=53911 ugly hack for gray rubish
I have no idea why but the problem happens while the games print some specific (maybe key frames?) frames using StretchBlt.
While calling nulldrv_StretchBlt (gdi32/bitblt.c) Wine will fail with ERROR_BAD_FORMAT on function dst_dev->funcs->pPutImage (line 271). Then it will attempt to get the correct colors and try again by calling get_mono_dc_colors (line 278). This will result in the incorrect color and then gray rubish.
If I change get_mono_dc_colors to return the text color instead of the back color it will work, most likely by pure luck.
Something wrong is happening way before all this but I couldn't trace back to the origin.
Can you try to see if the hack works for the logo video for you? This probably won't help TFC and REQUIRES the other patch attached here.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #22 from Gethyn ThomasQuail xylem2020@gmail.com --- (In reply to Bruno Jesus from comment #21)
Can you try to see if the hack works for the logo video for you? This probably won't help TFC and REQUIRES the other patch attached here.
Sure. From what I can see here, this patch in combination with the other fixes the AVI for HLs and other mods (TFC is the only exception as expected). Only problem I've noticed with it is that for some reason grayed out buttons have a weird gray box instead of text in winecfg. Other than that awesome work! Thank you for all your works so far.
Also would you like a copy of TFC to check out the other bug? I host an extracted copy of the WON version from the 1.1.1.0 update installer for HL.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #23 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Gethyn ThomasQuail from comment #22)
(In reply to Bruno Jesus from comment #21)
Can you try to see if the hack works for the logo video for you? This probably won't help TFC and REQUIRES the other patch attached here.
Sure. From what I can see here, this patch in combination with the other fixes the AVI for HLs and other mods (TFC is the only exception as expected). Only problem I've noticed with it is that for some reason grayed out buttons have a weird gray box instead of text in winecfg. Other than that awesome work! Thank you for all your works so far.
Thanks for the test again, that was just a hack and breaks a lot of other things. But it helps to test. I found the error to be in comctl32 I think. The problem is related to the background color that is filled in ANIMATE_PaintFrame. If I disable ACS_TRANSPARENT flag the video plays fine. Either wine is getting the wrong color for transparency or it should have disabled transparency due to some other missing test.
Also would you like a copy of TFC to check out the other bug? I host an extracted copy of the WON version from the 1.1.1.0 update installer for HL.
For now there is no need for that because I could not even fix this bug yet so mixing with other problems would not be a good idea.
https://bugs.winehq.org/show_bug.cgi?id=22533
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #53911|0 |1 is obsolete| |
--- Comment #24 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 53913 --> https://bugs.winehq.org/attachment.cgi?id=53913 better patch
Thanks for your previous test.
This patch should fix Half-Life and TFC (applied together with the patch from comment 12).
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #25 from Gethyn ThomasQuail xylem2020@gmail.com --- (In reply to Bruno Jesus from comment #24)
Created attachment 53913 [details] better patch
Thanks for your previous test.
This patch should fix Half-Life and TFC (applied together with the patch from comment 12).
Ok just got done testing, this patch is pretty much perfect. Only regression (of sorts) I got is that for some strange reason, one of the mods I have, it's AVI doesn't load anymore. One or two more mod AVIs seem to not be working too. If you think it's worth looking into I can provide info for those AVIs, but pretty much HL, TFC, and a bunch of random mods I have installed seemed to work perfectly.
When this bug is fixed and the patch is completed, there's two other trivial AVI related issues, but I'm not sure if they should remain in this bug or a new one should be created and this report should be closed.
https://bugs.winehq.org/show_bug.cgi?id=22533
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Half Life: loading screen |Half-Life: Logo video |rendering is wrong (msrle32 |rendering is wrong (msrle32 |does not handle frames with |does not handle frames with |0 biClrUsed) |0 biClrUsed)
--- Comment #26 from Bruno Jesus 00cpxxx@gmail.com --- This patch is still just a hack and should not really be considered (not even for wine-staging). I have opened bug 40276 and bug 40277 to target the other problems.
https://bugs.winehq.org/show_bug.cgi?id=22533
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |373a02c64169d4fc039a93153b6 | |6987057fee553
--- Comment #27 from Bruno Jesus 00cpxxx@gmail.com --- This bug is fixed by http://source.winehq.org/git/wine.git/?a=commit;h=373a02c64169d4fc039a93153b...
There is still bug 40276.
https://bugs.winehq.org/show_bug.cgi?id=22533
--- Comment #28 from Gethyn ThomasQuail xylem2020@gmail.com --- (In reply to Bruno Jesus from comment #27)
This bug is fixed by http://source.winehq.org/git/wine.git/?a=commit; h=373a02c64169d4fc039a93153b66987057fee553
There is still bug 40276.
Thank you for fixing this longstanding bug. I eagerly await your fixes for the other bugs.
https://bugs.winehq.org/show_bug.cgi?id=22533
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #29 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.9.6.