Jump to content
  • Advertisement
Sign in to follow this  
Michele Caletti

DirectSound Notifications - MATTER OF LIFE OR DEATH -)

This topic is 4837 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

I'm really blocked... i've implemented streams largely following the DSound C++ example in the SDK, setting up the notification points. It works fine. I've added SFX and something strange happened: when a SFX buffer plays and reaches what *would* be a theorical notification point (e.g. every 32k) i get the notification message.. .. on the stream! it's 100% related, not casual or occasional. i really can't figure how it happens since i didn't add the notification flag on sfx buffer creation (and the notification interface querying on them obviously fails if tested..) Anyone ever had this problem? I'm going mad... Thanks a lot Michele.

Share this post


Link to post
Share on other sites
Advertisement
When you get the effect interfaces from a sound buffer, the buffer back-end isn't actually copied anywhere - the DirectSound engine mixes the effects real-time by using the original buffer sound data as the source for the effect.

If you create a buffer with effects, it is only natural that the notifications occur on the original buffer no matter what effects are playing.

Please tell me if I misunderstood your problem [smile]

EDIT: Do explain exactly what you mean by "sfx buffer creation".

Share this post


Link to post
Share on other sites
Thanks for being that fast..

I'll try to be clearer:
- sfx buffer creation means calling CreateSoundBuffer() on the device..

-i don't have any working effect at the moment. just enabled them by creation flags.

-i have 1 static 2D sound buffer and 1 streaming buffer. suppose that the 2D sound is 128k long, and on the other side, i expect notifications on the streaming buffer each 32k. i get the correct notifications from the stream but, also, when the 2d sound buffer reaches 32k muliples of played data inside itself i get notifications! so the stream-associated thread wakes up thinking the stream has to be fed, while has not reached a proper notify point. in fact, i get, in this case, 4 extra notifications from the normal sound buffer, that had not notifications enabled.

In other words it behaves like EVERY buffer that is playing is generating notification events just like streaming buffers.

Thanks

Michele.

Share this post


Link to post
Share on other sites
Ok

Figured out something more. I've tried all combinations of HW/SW voice allocations between 2D, 3D voices and streams.

if 2D or 3D voices are running in HW and streams are in HW the bug will happen. all other combinations are safe. Looks like a driver (or dsound) bug, in my opinion. i have

Directx: SDK December 2004, debug runtime
Sound Board: Creative Audigy2, latest drivers.

let me know if someone has experienced the same even on different configurations.

Bye,

Michele.

Share this post


Link to post
Share on other sites
I had the same problem. Here is the explanation from SDK:


Notifications for hardware-controlled buffers are not provided reliably by all drivers; some may generate false notifications. To work around this problem, you can call IDirectSoundBuffer8::GetCurrentPosition whenever your application receives a notification, to be sure that the notification position has actually been reached. Another solution is to create the buffer in software.


So try to create stream buffers with DSBCAPS_LOCSOFTWARE flag.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!