DirectSound Notifications - MATTER OF LIFE OR DEATH -)

Started by
4 comments, last by Michele Caletti 18 years, 8 months ago
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.
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".

Niko Suni

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.
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.
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.
Thanks a lot

It's ok to know that it's not only an issue of my own.

Thanks,


Michele.

This topic is closed to new replies.

Advertisement