XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

5.1 speaker positions

Last post 08-28-2008 9:27 PM by The Dogtah. 4 replies.
  • 07-24-2008 9:49 PM

    5.1 speaker positions

    I asked this question in the "Game Studio Technologies" part of these forums but it seems like it might be more appropriate here.

    I am working on a game scenario that is based on a player's ability to accurately identify the direction that sounds are coming from. For example an anti-aircraft gunner in fog who hears the in-coming planes long before they become visible. One of the difficulties with developing such a game is knowing exactly where the speakers should be placed. The Dolby standard speaker placement has the centre speaker at 0 degrees, the Front Speakers at between 22 and 30 degrees and the rear ("surround") speakers at 90 to 110 degrees. However, it seems to me that when Microsoft wrote the software that converts an emitter direction into signals to be sent to the speakers they must have assumed that the speakers were at an exact location (eg front at 26 degrees and rear at 100 degrees). It would be very helpful to me to know what exact speaker placements were assumed by Microsoft but I can't find this in the documentation. 

    When I asked this question in theGame Studio part of the forum it was suggested that "this depends on the audio driver. It won't necessarily be the same across all soundcards." But that doesn't seem to be the case. I asked the manufacturer of my home theatre adapter. They say that they pick up the channel data (already mixed into 5 channels) from DirectSound. I have had a look at the DirectSound API but I can't find any reference to the algorithm for assigning emitter positions to channels. Can anyone tell me where in Microsofts documentation this information might be located? Thanks, David.

     

  • 07-26-2008 12:29 AM In reply to

    Re: 5.1 speaker positions

    Hi David.  I'm assuming you're asking about Windows behavior (it's a different story on Xbox).  Here's a partial answer:

    1. If you use software buffers, DirectSound will attempt to mix correctly from a buffer's input channel positions (the ones specified by the buffer's WAVEFORMATEXTENSIBLE.dwChannelMask value) to the actual speaker positions (as reported by the audio driver).  If you don't use WAVEFORMATEXTENSIBLE in your CreateSoundBuffer call, there is no dwChannelMask for dsound to look at so it defaults to a set of standard positionings based on the number of channels (5.1 for 6 channels, etc).  Note also that the driver may lie about the number of attached speakers and their position, perhaps because the user specified them wrong in the control panel and the driver has no way of knowing the true setup.

    2. Each input channel is mapped to the output channels like this: if there's already a speaker at the channel's intended position, map it 100% to that speaker, of course; otherwise, find the two "closest" speakers (one on either side of the intended position) and split the signal across them proportionally to how close they are (in azimuth angle terms).

    3. I can't tell you off the top of my head what speaker position angles we used in these calculations, but I believe it was simply 45° for front-right, 90° for S-R, 135% for B-R, etc.

    4. If you use hardware DirectSound buffers, all of this is implemented internally by the driver so you'd have to ask each manufacturer what they do... I wouldn't expect it to be wildly different than what we do, though.  (At least subjectively it should sound similar.)

    5. This is probably a little different on Windows Vista, since the entire audio system was revamped.  (I'm still on XP myself.)  The good news is that behavior should be more consistent across devices, since Vista doesn't support hardware acceleration at all.  (In fact, consistency was one of the reasons to do this in the first place.)

    I can't vouch for 100% accuracy, but I hope that helps -

    Dugan Porter
    Game Audio Team
    Microsoft

    Dugan Porter [MS]
    Game Audio Team
  • 07-26-2008 3:20 AM In reply to

    Re: 5.1 speaker positions

    Thanks very much for replying Dugan. Yes, I am asking about Windows XP. I am using the XNA framework so I am not making direct calls to DirectSound routines like CreateSoundBuffer(). I don't know whether XNA usesWAVEFORMATEXTENSIBLE in calls to CreateSoundBuffer(). It sounds like you are saying that there are two possiblities: either the XNA designers used their own channel mask (in which case they specified the speaker positions for a 5.1 system), or they don't (in which case the speaker positions are those specified as defaults by the DirectSound designers. Can you confirm that I have this right?

    Thanks, David.

  • 07-31-2008 9:37 PM In reply to

    Re: 5.1 speaker positions

    Dugan:

    2. Each input channel is mapped to the output channels like this: if there's already a speaker at the channel's intended position, map it 100% to that speaker, of course; otherwise, find the two "closest" speakers (one on either side of the intended position) and split the signal across them proportionally to how close they are (in azimuth angle terms).

    I did some testing with my system (Windows XP running an XNA application -> Sondigo home theatre adapter -> Rotel decoder). The best separation I can get is at 0 degrees for the front speaker, 45 degrees left and right for the front left and right speakers and 140 degrees left and right for the rear speakers. This suprises me because it is way outside of the Dolby specifications. I still can't work out if these angles are determined by Windows XP, the XNA system or the Sondigo hardware (although Sondigo say it isn't). What should I be reading to understand this better? David.

  • 08-28-2008 9:27 PM In reply to

    Re: 5.1 speaker positions

    I am still trying to find the exact speaker positions that are assumed by XNA for a 5.1 system. I am surprised that this information is not available as part of the specification for the XNA system. I am reduced to experimenting with a number of different values and seeing which is the best. Please, someone tell me where I can locate this information. Is there a specification document somewhere?

    This is a duplicate post (also in the XNA managed forum). I'm feeling a bit stuck.

    David.

Page 1 of 1 (5 items) Previous Next