Hi all,

FIFA98 does the following:
Call eacsnd.2: iSNDdirectcaps_(<unknown, check return>) ret=00503092 fs=0237
trace:dsound:DirectSoundCreate DirectSoundCreate (0x421c4228)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer 
(0x40b28794,0x4106fb90,0x400d1730,(nil))
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (structsize=20)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (flags=0x00000001:
DSBCAPS_PRIMARYBUFFER )
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (bufferbytes=0)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (lpwfxFormat=0x40b287b0)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer 
(formattag=0x0001,chans=2,samplerate=22050,bytespersec=44100,blockalign=2,bitspersamp=8,cbSize=0)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer Created buffer at 0x40b287e8
trace:dsound:IDirectSoundImpl_GetCaps (0x40b28794,0x4106fbc4)
trace:dsound:IDirectSoundImpl_GetCaps (flags=0x4106fc5c)
fixme:dsound:IDirectSoundImpl_SetCooperativeLevel (0x40b28794,00000150,3):stub
trace:dsound:IDirectSoundImpl_CreateSoundBuffer 
(0x40b28794,0x4106fc24,0x421c422c,(nil))
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (structsize=20)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (flags=0x00000001:
DSBCAPS_PRIMARYBUFFER )
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (bufferbytes=0)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (lpwfxFormat=(nil))
trace:dsound:IDirectSoundBufferImpl_SetFormat 
(formattag=0x0001,chans=2,samplerate=11025bytespersec=44100,blockalign=4,bitspersamp=16,cbSize=0)
trace:dsound:DSOUND_thread dsound is at pid 1504
trace:dsound:DSOUND_CloseAudio Audio stopped
trace:dsound:IDirectSoundBufferImpl_SetFormat 
(formattag=0x0001,chans=2,samplerate=16000bytespersec=64000,blockalign=4,bitspersamp=16,cbSize=0)
trace:dsound:DSOUND_CloseAudio Audio stopped
trace:dsound:IDirectSoundBufferImpl_SetFormat 
(formattag=0x0001,chans=2,samplerate=22050bytespersec=88200,blockalign=4,bitspersamp=16,cbSize=0)
trace:dsound:DSOUND_CloseAudio Audio stopped
trace:dsound:IDirectSoundBufferImpl_SetFormat 
(formattag=0x0001,chans=2,samplerate=32000bytespersec=128000,blockalign=4,bitspersamp=16,cbSize=0)
trace:dsound:DSOUND_CloseAudio Audio stopped
trace:dsound:IDirectSoundBufferImpl_SetFormat 
(formattag=0x0001,chans=2,samplerate=44100bytespersec=176400,blockalign=4,bitspersamp=16,cbSize=0)
trace:dsound:DSOUND_CloseAudio Audio stopped
trace:dsound:IDirectSoundImpl_Release (0x40b28794), ref was 2
Ret  eacsnd.2: iSNDdirectcaps_() retval = 00023e08 ret=00503092 fs=0237

Call eacsnd.2: iSNDdirectcaps_() ret=005031f7 fs=02c7
Ret  eacsnd.2: iSNDdirectcaps_() retval = 00023e08 ret=005031f7 fs=02c7

Call eacsnd.3: iSNDdirectstart_(<unknown, check return>) ret=0050326d fs=02c7
trace:dsound:DirectSoundCreate DirectSoundCreate (0x421c4228)
fixme:dsound:IDirectSoundImpl_SetCooperativeLevel (0x40b28794,00000150,4):stub
trace:dsound:IDirectSoundImpl_CreateSoundBuffer 
(0x40b28794,0x41cffcf0,0x421c422c,(nil))
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (structsize=20)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (flags=0x00000001:
DSBCAPS_PRIMARYBUFFER )
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (bufferbytes=0)
trace:dsound:IDirectSoundImpl_CreateSoundBuffer (lpwfxFormat=(nil))
trace:dsound:IDirectSoundBufferImpl_SetFormat 
(formattag=0x0001,chans=2,samplerate=22050bytespersec=88200,blockalign=4,bitspersamp=16,cbSize=0)
trace:dsound:DSOUND_CloseAudio Audio stopped
trace:dsound:IDirectSoundBufferImpl_GetCaps (0x40b287e8)->(0x41cffd04)
trace:dsound:IDirectSoundImpl_Release (0x40b28794), ref was 2
fixme:win32:EnterCriticalSection Crst 0x40a8ef64 belongs to process 1085487580,
current is 134605848!
err:mmsys:MULTIMEDIA_GetIData IData not found. Suicide !!!
/usr/local/bin/dwine: line 1:  1473 Terminated              /usr/local/src/wine/wine 
$1 $2 $3 $4 $5 $6 $7 $8 $9


The problem apparently is that the program does a GetCaps by calling the DLL
function iSNDdirectcaps_.
iSNDdirectcaps_ does the following:
- call DirectSoundCreate if no DSound iface active
- call IDirectSound_GetCaps
- call IDirectSound_Release

Now the problem is that in iSNDdirectstart_ the _Release fails as there are
too many references to Dsound iface 0x421c4228.

And it turns out that the iSNDdirectcaps_ _Release has not been successful
in destroying the DSound iface again, as it already had *two*
references (it seems to create and destroy a DSound iface explicitly for
the purpose of getting the caps).

Where is that second reference reference during the iSNDdirectcaps_
coming from ??

Well, it's coming from the primary buffer creation in DirectSoundCreate.
This is the thing that's broken.

How to fix that ?

Either the reference count of two is incorrect when a sound buffer for the
DSound iface exists (in this case the primary buffer created by us).
Or we may *not* create the "dsound" primary buffer within DirectSoundCreate.

-- 
Andreas Mohr            Tel.: +49 7159 800604 private (preferred)
Stauferstr. 6                          927883 main line (family)
D-71272 Renningen       http://home.germany.net/100-30936/
Germany                 languages: german, english, french

Reply via email to