[Openal-devel] Loopback API design question

Chris Robinson chris.kcat at gmail.com
Wed Feb 15 14:14:16 PST 2012


Hi guys.

I'm more or less finished with the loopback API and am in the process of 
writing up an extension spec for it, but there's a relatively minor issue I'd 
like to get feedback on.

Currently, a loopback device is created with this function:
ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(void);

This works well enough as it is, however it wouldn't be able to work if 
implemented in a router DLL as there's no informtation given by the app to 
specify which driver to send the call to.

There's a few ways I can think of to handle this:

1) Have the function take a string as a parameter so it can tell what driver 
to call to ("OpenAL Soft", "Rapture3D", "Generic Software", etc). Problem here 
is there's no way to query the available drivers, and another enumeration 
doesn't sound very nice. Matching a device driver to an open device could be a 
problem too.

2) Have it take a string, but accept the same strings as device enumeration. 
This would allow an app to get the right driver by providing the name of an 
already-open device, but it feels rather hacky as its not really opening the 
specified device.

3) Have it take an ALCdevice* handle. This would allow apps to easily match a 
loopback device with a device driver, but it would also require an open 
playback device if you want a specific driver.

For all three cases, NULL could be passed to take a default. I think I would 
prefer 3 personally, but what do you guys think?

Only other option is to not do anything and essentially require the app to use 
an open device to call alcGetProcAddress with to get the exports directly from 
a specific driver. I don't like this as it would also require getting all ALC 
and AL functions used with the loopback device (since the device handle 
returned by a driver-specific OpenDevice function won't be recognized outside 
of that driver), but it is an option.


More information about the Openal-devel mailing list