Major audio problems - unreliable audio?
by Mike Stoddart · in Torque Game Engine · 08/09/2002 (2:55 pm) · 12 replies
I'm having major problems with audio at the moment. I'm testing my game prototype with two people in the game, and with a dedicated server running on a P2-350 with 256Mb. The server is Linux, and it's load is probably around 0 as it isn't used for anything.
The problem I'm facing is that sound samples don't always play. I can stand on the spot and fire my pistol repeatedly until the clip is empty, and I might hear the shot say 8 or 9 times out of ten. The same happens with other sounds.
Could this be caused by using a slow server? I get the same problem when I run the game on my PC in standalone mode, but the problem seems worse.
Has anyone had any experience of this?
Thanks
The problem I'm facing is that sound samples don't always play. I can stand on the spot and fire my pistol repeatedly until the clip is empty, and I might hear the shot say 8 or 9 times out of ten. The same happens with other sounds.
Could this be caused by using a slow server? I get the same problem when I run the game on my PC in standalone mode, but the problem seems worse.
Has anyone had any experience of this?
Thanks
#2
08/09/2002 (4:11 pm)
I have an SB Live Value, on Win2k with the default drivers.
#3
08/10/2002 (9:33 am)
I have an SB Live card which works fine. The OpenAL dll was made by Creative, seems like it should work with their cards ;) I don't know of any outstanding issues with this card, I'll talk to Rick and see if he has any ideas.
#4
08/10/2002 (10:36 am)
Thanks Tim.
#5
Solution? Slow down the firing rate?
Another thing I noticed is that I'm having a lightning/ thunder system set up with 4 different sounds... and it doesn't cycle trough them but just keeps on playing the same one. Altough this might be a script thing offcourse (but I think not, I have it set up like most people around here)
08/10/2002 (10:47 am)
its not an issue of the soundcard.. i'm having the same problem when sounds play too fast after eachother. Sometimes it just skips a sound (my chaingun sounds like this: rrr..r.... rrrrrrrr.. rrrr..... rrrrrrrr...) and this happens a lot. Solution? Slow down the firing rate?
Another thing I noticed is that I'm having a lightning/ thunder system set up with 4 different sounds... and it doesn't cycle trough them but just keeps on playing the same one. Altough this might be a script thing offcourse (but I think not, I have it set up like most people around here)
#6
08/10/2002 (10:55 am)
It's almost as the Torque can't keep up with what's happening in the world?
#7
My problem was that sound on the client side would either not play, or would play distorted. The problem only happened on the client side. If I was both client and server, the problem wouldn't occur.
After much tedious tracing and debugging, I stumbled across this Rule of Torque that I hadn't known before:
* The client can't have any datablocks defined.
Or, to put it a different way:
* Datablocks can only be defined on the server. The server will transmit the datablocks to the client when it needs them.
Once I had re-organized my scripts so that no datablocks were defined on the client side my audio problems were solved.
I *think* the problem stemmed from datablocks being identified by index. And, in my server scripts, the audio profiles were among the first datablocks defined. So the datablocks that were erroneously being defined on the client would "share" an index with the server-sent datablocks, causing problems.
This is speculation. Perhaps I'm way off base in my explanation. But I do know for certain that removing all client-side datablock definitions solved my problem.
Hope this helps.
-David
Samu Games
08/11/2002 (9:22 am)
I don't know if it will help any, but last night I solved a minor audio issue I was having. Perhaps there are some similarities to the problem you're reporting.My problem was that sound on the client side would either not play, or would play distorted. The problem only happened on the client side. If I was both client and server, the problem wouldn't occur.
After much tedious tracing and debugging, I stumbled across this Rule of Torque that I hadn't known before:
* The client can't have any datablocks defined.
Or, to put it a different way:
* Datablocks can only be defined on the server. The server will transmit the datablocks to the client when it needs them.
Once I had re-organized my scripts so that no datablocks were defined on the client side my audio problems were solved.
I *think* the problem stemmed from datablocks being identified by index. And, in my server scripts, the audio profiles were among the first datablocks defined. So the datablocks that were erroneously being defined on the client would "share" an index with the server-sent datablocks, causing problems.
This is speculation. Perhaps I'm way off base in my explanation. But I do know for certain that removing all client-side datablock definitions solved my problem.
Hope this helps.
-David
Samu Games
#8
I think I'll download the Realm Wars demo and test the audio on that. It may be that I'm having problems with my datablocks, as they're all loaded by the server when the server reads the mission file.
Thanks
08/11/2002 (9:34 am)
David, thanks for that useful tip. I'm 99.9% sure that I don't have any client side datablocks defined.I think I'll download the Realm Wars demo and test the audio on that. It may be that I'm having problems with my datablocks, as they're all loaded by the server when the server reads the mission file.
Thanks
#9
08/11/2002 (10:39 am)
I don't seem to get this problem with the Realm Wars demo. Bummer, maybe I'm causing the problem by execing the scripts during mission load. :(
#10
There's a chance that this might be script related. It's possible that the changes I made to the weapon's state machine cause this problem.
Thanks
08/11/2002 (11:42 am)
Just a thought: is it better to use sounds that are mono? I noticed that the Realm Wars crossbow firing sound is mono, while mine is stereo. Might this cause any problems?There's a chance that this might be script related. It's possible that the changes I made to the weapon's state machine cause this problem.
Thanks
#11
You do not need stereo sound effects in torque since the sound will be played in actual 3d space, so you only need 1 channel sounds.
If you have 2 channels, you'll merely be playing them both from the same location, making the second channel useless.
08/11/2002 (12:51 pm)
Stereo is two channels of audio, which mimics a 3d space.You do not need stereo sound effects in torque since the sound will be played in actual 3d space, so you only need 1 channel sounds.
If you have 2 channels, you'll merely be playing them both from the same location, making the second channel useless.
#12
Rapidly playing sounds will always cause problems. The average sound card only has 16 to 32 channels. Playing several single shot sounds one after the other you will quickly eat through all the available channels on your card. Once all your channels are full the audio system tries to cull out sounds that are far away or almost finished playing. In your case none are far away and maybe one is near finished playing, if a free channel cannot be found it will skip playing the sound. But also consider the side effect that other sounds farther away will be abruptly stopped or not played at all because your chain gun (very close to you) is eating up all the sound resources.
In Tribes our chain gun had a spin-up sound, a looping firing sound and a spin-down sound. This is a much more efficient way to handle your sounds.
--Rick
08/12/2002 (8:03 am)
The core audio system is stable on Win32 (as far as I know). Mac and Linux OpenAL are working but not as extensively tested.Rapidly playing sounds will always cause problems. The average sound card only has 16 to 32 channels. Playing several single shot sounds one after the other you will quickly eat through all the available channels on your card. Once all your channels are full the audio system tries to cull out sounds that are far away or almost finished playing. In your case none are far away and maybe one is near finished playing, if a free channel cannot be found it will skip playing the sound. But also consider the side effect that other sounds farther away will be abruptly stopped or not played at all because your chain gun (very close to you) is eating up all the sound resources.
In Tribes our chain gun had a spin-up sound, a looping firing sound and a spin-down sound. This is a much more efficient way to handle your sounds.
--Rick
Torque Owner Tim Gift