FreeOrion

Forums for the FreeOrion project
It is currently Sun May 19, 2013 7:58 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: What am I doing wrong?
PostPosted: Mon Nov 19, 2007 10:00 pm 
Offline
Space Krill

Joined: Mon Nov 19, 2007 9:55 pm
Posts: 3
Okay guys, I installed .Net Framework 2.0 and FreeOrion 0.3.1-RC6, but I just can't make this whole thing work. Every time I try to start FreeOrion, there's just an endless stream of error messages. Here's the most "popular" one:

Error: Fillbuffer: OpenAL ERROR: Invalid name

Any ideas? I tried to search for this error, but it seems like I'm the only one with this problem... :?


Top
 Profile  
 
 Post subject: Re: What am I doing wrong?
PostPosted: Fri Dec 21, 2007 10:36 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7887
Location: Vancouver, BC
Sorry for the late reply, if you're still here to read it, but you might need to install OpenAL.


Top
 Profile  
 
 Post subject: Re: What am I doing wrong?
PostPosted: Wed Jan 16, 2008 4:28 pm 
Offline
Space Krill

Joined: Mon Nov 19, 2007 9:55 pm
Posts: 3
You're going to laugh, cause OpenAL was already installed. Seems like this program doesn't like Freeorion...


Top
 Profile  
 
 Post subject: Re: What am I doing wrong?
PostPosted: Tue Jan 22, 2008 12:11 pm 
Offline
Space Kraken
User avatar

Joined: Tue Aug 09, 2005 6:47 pm
Posts: 100
Location: Somewhere in Poland
Error: Fillbuffer: OpenAL ERROR: Invalid name
this happens when there is an OpenAL error after trying to copy decoded ogg data to a buffer. This doesn't neccesarily mean that this operation is at fault, as there is no checking for previous errors (TRANSLATION: I need more info to diagnose the problem)

Can you post the initial OpenAL debug information?
(something like "Unable to initialise OpenAL device: xxx" or "OpenAL initialized. Version xxx")

and check for errors like "PlayMusic: unable to open file xxx" and "PlayMusic: OpenAL ERROR: xxx"
All theese should appear once, somewhere at the beginning. Also, any other OpenAL-related errors would be helpful.
If these don't appear then we'll need more rigorous error-checking there.

Geoff the Medio wrote:
Sorry for the late reply, if you're still here to read it, but you might need to install OpenAL.
ummm... the fact that he's seing the message means he has OpenAL it was initialized properly, but encountered an error during operation.

_________________
abs(imag(ME) / abs(ME)) = exp(PI) - PI - 19;


Top
 Profile  
 
 Post subject: Re: What am I doing wrong?
PostPosted: Sat Feb 02, 2008 11:33 pm 
Offline
Space Krill

Joined: Mon Nov 19, 2007 9:55 pm
Posts: 3
Well, there's no initial OpenAL debug information. It starts right with "Error: Fillbuffer: OpenAL ERROR: Invalid name".

"PlayMusic: OpenAL ERROR: Invalid Name" is also present, as well as "PlaySound: OpenAL ERROR: Invalid Name" - which appears twice :|


Top
 Profile  
 
 Post subject: Re: What am I doing wrong?
PostPosted: Sun Feb 03, 2008 10:05 pm 
Offline
Space Kraken
User avatar

Joined: Tue Aug 09, 2005 6:47 pm
Posts: 100
Location: Somewhere in Poland
There is one possibility: I didn't check for any errors during sources generation, assuming that all soundcards using OpenAL can handle 16 sources (in HumanClientAppSoundOpenAL.h line 23, NUM_SOURCES - has to be at least 2 if you want something beside music) .... still, 16 is stated in OpenAL documentation as a "safe" amount of sources even for software fallback. (64 being called "a sensible limit")

_________________
abs(imag(ME) / abs(ME)) = exp(PI) - PI - 19;


Top
 Profile  
 
 Post subject: Re: What am I doing wrong?
PostPosted: Thu Feb 07, 2008 8:33 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7887
Location: Vancouver, BC
Someone's posted a sourceforge bug report about this (I think):

http://sourceforge.net/tracker/index.ph ... tid=544942


Top
 Profile  
 
 Post subject: Re: What am I doing wrong?
PostPosted: Fri Feb 08, 2008 1:50 pm 
Offline
Space Kraken
User avatar

Joined: Tue Aug 09, 2005 6:47 pm
Posts: 100
Location: Somewhere in Poland
I've changed the init code a bit so it should be fail-proof this time (but no sound for you at this time, sir - I'll try recoding the whole thing so that the number of sources can be dynamically changed at init instead of being hardcoded)
I'll try to compile it today and if it works (as in: initializes correctly, I can't reproduce your problem) I'll make a patch and send it to someone to commit to CVS

_________________
abs(imag(ME) / abs(ME)) = exp(PI) - PI - 19;


Top
 Profile  
 
 Post subject: Re: What am I doing wrong?
PostPosted: Fri Feb 08, 2008 3:24 pm 
Offline
Space Kraken
User avatar

Joined: Tue Aug 09, 2005 6:47 pm
Posts: 100
Location: Somewhere in Poland
Here is the patch if you want to apply it yourself:
Code:
diff -u -r -x .svn ./freeorion/FreeOrion/client/human/HumanClientAppSoundOpenAL.cpp ./freeorion-devel/FreeOrion/client/human/HumanClientAppSoundOpenAL.cpp
--- ./freeorion/FreeOrion/client/human/HumanClientAppSoundOpenAL.cpp   2008-01-22 13:47:10.000000000 +0100
+++ ./freeorion-devel/FreeOrion/client/human/HumanClientAppSoundOpenAL.cpp   2008-02-08 14:44:55.000000000 +0100
@@ -12,31 +12,63 @@
     {
         ALCcontext *m_context;
         ALCdevice *m_device;
-       
+        ALenum error_code;
+
         m_device = alcOpenDevice(NULL); /* currently only select the default output device - usually a NULL-terminated
                                          * string desctribing a device can be passed here (of type ALchar*)
                                          */
-        if (m_device == NULL) {
+        if (m_device == NULL)
             Logger().errorStream() << "Unable to initialise OpenAL device: " << alGetString(alGetError()) << "\n";
-        } else {
+        else
+        {
             m_context = alcCreateContext(m_device,NULL); // instead of NULL we can pass a ALCint* pointing to a set of
-            alcMakeContextCurrent(m_context);            // attributes (ALC_FREQUENCY, ALC_REFRESH and ALC_SYNC)
-            alutInitWithoutContext(NULL,NULL); // we need to init alut or we won't be able to read .wav files
-            alListenerf(AL_GAIN,1.0);
-            alGenSources(num_sources, sources);
-            alGenBuffers(2, music_buffers);
-            for (int i = 0; i < num_sources; ++i) {
-                alSourcei(sources[i], AL_SOURCE_RELATIVE, AL_TRUE);
+                                                         // attributes (ALC_FREQUENCY, ALC_REFRESH and ALC_SYNC)
+           
+            if ((m_context != NULL) && (alcMakeContextCurrent(m_context) == AL_TRUE))
+            {
+                alutInitWithoutContext(NULL,NULL); // we need to init alut or we won't be able to read .wav files
+                alListenerf(AL_GAIN,1.0);
+                alGetError(); // clear possible previous errors (just to be certain)
+                alGenSources(num_sources, sources);
+                error_code = alGetError();
+                if(error_code != AL_NO_ERROR)
+                {
+                     Logger().errorStream() << "Unable to create OpenAL sources: " << alGetString(error_code) << "\n" << "Disabling OpenAL sound system!\n";
+                    alcMakeContextCurrent(NULL);
+                    alcDestroyContext(m_context);
+                }
+                else
+                {
+                    alGetError();
+                    alGenBuffers(2, music_buffers);
+                    error_code = alGetError();
+                    if(error_code != AL_NO_ERROR)
+                    {
+                        Logger().errorStream() << "Unable to create OpenAL buffers: " << alGetString(error_code) << "\n" << "Disabling OpenAL sound system!\n";
+                        alDeleteBuffers(2, music_buffers);
+                        alcMakeContextCurrent(NULL);
+                        alcDestroyContext(m_context);
+                    }
+                    else
+                    {
+                        for (int i = 0; i < num_sources; ++i)
+                        {
+                            alSourcei(sources[i], AL_SOURCE_RELATIVE, AL_TRUE);
+                        }
+                        Logger().debugStream() << "OpenAL initialized. Version "
+                                               << alGetString(AL_VERSION)
+                                               << "Renderer "
+                                               << alGetString(AL_RENDERER)
+                                               << "Vendor "
+                                               << alGetString(AL_VENDOR)
+                                               << "\nExtensions: "
+                                               << alGetString(AL_EXTENSIONS)
+                                               << "\n";
+                    }
+                }
             }
-            Logger().debugStream() << "OpenAL initialized. Version "
-                                   << alGetString(AL_VERSION)
-                                   << "Renderer "
-                                   << alGetString(AL_RENDERER)
-                                   << "Vendor "
-                                   << alGetString(AL_VENDOR)
-                                   << "\nExtensions: "
-                                   << alGetString(AL_EXTENSIONS)
-                                   << "\n";
+            else
+                Logger().errorStream() << "Unable to create OpenAL context : " << alGetString(alGetError()) << "\n";
         }
     }

This is a quick fix (Disables the whole system if can't get the required number of buffers/sources as those numbers are currently hard-coded in all sound-related functions. I'll make a more elegant solution (try to use smaller amount of sources, then disable sound if that fails) later - currently too exhausted and sleep-deprieved (blame the university I'm attending))

_________________
abs(imag(ME) / abs(ME)) = exp(PI) - PI - 19;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group