[Openal-devel] Loopback API design question

Chris Robinson chris.kcat at gmail.com
Thu Mar 1 08:22:48 PST 2012


On Wednesday, February 29, 2012 10:43:17 AM Erik Hofman wrote:
> The way I envision this is that setting refresh disables real-time
> rendering (I could live with another way of telling the library to do
> so). This way the rendering step is triggered when calling the
> alcCaptureSamples function, just prior to returning the data.

This seems closer to the behavior of setting ALC_SYNC to true. On Loki's 
implementation, that would mean you had to call alcProcessContext to actually 
do the mix synchronously (where it would then automatically be sent to the 
device). I'm not sure if any other implementation did anything with the flag, 
though. Creative and OpenAL Soft always set it to false, and OSX seems to 
actually error if you try to query it.

> This would indeed require a device, being it a software renderer or a
> hardware accelerated one. In both cases it's just a matter of rendering
> up to the point the data is sent to the physical device and then instead
> of doing so returning the processed data to the caller application.

I still don't like the idea of hijacking a device that's expecting to play 
audio and "stealing" the data away from it before it gets a chance to. It's a 
potential waste of resources as there could be a hardware device open, but 
left unused because the app is reading the mix instead of giving it to the 
card.

I'd rather behavior like that go towards a device-level foldback extension, 
where the app can capture audio that the card is actually playing.


As an aside, I'm considering using a string parameter for 
alcLoopbackOpenDeviceSOFT. My reasoning is, it appears the enumeration list 
given by ALC_DEVICE_SPECIFIER is effectively a list of drivers, not devices. 
"Generic Software", "Generic Hardware", etc. Even for opened devices, it 
returns the name of the driver it belongs to. A string will allow for opening 
a loopback device on a specific driver without having to actually open a 
device. So, I think I'll let the function work with the names returned by 
enumeration.


More information about the Openal-devel mailing list