Ubuntu 9.10 64bit - problems with sound, music and zombies! - Page 2

Ubuntu 9.10 64bit - problems with sound, music and zombies!

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Vantskruv
Posts: 15
Joined: 10 Jan 2010, 19:15

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by Vantskruv »

libvorbis / libvorbisfile 1.2.0
libogg 1.1.3

Tried compile and install the latest sources but I'm not sure if they where installed correctly and active.
Vantskruv
Posts: 15
Joined: 10 Jan 2010, 19:15

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by Vantskruv »

I partly solved it, but with a very interesting conclusion!

Changing the return value to -1 in the callback function VorbisStreamSeek in file OggStream.cpp, or just passing NULL to the ov_callbacks STRUCT, will make the music appear in the game. Though disabling the VorbisStreamSeek function will, I guess, make it not possible for my music.lua script to decide if the music has ended or not, which is shown that the script will skip to next song about every second.

Another interesting thing is that if I VorbisStreamSeek is returning 0, the callback function seems to get stuck into an ininity loop, which makes the game stall. I've tried this in an example program.

But the most interesting thing is that, in my example program, which uses cstdio routines to open files, everything works fine if the seek callback function uses the cstdio fseek function, even if the callback function returns 0. If I commenting out the fseek function in the seek callback function, the callback function will be stuck in an infinity loop, if returning 0. It is almost if the fseek function has a magical touch to the seek callback function variables, so it don't get stuck in a infinite loop.
Vantskruv
Posts: 15
Joined: 10 Jan 2010, 19:15

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by Vantskruv »

For my part, SOLVED! :P

In function CFileHandler::Seek in file FileHandler.cpp:

Code: Select all

void CFileHandler::Seek(int length, ios_base::seekdir where)
{
	GML_RECMUTEX_LOCK(file); // Seek

	if (ifs)
	{
#ifdef WIN32
		// on mingw, EOF bit does not get reset when seeking to another pos
		ifs->clear();
#endif
  //Call to function ifs->clear() placed outside #ifdef statement.
      ifs->clear();
		ifs->seekg(length, where);
		
	}
	else if (hpiFileBuffer)
	{
		if (where == std::ios_base::beg)
		{
			hpiOffset = length;
		}
		else if (where == std::ios_base::cur)
		{
			hpiOffset += length;
		}
		else if (where == std::ios_base::end)
		{
			hpiOffset = hpiLength + length;
		}
	}
}
Function call ifs->clear() was placed outside the #ifdef WIN32 statement
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by wilbefast »

Cool :-)

I'll give it a try - now that my exams are over I can justify coming back to Spring a little :wink:
Funnily enough had I kept having fun during the break, I might have been more productive - I spent all the time I would've spent with Spring procrastinating on the internet :|
Vantskruv
Posts: 15
Joined: 10 Jan 2010, 19:15

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by Vantskruv »

Hehe, hope it works for ya! If there are any questions about installing it from source just ask!

FileHandler.cpp is found in rts/System/FileSystem/.
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by wilbefast »

Had a go and, um yeah, might actually be good if you walked me through it :shock:

I've done a year of CS but I'm not all that comfortable compiling huge projects like this one.
Vantskruv
Posts: 15
Joined: 10 Jan 2010, 19:15

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by Vantskruv »

It's more easy than it looks like, easy too say... :wink:.

If you have compiled a little project before it is not so much different, I guess you already found this page:
http://springrts.com/wiki/Build_from_source

Just trying to be overwhelmingly obvious, not trying to degrade the human race, here is my steps:

1. Download the packed source-file.
2. Pack the file up in a folder.
3. Open the terminal (this may not be so obvious for newcomers ;)
4. Follow the instructions from http://springrts.com/wiki/Build_from_source

Haha, I'm just fooling around little bit! :lol:

Anyway, the hardest part is the get the right packages so the project will compile, often there is not enough to get it to compile even though you have downloaded the instructed packages. Also the instructions can be a little confusing. Anyway download the libraries as instructed in the page I linked above (under the Debian title). For my part, I noticed that package:
libboost-system1.37-thread-dev

should be libboost-thread1.37-dev instead, which seems to mentioned under the Ubuntu 8.04 title. Better see it for yourself. Compile with try and trial!

Try compiling the project via terminal as instructed, and see what, if any, error messages it tells. Often it can give you tips of what is missing, sometimes very clearly, and sometimes very fogggy, so you need sometimes to guess what you have to have for the build. :)

I don't know how much you can or not, actually I'm not so good on this either. :) Also you are using a 64bit-system, not sure how it will work, but I guess fine! :) If there are any errors, try popup a message, and let's see what we can do to proceed! :)

Edit:

When writing:
cmake .
in the unpacked Spring folder in terminal, this will check if you have all the correct dependencies. If no errors occurs, everything is ok.

Then run the command:
make
in the same folder, which compiles the sources, this will take a little while.

The command:
make install
will install the project to the correct folders on your system, i.e. in /usr/share/games, often it is needed to be executed as root, i.e. sudo make install.
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by wilbefast »

Good tip for cmake - went through it, grabbed all the packages I'd missed along the way (though I did try to get them all from the beginning). Not sure where I should be building this thing (I think you underestimate my ignorance) but for now I'm just checking that I've got everything. I'm stuck at this error for the moment:

Code: Select all

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
X11_Xcursor_LIB (ADVANCED)
    linked by target "spring" in directory /home/william/Desktop/spring_0.80.5.2/rts
Do you know what library that is - can't seem to find it :?

I hope they'll fix this problem for the next official build: I mean, it's basically a typo :o
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by hoijui »

search for "Xcursor" in synaptic.
Vantskruv
Posts: 15
Joined: 10 Jan 2010, 19:15

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by Vantskruv »

Try install libxcursor1 and libxcursor-dev

Write in terminal:
sudo apt-get install libxcursor1 libxcursor-dev


Edit:
About the question where to build this thing. As what I know, it doesn't matter where you build it. When you type, sudo make install, it installs the game on the system, i.e. /usr/local/share/games/spring. As with the Spring source (other projects maybe different), the files installed on the system is logged in a file called install_manifest.txt in your build directory. If you want to remove the build-directory you should save this file to remember what files have been installed. As what I know there is no uninstall command for Spring when installing from sources. So save this file.

Anyway, a tip is to also compile and install the Springlobby, I don't know if the latest version, 0.56, can be found as an Ubuntu package. The new version is nice because you can download maps from it. If you want to compile it also, ask if you get into some problems.
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by wilbefast »

Yeah, I could on find "libxcursor1" (which I'd installed) in Synaptic - got "libxcursor-dev" through aptitude and everything seems to have done smoothly.

Right: it's "made", now I just need to do the "make install" part, which means getting rid of the original version, without deleting all the maps and mods I've collected :? Any tips before I crash my whole system?
Last edited by wilbefast on 20 Jan 2010, 17:07, edited 1 time in total.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by hoijui »

maps and mods should be in ~/.spring/maps ~/.spring/mods, that will not be touched at all with make install, so no need to worry about that.
you can also install to an other location first, with make install DESTDIR=/home/myUser/springTest for example.
Vantskruv
Posts: 15
Joined: 10 Jan 2010, 19:15

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by Vantskruv »

Thanks for that hoijui! That's really nice to get it to intall where you want it!

Hope it works for you willbefast!

I would recommend some music from MAN2 (Massive Assault Network 2), works really nice mixed with TA music.
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by wilbefast »

Hell yeah :mrgreen:

We have music - you're both brilliant :-)

Or problem now is that SpringLobby doesn't seem to be picking up any maps/mods - this may be because my original installation was in /usr/share/games/spring and the new one is in /usr/local/share/games/spring - but that's a bit odd seeing as I moved all the maps and mods to ~/spring (the .deb installation puts Kernel Panic and default maps in the installation directory for example).

I "got rid of" the old installation via synaptic (spot the contradiction :? ) but I kept SpringLobby as it was. Any idea how I can get it up and running again? A release where I can download maps is tempting, but I think I've had enough excited for a little while :P

I like .deb files: they're all nice and clickable and they just do everything for you :-) This is only the second game I've ever compiled BTW (except my little Sokoban clone): UFO literally took hours.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by hoijui »

In Springlobby Options/Preferences, go to the Spring tab, and make usre it points to the two files you just installed.
There is also a checkbox.. which you may have to tick (read what it says).
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by wilbefast »

I've got them pointing at /usr/local/bin/spring and /usr/lib64/spring/unitsync.so - the first one I know is correct, because I can run it from that executable and everything works fine (the other executable didn't).

Image

Still no luck with maps/mods - they are in the data directory but it doesn't seem to be finding them properly. "spring" on its own picks them up just fine though :|
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by hoijui »

default install prefix when compiling spring is /usr/local. for packages, it is /usr. this prevents mixing of the two.
you are using the /usr/ unitsync (also, only old unitsyncs miss the lib prefix).
in other words, it most likely is somewhere below /usr/local/lib64, try:
find /usr/local/ -name libunitsync.so
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by wilbefast »

Sham bam bamena!

Fantastic, and there I was thinking that it was all chosen at random :P I'd sortof guessed that if /usr/share/ => /usr/local/share then logically /usr/lib64 => /usr/local/lib64 but the file was actually /usr/local/lib/libunitsync.so in the end.

Is it going to make a difference that it's not a 64 bit library? For the moment everything seems to be working fine anyway, so thanks for the help :mrgreen:

And thanks a bunch Vantskruv for figuring out what the problem was - super kudos!

edit: may have spoken too soon actually :oops: it finds everything now, but if I try to run the game from the lobby:

Code: Select all

LogOutput initialized.
Spring 0.80.5.1
Available log subsystems: mapinfo, CollisionVolume, unit, VFS-detail, VFS, ArchiveScanner, Sound
Enabled log subsystems: Sound
Enable or disable log subsystems using the LogSubsystems configuration key
  or the SPRING_LOG_SUBSYSTEMS environment variable (both comma separated).
using configuration source "/home/william/.springrc"
[CMyMath::Init] CPU SSE mask: 124, flags:
	SSE 1.0:  1,  SSE 2.0:  1
	SSE 3.0:  1, SSSE 3.0:  1
	SSE 4.1:  0,  SSE 4.2:  0
	SSE 4.0A: 0,  SSE 5.0A: 0
	using streflop SSE FP-math mode, CPU supports SSE instructions
OS: Linux
OS: 64bit native mode
Using read-only  data directory: /usr/games/
Using read-write data directory: /home/william/.spring/
Content error: could not find 'gamedata/parse_tdf.lua' code
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by hoijui »

i always forget what this error means :D
but i am sure someone else can help.
also, lib instead of lib64 here does not mean the lib is not 64 bit.. its just that the spring build system always uses lib as default, and not lib64 when compiling 64bit stuff.
User avatar
wilbefast
Posts: 255
Joined: 14 Oct 2009, 18:04

Re: Ubuntu 9.10 64bit - problems with sound, music and zombies!

Post by wilbefast »

Dang... the pop'up just says "could not find 'gamedata/parse_tdf.lua' code" by the way, and I can't find that file anywhere so maybe it doesn't even exist.
Post Reply

Return to “Help & Bugs”