"Those Funny Funguloids!" -- v1.06 [+ Linux ver]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!

Postby mh » Tue Apr 17, 2007 4:39 pm

piet wrote:OpenAL is quite picky on the sample format in my experience. I haven't looked at the sound files yet but it might be something in that direction. Or using too few channels which means that a playing sample might be interrupted at the wrong moment to free a channel for the next sound. However, it definitely sounds different (different mixing algorithms I guess)

I don't think it's a channel problem (still maybe they could be upped to 32 instead of 16? The FMOD version uses 128.. ..not that it needs that many.. ;)). But the problem isn't worth losing sleep over, it's not even really distracting. :)

Yup, placing it in soundsystem.h was just a quick fix since I didn't know whether FMOD support will be dropped completely so I went for this hacky typedef solution. autotools put such things into config.h I think.

Ok. I don't want to drop it completely, but to either maintain two packages, one for FMOD and one for OpenAL or go with the autoconfig route (that'd be the preferred solution).

Even if it's big and ugly it's not that hard. If anyone volunteers I'll do it ;-)

I once looked into them, and got scared away almost instantly.. :D Maybe I could take an another look, but if you / anyone has any experience with them, the help is really appreciated. :)

Definitely strange since everything else works perfect for me (at least in regards to ALSA, lol ;-) In any case I'm not going to look into this one since FMOD isn't my cup of tea. And I agree, OSS is hopelessly outdated.

Yeah, no need to investigate it further. FMOD's been somewhat unreliable in Linux before as well (in my experience), but in Windows it works really great.

You're welcome. And how should I have passed on this game when it comes to hunt spacey 'shrooms in such a colourful space 8)

Hehe, right! :)
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Wed Apr 18, 2007 10:38 pm

mh wrote:I don't think it's a channel problem (still maybe they could be upped to 32 instead of 16? The FMOD version uses 128.. ..not that it needs that many.. ;)). But the problem isn't worth losing sleep over, it's not even really distracting. :)


16 was for testing purposes (which had nothing to do with funguloids), but I don't think that there are more than a few samples playing at the same time. But 64 might be more reasonable.

mh wrote:I don't want to drop it completely, but to either maintain two packages, one for FMOD and one for OpenAL or go with the autoconfig route (that'd be the preferred solution).


Well, I spent some time with the autotools (what a pita) and the important stuff has been done so far (searching or specifying paths to all needed libs is working)! There are still some minor tasks to do (like adding the docs and moving the executable to the right position). I'll report back when it's done, probably friday...

EDIT: What the hell, here it is: http://www.newbyteorder.net/funguloids- ... c1.tar.bz2
See "configure --help" for options but it should find all headers and libs by itself if they're not hidden too well ;-) And by the way, there is no "make install" as I don't think that it would make any sense.
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Thu Apr 19, 2007 9:52 am

Very nice work piet!

piet wrote:16 was for testing purposes (which had nothing to do with funguloids), but I don't think that there are more than a few samples playing at the same time. But 64 might be more reasonable.

I set it to 32, should be plenty.

EDIT: What the hell, here it is: http://www.newbyteorder.net/funguloids- ... c1.tar.bz2
See "configure --help" for options but it should find all headers and libs by itself if they're not hidden too well ;-) And by the way, there is no "make install" as I don't think that it would make any sense.

Cool, it works fine! :) Is bootstrap needed btw? It didn't run on my box, I guess I have older autotools it requires. It seems to want 2.61.

I have modified a few files (added the ALSA stuff for FMOD, set channels to 32, added an icon, made the playlist.lua to add .mp3 and .ogg only..), here's the modified files: http://koti.mbnet.fi/lsoft/funguloids-1.05f-ac1-modified.tar.bz2. I also renamed INSTALL to README, I guess we could have the standard GNU INSTALL file there..?

Thanks a lot for your work so far, I'll be sure to credit you when the work is done! :)
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Fri Apr 20, 2007 2:18 am

mh wrote:Cool, it works fine! :) Is bootstrap needed btw? It didn't run on my box, I guess I have older autotools it requires. It seems to want 2.61.

Yes, you're right, bootstrap shouldn't go into the dist package.
Which autoconf version is actually needed is beyond me. 2.61 was automagically configured as that's my version. Ogre uses 2.50, CeGUI 2.59. Since I don't use anything over the top, I'll set it to 2.50 and wait for complaints ;-)

I have modified a few files (added the ALSA stuff for FMOD, set channels to 32, added an icon, made the playlist.lua to add .mp3 and .ogg only..), here's the modified files:

Great! Ogg/Vorbis playback is working as well and I will try my luck with libmad for mp3 support tomorrow :D

I also renamed INSTALL to README, I guess we could have the standard GNU INSTALL file there..?

Yes, right. It might also be a good idea to put the gamesettings and probably hiscores too in some directoy in the user's $HOME. Then Funguloids could be installed system-wide and "make install" would really make sense.

Thanks a lot for your work so far, I'll be sure to credit you when the work is done! :)

It's my pleasure and do as you like ;-) A big part of the code has actually been finished a while ago (our failed game project :( and it would be a shame to let the stuff get mouldy on some harddisks when it can be used somewhere nice. And as I said before, it's really great to have such fun eye candy and I really appreciate the initial Linux release. And so, as I incidentally happened to hit the Ogre forums after some month I was captured by... Those Funny Funguloids! Lol, well, it's time to go to suspend I believe ;-)
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Fri Apr 20, 2007 8:52 am

piet wrote:Which autoconf version is actually needed is beyond me. 2.61 was automagically configured as that's my version. Ogre uses 2.50, CeGUI 2.59. Since I don't use anything over the top, I'll set it to 2.50 and wait for complaints ;-)

Heh, fair enough! ;)

It might also be a good idea to put the gamesettings and probably hiscores too in some directoy in the user's $HOME. Then Funguloids could be installed system-wide and "make install" would really make sense.

That's very true, I'll look into this.
EDIT: Here's the modified files. It now saves/loads gamesettings.cfg and hiscore.lst to .funguloids in users home directory. http://koti.mbnet.fi/lsoft/funguloids-config-changes.zip.

Btw, I'm running on Ubuntu Feisty Fawn now, the upgrade from Edgy went perfectly! :)
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Sat Apr 21, 2007 10:23 pm

After more than a couple of hours debugging the MP3 support I took a break and finally investigated into the pops and clicks with OpenAL. First thing I learned is that there is now support for a configuration in $HOME/.openalrc. OpenAL's current default is to use ALSA with the 'default' device which would be something like this:

Code: Select all
(define devices '(alsa native arts esd null))
(define alsa-device "default")
(define speaker-num 2)


This, however. produces lots of clicks (and not only for me) :-( When adding "dsp" as the first device in the list, OSS (/dev/dsp, hence the name) is used and there are no clicks, but every now and then playback is somehow "phased" right after start and until leaving and restarting the game.

A working configuration for me is to use ALSA with the "dmix" device (define alsa-device "dmix"). This is a software mixer designed to allow more than one application sound output even if the soundcard doesn't support hardware mixing.

I've rolled another tarball with your changes merged and working Ogg and broken MP3 support (the latter isn't compiled in if configure cannot detect mad.h): http://www.newbyteorder.net/funguloids-1.05f-ac2.tar.bz2

MP3 support was supposed to be based on libmad (the name hits the spot) which comes with no documentation. The official solution is to have a look into some third-party source code of an application that takes a mp3 from standard input and outputs it to stdout as raw pcm samples. The raw stream is only static and - know what - that's what my broken MP3 support produces as well.
I'll be searching for another mp3 decoder lib after setting up the install target. There is a new debug printout that shows all available OpenAL extensions. Mine comes with a mp3 extension so maybe there is no need to write a streaming class. I'll have a closer look into this...

EDIT: after a night's sleep I figured out some of the bugs in the mp3 decoder code. It's far from perfect but it is more or less working.
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Sun Apr 22, 2007 3:38 pm

piet wrote:After more than a couple of hours debugging the MP3 support I took a break and finally investigated into the pops and clicks with OpenAL. ....

I've yet to try the dmix stuff, but great if it reduces the clicks! :) I suppose that is relevant information for the README when we're (well, mainly you.. :D) done with this.

I've rolled another tarball with your changes merged and working Ogg and broken MP3 support (the latter isn't compiled in if configure cannot detect mad.h): http://www.newbyteorder.net/funguloids-1.05f-ac2.tar.bz2

MP3 support was supposed to be based on libmad (the name hits the spot) which comes with no documentation. The official solution is to have a look into some third-party source code of an application that takes a mp3 from standard input and outputs it to stdout as raw pcm samples. The raw stream is only static and - know what - that's what my broken MP3 support produces as well.
I'll be searching for another mp3 decoder lib after setting up the install target. There is a new debug printout that shows all available OpenAL extensions. Mine comes with a mp3 extension so maybe there is no need to write a streaming class. I'll have a closer look into this...

EDIT: after a night's sleep I figured out some of the bugs in the mp3 decoder code. It's far from perfect but it is more or less working.

Nice work again, piet! :) Ogg worked quite well here.

Oh btw, could you add "fmod_use_alsa=on" to the gamesettings.cfg in your copy. Not required, but as the docs refer to it, it should be visible there.. ;)

What's the way to choose whether to use FMOD or OpenAL? I suppose passing something to configure? That'll go to the README as well. OpenAL can be the default, as more people have that installed already. (..and prefer free software over proprietary)
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Sun Apr 22, 2007 11:08 pm

mh wrote:I've yet to try the dmix stuff, but great if it reduces the clicks! :) I suppose that is relevant information for the README when we're (well, mainly you.. :D) done with this.


Honestly I didn't feel too comfortable about this dmix "solution" as I can't really believe that ALSA is that flawed. So I had a closer look into this alsa/dmix/oss thingy. It turned out that the correct device string for dmix should have been "plug:dmix". OpenAL's fallback (called "native") is still OSS which is used whenever the configured device doesn't work. According to OpenAL's mailing list this is due to unsolved problems with ALSA (clicks are mentioned!!!) :x It boils down to "OSS good, ALSA bad" as "plug:dmix" produces clicks just as ALSA's default device :-( However, this might not be true for all users, as ALSA worked for Aladrin...

Ogg worked quite well here.

Well, that's nice to hear :D As I suppose you're using OSS? With or without clicks? (btw, quickest way to find out what sound output is actually used is to install "lsof" and do "lsof | grep fungu" and look/grep for "alsa" or "dsp").

mh wrote:Oh btw, could you add "fmod_use_alsa=on" to the gamesettings.cfg in your copy. Not required, but as the docs refer to it, it should be visible there.. ;)

You're right, added...

mh wrote:What's the way to choose whether to use FMOD or OpenAL? I suppose passing something to configure? That'll go to the README as well. OpenAL can be the default, as more people have that installed already. (..and prefer free software over proprietary)

Right now configure will try to detect both FMOD and OpenAL. OpenAL will be used over FMOD unless you add the "--with-fmod=..." flag (actual value doesn't matter). I'll have to add some more "no" values for all of the optional stuff like Ogg and MP3, and OpenAL.

I've been wondering about all these problems with OpenAL and ALSA and I'm not sure whether this is really going somewhere. I guess FMOD works quite well with OSS and/or ALSA while OpenAL simply introduces inferior sound quality (and maybe other problems) for the sake of using free software.
Before all these throwbacks I thought about putting all sound stuff into a easy to use library (like FMOD but open source). For the moment, I rather believe that having autoconf up and running is one important thing to help spread Funguloids to Linux users. I will definitely go for the library (and thus finish the MP3 code and perform a major cleanup) but whether this code should go into the next Funguloids release is up to you. On the other hand, it might be a bit too early to give up without any further feedback. I have a fresh and clean Ubuntu 6.10 installation on my other computer (with some quirky on-board sound) so I could give it a try there.
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Mon Apr 23, 2007 10:43 am

piet wrote:Honestly I didn't feel too comfortable about this dmix "solution" as I can't really believe that ALSA is that flawed. So I had a closer look into this alsa/dmix/oss thingy. It turned out that the correct device string for dmix should have been "plug:dmix". OpenAL's fallback (called "native") is still OSS which is used whenever the configured device doesn't work. According to OpenAL's mailing list this is due to unsolved problems with ALSA (clicks are mentioned!!!) :x It boils down to "OSS good, ALSA bad" as "plug:dmix" produces clicks just as ALSA's default device :-( However, this might not be true for all users, as ALSA worked for Aladrin...

Ogg worked quite well here.

Well, that's nice to hear :D As I suppose you're using OSS? With or without clicks? (btw, quickest way to find out what sound output is actually used is to install "lsof" and do "lsof | grep fungu" and look/grep for "alsa" or "dsp").

Okay, now that I tried it.. I was using ALSA all the time, and there were clicks actually in the Ogg play (as well as in the other sound effects).. But! Then I tried with .openalrc:
Code: Select all
(define devices '(alsa native arts esd null)')
(define alsa-device "default")
(define speaker-num 2)

..and the clicks went away. So the default device works well on my box. I don't know what settings it uses when there's no rc-file. From Ogre.log I see that OpenAL is using software renderer. Maybe the hardware support is flawed..? :? But to sum up: with that .openalrc it works really well (from the little testing I've done..). :)

Right now configure will try to detect both FMOD and OpenAL. OpenAL will be used over FMOD unless you add the "--with-fmod=..." flag (actual value doesn't matter). I'll have to add some more "no" values for all of the optional stuff like Ogg and MP3, and OpenAL.

Right, sounds good.

Before all these throwbacks I thought about putting all sound stuff into a easy to use library (like FMOD but open source). For the moment, I rather believe that having autoconf up and running is one important thing to help spread Funguloids to Linux users. I will definitely go for the library (and thus finish the MP3 code and perform a major cleanup) but whether this code should go into the next Funguloids release is up to you. On the other hand, it might be a bit too early to give up without any further feedback. I have a fresh and clean Ubuntu 6.10 installation on my other computer (with some quirky on-board sound) so I could give it a try there.

If the library results in cleaner code and/or better performance, then go for it! :) I'd like the next Linux version to be a "worthy official release".. ;) Btw, as for the MP3 code, my OpenAL has the MP3 extension as well. Although I guess you had some other code working currently, just mentioning anyway.. Oh, and I have a quirky on-board sound as my only sound source! ;)

EDIT: Btw, you could start using version number 1.06 for the next tarballs, since once this Linux version is ready, I'm releasing v1.06 for Windows too with the latest Linux compatible sources. :)
Last edited by mh on Mon Apr 23, 2007 10:56 am, edited 2 times in total.
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby Shadow007 » Mon Apr 23, 2007 10:48 am

Just to tell something I've seen this Week-End : Those Funny Fungoloids is featured (as in 20 lines and a few screenshots in the french "Joystick" magazine. If I can, I'll send a few photographs this evening.
Shadow007
Gremlin
 
Posts: 185
Kudos: 0
Joined: 07 May 2005

Postby mh » Mon Apr 23, 2007 10:51 am

Shadow007 wrote:Just to tell something I've seen this Week-End : Those Funny Fungoloids is featured (as in 20 lines and a few screenshots in the french "Joystick" magazine. If I can, I'll send a few photographs this evening.

Ooh, really cool! :) Any photos would be neat, thanks! :D
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Mon Apr 23, 2007 6:56 pm

Just a quick update: I somewhat figured out what causes the clicks and how to remedy this. My ~/.asoundrc looks like this now:

Code: Select all
pcm.!default {
        type plug
        slave.pcm "dmixer44k"
}

pcm.dmixer44k {
        type dmix
        ipc_key 12678
        slave {
                pcm "hw:0,0"
                rate 44100
                period_time 0
                period_size 1024
                buffer_size 4096
        }
        bindings {
                0 0
                1 1
        }
}

ctl.dmixer44k {
        type hw
        card 0
}


The important parts are "rate 44100" (my on-board soundcard is fixed to 48k as is the default auf the dmix plugin) and "period_time 0" and "period_size 1024". Omitting any of these three will result in audible clicks (for me at least)! Now it works like a charm :)

This should go into the README, too, after I read some more about it. So, after all it looks like ALSA's problem.
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Mon Apr 23, 2007 8:47 pm

piet wrote:This should go into the README, too, after I read some more about it. So, after all it looks like ALSA's problem.

Okay then, sure. :) It seemed to work for me without any of this, though.
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby Shadow007 » Mon Apr 23, 2007 8:49 pm

The photograph (not a good one ! :( )

Image

I'll try and send a translation ... but if anybody else want's to I'll be happy to let him do it :)
Shadow007
Gremlin
 
Posts: 185
Kudos: 0
Joined: 07 May 2005

Postby mh » Tue Apr 24, 2007 11:22 am

Shadow007 wrote:The photograph (not a good one ! :( )

Image

I'll try and send a translation ... but if anybody else want's to I'll be happy to let him do it :)

Thanks! A translation would be nice, I don't understand any of that.. :D
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Tue Apr 24, 2007 10:48 pm

Ok, getting closer to the final version: http://www.newbyteorder.net/funguloids-1.06-0.tar.bz2

Mp3 support is working now but needs some major cleanup.

make install is configured, too, and puts all of the game files into $prefix/games/funguloids/ (no handling of the *.mpk files since they're not in the source package - that should be optional in a future version) and adds a script to $prefix/bin/funguloids.sh to start the game. There are some minor changes needed to put ogre.cfg and Ogre.log into the user's .funguloids/ directory (else you'll need write access to the game dir).

FMOD sound output seems to be broken for me (just a few scratching sounds with oss and nothing at all with ALSA) which is really strange! After setting up ALSA's default device, sound output has become very stable - even with multiple apps doing sound output and wild window moving - no clicks at all :D

README and INSTALL will be updated next and then a public Linux beta could be started ;-)
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Wed Apr 25, 2007 8:46 am

piet wrote:Mp3 support is working now but needs some major cleanup.

Awesome work as always, piet! :) I think there's something slightly wrong though, configure finds FMOD fine, but when I specify --with-fmod=yes it doesn't find it anymore, and uses OpenAL instead.. :? When I use --without-openal it chooses FMOD correctly. And could you add 'FileSystem=icon' to the resources.cfg, otherwise it won't load the window icon. Maybe all the object files should be in separate 'obj' directory or something, they kinda clutter the 'src' directory.. ;)

make install is configured, too, and puts all of the game files into $prefix/games/funguloids/ (no handling of the *.mpk files since they're not in the source package - that should be optional in a future version) and adds a script to $prefix/bin/funguloids.sh to start the game. There are some minor changes needed to put ogre.cfg and Ogre.log into the user's .funguloids/ directory (else you'll need write access to the game dir).

Hmm, I'll look into that. The ogre.cfg and log should be easy to fix. I think resources.cfg and the playlist stuff (it tries to load everything from ./music) need some work too.. Maybe some sed magic for the resources.cfg? What about the music dir? It could go where the *.mpk files go, but then users couldn't add their own music (unless they have the rights)..
EDIT: http://koti.mbnet.fi/lsoft/ogreapp.cpp
I modified that file to support some defines. OGRE_PLUGINS_AND_RESOURCES_PATH is the path where plugins.cfg and resources.cfg (need only read access) are stored. That should be defined in configure progress I think. Right now if it's not defined, it defaults to "". OGRE_CONFIG_AND_LOG_PATH is the path where ogre.cfg and Ogre.log goes to. It defaults to $HOME/.funguloids, unless defined to something else.

FMOD sound output seems to be broken for me (just a few scratching sounds with oss and nothing at all with ALSA) which is really strange! After setting up ALSA's default device, sound output has become very stable - even with multiple apps doing sound output and wild window moving - no clicks at all :D

That is weird. But doesn't surprise me, FMOD has behaved weirdly in Linux before.. :P And damn, just found out that OpenAL doesn't work that well here, I was mistaken before in that I assumed it used ALSA, but seems that it uses OSS.. Whenever I have other programs using audio, there's no sound in Funguloids. No error messages, though. I guess it's back to FMOD for me.. Good to have the choice, though, I'm sure most (Linux) people prefer OpenAL! :D

README and INSTALL will be updated next and then a public Linux beta could be started ;-)

*does Mr. Burns impression* Excellent! :twisted:
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Thu Apr 26, 2007 9:55 pm

I think there's something slightly wrong though, configure finds FMOD fine, but when I specify --with-fmod=yes it doesn't find it anymore, and uses OpenAL instead.. :?

Oops, never intented to support "yes" but you are right. No big deal, I'll see that yes/no/without works everywhere it's needed.

Maybe all the object files should be in separate 'obj' directory or something, they kinda clutter the 'src' directory.. ;)

Never really noticed it since kdevelop can filter the files shown. I try to figure out how to change this (low priority).

EDIT: http://koti.mbnet.fi/lsoft/ogreapp.cpp
I modified that file to support some defines. OGRE_PLUGINS_AND_RESOURCES_PATH is the path where plugins.cfg and resources.cfg (need only read access) are stored. That should be defined in configure progress I think. Right now if it's not defined, it defaults to "". OGRE_CONFIG_AND_LOG_PATH is the path where ogre.cfg and Ogre.log goes to. It defaults to $HOME/.funguloids, unless defined to something else.

Wow, fast as always ;-) With those changes, install could copy all resources to $prefix/lib/funguloids/ and install the executable as $prefix/games/funguloids. That's probably "more a standard" than a start script.

And damn, just found out that OpenAL doesn't work that well here, I was mistaken before in that I assumed it used ALSA, but seems that it uses OSS.. Whenever I have other programs using audio, there's no sound in Funguloids. No error messages, though. I guess it's back to FMOD for me.. Good to have the choice, though, I'm sure most (Linux) people prefer OpenAL! :D

Well, I really believe that dmix should have been release at five years ago. Try to use the .asoudrc from above (if you haven't). It will replace the default device with a new one that is using dmix. And make sure that all other apps that do sound output 1. use ALSA and 2. use the default device (and not explicitly "hw:0,0" which happens to be ALSA default device unless configured otherwise). OSS apps can be starting using the "aoss" wrapper.

OpenAL complains about not being able to get audio access but I'd rather say that exiting the game isn't an option. I personally would leave it the way it is!?

README and INSTALL will be updated next and then a public Linux beta could be started ;-)

*does Mr. Burns impression* Excellent! :twisted:

Lol, thanks again, but this will probably need a couple of days since I have to do some real-worldish stuff...
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Fri Apr 27, 2007 1:15 pm

piet wrote:Wow, fast as always ;-) With those changes, install could copy all resources to $prefix/lib/funguloids/ and install the executable as $prefix/games/funguloids. That's probably "more a standard" than a start script.

Why lib/? Shouldn't it use share/? But yeah, the standard way would probably be the best for most people. http://pingus.seul.org/~grumbel/tutorials/game_install/install_dirs.html Reading that, maybe the hiscores should be saved to /var/games/funguloids, so on a multiuser PC the players could compete for the best score.. :)

Well, I really believe that dmix should have been release at five years ago. Try to use the .asoudrc from above (if you haven't). It will replace the default device with a new one that is using dmix. And make sure that all other apps that do sound output 1. use ALSA and 2. use the default device (and not explicitly "hw:0,0" which happens to be ALSA default device unless configured otherwise). OSS apps can be starting using the "aoss" wrapper.

Didn't work. :( I have Audacious set to use default ALSA device, but Funguloids and it still can't play simultaneously.. Btw, should the changes to .asoundrc and/or .openalrc be in effect instantly, or after a restart? I tried restarting, but no luck. Right now I have that .asoundrc and have set "plug:dmix" for .openalrc.

OpenAL complains about not being able to get audio access but I'd rather say that exiting the game isn't an option. I personally would leave it the way it is!?

Agreed, no need to exit. But it doesn't complain anything for me. From Ogre.log it would seem that everything works perfectly.

Lol, thanks again, but this will probably need a couple of days since I have to do some real-worldish stuff...

Hehe, no problem! :)
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Fri Apr 27, 2007 11:03 pm

mh wrote:Why lib/? Shouldn't it use share/?

I thought it would be wise not to put customised "resources.cfg" and "plugins.cfg" into share/ since they might only work on the host where they were built - while I agree that the mpks should go there (imagine /usr/share being mounted on a host where Ogre is installed in /usr/local/ instead of /usr as on the file server. The server's plugins.cfg says the plugins are in /usr/lib/OGRE/ while they're actually in /usr/local/lib/OGRE/). However, I can't really see that funguloids will be an app where a network-wide installation is critical so then it's share.

mh wrote:Reading that, maybe the hiscores should be saved to /var/games/funguloids, so on a multiuser PC the players could compete for the best score.. :)

I though about that before (and decided that to be overkill if it's implemented foolproof): you would have to make sure that there is a group for such use (e.g. games) and create it if it doesn't. Then all gamers must share this group. Or make the highscores world-writable, which is out of option (at least for me!). I thought I would probably hit every pitfall when trying to ensure this all, so I decided to give up. However, it might be a good thing to have at least the option to install it with a shared highscore file (this could be handled by the configure script). The funguloids executable could be installed setgid games but without any checks for the existants of this group etc.

Didn't work. :( I have Audacious set to use default ALSA device, but Funguloids and it still can't play simultaneously..

Then I strongly believe that something isn't using dmix via the default device (checked your desktop's sound daemon?). Unfortunately, I haven't figured out yet how to tell which apps are using which (ALSA) device so looking which files are open is the way to go:

This is my lsof output when funguloids is the first app using sound output at all (it creates a socket in /tmp/):

Code: Select all
funguloid 6528        piet   11u     unix 0xf57cfac0               29573 /tmp/alsa-dmix-6528-1177707487-72131
funguloid 6531        piet   11u     unix 0xf57cfac0               29573 /tmp/alsa-dmix-6528-1177707487-72131
funguloid 7132        piet  mem       CHR      116,6                2711 /dev/snd/pcmC0D0p
funguloid 7132        piet   12u      CHR      116,6                2711 /dev/snd/pcmC0D0p
funguloid 7132        piet   13r      CHR      116,2                2743 /dev/snd/timer
funguloid 7134        piet  mem       CHR      116,6                2711 /dev/snd/pcmC0D0p
funguloid 7134        piet   12u      CHR      116,6                2711 /dev/snd/pcmC0D0p

with funguloids still running and rocking I can start xmms (mp3 player) and have a perfect cacophony ;-) XMMS doesn't open the socket in /tmp but the same sound device as funguloids:
Code: Select all
xmms      6661        piet  mem       CHR      116,6                2711 /dev/snd/pcmC0D0p
xmms      6661        piet    8u      CHR      116,8                2672 /dev/snd/controlC0
xmms      6661        piet   10u      CHR      116,2                2743 /dev/snd/timer
xmms      6661        piet   11u      CHR      116,6                2711 /dev/snd/pcmC0D0p
xmms      6661        piet   12r      CHR      116,8                2672 /dev/snd/controlC0

With OSS, you will get /dev/[sound/]dsp in the output:
Code: Select all
xmms      6661        piet    9r      CHR       14,3                2693 /dev/dsp



Btw, should the changes to .asoundrc and/or .openalrc be in effect instantly, or after a restart? I tried restarting, but no luck.

The ALSA lib has to release all (hardware) sound device in use (closing all apps with sound output should do the trick). Changes in the openalrc took effect on each new start.

Right now I have that .asoundrc and have set "plug:dmix" for .openalrc.

That's not going to work. It's important that *all* apps use the default device and not "plug:dmix" directly. But I guess you have tried "default" in .openalrc, right? And note that OpenAL will *always* fall back to OSS even if it is not mentioned in the device list (as "dsp" or "native").

OpenAL complains about not being able to get audio access but I'd rather say that exiting the game isn't an option. I personally would leave it the way it is!?

Agreed, no need to exit. But it doesn't complain anything for me. From Ogre.log it would seem that everything works perfectly.

Strange, that's my output when sound is blocked by another app:
Code: Select all
ALSA lib pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave
open /dev/[sound/]dsp: Device or resource busy
OpanAL: cannot create OpenAL device
OpenALSoundSystem ERROR: cannot create SoundSystem.
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Sat Apr 28, 2007 8:47 am

piet wrote:I thought it would be wise not to put customised "resources.cfg" and "plugins.cfg" into share/ since they might only work on the host where they were built - while I agree that the mpks should go there (imagine /usr/share being mounted on a host where Ogre is installed in /usr/local/ instead of /usr as on the file server. The server's plugins.cfg says the plugins are in /usr/lib/OGRE/ while they're actually in /usr/local/lib/OGRE/). However, I can't really see that funguloids will be an app where a network-wide installation is critical so then it's share.

Ah okay, do whatever you think it's for the best. I haven't used Linux very much (as of now), so I shouldn't decide on these things.. :)

I though about that before (and decided that to be overkill if it's implemented foolproof): you would have to make sure that there is a group for such use (e.g. games) and create it if it doesn't. Then all gamers must share this group. Or make the highscores world-writable, which is out of option (at least for me!). I thought I would probably hit every pitfall when trying to ensure this all, so I decided to give up. However, it might be a good thing to have at least the option to install it with a shared highscore file (this could be handled by the configure script). The funguloids executable could be installed setgid games but without any checks for the existants of this group etc.

:shock: Darn, didn't realise there's that much to it. Then it shall be as it is, $HOME/.funguloids. :)

Then I strongly believe that something isn't using dmix via the default device (checked your desktop's sound daemon?).

I have ALSA for all the GNOME sound settings. However, there's also software mixing (ESD) box checked.

This is my lsof output when funguloids is the first app using sound output at all (it creates a socket in /tmp/):

Audacious (it's based on XMMS) uses /dev/snd, but Funguloids doesn't seem to use anything sound related.. :?

That's not going to work. It's important that *all* apps use the default device and not "plug:dmix" directly. But I guess you have tried "default" in .openalrc, right? And note that OpenAL will *always* fall back to OSS even if it is not mentioned in the device list (as "dsp" or "native").

Okay. I did try with "default", though. Didn't work. :(

FMOD works fine though.
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Thu May 03, 2007 9:54 pm

Finally, after some delay, here is a new version: http://www.newbyteorder.net/funguloids-1.06-1.tar.bz2

Changes:
    * INSTALL has been filled with life
    * The executable is now installed to $PREFIX/games/ and the data files to $PREFIX/share/games/funguloids/. That should be standard enough...
    * Autotools are set up a bit more clean, all no/with/yes etc. options are supposed to work now.
    * All paths inside the configuration files are pointing to the right files. This does mean, however, that executing funguloids from the source's bin/ dir will depend on the installed data files and not the ones from the source dir.
    * A shared system-wide highscore file can be enabled with a configure option. The default is to use the user's .funguloids directory.
    * Music is fetched from $PREFIX/share/games/funguloids/music. It would be nice to add a LUA function that returns the expanded path to $HOME/.funguloids/ to allow adding music from the user's home dir.


Okay. I did try with "default", though. Didn't work. Sad

FMOD works fine though.

I noticed just a few days ago that I cannot play back audio with another sample rate (e.g. 48k) without clicks with mplayer. vlc works fine, though. Both use ALSA's dmix configured to 44k for maximum quality Funguloids experience 8) I had a peek inside OpenAL's ALSA sources and read some more about clicks and sample rate conversion but still need to try some other options like ALSA's sample rate converter plugin. What a pain!

And then I has this strange experience with a new GP2X. While the device is quite funny, its mp3 software (or even the hardware?) is compromised by, guess what, clicks! I returned it but I simply cannot shake the feeling that I'm haunted by bad audio implementations (at least two persons confirmed the clicks so it is not me going nuts ;-)
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Fri May 04, 2007 12:33 pm

Awesome work once again, piet! :D

piet wrote:Changes:
    * INSTALL has been filled with life
    * The executable is now installed to $PREFIX/games/ and the data files to $PREFIX/share/games/funguloids/. That should be standard enough...
    * Autotools are set up a bit more clean, all no/with/yes etc. options are supposed to work now.
    * All paths inside the configuration files are pointing to the right files. This does mean, however, that executing funguloids from the source's bin/ dir will depend on the installed data files and not the ones from the source dir.
    * A shared system-wide highscore file can be enabled with a configure option. The default is to use the user's .funguloids directory.
    * Music is fetched from $PREFIX/share/games/funguloids/music. It would be nice to add a LUA function that returns the expanded path to $HOME/.funguloids/ to allow adding music from the user's home dir.

Works really well! :) I think the path for the icon is not created though, as pointed in INSTALL: ...It is located in ${prefix}/games/funguloids/icons/GLX_icon.png. Also, is there 'make uninstall'? I guess it would be handy thing to have.
EDIT: About the icon, the file funguloids.png is not used by anything so it's not needed to install. GLX_icon.png is the exact same file, and it's used for the Ogre window. But maybe it (funguloids.png) should go to /usr/share/pixmaps/ so it'll be available when adding menu items? Not needed if it creates some additional permission problems etc.. :P

I modified some files to support the GetMusicDir() Lua-function, a good idea that was. Now if the user copies music to $HOME/.funguloids/music/, it will be picked up by the game. :) README (as well as the readme.html) was changed as well. There's nothing on the audio things in there yet, so it'll need some work. Now the game uses the define VERSION for it's version number in the main menu, instead of reading it from Ogre .overlay file. Note that the adjustment is off with the v1.05 mpk-files, I will supply an updated .mpk for v1.06 so it looks correct no matter how lengthy the version string is. :) I also fixed some stupid preprocessor bugs (I had used #ifdef OGRE_PLATFORM_LINUX instead of #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX.. :oops:).

That's all I changed, I think. 8)

http://koti.mbnet.fi/lsoft/fung/1.06-1-mods.zip
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

Postby piet » Sat May 05, 2007 3:35 pm

mh wrote:I think the path for the icon is not created though, as pointed in INSTALL: ...It is located in ${prefix}/games/funguloids/icons/GLX_icon.png. Also, is there 'make uninstall'? I guess it would be handy thing to have.


Hey, what a very observant ready you are, respect ;-) Missed a 'share' in the docs but as you pointed out, share/pixmaps/ is a much more convenient place for the user so funguloids.png goes there now.

'make uninstall' comes free with autotools. Added a paragraph to INSTALL as well.

mh wrote:I modified some files to support the GetMusicDir() Lua-function, a good idea that was. Now if the user copies music to $HOME/.funguloids/music/, it will be picked up by the game. :)


Works great and makes testing much more fun ;-)

mh wrote:README (as well as the readme.html) was changed as well. There's nothing on the audio things in there yet, so it'll need some work.


I will try to find the best, complete and up-to-date docs :roll: online and add a link to README or INSTALL. I believe that this would be better than doing it by myself because it will be updated as OpenAL and/or ALSA changes.

Except for some more hints on the audio setup the linux tarball can be considered at least beta :D Here it is: http://www.newbyteorder.net/funguloids-1.06-2.tar.bz2

Yes, and thanks for the credits :)
piet
Kobold
 
Posts: 27
Kudos: 0
Joined: 10 Mar 2004
Location: Berlin, Germany

Postby mh » Sat May 05, 2007 8:26 pm

piet wrote:I will try to find the best, complete and up-to-date docs :roll: online and add a link to README or INSTALL. I believe that this would be better than doing it by myself because it will be updated as OpenAL and/or ALSA changes.

Except for some more hints on the audio setup the linux tarball can be considered at least beta :D Here it is: http://www.newbyteorder.net/funguloids-1.06-2.tar.bz2

Sounds great! We'll get this out soon, I hope. :)

Yes, and thanks for the credits :)

You're welcome! :D
.: An Ogre game: Those Funny Funguloids! :.
User avatar
mh
Gremlin
 
Posts: 160
Kudos: 0
Joined: 18 Jun 2003
Location: Finland

PreviousNext

Return to Showcase

Who is online

Users browsing this forum: No registered users and 8 guests