Search Unity

Audio position issue

Discussion in 'Editor & General Support' started by chrischris, Aug 30, 2007.

  1. chrischris

    chrischris

    Joined:
    Oct 18, 2005
    Posts:
    19
    I am having problems with 3D positioning of audio. Attached is a very simple project, containing:

    - Main camera at default transform ( 0, 1, -10 ) with an AudioListener.
    - Sphere at ( 0, 1, 10 ) with a looping AudioSource.
    - Scene "SlideX": The camera ping-pongs along the X-axis. The audio correctly moves through the stereo field, corresponding to the visual relative movement of the sphere.
    - Scene "RotateY": The camera rotates around the Y-axis. The audio seems to move in the wrong direction through the stereo field, opposite of the visual relative movement of the sphere.

    I have tested this on a MacPro 2x3GHz and an iMac G4 with equal results.

    Can anyone else verify this behavior? Or perhaps point out something I might be missing? :) I have not submitted a bug report yet as it could be user-error.

    Thanks!
     

    Attached Files:

  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yeah, unfortunately the 3D audio seems to be misbehaving. I submitted a bug report about this a while ago, although I haven't heard anything, so I wonder if it might be worth someone else submitting too. I was wondering if it might be an endian issue as I'm on PPC, but it seems not. The weird thing is, unless I'm completely misremembering, I think it used to work right with 1.5.

    --Eric
     
  3. chrischris

    chrischris

    Joined:
    Oct 18, 2005
    Posts:
    19
    Thanks for the info. I submitted a bug report with the project attached. The problem is a major bummer as it is a showstopper for a viable first-person game. Manual attenuation without stereo panning won't cut it unfortunately for today's savvy player. I remember similar problems with audio in UT2004 way back when it came out -- the common element with Unity being OpenAL ( correct me if I'm wrong ). My best hope for now is that the audio engine receives some much-needed love in 2.0 :wink:
     
  4. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Audio is my main bag, so I take issue with the lack of great audio implementation in Unity thus far. However, the rest of Unity makes up for the audio stuff, at least at the Indie price point.

    That being said, just run everything in mono. I find mono to be pretty convincing, considering the screen is right in front of you. Someday, if we have widespread holographic displays or something, mono won't be enough. At this point in time, though, I know too many people who still put one speaker on top of the other because that's the best use of desktop space. :?

    Oh, and I have yet to see surround sound speakers set up properly outside of the installations within places like Best Buy. I have even been in a couple professional recording studios where it wasn't done by the book. Having a bunch of speakers around is great for special effects and separation, but I wouldn't plan on anyone hearing 3D audio where it's actually "coming from".
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yeah, but in a first-person game, objects in the game aren't necessarily in front of you. I don't think mono has been acceptable in this sort of game since Doom.

    I find I do noticeably better in UT2004 with surround vs. stereo, since you can tell if you're being hit from behind instantly, instead of spending that crucial moment trying to figure it out. Unfortunately the surround in UT2004 is an unstable hack on the Mac. On the PC, surround is becoming quite standard, but the Mac is lagging sadly behind here...I think World of Warcraft is the only Mac game that features it reliably. I'd love to see stable and working surround in Unity, but I'd settle for working stereo. ;)

    --Eric
     
  6. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Eric, you're a very smart person. You probably know how to set up your speakers, and you probably understand how to use them to play better. All I'm saying is that we can't expect this from that many people.

    I've been privy to experiencing surround sound with a full-bandwidth, uncompressed channel for each (active) monitor. It's amazing and I wish it was actually feasible to allow this experience to be available to consumers, but we're just not there yet. I don't even want that kind of wiring in my project studio. Why would a consumer want to deal with it when the only speakers (seemingly) available aren't good anyway?

    I played Resident Evil 4 last year directly into a 12-inch CRT TV with one speaker on the side, and was thoroughly spooked. I started hating that game after a while, but the first few hours were amazing. Good game sound is like a fine piece of music. It still sounds good even if it's being played on AM radio in your jalopy.
     
  7. chrischris

    chrischris

    Joined:
    Oct 18, 2005
    Posts:
    19
    I'm not aware that Unity has any actual "surround sound" output functionality. ( ProLogic, DTS, etc ) That is indeed an issue irrelevant to most users. The problem at hand, however, has nothing to do with surround sound. Proper stereo ( 2 channel ) placement is simply a baseline requirement for any serious type of first-person perspective game. If a gun fires to my left, I should not hear it to my right, which is what can end up happening now.
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Uh...if you say so. ;) Thing is, surround sound is starting to become an expected feature in PC games. There are quite a lot of 5.1 (and 4.1, and 7.1) "computer' speaker systems out there, and while the quality of many may be suspect (I had a Logitech system briefly, and gave it up in favor of a "real" Onkyo receiver setup), the number of people using them is only going up.

    But anyway, yeah that's not completely relevant for now; I'd just like to have working stereo sound to start with. :) The only way I know of to make sounds mono is, ironically, to make them stereo (so the directional feature is disabled), which of course increases asset size. So in the meantime I've just been doing stuff where the camera doesn't move, because that's the only way to get consistent sound, unfortunately.

    --Eric
     
  9. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Wow, you're right. I just haven't had a chance to see how bad it was before now. I checked out this project folder. "RotateY" made me kind of mad! "SlideX" was awesome! The combination is irritating, because now I know it CAN be awesome, but can't use it! :evil:

    Also, I don't pretend to understand endianness very well yet, but I'm on a MacBook Pro, here.

    From the manual:
    Then again, I guess I can't expect much after having read this:
    MAYBE NOT TO MY GRANDPA, who had grenades blow up close to his head! I'm telling you, this is the fault of crappy speakers being so proliferated in this world. Nobody even knows what good audio sounds like, because consumer speakers can't reproduce a reasonable amount of frequencies reliably. I don't even have money for really great monitors, but the difference between even "cheap" active pro monitors and consumer speakers is INSANE.

    The fact that every single consumer surround sound system uses a receiver/amplifier is the worst part of the whole situation, in my opinion. The only way to get what I would consider to be good surround sound is to send a balanced signal to a full-range active monitor, for EACH channel. Yes, that means each individual speaker cabinet requires a fat cable and a power cord being plugged into it.

    The thing is, there really isn't any way to even create this stuff at a reasonable price! I tried getting a Firewire audio interface with six balanced line outputs, hoping to get into surround music creation, but the idiots who made it only allowed control of TWO channels with the volume knob. And OS X system volume control didn't work with it, either.

    Long story short, the world of surround sound is currently a world of crap, and stereo still rules the game as far as I'm concerned. At least Apple forces you to set up your speakers right by placing them right into the display, even if the speakers themselves are rubbish.
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    PPC = big endian, x86 (Intel) = little endian; the order in which bytes for large numbers are stored in memory. A moot point, since the problem happens on all Macs it seems like. ;)

    :D I'm far from an audiophile and don't have professional equipment, but personally I use 44khz where possible...still I find textures usually take up the large majority of space in a project, so I don't think that's really an issue....

    --Eric
     
  11. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    The 44k is appreciated here. I actually do most of my recording at 96kHz, because then I can pitch shift things down better without them sounding dull. I wish Apple would embrace HDMI already, because it can carry 8 channels of uncompressed, 24-bit, 192 kHz audio. It also doesn't necessitate those stupid archaic screw-in bits like DVI. Still, I don't see much of a point in delivering anything over 44.1/48 kHz audio. Nobody's speakers can reproduce higher frequencies very well, if at all.

    And I'm not what I would consider an audiophile either, though I would consider myself to be an audio professional. I just like having the ability to reproduce sound at a quality level that makes it sound as great as possible to my ears for what I arbitrarily consider a reasonable price tag. This can be done in stereo for a few hundred dollars. To me, ogg vorbis is so good that I can use the even lowest bitrate settings and still be happy with how it sounds. I am very happy that it has been embraced in game audio. (Screw Apple for no ogg support on iPods, though.) I would never go below 44.1k for audio delivery as long as we're using vorbis. It's good enough that it can do the high frequencies justice, no matter how many bits you allow it.
     
  12. chrischris

    chrischris

    Joined:
    Oct 18, 2005
    Posts:
    19
    Can we get a word on this from OTEE? :) This thread ( http://forum.unity3d.com/viewtopic.php?t=5578 ) references the problem as well, but the best official reply is "... its a fairly well tested code path ...". Hmm... :wink:

    I know this must be an extremely busy time at OTEE with 2.0 coming, so anything as simple as "it will be addressed in 2.0" or "you're doing it wrong" or "yup, it's broken" would be great. I'll need to quickly start rolling a cross-platform audio plugin otherwise ( bleh ) as the current state is unusable for FPS work.[/url]
     
  13. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    I understand if OTEE feels the need to be secretive about this at the moment, but audio really is the weakpoint in Unity right now, for me. Some of my favorite games are rhythm games (Dance Dance Revolution, Space Channel 5, Guitar Hero, Percussion Master), and I can't make anything similar right now.

    As somebody with a background appropriate for making such games, it's quite sad, really. :cry:

    I care about positional sound, as well, of course, but the other stuff is actually more important to me personally.
     
  14. Samantha

    Samantha

    Joined:
    Aug 31, 2005
    Posts:
    609
    We have reproduced the issue discussed here and it is on the plate for upcoming fixes.
     
  15. chrischris

    chrischris

    Joined:
    Oct 18, 2005
    Posts:
    19
    Great -- thank you!
     
  16. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Fantastic! That's all we need to hear.

    --Eric