June 28, 2008  
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30

[00:37:15] * KittyCat is back.
[00:41:49] *** prophile has joined #openal
[00:41:49] *** ChanServ sets mode: +v prophile
[00:46:48] *** angasule has joined #openal
[00:46:48] *** ChanServ sets mode: +v angasule
[01:15:41] *** prophile has quit IRC
[01:24:57] *** kb1ooo has quit IRC
[04:43:58] *** barraAway has quit IRC
[05:21:18] *** jvalenzu has quit IRC
[05:39:04] *** juanmabc has quit IRC
[06:49:08] *** juanmabc has joined #openal
[06:49:08] *** ChanServ sets mode: +v juanmabc
[06:51:57] *** juanmabc has quit IRC
[07:28:09] *** juanmabc has joined #openal
[07:28:09] *** ChanServ sets mode: +v juanmabc
[08:21:21] *** juanmabc has quit IRC
[08:33:11] *** juanmabc has joined #openal
[08:33:11] *** ChanServ sets mode: +v juanmabc
[09:03:18] * KittyCat is away: sleep
[10:11:43] *** juanmabc has quit IRC
[11:56:59] *** juanmabc has joined #openal
[11:56:59] *** ChanServ sets mode: +v juanmabc
[12:39:15] *** prophile has joined #openal
[12:39:16] *** ChanServ sets mode: +v prophile
[16:42:12] *** jvalenzu has joined #openal
[16:42:12] *** ChanServ sets mode: +v jvalenzu
[17:45:19] *** barra_away has joined #openal
[17:45:20] *** ChanServ sets mode: +v barra_away
[17:48:56] *** barra_away is now known as barra_
[18:13:33] *** juanmabc has quit IRC
[18:35:50] *** angasule has quit IRC
[19:28:31] *** wild has joined #openal
[19:28:31] *** ChanServ sets mode: +v wild
[19:28:39] <wild> hi
[19:55:09] *** juanmabc has joined #openal
[19:55:09] *** ChanServ sets mode: +v juanmabc
[19:55:44] <wild> hi
[19:55:53] <barra_> moin wild
[19:56:42] <wild> i was curious on why when i run a simple cmd openal app that plays ogg
[19:56:51] <wild> half my processor is being used
[20:00:30] <KittyCat> what command?
[20:00:33] <KittyCat> what OS?
[20:01:33] <wild> linux
[20:01:43] <wild> distro is ubuntu
[20:02:07] <wild> i already installed the openal soft drivers. but the openal app still is using 50% of the processor
[20:03:31] <wild> do you want to see the code?
[20:04:10] *** angasule has joined #openal
[20:04:11] *** ChanServ sets mode: +v angasule
[20:05:24] <KittyCat> sure
[20:05:58] <KittyCat> you can paste it to http://rafb.net/paste if you need some place
[20:06:52] <wild> http://pastebin.com/m29e682fe
[20:06:58] <wild> that fine?
[20:07:27] <wild> the code is straight from the devmaster tutorials but i dont belive it should be using 50% of the processor
[20:07:49] * KittyCat looks
[20:10:24] <KittyCat> it's because the code isn't resting at all
[20:10:48] <KittyCat> it just runs as fast as possible and takes up as much thread time as it can
[20:11:27] <wild> so how would i slow it down?
[20:11:58] <KittyCat> alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed);
[20:12:04] <KittyCat> if(processed == 0) {
[20:12:10] <KittyCat>   usleep(1000);
[20:12:14] <KittyCat>   return true;
[20:12:15] <KittyCat> }
[20:12:31] <wild> put it were ?
[20:12:52] <KittyCat> cAudio::update
[20:13:33] <KittyCat> also, 8096*8 bytes is rather large to put on the stack
[20:13:55] <wild> wow thanks that helped
[20:13:58] <wild> perfectly
[20:14:01] <KittyCat> and I'd probably use 3 buffers instead of 2
[20:14:19] <wild> alright
[20:15:42] <wild> now just gotta work on it somemore till i can put it in the game framework :)
[20:15:54] <wild> you have been a great help you just solved tns of fustration
[20:16:31] <KittyCat> :)
[20:16:54] <KittyCat> normally it'd be the main game loop that would rest for you, and you'd just poll the audio as part of the logic
[20:37:31] <wild> with the same code how would i be able to play multiple streams
[20:37:33] <wild> at the same time
[20:55:39] * KittyCat is back.
[20:57:54] <wild> trying to play multiple sources
[21:12:35] <wild>  kittycat im trying to adapt the code i have to the code in tutorial 5
[21:12:49] <wild> http://64.233.167.104/search?q=cache:yg_tzRWmyIwJ:www.devmaster.net/articles/openal-tutorials/lesson5.php+http://www.devmaster.net/articles/openal-tutorials/lesson5.php&hl=en&ct=clnk&cd=1&gl=us&client=firefox-a
[21:12:57] <wild> but it dosnt seem to work the same way
[21:16:09] <KittyCat> what's the issue you're having?
[21:16:28] <wild> i just quite cant get how i would get multiple streams playing
[21:16:41] <wild> how does throwing the sources into a vector enable me to play multiple?
[21:17:30] <KittyCat> it doesn't. but putting them into a vector helps manage them
[21:17:54] <wild> ok so how do i play multiple sources?
[21:18:08] <KittyCat> by generating two sources, attaching them to buffers, and then playing them
[21:18:32] <KittyCat> when you call alGenSources you get a unique ID for the source(s). each one is its own object
[21:18:55] <wild> ok
[21:20:04] <wild> how do i get the unique id?
[21:20:26] <KittyCat> alGenSources(1, &source);  source is now the unique id
[21:21:11] <KittyCat> Sources.push_back(source); // store the source in the vector
[21:21:15] <KittyCat> alGenSources(1, &source);  source is now another unique id
[21:21:24] <KittyCat> Sources.push_back(source); // store the second source in the vector
[21:22:05] <wild> ok
[21:22:30] <wild> so since both are called & source playing source
[21:22:34] <wild> should play both correct?
[21:23:37] <KittyCat> the'll play when you call alSourcePlay on them (which you do after attaching a source on them)
[21:24:13] <KittyCat> you have to call it on each one individually
[21:25:15] <KittyCat> generally, the source would be a part of a bigger object that can play a sound
[21:25:21] <KittyCat> like:
[21:25:30] <KittyCat> struct Object {
[21:25:35] <KittyCat>   float x, y, z;
[21:25:41] <KittyCat>   ALuint source;
[21:25:42] <KittyCat>   ...
[21:25:44] <KittyCat> };
[21:26:24] <KittyCat> and when an object wants to make a sound, you'd use its 'source' member
[21:26:28] <wild> so right now what the code is doign is loading both but it only plays the second one becuase it has the source id correct
[21:27:15] <KittyCat> that tutorial you linked to looks to be rather poor, btw..
[21:27:25] <wild> do you have a better one?
[21:27:35] <KittyCat> not off hand..
[21:27:47] <wild> example code etc?
[21:27:50] <KittyCat> why don't you paste your current code, and I'll help you figure it out
[21:28:32] <wild> http://pastebin.com/m29e682fe
[21:28:58] <wild> hold up thats old
[21:32:03] <wild> http://pastebin.com/m1c034c60
[21:33:24] <wild>  witht he current one
[21:33:56] <wild> current code 1.ogg plays only
[21:35:37] <KittyCat> there's a problem in that that ogg/vorbis data only has one instance, and you're only u sing 'source', which is set to the last loaded source.
[21:36:13] <KittyCat> the way to do it h ere would be to make cAudio only have one source, but allow you to make two cAudio objects
[21:37:09] <wild> but then wouldnt i need like 4 objects in order to play 4 sounds at same time?
[21:37:24] <KittyCat> right. that's what you need
[21:37:34] <KittyCat> each object needs its own information
[21:38:16] <KittyCat> each object needs its own buffers, its own OggVorbis_File, its own vorbis_info, etc
[21:38:18] <wild> i want to simplfiy it to just doing caudio->open(file);
[21:38:32] <wild> anywere without needing to create seperate objects
[21:38:37] <wild> but i take it this is undoable?
[21:39:25] <KittyCat> it might be doable, but it would be largely impractical
[21:39:33] <KittyCat> and ultimately confusing
[21:40:28] <wild> the reason i needed one instance is
[21:40:43] <wild> so i could call the updating in the maincpp and be able to load files from everywere else
[21:42:27] <wild> the game loop is in the main.cpp and i dont wanna call all the audio updates from there unless...
[21:46:34] <KittyCat> normally I'd think you'd have an array of base objects, and in your main loop you'd iterate over them all
[21:47:16] <KittyCat> cAudio::cAudio could add 'this' to a static std::vector<cAudio*>
[21:47:29] <KittyCat> and cAudio::~cAudio would remove 'this' from the same vector
[21:48:20] <KittyCat> then in your loop, you just need to iterator over the objects in cAudio::TheVector, call calling update, playing, and playback as needed
[21:49:02] <angasule> time to get some food :) Then I'll touch the thingie up a little and make a beta release, it's almost done
[21:49:03] <angasule> http://www.anduin.net/~angasule/
[21:50:41] <wild> hmm
[21:50:56] *** juanmabc has quit IRC
[21:52:29] <wild> so the vector would hold all the sources and i move threw them?
[21:53:33] <KittyCat> the vector would hold all the cAudios
[21:54:51] <wild> alright and to play them i basically put a while loop or just add teh update code going threw the vector?
[21:55:28] <KittyCat> right. for each object in the vector, you call the update method, playing, and playback as needed
[21:55:56] <wild> cool
[21:56:01] <wild> lets try it now XD
[21:56:13] <KittyCat> for(cAudio::TheVector::iterator i = cAudio::TheVector.begin();i != cAudio::TheVector.end();i++) {
[21:56:26] <KittyCat>    if((*i)->update()) {
[21:56:30] <wild> thevector being the name of the bector itself correct?
[21:56:42] <KittyCat> yeah
[22:01:36] <wild> gave me a cAudio::thevector is not a class or namespace
[22:01:51] <KittyCat> how are you declaring it?
[22:01:58] <wild> in caudio
[22:02:01] <wild> public:
[22:02:13] <wild> vector<cAudio*> thevector;
[22:02:20] <KittyCat> should be static
[22:02:33] <KittyCat> it's baiscally a list of instances
[22:03:10] <wild> i put static vecotr<cAudio*> thevector
[22:04:40] <KittyCat> you need 'vector<cAudio*> cAudio::thevector;' outside of the class like any other static member too, don't forget
[22:04:41] <wild> when i pust static vector<cAudio*> thevector; i get the same error cAudio::thevector is not a class or namespace
[22:04:51] <KittyCat> how are you using it?
[22:06:47] <wild> i just have static vector<cAudio*> thevector; declared under public in cAudio
[22:07:48] <wild> ill show you
[22:07:51] <KittyCat> you need 'vector<cAudio*> cAudio::thevector;' outside of the class, too
[22:08:43] <wild> meaing in the cAudo cpp correct
[22:08:53] <KittyCat> yeah
[22:09:15] <KittyCat> just like you did with cAudio cAudio::m_cAudio;
[22:10:09] <wild> gave me invalid declarator before cAudio
[22:10:25] <KittyCat> paste your new code
[22:14:26] <wild> http://pastebin.com/m1e3462aa
[22:15:45] <KittyCat> which line is the error?
[22:16:06] <wild> 63
[22:16:44] <KittyCat> remove the cAudio at the beginning of the line
[22:16:54] <KittyCat> vector<cAudio*> is the type, not cAudio
[22:17:18] <wild> when i do that i get a error "class cAudio::thevector is not a class or namespace
[22:17:25] <wild> line 355
[22:18:23] <KittyCat> 'iterator', not 'interator'
[22:18:49] <wild> still get same error :/
[22:18:57] <wild> but thanks for the catch :)
[22:19:27] <KittyCat> hmm.. you shouldn't use the 'using' keyword in a header
[22:20:10] <KittyCat> can also get rid of Instance() and m_cAudio. those are replaced by the vector
[22:21:35] <wild> i still get the same cAudio::thevector is not a class or namespace
[22:21:40] <wild> i fixed the using thing to
[22:23:39] <KittyCat> hmm, I don't know.. I can't see a problem..
[22:23:45] <KittyCat> paste the updated code
[22:24:17] <wild> curious if i dont have Instance anymore
[22:24:21] <wild> to create the object i do
[22:24:25] <wild> cAudio audio; now?
[22:24:39] <wild> to create the object?
[22:24:52] <wild> nvm
[22:24:54] <KittyCat> that's one way, sure
[22:28:19] <wild> http://pastebin.com/m6e07b30a
[22:29:17] <wild> error 348
[22:35:54] <wild> werid..
[22:36:36] <KittyCat> very. I can't see why that error is coming up..
[22:36:55] <wild> im asking in the freenode c++ channel currently
[22:38:51] <KittyCat> oh. vector<cAudio*>::iterator
[22:39:02] <KittyCat> not cAudio::thevector::iterator
[22:39:45] <wild> lol that worked
[22:39:47] <KittyCat> you also need to use 'cAudio audio;' instead of 'cAudio* audio;'
[22:39:51] <KittyCat> same for audio2
[22:39:59] <KittyCat> unless you want to new/delete them
[22:40:41] <wild> true
[22:43:06] <wild> lol played small bit then crashed
[22:43:17] <wild> shouldnt it be a while loop?
[22:43:23] <wild> or a while within the for loop?
[22:44:39] <KittyCat> in a while loop, yeah
[22:44:44] <KittyCat> something like:
[22:44:51] <KittyCat> bool playing;
[22:44:53] <KittyCat> do {
[22:44:58] <KittyCat>   playing = false;
[22:45:04] <KittyCat>   for(...) {
[22:45:16] <KittyCat>     if((*i)->update()) {
[22:45:23] <KittyCat>       playing = true;
[22:45:27] <KittyCat>       ...
[22:45:31] <KittyCat>     }
[22:45:34] <KittyCat>   }
[22:45:39] <KittyCat> } while(playing);
[22:48:20] <wild> yeah i get like 1 second of playing then crash
[22:50:13] * wild slams head on tale
[22:50:43] <wild> table*
[22:50:47] <KittyCat> use a debugger
[22:51:55] <wild> dosnt crash just stops playing
[22:52:02] <wild> playback isnt looping
[22:52:22] <KittyCat> paste the code
[22:54:08] <wild> http://pastebin.com/m6957f9b3
[22:54:16] <wild> whoops i never call update
[22:54:41] <wild> it worked :)
[22:57:28] <wild> ty :)
[22:59:07] <KittyCat> you're welcome :)
[22:59:21] * wild bows
[22:59:37] <wild> first time anyone spent 2 sum hours helping me
[23:02:47] <angasule> KittyCat: do ALSA and OSS exist on windows? I could just not show them on windows, and also not show winmm and dsound on linux
[23:03:12] <KittyCat> they don't, afaik
[23:03:22] <KittyCat> though I'd imagine it's not technically impossible
[23:03:29] <angasule> anyway, saving and loading are done for both local and global config
[23:03:43] <KittyCat> cool
[23:03:49] <wild> i currently have two linux boxes one oss and one alsa
[23:03:56] <wild> i can test something out for you if you want
[23:04:28] <angasule> cool, KittyCat must have use for that, my thing just configures openal-soft :)
[23:06:43] <wild> openal-soft i setup manualy
[23:07:03] <wild> that wasnt fun at all now synaptic tells me i have broken packages i dont care :/ though
[23:08:21] <KittyCat> hopefully openal soft packages will get in soon
[23:08:39] <angasule> debian should be getting it into testing any day now
[23:08:54] <angasule> which means it'll make it for the next stable debian release AND the next ubuntu release
[23:09:09] <wild> the next ubuntu release is in a while
[23:09:16] <angasule> yeap
[23:09:23] <wild> im on gutsy still i never liked
[23:09:25] <wild> hardy
[23:11:18] <wild> whats the deal with lgpl the licences?
[23:11:24] <wild> can you give me a quick summary
[23:12:34] <KittyCat> you can distribute binaries of it without a problem, unless you modify it it (then you must give back the changes)
[23:12:54] <KittyCat> also you need to make sure it can be replaced
[23:13:10] <KittyCat> eg. if it's a shared lib, make sure people can replace it with their own version if they want
[23:13:29] <KittyCat> if it's static linked, you need to provide object files so they can relink it with their own version
[23:15:53] <wild> alright how far is selling it?
[23:16:05] <wild> whats restrictions like lets say i make a program with a libary thats lgpl
[23:16:11] <angasule> selling it is ok
[23:16:36] <wild> ahh ok
[23:21:30] <wild> angasule you have a program that will setup openal-soft?
[23:21:43] <angasule> wild: it's used to configure the options, not to install it
[23:21:53] <wild> lol easy way to install it?
[23:22:49] <wild> its telling me libopenal-dev and libalut0 are broken
[23:23:32] <KittyCat> libalut shouldn't be
[23:24:39] <KittyCat> you just need to install openal-soft like normal, and replace libopenal.so.0.0.0 from the openal package (point it to openal-soft's libopenal.so.1)
[23:25:53] <wild> so rename libopenal.so.0 to something else
[23:25:59] <wild> then run the instalation?
[23:26:12] <wild> i had trouble with openal-soft before
[23:26:29] <wild> its giving me cant overwrite libopenal.so becuase its owned by openal0
[23:27:14] <KittyCat> libopenal.so.0.0.0
[23:27:26] <KittyCat> make it a symlink that points to openal-soft's libopenal.so.1
[23:27:51] <wild> there is no libopenal.so.1
[23:28:33] <KittyCat> openal soft installs it. it's likely in /usr/local/lib
[23:29:52] <wild> nope when i run the openal-soft it gives me dpkg: error processing libopenl0a-soft.deb trying to overright '/usr/lib/libopenal.so.0 wich is also in package libopenal0a
[23:30:15] <wild> im not compiling from source
[23:30:19] <KittyCat> when you run openal soft?
[23:30:36] <wild> when i try to run the openal-soft.deb
[23:31:05] <KittyCat> oh. you probably need to uninstall the current openal package
[23:31:29] <wild> i tried that then i get
[23:31:35] <wild> broke packages when i reboot
[23:32:21] <angasule> there is an openal-soft.deb?
[23:32:29] <wild> lol o i know
[23:32:35] <wild> http://ubuntuforums.org/showthread.php?t=725727&highlight=openal+soft
[23:32:44] <wild> ill install the openal soft lib.so.o
[23:32:56] <wild> rename to lib.so.1 then install the original openal and change sym link
[23:33:27] <KittyCat> you shouldn't need to install both
[23:35:13] <wild> how do i find out were the linked libary is?
[23:35:43] <wild> i can install the openal dev packages manualyt
[23:36:15] <KittyCat> uninstall libopenal0a, then install libopenl0a-soft
[23:37:05] <wild> now i got no alut
[23:37:30] <wild> and when i try to install the libalut deb it trys to reinstall libopenal0a
[23:38:08] <wild> would it be alot easier if i just compiled it from source?
[23:39:20] <KittyCat> probably
[23:39:44] <wild> bah
[23:39:50] <wild> how would i change the symlink?
[23:40:18] <KittyCat> rm libopenal.so.0.0.0 && ln -s ../local/lib/libopenal.so.1 libopenal.so.0.0.0
[23:40:22] <KittyCat> as root, while in /usr/lib
[23:43:31] <wild> damn my slow connection
[23:43:37] <wild> 4mb download
[23:46:36] <wild> jsut noticed
[23:46:53] <wild> if there is one file to be played it wont play it

top