Archived

This topic is now archived and is closed to further replies.

Exclusive cooperative level in DSound

This topic is 5011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! Can anyone tell me how to make my application have access to the playback buffer and the capture buffer while it loses focus or is minimized (VC++)? Thanks.

Share this post


Link to post
Share on other sites
I use the exclusive cooperative level (though not for the purpose you mentioned) and just for the fun of it I ran a transmission and minimized all the windows to see if the sound would continue and it does.

Just experimental evidence; I have not tried to run the program competing with other soundcard hogs (like Cakewalk).

Brian

Share this post


Link to post
Share on other sites
So how do you do it? DSSCL_EXCLUSIVE doesn''t fix the problem in DirectSound 8 as it is defined with the same value DSSCL_PRIORITY is.

Share this post


Link to post
Share on other sites
I apologize...at one time I used the EXCLUSIVE but I now use the PRIORITY. The reason is I specify the format of the primary buffer. On the other hand, I never actually write to the primary buffer, just the secondary buffer. I did this for full duplex purposes as the SDK example shows it. I do not understand why this has to be done, because true full duplexing still does not work for all sampling rates.

Nevertheless, by creating and formating the primary buffer, and only using secondary buffers, the end result is that I have all the advantages of secondary buffers and as a byproduct, get some soundcard hardware priority. That is very important for my application which is a digital radio decoder/encoder. Unfortunately for my application, other applications can still use the soundcard which will destroy my signals. I am guessing that is because I do not actually use the primary buffer.

There is nothing anywhere that has explained to me the hows and whys of all this. I have come up with a lot more behaviors I do not understand. Unlike the Direct X stuff, the amount of info on all the Direct Sound stuff is quite limited.

In any case, what happens when you try the PRIORITY setting or is that something you don''t want?

Brian

Share this post


Link to post
Share on other sites
I took out all the primary buffer creation stuff to see what would happen. Ran the transmitter and out came all the sounds. Then I minimized all the windows and the sound still came. I ran a jukebox program and both sounds are playing simultaneously.

I don''t know what else may have happened by not formatting the primary buffer, (the receive and send timing and other full duplex problems) but as far as the sound still playing when minimized, it has no effect.

But that doesn''t work for you? What flags do you use in the description of the secondary buffer? I use

dsTXbd.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2;

Maybe it''s the "GLOBALFOCUS" that does it. The wording certainly suggests it!

Well, I looked at the docs and here it is!

DSBCAPS_GLOBALFOCUS
The buffer is a global sound buffer. With this flag set, an application using DirectSound can continue to play its buffers if the user switches focus to another application, even if the new application uses DirectSound. The one exception is if you switch focus to a DirectSound application that uses the DSSCL_EXCLUSIVE or DSSCL_WRITEPRIMARY flag for its cooperative level. In this case, the global sounds from other applications will not be audible.

Guess that answers it.

Brian


Share this post


Link to post
Share on other sites