Jump to content
  • Advertisement
Sign in to follow this  

Sound in remote desktop does not work after a disconnect/reconnect

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

Hi all,

This is more of a feedback/general question than any kind of specific problem... kind of. A while ago I wrote a sound engine with SlimDX. While writing it, it was pointed out to me that I was creating a new XAudio2 device and mastering voice for each sound I was creating and that this probably wasn't the best approach. It was fine to use a single static instance of these and I created a static manager class to initialize and shut down the sound engine, that is, to create and destroy my XAudio2 device and mastering voice. Everything worked great and no problems!

Until now that is... through a rather random incident during testing, it turns out that when a remote desktop session is disconnected, after reconnecting sound won't work. I did some digging around and my guess is that the Windows playback device, Remote Audio, goes away when the session closes and a new one is created when the new session connects. I would then have to guess that the XAudio2 device that was created is no longer valid. Unfortunately there appears to be no exception or error to indicate this... as far as SlimDX/XAudio2 is concerned, there are no problems at all. It continues to play sounds, it's just that nothing happens.

I created a test application and modified my code so that each sound would create/destroy it's own device and mastering voice. Doing this, sounds created before the session disconnect no longer work; however, sounds created after reconnecting do play correctly.

So I have two questions:

1. Is it reasonable to have each sound create/maintain it's own XAudio2 device and mastering voice? The advice I was given, which makes a lot of sense, was that this is wasteful; however, being unable to create sounds after losing the remote session is a bit of a problem for us.

2. Is this something anybody else has encountered? Does anyone have any thoughts on how to overcome this problem?

I appreciate any help anyone can give. Thank you! :)

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!