Hi!
I tried Final Fantasy 8 under Wine (no Windows), yesterday. Got it running, but FF8Config refused to start complaining something about MIDI error. Of course no music.
Here is what I found after debugging almost 6 hours :(
1. There are some missing registry entries which are needed.
[Software\Classes\CLSID\{58C2B4D0-46E7-11D1-89AC-00A0C9054129}] 1028325524 @="DirectMusicSynth"
[Software\Classes\CLSID\{58C2B4D0-46E7-11D1-89AC-00A0C9054129}\InprocServer32] 1028325524 @="dmsynth.dll" "ThreadingModel"="Both" [Software\Classes\CLSID\{636B9F10-0C7D-11D1-95B2-0020AFDC7421}] 1028325524 @="DirectMusic Object"
[Software\Classes\CLSID\{636B9F10-0C7D-11D1-95B2-0020AFDC7421}\InprocServer32] 1028325524 @="dmusic.dll" "ThreadingModel"="Both" [Software\Microsoft\DirectMusic] 1028325524 @="" "GMFilePath"="gm.dls"
[Software\Microsoft\DirectMusic\Defaults] 1028325524 @="" "DefaultOutputport"="{58C2B4D0-46E7-11D1-89AC-00A0C9054129}"
[Software\Microsoft\DirectMusic\SoftwareSynths] 1028325524 @=""
[Software\Microsoft\DirectMusic\SoftwareSynths\{58C2B4D0-46E7-11D1-89AC-00A0C9054129}] 1028325524 @="" "Description"="Microsoft Software Synthesizer"
2. Original (native) DMUSIC.DLL, DMUSIC16.DLL, DMUSIC32.DLL, DMSYNTH.DLL are needed too.
After above changes FF8Config wasn't complaining about MIDI problems., but simply hanging after displaying window. I think problem is that I'm using native DirectMusic DLLs or am I wrong? Maybe not, because there is X11DRV error...
Here is wine output:
$ wine --debugmsg +ole FF8Config.exe trace:ole:OLE32_DllEntryPoint 0x40bda000 0x1 0x1 trace:ole:CoRegisterMallocSpy trace:ole:IMallocSpy_fnQueryInterface ({0000001d-0000-0000-c000-000000000046},0x405c6dec) trace:ole:OLE32_DllEntryPoint 0x40bda000 0x2 (nil) trace:ole:OLE32_DllEntryPoint 0x40bda000 0x2 (nil) fixme:ddraw:MESA_IDirect3D2Impl_EnumDevices (0x403d8f58)->(0x401e45,0x403d8f58),stub! fixme:ddraw:MESA_IDirect3D2Impl_EnumDevices (0x403d8f58)->(0x401e45,0x403d8f58),stub! trace:ole:OLE32_DllEntryPoint 0x40bda000 0x2 (nil) fixme:ddraw:MESA_IDirect3D2Impl_EnumDevices (0x403d8f58)->(0x401e45,0x403d8f58),stub! fixme:ddraw:MESA_IDirect3D2Impl_EnumDevices (0x403d8f58)->(0x401e45,0x403d8f58),stub! trace:ole:CoInitializeEx ((nil), 2) trace:ole:CoInitializeEx () - Initializing the COM libraries trace:ole:RunningObjectTableImpl_Initialize () trace:ole:WINE_StringFromCLSID 0x4155a0->{636B9F10-0C7D-11D1-95B2-0020AFDC7421} trace:ole:CoGetClassObject CLSID: {636b9f10-0c7d-11d1-95b2-0020afdc7421}, IID: {00000001-0000-0000-c000-000000000046} trace:ole:COMPOBJ_DLLList_Add fixme:setupapi:SetupDiGetClassDevsA {6994ad04-93ef-11d0-a3cc-00a0c9223196} (null) 0000 00000012 trace:ole:__CLSIDFromStringA {58C2B4D0-46E7-11D1-89AC-00A0C9054129} -> 0x405c6d4c trace:ole:WINE_StringFromCLSID 0x405c6d4c->{58C2B4D0-46E7-11D1-89AC-00A0C9054129} trace:ole:CoGetClassObject CLSID: {58c2b4d0-46e7-11d1-89ac-00a0c9054129}, IID: {00000001-0000-0000-c000-000000000046} trace:ole:COMPOBJ_DLLList_Add trace:ole:CoUninitialize () err:ntdll:RtlpWaitForCriticalSection section 0x40cd0424 "x11drv_main.c: X11DRV_CritSection" wait timed out, retrying (60 sec) tid=080720a8
If running wine like this 'wine --debugmsg +all FF8Config.exe &>log' the FF8Config not hangs in displaying window and looks like it's running ok! This means wine is running very slowly, because of writing debug messages, so there is some kind of timing error... may be not. Don't know for sure. Could somebody point me where should I look? What above "err:ntdll:..." really means? How should I debug it?
And I'd like to ask is somebody who works on DirectMusic implementation under Wine? If no, could somebody tell me how hard should be add this? Is really necessary to implement each DLL or just DMSYNTH.DLL(?) contains needed rutines? I'd like to get FF8 running at any price :)
Thank you in advance.
Regards, Martin.
On Mon, 5 Aug 2002, Martin Lexa wrote:
Hi!
I tried Final Fantasy 8 under Wine (no Windows), yesterday. Got it running, but FF8Config refused to start complaining something about MIDI error. Of course no music.
[...]
After above changes FF8Config wasn't complaining about MIDI problems., but simply hanging after displaying window. I think problem is that I'm using native DirectMusic DLLs or am I wrong? Maybe not, because there is X11DRV error...
Here is wine output:
$ wine --debugmsg +ole FF8Config.exe trace:ole:OLE32_DllEntryPoint 0x40bda000 0x1 0x1 trace:ole:CoRegisterMallocSpy trace:ole:IMallocSpy_fnQueryInterface ({0000001d-0000-0000-c000-000000000046},0x405c6dec) trace:ole:OLE32_DllEntryPoint 0x40bda000 0x2 (nil) trace:ole:OLE32_DllEntryPoint 0x40bda000 0x2 (nil) fixme:ddraw:MESA_IDirect3D2Impl_EnumDevices (0x403d8f58)->(0x401e45,0x403d8f58),stub! fixme:ddraw:MESA_IDirect3D2Impl_EnumDevices (0x403d8f58)->(0x401e45,0x403d8f58),stub! trace:ole:OLE32_DllEntryPoint 0x40bda000 0x2 (nil) fixme:ddraw:MESA_IDirect3D2Impl_EnumDevices (0x403d8f58)->(0x401e45,0x403d8f58),stub! fixme:ddraw:MESA_IDirect3D2Impl_EnumDevices (0x403d8f58)->(0x401e45,0x403d8f58),stub! trace:ole:CoInitializeEx ((nil), 2) trace:ole:CoInitializeEx () - Initializing the COM libraries trace:ole:RunningObjectTableImpl_Initialize () trace:ole:WINE_StringFromCLSID 0x4155a0->{636B9F10-0C7D-11D1-95B2-0020AFDC7421} trace:ole:CoGetClassObject CLSID: {636b9f10-0c7d-11d1-95b2-0020afdc7421}, IID: {00000001-0000-0000-c000-000000000046} trace:ole:COMPOBJ_DLLList_Add fixme:setupapi:SetupDiGetClassDevsA {6994ad04-93ef-11d0-a3cc-00a0c9223196} (null) 0000 00000012 trace:ole:__CLSIDFromStringA {58C2B4D0-46E7-11D1-89AC-00A0C9054129} -> 0x405c6d4c trace:ole:WINE_StringFromCLSID 0x405c6d4c->{58C2B4D0-46E7-11D1-89AC-00A0C9054129} trace:ole:CoGetClassObject CLSID: {58c2b4d0-46e7-11d1-89ac-00a0c9054129}, IID: {00000001-0000-0000-c000-000000000046} trace:ole:COMPOBJ_DLLList_Add trace:ole:CoUninitialize () err:ntdll:RtlpWaitForCriticalSection section 0x40cd0424 "x11drv_main.c: X11DRV_CritSection" wait timed out, retrying (60 sec) tid=080720a8
This is probably related to something more graphical.
/Johan Gill, johane@lysator.liu.se
* Johan Gill (johane@lysator.liu.se) wrote:
This is probably related to something more graphical.
Probably yes. Here is my current investigation:
Debug: ------
wine --debugmsg +module,+x11drv,+ddraw,+win32,+gdi FF8Config.exe
[...] trace:ddraw:User_DirectDrawSurface_final_release waiting for update thread to terminate... trace:ddraw:User_DirectDrawSurface_final_release update thread terminated trace:ddraw:DIB_DirectDrawSurface_free_dc Releasing DC for surface: 0x403df0a0
[Point 1] X11DRV_SelectBitmap called trace:gdi:GDI_GetObjPtr (0044): enter 1 trace:gdi:SelectObject hdc=00c8 0044 trace:gdi:GDI_GetObjPtr (00c8): enter 2 trace:gdi:GetStockObject returning 44 trace:gdi:GDI_GetObjPtr (0044): enter 3 trace:gdi:GetStockObject returning 44 trace:x11drv:X11DRV_SelectBitmap Before wine_tsx11_lock() err:ntdll:RtlpWaitForCriticalSection section 0x40cd0644 "x11drv_main.c: X11DRV_CritSection" wait timed out, retrying (60 sec) tid=080720a8 [End of point 1]
Code: -----
HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
[...]
/* Change GC depth if needed */ if (dc->bitsPerPixel != bmp->bitmap.bmBitsPixel) { TRACE("Before wine_tsx11_lock()\n"); wine_tsx11_lock(); TRACE("After wine_tsx11_lock()\n"); XFreeGC( gdi_display, physDev->gc ); physDev->gc = XCreateGC(gdi_display, physDev->drawable, 0, NULL ); XSetGraphicsExposures(gdi_display,physDev->gc,False ); XSetSubwindowMode(gdi_display,physDev->gc,IncludeInferiors); XFlush(gdi_display); TRACE("Before wine_tsx11_unlock()\n"); wine_tsx11_unlock(); TRACE("After wine_tsx11_unlock()\n"); } GDI_ReleaseObj(hbitmap); return hbitmap;
static void nop(void) { } void (*wine_tsx11_lock)(void) = nop; void (*wine_tsx11_unlock)(void) = nop;
Why there is no locking mechanism? This should be the problem, shouldn't be?
If running wine with --debugmsg +all FF8Config:
[...] [Point 1] X11DRV_SelectBitmap called 080720a8:Call x11drv.SelectBitmap(403ff140,00000044) ret=407a7268 080720a8:trace:win32:_EnterSysLevel (0x407de7a4, level 3): thread 0x80720a8 (fs 008f, pid 4757) count before 2 080720a8:trace:win32:_EnterSysLevel (0x407de7a4, level 3): thread 0x80720a8 (fs 008f, pid 4757) count after 3 080720a8:trace:gdi:GDI_GetObjPtr (0044): enter 3 080720a8:trace:gdi:GetStockObject returning 44 080720a8:trace:gdi:GDI_ReleaseObj (0044): leave 3 080720a8:trace:win32:_LeaveSysLevel (0x407de7a4, level 3): thread 0x80720a8 (fs 008f, pid 4757) count before 3 080720a8:trace:win32:_LeaveSysLevel (0x407de7a4, level 3): thread 0x80720a8 (fs 008f, pid 4757) count after 2 080720a8:Ret x11drv.SelectBitmap() retval=00000044 ret=407a7268 [End of point 1] [...]
As you can see function SelectBitmap run without any problems and FF8Config works correctly.
Which "debug message slowing" is so important? These in win32:_EnterSysLevel and win32:_LeaveSysLevel. If I disable any TRACEs, messages, etc. in these two functions then running wine 'with --debugmsg +all' FF8Config will hang.
This should be some kind of race condition bug. Or am I wrong? Could someone help me with this? I don't know wine internals too much but I'd like to solve this. Thank you.
Martin