multiple sound issues

Do you need help? Ask here!

Bug reporting belongs here: http://developer.wz2100.net/newticket
Post Reply
GiGaBaNE
Trained
Trained
Posts: 262
Joined: 24 Jun 2007, 17:51

multiple sound issues

Post by GiGaBaNE »

Hi all, been playing this version of warzone for a few days now, normally i play the cd based release patched to ver 1.12, but im liking a lot of the features added such as mouse scroll and map sort by players =)

i know this project is no walk in the park but im hoping for a little help with sound from you guys i have 2 issues i need to resolve.

first, i have the same problem as a lot of you with only so many sounds playing at once, and i just love to hear my machine guns blazing. i saw a few snippets about configuring openal but it went above my head, i see no way of changing the settings, and no easy to follow readme's on the openal website.

Second and by no means less annoying is the sound effects range,  i play in 1280x1024 rez as any good commander would, wanting to see as much as possible of the battle, and my sound is off center and very short ranged. here is an example picture of an oil derek with its sound boundries, if the oil derek moves out of the red square i cant hear it.
(NOTE: have attached picture because i dont know how to make it part of the post)

my request is a way to center the sound and stretch the boundries to the full screen or maybe slightly beyond.
Attachments

[The extension has been deactivated and can no longer be displayed.]

Version: master-20110320 QT
VGA:Nvidia GeForce GT 220
Driver in use: 6.14.12.6658
CPU: AMD Athlon 64 X2 Dual 4200+
RAM: 2 x DDR-II 1GB corsair
OS: WinXP sp3
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: multiple sound issues

Post by kage »

that's odd... iirc, i can hear derricks if they're more than a screen away at 1600x1200
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: multiple sound issues

Post by DevUrandom »

I found this to be a little bit weird and behaving differently on Windows than on Linux.
Eg. see https://gna.org/bugs/?6801
GiGaBaNE
Trained
Trained
Posts: 262
Joined: 24 Jun 2007, 17:51

Re: multiple sound issues

Post by GiGaBaNE »

sounds like my one DevUrandom, tho' the boxes i drew are the only locations i get any sound at all from on screen sprites. Voice comes over just fine. i will see if it runs in rez 320x240 because i suspect that the sound will be "full screen" at that or slightly lower rez, this is just speculation based on the 'shift' of the area of sound vs resolution.

fyi this box is win xp pro with 'realtek AC'97 Audio for Via, driver ver 5.10.0.5420'
will check on another box
Version: master-20110320 QT
VGA:Nvidia GeForce GT 220
Driver in use: 6.14.12.6658
CPU: AMD Athlon 64 X2 Dual 4200+
RAM: 2 x DDR-II 1GB corsair
OS: WinXP sp3
GiGaBaNE
Trained
Trained
Posts: 262
Joined: 24 Jun 2007, 17:51

Re: multiple sound issues

Post by GiGaBaNE »

LOL ok my speculation was way off, i checked at that lower res and the area of sound moved way to the bottom of the screen, like one inch high and 3 inches wide...most centered res seems to be 800x600, but the area of sound is still very small, i just want to hear things that are on my screen...have no such problems with the official release, so im certain its something in the code, most likely that openal stuff, but i have no idea how to configure it
Version: master-20110320 QT
VGA:Nvidia GeForce GT 220
Driver in use: 6.14.12.6658
CPU: AMD Athlon 64 X2 Dual 4200+
RAM: 2 x DDR-II 1GB corsair
OS: WinXP sp3
superdau
Greenhorn
Posts: 9
Joined: 10 Jul 2007, 23:00

Re: multiple sound issues

Post by superdau »

I have the same problem. I finally got the sound working at all (had constant crashes with OAL). But now the sound is totally off center. Even at 800x600 I don't hear anything that is in the lower half of the screen, but in return hear oil derricks extremly loud although they are in the mist far up the screen. There also seems to be a vertical "nosound stripe" one fourth from the right of the screen. If an oil derrick is right in there I don't hear it, if I move the camera a little to the left it's extremly loud again.
GiGaBaNE
Trained
Trained
Posts: 262
Joined: 24 Jun 2007, 17:51

Re: multiple sound issues

Post by GiGaBaNE »

i have now checked the game on several machines. and several are using ac97 but with success, so im not sure if its a driver build problem, or different styles of hardware implementation of that codec..

if a dev wants to take this issue up, ill give them the specs of 4 or 5 machines im using the game on with a brief on how the sound works on that hardware..
Version: master-20110320 QT
VGA:Nvidia GeForce GT 220
Driver in use: 6.14.12.6658
CPU: AMD Athlon 64 X2 Dual 4200+
RAM: 2 x DDR-II 1GB corsair
OS: WinXP sp3
superdau
Greenhorn
Posts: 9
Joined: 10 Jul 2007, 23:00

Re: multiple sound issues

Post by superdau »

I've installed the newest drivers available from nvidia, but it didn't change anything (except that the new driver has less features than the previous one). Same off-center problem, same volume problem.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: multiple sound issues

Post by Per »

I always thought there was something odd with the oil derrick sound, because it is so damn loud on my system compared to everything else. However, I have never taken the time to sit down and actually learn OpenAL...
"Make a man a fire, you keep him warm for a day. Set a man on fire, you keep him warm for the rest of his life."
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: multiple sound issues

Post by Giel »

Per wrote: I always thought there was something odd with the oil derrick sound, because it is so damn loud on my system compared to everything else. However, I have never taken the time to sit down and actually learn OpenAL...
It's got nothing to do with OpenAL AFAIK. It's the result from the sound code simply ignoring the volume settings as provided in audio.cfg and frontaud.cfg.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
superdau
Greenhorn
Posts: 9
Joined: 10 Jul 2007, 23:00

Re: multiple sound issues

Post by superdau »

Ok, maybe I found an explanation for only hearing in the upper half of the screen: as soon as I select 4-channel-audio in my audio-mixer I sometimes have no sound coming from the rear speakers (only in this game). When it worked, sound for units that were on the middle of the screen could be heard in the rear speakers, which felt very unnatural. Why is sound coming from behind when the units are in front of you? It seems the "center" must be realigned in the game. Btw. this seems related to a camera issue. It's the same when using the map to move the camera around: the point you clicked there is on the far end of the view. So before you can even select units or buildings on the point you clicked (e.g. the green dot on the mini map), you have to scroll up the screen.
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18
Contact:

Re: multiple sound issues

Post by Giel »

Thanks for that explanation; I think you made me help realize what the real cause to this problem might be: a wrongly calculated "listener" orientation.

Problem is that OpenAL uses an "up" and "at" vector to determine the listener's orientation. And to be quite honest I wouldn't know how these relate to something like pitch, yaw and roll (like in an aircraft).

Quite precisely I think it's related to this piece of code in lib/openal_track.c:

Code: Select all

/** sets player's sound orientation
 * \param iX pitch in degree (current function implementation ignores this)
 * \param iY roll in degree (current function implementation ignores this)
 * \param iZ yaw in degree
 */
void sound_SetPlayerOrientation( SDWORD iX, SDWORD iY, SDWORD iZ )
{
#ifndef WZ_NOSOUND
	//~~~~~~~~~~~
	float	ori[6];
	//~~~~~~~~~~~

	// convert params to rad
	// float pitch = (float)iX * M_PI / 180;
	// float roll = (float)iY * M_PI / 180;
	float yaw = (float)iZ * M_PI / 180;

	ori[0] = -sin( yaw );
	ori[1] = cos( yaw );
	ori[2] = 0;
	ori[3] = 0;
	ori[4] = 0;
	ori[5] = 1;
	alListenerfv( AL_ORIENTATION, ori );
#endif
}
ori[0,1,2] are the x, y and z coordinates of the "up"-vector, while ori[3,4,5] are the coordinates for the "at"-vector.
So if you see anything wrong there (which wouldn't surprise me really), or better yet know how to fix that, please explain/tell me.
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
superdau
Greenhorn
Posts: 9
Joined: 10 Jul 2007, 23:00

Re: multiple sound issues

Post by superdau »

You mean me? Ok, I've never programmed a game, let alone openal, but nevertheless I looked at openal now and the problem is mainly mathematical, so let's give it a try.

First the roll angle isn't needed, because as I see from the game you can't "roll". If this sometime should be possible - I envision a chasecam on a plane ;-) - it would have to be taken into account in the up vector only.

The at vector would be (maybe the signs have to be changed, I don't know the convention):

Code: Select all

	ori[0] = -sin( yaw ) * cos(pitch);
	ori[1] =  cos( yaw ) * cos(pitch);
	ori[2] =  sin(pitch);
What the up vector has to look like depends on what is possible in the game. If the view can never be vertical (up or down doesn't matter) it can be left as is. In the other case (or if - because computer arithmetics don't have unlimited precision - the camera can come close to vertical) something like this has to be used (again signs my have to be adapted):

Code: Select all

	ori[3] =  sin( yaw ) * sin(pitch);
	ori[4] = -cos( yaw ) * sin(pitch);
	ori[5] =  cos(pitch);
Both vectors would always be perpendicular, so you are an the safe side, but of course the it takes more calculations (although this should only kick in if the function is called really frequently).


But still I think the problem is not really the direction the camera is viewing (the current audio code just looks to the horizon), although it maybe could be a little akward at extrem close zooms and tilts. The main reason is, where the game places the center of the camera. As I said before, if I click the minimap, e. g. directly on a green dot representing a unit, the camera will show the unit in the upper third of the screen. This is also approximatly the point where the sound changes from front to back speakers. To actually do something with the unit, you have to scroll up to have the unit in the lower half of the screen and thereby in good view, where I would expect it after klicking the map. It seems as if the x,y,z position for the sound is also this far point in front of the camera instead of the position of the camera itself! I would look into this (and the issue with view positioning itself).
Post Reply