OpenAL explained

OpenAL
Logo Size:200px
Author:Loki Software
Developer:Creative Technology
Latest Release Version:1.1 (installer 2.1.0.0)[1]
Programming Language:C
Genre:Application programming interface
License:
  • Sample Implementation: Proprietary since v1.1, LGPL before v1.1, BSD in early versions[2]
  • "OpenAL" trademark: unclear, held by Creative Labs, Inc.

OpenAL (Open Audio Library) is a cross-platform audio application programming interface (API). It is designed for efficient rendering of multichannel three-dimensional positional audio. Its API style and conventions deliberately resemble those of OpenGL. OpenAL is an environmental 3D audio library, which can add realism to a game by simulating attenuation (degradation of sound over distance), the Doppler effect (change in frequency as a result of motion), and material densities.

OpenAL aimed to originally be an open standard and open-source replacement for proprietary (and generally incompatible with one another) 3D audio APIs such as DirectSound and Core Audio, though in practice has largely been implemented on various platforms as a wrapper around said proprietary APIs or as a proprietary and vendor-specific fork. While the reference implementation later became proprietary and unmaintained, there are open source implementations such as OpenAL Soft available.

History

OpenAL was originally developed in 2000 by Loki Software to help them in their business of porting Windows games to Linux.[3] After the demise of Loki, the project was maintained for a time by the free software/open source community, and implemented on NVIDIA nForce sound cards and motherboards. It was hosted (and largely developed) by Creative Technology until circa 2012.

Since 1.1 (2009), the sample implementation by Creative has turned proprietary, with the last releases in free licenses still accessible through the project's Subversion source code repository. However, OpenAL Soft is a widely used open source alternative and remains actively maintained and extended.

While the OpenAL charter says that there will be an "Architecture Review Board" (ARB) modeled on the OpenGL ARB, no such organization has ever been formed and the OpenAL specification is generally handled and discussed via email on its public mailing list.

The original mailing list, openal-devel hosted by Creative, ran from March 2003 to circa August 2012.[4] Ryan C. Gordon, a Loki veteran who went on to develop Simple DirectMedia Layer, started a new mailing list and website at OpenAL.org in January 2014.[5] As of February 2023, the list remains in use.

API structure and functionality

The general functionality of OpenAL is encoded in source objects, audio buffers and a single listener. A source object contains a pointer to a buffer, the velocity, position and direction of the sound, and the intensity of the sound. The listener object contains the velocity, position and direction of the listener, and the general gain applied to all sound. Buffers contain audio data in PCM format, either 8- or 16-bit, in either monaural or stereo format. The rendering engine performs all necessary calculations for distance attenuation, Doppler effect, etc.

The net result of all of this for the end user is that in a properly written OpenAL application, sounds behave quite naturally as the user moves through the three-dimensional space of the virtual world. From a programmer's perspective, very little additional work is required to make this happen in an existing OpenGL-based 3D graphical application.

Unlike the OpenGL specification, the OpenAL specification includes two subsections of the API: the core consisting of the actual OpenAL function calls, and the ALC (Audio Library Context) API which is used to manage rendering contexts, resource usage and locking in a cross platform manner. There is also an 'ALUT' (Audio Library Utility Toolkit) library that provides higher level 'convenience' functions — exactly analogous to OpenGL's 'GLUT'.

In order to provide additional functionality in the future, OpenAL utilizes an extension mechanism. Individual vendors are thereby able to include their own extensions into distributions of OpenAL, commonly for the purpose of exposing additional functionality on their proprietary hardware. Extensions can be promoted to ARB (Architecture Review Board) status, indicating a standard extension which will be maintained for backwards compatibility. ARB extensions have the prospect of being added to the core API after a period of time.

For advanced digital signal processing and hardware-accelerated sound effects, the EFX (Effects Extension) or environmental audio extensions (EAX) can be used.

Limitations

The single listener model in OpenAL is tailored to a single human user and is not fit for artificial intelligence or robotic simulations or multiple human participants as in collaborative musical performances.[6] In these cases a multiple listener model is required. OpenAL also fails to take into account sound propagation delays (the speed of sound is used for the Doppler effect only). The distance to a sound source only translates into an amplitude effect (attenuation) and not a delay. Hence OpenAL cannot be used for time difference of arrival calculations unless that functionality is added in separately.[7]

In order to take full speed advantage of OpenAL, a vendor/hardware specific implementation is needed and these are seldom released as open source. Many supported platforms in fact implement OpenAL as a wrapper which simply translates calls to the platform's native, and often proprietary, audio API. On Windows, if a vendor specific implementation is not detected it will fall back to the wrap_oal.dll wrapper library that translates OpenAL into DirectSound (Generic Software) or DirectSound3D (Generic Hardware); the removal of the latter from Windows Vista onward has effectively broken generic hardware acceleration on modern versions of Windows.[8] [9]

Supported platforms

The API is available on the following platforms and operating systems:[10] Android (supports OpenSL ES), AmigaOS 3.x and 4.x,[11] Bada, BlackBerry 10,[12] BlackBerry PlayBook, BSD, iOS (supports Core Audio), IRIX, Linux (supports ALSA, OSS, PortAudio and PulseAudio), Mac OS 8, Mac OS 9 and Mac OS X (Core Audio), Microsoft Windows (supports DirectSound, Windows Multimedia API and Windows Multimedia Device (MMDevice) API), MorphOS, OpenBSD,[13] Solaris, QNX, and AROS.[14]

Supported gaming devices are for instance: GameCube, PlayStation 2, PlayStation 3, Xbox, Xbox 360, Wii, and PlayStation Portable.

Applications

Games

The following video games are known to use OpenAL:

Other applications

Implementations

OpenAL SI
  • The OpenAL Sample Implementation is the original implementation, from Loki, and is not currently maintained.
    OpenAL Soft
  • OpenAL Soft is an LGPL-licensed, cross-platform, software implementation. The library is meant as a free compatible update/replacement to the now-deprecated and proprietary OpenAL Sample Implementation. OpenAL Soft supports mono, stereo (including HRTF and UHJ), 4-channel, 5.1, 6.1, 7.1, and B-Format output. Ambisonic assets are supported.[29] [30]
    AeonWave-OpenAL
  • AeonWave-OpenAL is an LGPL-licensed OpenAL emulation layer that takes advantage of the hardware acceleration provided by the non-free but low cost AeonWave 4D-audio library for Linux and Windows made by Adalin B.V. The author claims that AeonWave-OpenAL implementation renders 3D audio five (on an AMD Athlon 64 X2) to seven (on an Intel Atom N270) times faster than either OpenAL SI or OpenAL Soft under the same conditions.[31] By using the AeonWave library this implementation supports HRTF as well as spatialised surround sound for up to eight speakers.
    Rapture3D OpenAL Driver
  • The Rapture3D OpenAL Driver is a non-free, commercial, Windows only, software implementation made by Blue Ripple Sound. The library is intended as a high performance drop-in replacement for other implementations. It features:[32]
    Apple OpenAL[33]
  • Apple ships an implementation of OpenAL in macOS and iOS. It is a very thin layer over the 3D Mixer (kAudioUnitSubType_3DMixer) feature in the operating system. This implementation was originally written by Ryan C. Gordon for Altivec Mac OS X systems.[34]
    MojoAL
  • Tiny (single-file), full OpenAL 1.1 implementation built on top of SDL2 by Ryan C. Gordon.[35]

    See also

    External links

    Implementations:

    Developer resources:

    Notes and References

    1. Web site: OpenAL: Cross Platform 3D Audio . openal.org.
    2. Web site: OpenAL License. November 10, 2012. dead. https://web.archive.org/web/20121230175931/http://connect.creativelabs.com/openal/Documentation/The%20OpenAL%20Utility%20Toolkit.htm. December 30, 2012.
    3. Press release with regards to OpenAL . 2011-07-18 . 2016-03-06 . https://web.archive.org/web/20160306095132/http://linux.omnipotent.net/article.php?article_id=7626 . dead .
    4. Web site: Wayback Machine prefix query: openal-devel archive . 25 April 2023.
    5. Web site: The openal January 2014 Archive by thread . openal.org.
    6. Wozniewski, Mike . Settel, Zack . Cooperstock, Jeremy . User-specific audio rendering and steerable sound for distributed virtual environments. Proceedings of International conference on auditory displays (ICAD). 2007. August 5, 2012.
    7. https://games.slashdot.org/comments.pl?sid=1276489&cid=28412367 Open Source FPS Game Alien Arena 2009 Released #28412367
    8. https://web.archive.org/web/20070118174547/http://www.openal.org/windows_enumeration.html Enumeration with OpenAL on Windows
    9. https://web.archive.org/web/20130606032320/http://connect.creativelabs.com/openal/OpenAL%20Wiki/OpenAL%C2%AE%20and%20Windows%20Vista%E2%84%A2.aspx OpenAL® and Windows Vista™
    10. Web site: OpenAL – Platforms. May 10, 2012.
    11. Web site: Archived copy . se.aminet.net . 6 June 2022 . https://web.archive.org/web/20180316151848/http://se.aminet.net/dev/lib/openal-soft.readme . 16 March 2018 . dead.
    12. Web site: blackberry/OpenAL 路 GitHub. Github.com. January 14, 2013.
    13. Web site: OpenAL for OpenBSD. 2011-07-18. 2012-03-18. https://web.archive.org/web/20120318180218/http://openports.se/audio/openal. dead.
    14. Web site: OpenAL/alut/ogg/vorbis [Forum – Development (General)|publisher=AROS-Exec|access-date=June 16, 2013|archive-date=May 26, 2013|archive-url=https://web.archive.org/web/20130526135417/http://aros-exec.org/modules/newbb/viewtopic.php?post_id=33758|url-status=dead].
    15. Web site: Overview . 0 A.D. Game Info . Wildfire Games . December 5, 2012 . https://web.archive.org/web/20130926184253/http://play0ad.com/2012/12/ . September 26, 2013 . dead .
    16. Web site: Games . OpenAL.org .
    17. Web site: SCS Software forum. June 5, 2019. https://web.archive.org/web/20190605144436/https://forum.scssoft.com/viewtopic.php?t=273087. June 5, 2019. live.
    18. Web site: HPL Engine – Mod DB. November 20, 2012.
    19. Web site: Troubleshooting: Reinstall OpenAL : Beamdog. May 29, 2014.
    20. Web site: Bit.Trip Runner - PCGamingWiki. October 8, 2022.
    21. Web site: ioquake3 website.
    22. Web site: Blue Ripple Sound . September 23, 2017.
    23. Web site: Blue Ripple Sound . September 23, 2017.
    24. Web site: Modulaatio Games . September 6, 2012 . https://web.archive.org/web/20120906033450/http://www.modulaatio.com/runningwithrifles/?page_id=14 . dead .
    25. Web site: Compatible OpenAL Games. Blue Ripple Sound.
    26. Web site: Vanda Engine.
    27. Book: Jam Tomorrow: Collaborative Music Generation in Croquet Using OpenAL - IEEE Conference Publication. 73–78. 10.1109/C5.2006.22. Jam Tomorrow: Collaborative Music Generation in Croquet Using OpenAL. 2006. Thalmann. Florian. Gaelli. Markus. 978-0-7695-2563-1. 10.1.1.67.8139. 5577203.
    28. Web site: Bino: free 3D video player - About. Martin. Lambers. bino3d.org.
    29. Web site: OpenAL Soft – Software 3D Audio . openal-soft.org. January 4, 2014.
    30. Web site: OpenAL Soft Git repository. December 26, 2013.
    31. Web site: [Openal-devel] Announcement: AeonWave-OpenAL 1.1.7 released. May 9, 2012. Hofman, Erik. December 9, 2012. Test have shown that AeonWave-OpenAL renders audio five times faster (on an AMD Athlon-64 X2 processor) and up to seven times faster (on an Intel Atom-N270 processor) than both OpenAL-Soft and OpenAL-Sample. Rendering 32 sounds on the Atom-N270 (the maximum for OpenAL-Soft) saves 1 Watt of continuous power consumption according to powertop.. dead. https://archive.today/20130119200045/http://opensource.creative.com/pipermail/openal-devel/2012-May/005903.html. January 19, 2013.
    32. Web site: Developers. 2009. Blue Ripple Sound Limited. January 24, 2011.
    33. Web site: Source Browser.
    34. Web site: An OpenAL implementation for MacOS X . icculus.org.
    35. Web site: MojoAL . icculus.org.