Source Code Project Mantis - FSSCP
View Issue Details
0002624FSSCPsoundpublic2012-03-05 22:192012-07-01 20:59
Assigned Toiss_mneur 
Platformx64OSWindows 7OS Version
Product Version3.6.14 RC5 
Target VersionFixed in Version 
Summary0002624: Sound does not pan correctly in cutscenes
DescriptionFor some reason, if a cutscene plays or the player changes view (e.g., by using the joystick hat), sounds are panned based on the camera's position and the player ship's heading. For example, if the player ship is facing forward but the camera is facing right, sounds will be panned as if the camera is facing forward.

This seems to happen regardless of the output device setting. Using the -no_3d_sound flag fixes it (but causes other positioning problems).
Steps To ReproduceThe attached mission demonstrates this problem. In it, the warp sound will play in each of these locations in order:

1) 200 meters in front
2) 1,000 meters in front
3) 200 meters to the right

This will happen four times with different camera and ship locations and headings:

1) Camera in ship, ship facing forward
2) Camera 800 meters behind ship, both camera and ship facing forward
3) Camera 800 meters behind ship and facing right, ship facing forward
4) Camera 800 meters behind ship and facing forward, ship facing right

The mission will tell you how the camera and ship are positioned as well as the proper panning and volume. If the sound is not panned correctly in current builds, the "panning" line will be red.
TagsNo tags attached.
Attached Fileszip (1,923) 2012-03-05 22:19
log fs2_open.log (35,080) 2012-03-05 22:19
png mantis-2624-layout.png (4,270) 2012-05-12 22:03

2012-05-10 02:50   
I can confirm this bug. freespace.cpp:4082 is the problem. The Listener location is set to the camera's position, but the player's speed and orientation.
2012-05-12 16:52   
After reviewing the code. I think I may have misunderstood what the problem is.

Everything appears to be working as intended. I have attached an image that outlines the positions of the sounds as specified in the mission file. They are all being played as one would expect.
2012-05-12 17:20   
(Last edited: 2012-05-12 17:23)
Are you sure it's working properly? When you play the mission, do the positions of the sounds match the text displayed in-mission?

When you test, make sure that you're *not* using the -no_3d_sound flag. Also be sure to listen with something that has good stereo separation, such as stereo headphones (not laptop speakers).

EDIT: In the image you posted, the 2's that are right of the ship should be 3's.

2012-05-12 22:35   
[Fixed the image]

Okay. Seems I had -no_3d_sound enabled from testing previously.

So, it seems I was correct with what was causing this problem here. Please try the attached build.

On the topic of no_3d_sound issues, I don't know what you mean about the "other" positioning problems with no_3d_sound because it seems to be working fine (considering it just confused me). Please open another ticket describing it in more detail as I don't see any problems with it as it is right now.
2012-05-12 22:38   
Hmm. Seems the build is too large. Build is here:
2012-05-12 23:40   
Yay! Your build solved the problem.

As for the -no_3d_sound problem, dynamic panning* does not work when that flag is used. I believe the old sound code (from 3.6.12 and earlier) also behaved this way.

*I think this is the right term. I'm referring to sound effects being panned while they're played.
2012-05-16 22:55   
Fix committed to trunk@8788.
2012-07-01 20:59   
Fix committed to fs2_open_3_6_14@8934.

Issue History
2012-03-05 22:19YarnNew Issue
2012-03-05 22:19YarnFile Added:
2012-03-05 22:19YarnFile Added: fs2_open.log
2012-05-10 02:50iss_mneurNote Added: 0013535
2012-05-10 02:50iss_mneurStatusnew => confirmed
2012-05-12 16:15iss_mneurFile Added: mantis-2624-layout.png
2012-05-12 16:52iss_mneurNote Added: 0013551
2012-05-12 16:52iss_mneurAssigned To => iss_mneur
2012-05-12 16:52iss_mneurStatusconfirmed => feedback
2012-05-12 17:20YarnNote Added: 0013552
2012-05-12 17:20YarnStatusfeedback => assigned
2012-05-12 17:23YarnNote Edited: 0013552bug_revision_view_page.php?bugnote_id=13552#r120
2012-05-12 22:03iss_mneurFile Deleted: mantis-2624-layout.png
2012-05-12 22:03iss_mneurFile Added: mantis-2624-layout.png
2012-05-12 22:35iss_mneurNote Added: 0013553
2012-05-12 22:35iss_mneurStatusassigned => feedback
2012-05-12 22:38iss_mneurNote Added: 0013554
2012-05-12 23:40YarnNote Added: 0013555
2012-05-12 23:40YarnStatusfeedback => assigned
2012-05-16 22:55Changeset attached => fs2open trunk r8788
2012-05-16 22:55guestNote Added: 0013562
2012-05-16 22:55guestStatusassigned => resolved
2012-05-16 22:55guestResolutionopen => fixed
2012-07-01 20:59ZacamChangeset attached => fs2open fs2_open_3_6_14 r8934
2012-07-01 20:59ZacamNote Added: 0013759