Page 1 of 3
Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 21 Nov 2009, 16:32
by wilbefast
Hi all,
Since upgrading to Karmic 64bit I've been getting these strange popping, crackling distortions on sounds - sometimes rather than playing the sound I just get a buzz. This happens especially at the beginning of a game when the countdown noise is (not) played. The problem generally goes away after a bit, but often comes back, and seems to get worse and worse until no sound is played at all.
I've just cleaned everything out and re-installed spring (again) and the crackle is still present if less bad. The reason for the re-installation, on top of sound no longer working at all, was that spring was refusing to close unless ended manually: it took me a while to realise that my computer was being sluggish because several "spring" processes were shambling around in the background. The re-installation seems to have fixed this for now, and hopefully it won't come back.
Finally I've still got the same problem as I had on Jaunty when it comes to music, and I wonder if it's connected:
- The only music widget that ever seems to work is the one that comes with Evolution RTS (by zwzsg)
- This widget will work from inside the other mod files' LuaUI folders, but I've just been explained that my cracking open and putting music into various mod-files is the reason I can't seem to synch with anybody anymore

- If put music.lua into ~/.spring/LuaUI/widgets it will cause spring to emit a sharp buzz of agony and then freeze up (and need to be 'kill -9'ed). This always happens, the moment it starts, unless there are no .ogg files in ~/.spring/music: in other words, it finds the file, tries to load it, reels writhes and faints in coils.
I've gone to great length to get all the Kernel Panic music together, plus the TA OST and then of course there's the (very nice) Evo soundtrack: if it's possible I'd like to play the correct track at the correct time in the correct mod, but for now I'd be happy to get any music working at all without the whole game freezing (after that I'll try and figure out something myself).
Please help
William
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 21 Nov 2009, 16:39
by Auswaschbar
Tried disabling pulseaudio? Looks like that resolves most of the ubuntu audio problems...
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 21 Nov 2009, 16:41
by wilbefast
Auswaschbar wrote:Tried disabling pulseaudio? Looks like that resolves most of the ubuntu audio problems...
I think I use alsa, but where would I go to disable pulseaudio?
edit: should have googled that... still, I've destroyed my operating system before running scripts I found off the net...
edit2: okay, the buzzing problem seems to have been cleared up by getting rid of pulseaudio (I used alsa on 9.04 but apparently 9.10 likes to shove puleseaudio down your throat) - music will still make the game freeze up (unless it's inside the mod file) but we are making progress. I used:
http://ubuntuforums.org/showthread.php?t=1313253#4
Thanks for the suggestion

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 21 Nov 2009, 17:13
by zwzsg
That's probably a stupid idea that has nothing to do with it, but, does it work better if you disable the music widget, start a game with the music widget off, and turn off several seconds after game started?
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 21 Nov 2009, 17:40
by wilbefast
Worth a try, but unfortunately it does the same thing: freezes as soon as the widget is activated
I'm not in any way blaming your lua by the way...
Man, all sound and music, in and out of spring, works so much better now with pulseaudio gone

My microphone is actually audible!
edit: I've been thinking - probably the best way to give different mods different music would be to create several copies of the lua, each pointing to a different directory, then activate the appropriate one in the appropriate mod. Ugly but effective. That is assuming I get the music working at all...
edit 2: re-tried a couple of other music widgets just to make sure: don't know if they work when used inside a mod file, but in any case they cause the game to freeze just like the first one.
I think it may have something to do with the
Spring.PlaySoundStream() function which all these scripts use.
Did a quick search for the above and guess what?
Kinyif_fantom wrote:I use 64 bit Uuntu Jaunty. Spring.PlaySoundStream LUA function freezes 0.80.4. With 0.80.2 it worked, just the volume was ignored (with Spring.SetSoundStreamVolume also). Before 0.80.2 everything was fine.
http://springrts.com/phpbb/viewtopic.ph ... 9&start=27
It would seem that this problem (with 0.80.4) has not been fixed for 0.80.5
edit 3: the zombies are back again

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 10 Jan 2010, 19:22
by Vantskruv
I've been trying to use a music widget and it for me also freezes the game. I'm running Spring v.0.80.5 on Crunchbang 9.04 32-bit, removed the PulseAudio from the package-manager.
There is something wrong with the PlaySoundStream function which freezes the game totally, no fail logs or debug-output to hint from. I tried changing to play music with the PlaySoundFile function, which succeeded! Though I can't stop the music or get the music time when using this method.
Do anyone know if something is missing (libraries??), what is the problem?
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 10 Jan 2010, 21:59
by wilbefast
It was reported as a bug, no idea what's causing it exactly though - and no fix as yet

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 11 Jan 2010, 06:01
by Vantskruv
Hmm, ok, but I get a feeling not so many people complaining about the bug. It seems it works out for others, I'll try download the source and compile, maybe it helps.
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 11 Jan 2010, 12:22
by hoijui
if you do that, make sure to get the 0.80.5-branch from git, and do not use the tarball, as it does not contain the Ubuntu 9.10 related fixes.
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 11 Jan 2010, 22:03
by Vantskruv
Thank you for your reply.
I've managed to compile and run Spring. Though the problem persist. I've been stepping into the code. But before doing any conclusions, I need to test the boost libraries to see if there is some fault there. I've managed to step into to the SoundSource.cpp code and I'll try (if I succeed

) to make my own program playing some music. I'm not sure if I have understood everything correctly yet, need to scavage more in the code, but I guess your are using the boost libraries to play music?
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 11 Jan 2010, 22:09
by Auswaschbar
Vantskruv, did you disable pulseaudio? Normally, sound related problems go away then.
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 12 Jan 2010, 15:56
by Vantskruv
I don't know if I've disabled it correctly. I removed the pulseaudio package from synaptic, but I'm not sure if it is enough. Though I noticed a change in the sound-manager where PulseAudio existed as an option before uninstalling, and now the option PulseAudio doesn't exist in the list. But maybe some PulseAudio routines hides in the background. When I come home I'll search for method to cleanly remove the PulseAudio.
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 12 Jan 2010, 16:00
by hoijui
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 12 Jan 2010, 19:57
by Vantskruv
Thanks, already done that. I've also tried disabling pulseaudio with this guide:
http://idyllictux.wordpress.com/2009/04 ... io-at-bay/
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 12 Jan 2010, 21:11
by wilbefast
Trust me - this is not a problem with Pulseaudio: I've tried with and without on 32, 64 bit 9.04 and 9.10: always the same problem. May be hardware: what is your rig Vantskruv?
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 13 Jan 2010, 10:46
by Vantskruv
I'm using a Gigabyte GA-EX58-UD5 motherboard with an Intel Core i7 920, 2.66GHz CPU and 6Gb RAM:
http://www.gigabyte.com.tw/Support/Moth ... #anchor_os
which have builtin audio Realtek ALC889A. I've compiled and installed Realtek audio drivers v5.13:
http://www.realtek.com/downloads/downlo ... Down=false
though they have recently released new drivers v5.14,which I'll test when I come home.
I'll put up a startup logfile for the Spring engine if you want to see it. (Can't do it now).
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 13 Jan 2010, 13:47
by wilbefast
Hmm - mine is HDA Intel ALC268 - I think... clearly I'm not a savy as you are

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 13 Jan 2010, 20:00
by Vantskruv
willbefast, hehe, I'm not so savvy as you think!
Anyway, I compiled the new Realtek HD drivers (v5.14), which also didn't work.
I've been looking through a little more and found in my log this:
Code: Select all
[ 0] Sound: Unable to open audio file: FailedCommand
[ 0] Sound: CSound::GetSoundId: could not find sound: FailedCommand
I've been looking through the code from the above log-outputs and these are coming from the CSound class, in methods CSound::LoadSoundBuffer and CSound::GetSoundId. I'm not sure if these failure logs has any importance because in the constructor of the CGuiHandler class has this line:
Code: Select all
failedSound = sound->GetSoundId("FailedCommand", false);
Ok, I think I've narrowed down the source of the problem. I think I've come so far now to not understand how to solve the problem. In method OggStream::Play() (source oggstream.cpp):
Code: Select all
// open an Ogg stream from a given file and start playing it
void COggStream::Play(const std::string& path, float volume)
{
if (!stopped) {
// we're already playing another stream
return;
}
vorbisTags.clear();
int result = 0;
ov_callbacks vorbisCallbacks;
vorbisCallbacks.read_func = VorbisStreamRead;
vorbisCallbacks.close_func = VorbisStreamClose;
vorbisCallbacks.seek_func = VorbisStreamSeek;
vorbisCallbacks.tell_func = VorbisStreamTell;
CFileHandler* buf = new CFileHandler(path);
if ((result = ov_open_callbacks(buf, &oggStream, NULL, 0, vorbisCallbacks)) < 0) {
logOutput.Print("Could not open Ogg stream (reason: %s).", ErrorString(result).c_str());
return;
}
vorbisInfo = ov_info(&oggStream, -1);
{
vorbis_comment* vorbisComment;
vorbisComment = ov_comment(&oggStream, -1);
vorbisTags.resize(vorbisComment->comments);
for (unsigned i = 0; i < vorbisComment->comments; ++i)
{
vorbisTags[i] = std::string(vorbisComment->user_comments[i], vorbisComment->comment_lengths[i]);
}
vendor = std::string(vorbisComment->vendor);
//DisplayInfo();
}
if (vorbisInfo->channels == 1) {
format = AL_FORMAT_MONO16;
} else {
format = AL_FORMAT_STEREO16;
}
alGenBuffers(2, buffers); CheckError("COggStream");
if (!StartPlaying()) {
ReleaseBuffers();
} else {
stopped = false;
paused = false;
}
CheckError("COggStream");
}
When commenting out everything below:
CFileHandler* buf = new CFileHandler(path);
everything runs fine, though of course no music play.
But when uncommenting the IF statement below, and commenting out everything below, Spring will freeze as normal when trying to play music. So it seems maybe the problem is lying in the method
ov_open_callbacks() which is declared in the header
vorbisfile.h. I don't know if there is some problem with vorbis on my computer, or if it is wrongly used in the Spring-engine.
Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 14 Jan 2010, 12:36
by wilbefast
That sounded pretty savvy to me

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!
Posted: 14 Jan 2010, 12:45
by Auswaschbar
Vantskruv wrote:I don't know if there is some problem with vorbis on my computer, or if it is wrongly used in the Spring-engine.
Afaik the function is used according to their docs. And given the fact it works for everyone else, it is probably a problem on your side. Whatversion of the ogg / vorbis / vorbisfile libraries you have?