OpenGL + Audio can be a good thing. We at the SoundLab have been using
this combination in many of our apps. It is important to structure the
audio callbacks in such a way that it can operate independent of the main
render function. I have to jump on a plane to Vancouver (NIME2005), but
here are some apps that involves audio and opengl:
sndpeek:
http://soundlab.cs.princeton.edu/software/sndpeek/
(look at the audio callback vs. the render function in sndpeek.cpp)
rt_lpc:
http://soundlab.cs.princeton.edu/software/rt_lpc/
(see rt_lpc.cpp)
soon the audicle:
http://audicle.cs.princeton.edu/
Hope this helps.
Best
Ge!
On Sat, 21 May 2005, Richard Spindler wrote:
Hi,
I have a little Problem:
I'm using OpenGL in my Program, in combination with OSS via portaudio.
The Updates of the OpenGL display are triggered by the audio callback,
protected using the available Methods of the GUI-Toolkit that I use
(fltk).
And I'm experiencing very strange effects, like: without Audio the
OpenGL works fine. without the OpenGL, the audio works fine, however
when used in combination, the Audio Thread (callback) stops very soon,
and I have no Idea why?
I used efence to discover wheater I'm screwing up memory somewhere,
but I couldn't find anything. I ran valgrind, but it couldn't find
something helpful either.
I ran it from within gdb, but the program behaves correctly if run
from gdb (heisenbug?). It even works better whenever I insert some
cout's for debugging purposes.
in gdb it also reports a signal like this when initializing the
openGL, but I believe that might be propably unreleated.
http://music.columbia.edu/pipermail/linux-audio-user/2004-October/016821.ht…
BTW. I'm running an unmodified ubuntu warty.
Any tips or pointers??
Thanks
Richard
PS.: (writing this message led me to some more experiments ;) )
I'm fairly sure that something is screwed up within thread
syncronisation, because I can "fix" it by inserting a usleep() call at
a certain position, but I do have a fairly hard time imagining what
could be wrong. I'm considering to switch to blocking IO for Audio
because, latency and stuff is not really an issue.