I'm running 2.8.2 with great success on my Ubuntu 6.06 machine.
I've noticed that the sound doesn't sync with the video.
When my light cycle crashes, the explosion is hear about a half to 1 second later.
I've noticed this in other games as well.
I've read in other forums that this could be caused my applications not have been rewritten to work with ALSA.
Have Armagetron been written to work with ALSA?
Any suggestions on how to work around this sound sync issue?
Thanks.
- Darren.
SoundSync Issue
- Lucifer
- Project Developer
- Posts: 8765
- Joined: Sun Aug 15, 2004 3:32 pm
- Location: Republic of Texas
Yeah, turn off your esound daemon, GNOME's default sound server. 
Um, what you've read isn't completely accurate. To get lowest possible latency, you need to use alsa directly. But that's not all of it. The fact is that if the sound comes up to about 100ms late, it is indistinguishable from a sound that happens at 0ms. In fact, in context we can probably go up to 200ms late on sound and still have it be reasonably believable. Even using alsa through it's oss emulation layer, you're talking a max of about 25ms of additional latency, which isn't much. It's not even enough to do stereo separation on a mono track.
Arts, for KDE users, adds an automatic 50ms of latency. That's all in its buffers. SDL_mixer will do something similar, but the version you're using uses SDL directly. Esound has a solid reputation for being the worst sound server ever written, and the last time I fired up a GNOME desktop, it still had esound in it (about 6 months ago or so, it was a Ubuntu liveCD). Whether or not it's still bad, I don't know. But expect it to add some latency.
Buffers, remember that.
That's where the latency comes in, for the most part. Buffers, if you don't know already, are where you store the sound while waiting to give it to the sound card. There are 2 buffers we know about on your system, one in the game and one in alsa. Alsa may have an additional buffer in the oss emulation, but I doubt it (and I haven't looked at the code so I don't know for sure anyway). Then there's a sound server, if you have one running. I don't think SDL has its own buffer. SDL_mixer does, but we're not using it in 0.2.8.
There's a setting in the Sound Menu (under System Setup) for setting the size of the buffers. Try decreasing that and see if it helps. If it doesn't, see if you can get SDL built with alsa rather than oss support. That probably won't make a lot of difference. Check if you have esound running, and if so, shut it off. Also keep in mind that the buffer size in armgetron is only the buffer size in armagetron, we can't do anything about any other buffers the sound goes through on its way to your speakers.
Other sources of latency include the kernel and the sound card itself. In the case of the sound card, it depends on how good it is. The really high-dollar sound cards come in screaming at near 0ms of latency on the card. Cheap ones can add 10-50ms or more, although extreme latency caused by the sound card is so rare I hven't seen it.
For that matter, I've only heard about it from untrustworthy sources. Kernel latency generally only makes a difference if you're doing serious work with sound, like the kind of stuff you'd do when you plug in 16 microphones and mic a whole band and the audience and try to do effects processing with your computer. Gaming, no matter how snobby any particular gamers may be, is not high performance sound. (Now is the time to point out that the ASIO guys, whose name I've temporarily forgotten, determined that to get Windows down to 50ms of latency they'd need to hack the kernel directly, but that it was possible, and Microsoft both refused to write the code to do it and to let the ASIO guys hack the kernel to do it. At this time, linux ships out of the box with less than 50ms of latency, and you can apply patches to reduce it)
Anyway, check to make sure you've shut off any sound server you might have running (esound in GNOME, arts in KDE, I don't know what the others use), and see how it does. I'd expect some improvement, but some systems just have bad sound that way.
Um, what you've read isn't completely accurate. To get lowest possible latency, you need to use alsa directly. But that's not all of it. The fact is that if the sound comes up to about 100ms late, it is indistinguishable from a sound that happens at 0ms. In fact, in context we can probably go up to 200ms late on sound and still have it be reasonably believable. Even using alsa through it's oss emulation layer, you're talking a max of about 25ms of additional latency, which isn't much. It's not even enough to do stereo separation on a mono track.
Arts, for KDE users, adds an automatic 50ms of latency. That's all in its buffers. SDL_mixer will do something similar, but the version you're using uses SDL directly. Esound has a solid reputation for being the worst sound server ever written, and the last time I fired up a GNOME desktop, it still had esound in it (about 6 months ago or so, it was a Ubuntu liveCD). Whether or not it's still bad, I don't know. But expect it to add some latency.
Buffers, remember that.
There's a setting in the Sound Menu (under System Setup) for setting the size of the buffers. Try decreasing that and see if it helps. If it doesn't, see if you can get SDL built with alsa rather than oss support. That probably won't make a lot of difference. Check if you have esound running, and if so, shut it off. Also keep in mind that the buffer size in armgetron is only the buffer size in armagetron, we can't do anything about any other buffers the sound goes through on its way to your speakers.
Other sources of latency include the kernel and the sound card itself. In the case of the sound card, it depends on how good it is. The really high-dollar sound cards come in screaming at near 0ms of latency on the card. Cheap ones can add 10-50ms or more, although extreme latency caused by the sound card is so rare I hven't seen it.
Anyway, check to make sure you've shut off any sound server you might have running (esound in GNOME, arts in KDE, I don't know what the others use), and see how it does. I'd expect some improvement, but some systems just have bad sound that way.
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN
Be the devil's own, Lucifer's my name.
- Iron Maiden
Be the devil's own, Lucifer's my name.
- Iron Maiden
-
darrensnospam
- Posts: 5
- Joined: Sat Jun 03, 2006 6:00 am
Thanks.
You've given me some things to research. I'll let you know how it goes.
- darrensnospam
P.S. Where's the support group for those addicted to armagetron?
I keep staying up until 2:00 AM playing it. 
- darrensnospam
P.S. Where's the support group for those addicted to armagetron?