Hi everyone, I am having probems with DirectSound again. I have a function in which I call once the engine is no longer needed and it needs to be shutdown. Anyway it cleans up the context and destroys the created heap and killls the mixing thread. Anyway I have a problem, I release the DirectSound secondary buffer with the following code (BTW I'm using Chris Hobbs DS include)


DSBINVOKE Release, (DSBuffer object)


That function works fine and clears EAX.

However when I try to release the main DirectSound object I created at initialization with:



DSINVOKE Release, (DS object)



It seems to lock my CPU in a infinite loop and the function never returns control back to my program any idea as to what is happening?

BTW, I use Win2K and have a Hercules GameSurround Muse Lt (CMI8738) did the same thing on my onboard VIA 686A

I do the code in that order
Posted on 2003-02-19 18:09:22 by x86asm
1)Have you stoped by explicit commands and/or waited for any primary or secondary sound buffers to stop playing? before releasing objects?
2)is that code in a separated Thread ?
Posted on 2003-02-19 18:50:36 by BogdanOntanu
When I issue the shutdown command to the mixer thread (which uses 2ndary buffer), the mixing thread stops the secondary buffer and then terminates. The main thread meanwhile sleeps to ensure than the mixing thread has registed it. Then once the sleep interval is over I first release the DirectSoundBuffer, then the DirectSound and then my CPU is locked from then, could it be a threading problem?
Posted on 2003-02-20 15:41:51 by x86asm
 

mov eax,RenderedMusic
mov eax,[eax]
push RenderedMusic
call dword ptr[eax+72] ;stop snd
;mov eax,RenderedMusic
;mov eax,[eax]
;call dword ptr[eax+8] ;release snd
mov eax, iDREAMER.DSOUND
mov eax, [eax]
push iDREAMER.DSOUND
call DWORD PTR [eax+8];release DS

RenderedMusic is a secondary buf
Posted on 2003-02-23 00:03:56 by Ultrano

 

mov eax,RenderedMusic
mov eax,[eax]
push RenderedMusic
call dword ptr[eax+72] ;stop snd
;mov eax,RenderedMusic
;mov eax,[eax]
;call dword ptr[eax+8] ;release snd
mov eax, iDREAMER.DSOUND
mov eax, [eax]
push iDREAMER.DSOUND
call DWORD PTR [eax+8];release DS

RenderedMusic is a secondary buf


Hey thanks Ulrano, it seems for some strange reason when I got rid of the debugger the main DirectSound object didnt refuse to get rid of itselve. So I guess it was my dbugger, many thanks guys, :D
Posted on 2003-02-23 12:12:50 by x86asm