Priority level

gianni
11-14-2001, 05:21 AM
I'm here with a new question.
I'm trying to use DSound as fast and effective as I can: what I have in mind is a sort of synth with a short response time (no more than a few tens of milliseconds). So now I'm trying to write directly into the Primary Buffer: it should give less CPU load and less average distance between write and play cursors (I've seen this behaviour on two different PCs: a 233 MMX and a P III 733). To do that I use the method SetCooperativeLevel with the DSSCL_WRITEPRIMARY option.
And here comes the problem: when testing inside the debugging environment, it works. When instead I compile and run the executable, the method gets the runtime error 887800a0 ("DSERR_OTHERAPPHASPRIO - Another application has a higher priority level, preventing this call from succeeding").
I have the suspicion that the "higher priority level" application is the standard Win98 mixer.
Does anyone have ideas to overcome this problem?

Squirm
11-14-2001, 12:48 PM
You might try adding:

<pre>SetCooperativeLevel DSSCL_WRITEPRIMARY Or DSSCL_PRIORITY</pre>

Or you might want to try:

<pre>SetCooperativeLevel DSSCL_WRITEPRIMARY Or DSSCL_EXCLUSIVE</pre>

Thus, if it IS the win98 mixer, using the second option I showed will completely block all other applications. Using the first line would give your app PRIORITY over the mixer. Try it and see.

Good luck.

gianni
11-15-2001, 03:13 AM
Using the parameters DSSCL_PRIORITY Or DSSCL_WRITEPRIMARY, I get "Error 5: invalid procedure call or argument"
In the other case, it does not recognize the value DSSCL_EXCLUSIVE (variable not defined)
I suppose it accepts only a single value among NORMAL, PRIORITY, WRITEPRIMARY

Squirm
11-15-2001, 05:49 PM
Well, if the Consts arent working you could use the raw numbers instead:

DSSCL_WRITEPRIMARY = 4
DSSCL_EXCLUSIVE = 3
DSSCL_PRIORITY = 2
DSSCL_NORMAL = 1

Remember not to add them with + , use the Or keyword.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum