OpenAL -- where to get it?
by J "hplus" W · in Torque Game Engine · 10/13/2006 (8:16 pm) · 5 replies
I deleted the question right after posting, because the real answer was as easy as "yum install openal".
The version on www.openal.org seemed to be old (version 0.8).
However, the REAL question was "why doesn't Torque find it" and the answer was "because it doesn't look in /lib or /usr/lib, only in the Torque directories and straight dlopen()". Thus, adding cases for searching /lib, /usr/lib and /usr/local/lib in the audio init makes it work much better.
Now, if I could only reduce the latency from the half-second it is now to something usable...
Maybe I should just re-implement sound on top of JACK instead.
The version on www.openal.org seemed to be old (version 0.8).
However, the REAL question was "why doesn't Torque find it" and the answer was "because it doesn't look in /lib or /usr/lib, only in the Torque directories and straight dlopen()". Thus, adding cases for searching /lib, /usr/lib and /usr/local/lib in the audio init makes it work much better.
Now, if I could only reduce the latency from the half-second it is now to something usable...
Maybe I should just re-implement sound on top of JACK instead.
#2
/lib and /usr/lib are in fact deliberately *not* in /etc/ld.so.conf, because /lib/ and /usr/lib are hardcoded in other places. On the other hand:
I've had these problems before. Try re-running /sbin/ldconfig. Worst case, you can add /lib and /usr/lib at the end of your /etc/ld.so.conf, re-run /sbin/ldconfig, and it should pick them up.
Flicking through the torque code [x86UNIXOpenAL.cc], I'd suggest just snipping lines 213 to 238, and molesting LD_LIBRARY_PATH or even [ewww] LD_PRELOAD instead, to make torque just follow otherwise normal linux library good karma.
Gary (-;
10/16/2006 (11:10 am)
From the manpage:The function dlopen() loads the dynamic library file named
by the null-terminated string filename and returns an
opaque "handle" for the dynamic library. If filename is
NULL, then the returned handle is for the main program.
If filename contains a slash ("/"), then it is interpreted
as a (relative or absolute) pathname. Otherwise, the
dynamic linker searches for the library as follows (see
ld.so(8) for further details):
o (ELF only) If the executable file for the calling
program contains a DT_RPATH tag, and does not con?
tain a DT_RUNPATH tag, then the directories listed
in the DT_RPATH tag are searched.
o If the environment variable LD_LIBRARY_PATH is
defined to contain a colon-separated list of direc?
tories, then these are searched. (As a security
measure this variable is ignored for set-UID and
set-GID programs.)
o (ELF only) If the executable file for the calling
program contains a DT_RUNPATH tag, then the direc?
tories listed in that tag are searched.
o The cache file /etc/ld.so.cache (maintained by
ldconfig(8)) is checked to see whether it contains
an entry for filename.
o The directories /lib and /usr/lib are searched (in
that order)./lib and /usr/lib are in fact deliberately *not* in /etc/ld.so.conf, because /lib/ and /usr/lib are hardcoded in other places. On the other hand:
I've had these problems before. Try re-running /sbin/ldconfig. Worst case, you can add /lib and /usr/lib at the end of your /etc/ld.so.conf, re-run /sbin/ldconfig, and it should pick them up.
Flicking through the torque code [x86UNIXOpenAL.cc], I'd suggest just snipping lines 213 to 238, and molesting LD_LIBRARY_PATH or even [ewww] LD_PRELOAD instead, to make torque just follow otherwise normal linux library good karma.
Gary (-;
#3
Anyway, I've always been quite annoyed at how hard it is to get shared libraries loading right on Linux, and LD_RUN_PATH vs LD_LIBRARY_PATH vs all those other paths. All other OS-es I've used have used a sane, simple method, that a mere mortal can understand. Oh, well. At least, these days, calling dlopen() doesn't necessarily automatically pollute your symbol table :-/
10/16/2006 (3:08 pm)
Linux is not the only UNIX, you know :-)Anyway, I've always been quite annoyed at how hard it is to get shared libraries loading right on Linux, and LD_RUN_PATH vs LD_LIBRARY_PATH vs all those other paths. All other OS-es I've used have used a sane, simple method, that a mere mortal can understand. Oh, well. At least, these days, calling dlopen() doesn't necessarily automatically pollute your symbol table :-/
#4
But it's the only one torque runs on officially :-)
Gary (-;
PS Lies. SCO's a library trainwreck too.
10/16/2006 (3:30 pm)
Quote:Linux is not the only UNIX, you know :-)
But it's the only one torque runs on officially :-)
Gary (-;
PS Lies. SCO's a library trainwreck too.
#5
10/16/2006 (7:08 pm)
Just to note on SuSE 10.1 users... both the OpenAL and OpenAL devel drivers from openal.org should be installed to make Torque work. The higher openal drivers provided by YaST2 won't work.
Torque Owner Mike Rowley
Mike Rowley
www.openal.org/ tis here. :)