Search:  
Gentoo Wiki

OpenAL

Contents

Introduction

OpenAL is a cross-platform 3D audio library, it is used mainly in audio applications & games. i.e ut2004 & TaSpring. Unfortunaly OpenAL defaults to OSS for sound playback if its not configured & told to use something else i.e ALSA.


Which config file to use

There are 2 different places for the config file for OpenAL

  1. /etc/openalrc is for system wide setup
  2. ~/.openalrc is for user specific setup

Configuring OpenAL

To comment lines # = text  ; = options

Code: Select audio system to use
 (define devices '(alsa))
 (define devices '(alsa esd arts sdl null))
  1. First line is just tellin OpenAL to use alsa
  2. Second line tells OpenAL to use alsa, if that fails it falls back to esd and so on.


Code: Select soundcard for ALSA to use
 # Sound Output
 (define alsa-out-device default)
 (define alsa-out-device "hw:0,0")

 # Sound Input i.e microphone
 (define alsa-in-device default)
 (define alsa-in-device "hw:0,0")
  1. If u only have one soundcard use the first line(s). It tells openal to use default soundcard for output | input.
  2. Second Line(s) specifc tell OpenAL which soundcard to use. i.e u got more than one soundcard
    1. ( Use aplay -l for find out soundcard numbers i.e hw0:0 )


Code: Speaker Setup
 # 2 Speaker setup
 (define speaker-num 2)

 # 4 Speaker surround with ALSA
 (define speaker-num 4)
 (define alsa-out-device "surround40:0,0")

 # 6 Speaker surround with ALSA
 (define speaker-num 6)
 (define alsa-out-device "surround51:0,0")
Code: More options
(define display-banner #t)
(define source-gain 1.0)
(define sampling-rate 44800)

These options are also avaible according to the source code.

Example

Below is example of /etc/openalrc. Its setup to use Alsa & default soundcard & 2 speakers

File: /etc/openalrc
 (define devices '(alsa))
 (define alsa-out-device default)
 (define alsa-in-device default)
 (define speaker-num 2)
Retrieved from "http://www.gentoo-wiki.info/OpenAL"

Last modified: Fri, 05 Sep 2008 02:44:00 +0000 Hits: 2,996