zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
alsa.c File Reference
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
#include "alMain.h"
#include "alu.h"
#include <alsa/asoundlib.h>

Go to the source code of this file.

Macros

#define CHECK(x)   if((funcerr=#x),(err=(x)) < 0) goto error
 
#define CHECK(x)   if((funcerr=#x),(err=(x)) < 0) goto error
 
#define CHECK(x)   if((funcerr=#x),(err=(x)) < 0) goto error
 

Functions

void alc_alsa_deinit (void)
 
ALCboolean alc_alsa_init (BackendFuncs *func_list)
 
void alc_alsa_probe (enum DevProbe type)
 
static ALCuint alsa_available_samples (ALCdevice *Device)
 
static ALCenum alsa_capture_samples (ALCdevice *Device, ALCvoid *Buffer, ALCuint Samples)
 
static void alsa_close_capture (ALCdevice *Device)
 
static void alsa_close_playback (ALCdevice *device)
 
static ALint64 alsa_get_latency (ALCdevice *device)
 
static ALCboolean alsa_load (void)
 
static ALCenum alsa_open_capture (ALCdevice *Device, const ALCchar *deviceName)
 
static ALCenum alsa_open_playback (ALCdevice *device, const ALCchar *deviceName)
 
static ALCboolean alsa_reset_playback (ALCdevice *device)
 
static void alsa_start_capture (ALCdevice *Device)
 
static ALCboolean alsa_start_playback (ALCdevice *device)
 
static void alsa_stop_capture (ALCdevice *Device)
 
static void alsa_stop_playback (ALCdevice *device)
 
static ALuint ALSANoMMapProc (ALvoid *ptr)
 
static ALuint ALSAProc (ALvoid *ptr)
 
static const char * prefix_name (snd_pcm_stream_t stream)
 
static DevMap * probe_devices (snd_pcm_stream_t stream, ALuint *count)
 
static int verify_state (snd_pcm_t *handle)
 

Variables

static DevMap * allCaptureDevNameMap
 
static DevMap * allDevNameMap
 
static const BackendFuncs alsa_funcs
 
static const ALCchar alsaDevice [] = "ALSA Default"
 
static ALuint numCaptureDevNames
 
static ALuint numDevNames
 

Macro Definition Documentation

#define CHECK (   x)    if((funcerr=#x),(err=(x)) < 0) goto error
#define CHECK (   x)    if((funcerr=#x),(err=(x)) < 0) goto error
#define CHECK (   x)    if((funcerr=#x),(err=(x)) < 0) goto error

Function Documentation

void alc_alsa_deinit ( void  )

Definition at line 1308 of file alsa.c.

References allCaptureDevNameMap, allDevNameMap, free, i, NULL, numCaptureDevNames, and numDevNames.

ALCboolean alc_alsa_init ( BackendFuncs func_list)

Definition at line 1300 of file alsa.c.

References ALC_FALSE, ALC_TRUE, alsa_funcs, and alsa_load().

static ALCuint alsa_available_samples ( ALCdevice Device)
static
static ALCenum alsa_capture_samples ( ALCdevice Device,
ALCvoid Buffer,
ALCuint  Samples 
)
static
static void alsa_close_capture ( ALCdevice Device)
static

Definition at line 1063 of file alsa.c.

References DestroyRingBuffer(), ALCdevice_struct::ExtraData, free, and NULL.

static void alsa_close_playback ( ALCdevice device)
static

Definition at line 688 of file alsa.c.

References ALCdevice_struct::ExtraData, free, and NULL.

static ALint64 alsa_get_latency ( ALCdevice device)
static

Definition at line 1268 of file alsa.c.

References ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::Frequency, and maxi64().

static ALCboolean alsa_load ( void  )
static

Definition at line 188 of file alsa.c.

References ALC_FALSE, ALC_TRUE, and LOAD_FUNC.

Referenced by alc_alsa_init().

static void alsa_start_capture ( ALCdevice Device)
static

Definition at line 1075 of file alsa.c.

References AL_TRUE, aluHandleDisconnect(), ERR, and ALCdevice_struct::ExtraData.

static ALCboolean alsa_start_playback ( ALCdevice device)
static
static void alsa_stop_capture ( ALCdevice Device)
static
static void alsa_stop_playback ( ALCdevice device)
static

Definition at line 901 of file alsa.c.

References ALCdevice_struct::ExtraData, free, NULL, and StopThread().

static const char* prefix_name ( snd_pcm_stream_t  stream)
static

Definition at line 310 of file alsa.c.

References assert.

Referenced by probe_devices().

static DevMap* probe_devices ( snd_pcm_stream_t  stream,
ALuint count 
)
static
static int verify_state ( snd_pcm_t *  handle)
static

Definition at line 422 of file alsa.c.

Referenced by ALSANoMMapProc(), and ALSAProc().

Variable Documentation

DevMap* allCaptureDevNameMap
static

Definition at line 306 of file alsa.c.

Referenced by alc_alsa_deinit(), alc_alsa_probe(), and alsa_open_capture().

DevMap* allDevNameMap
static

Definition at line 304 of file alsa.c.

Referenced by alc_alsa_deinit(), alc_alsa_probe(), and alsa_open_playback().

const BackendFuncs alsa_funcs
static
Initial value:
= {
}
static ALCboolean alsa_start_playback(ALCdevice *device)
Definition: alsa.c:847
static ALint64 alsa_get_latency(ALCdevice *device)
Definition: alsa.c:1268
static void alsa_close_capture(ALCdevice *Device)
Definition: alsa.c:1063
static void alsa_close_playback(ALCdevice *device)
Definition: alsa.c:688
static ALCboolean alsa_reset_playback(ALCdevice *device)
Definition: alsa.c:697
static ALCenum alsa_capture_samples(ALCdevice *Device, ALCvoid *Buffer, ALCuint Samples)
Definition: alsa.c:1090
static ALCuint alsa_available_samples(ALCdevice *Device)
Definition: alsa.c:1164
static void alsa_stop_playback(ALCdevice *device)
Definition: alsa.c:901
void ALCdevice_LockDefault(ALCdevice *device)
Definition: ALc.c:1277
static ALCenum alsa_open_capture(ALCdevice *Device, const ALCchar *deviceName)
Definition: alsa.c:917
static void alsa_start_capture(ALCdevice *Device)
Definition: alsa.c:1075
void ALCdevice_UnlockDefault(ALCdevice *device)
Definition: ALc.c:1281
static void alsa_stop_capture(ALCdevice *Device)
Definition: alsa.c:1235
static ALCenum alsa_open_playback(ALCdevice *device, const ALCchar *deviceName)
Definition: alsa.c:640

Definition at line 1283 of file alsa.c.

Referenced by alc_alsa_init().

const ALCchar alsaDevice[] = "ALSA Default"
static

OpenAL cross platform audio library Copyright (C) 1999-2007 by authors. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Or go to http://www.gnu.org/copyleft/lgpl.html

Definition at line 33 of file alsa.c.

Referenced by alsa_open_capture(), alsa_open_playback(), and probe_devices().

ALuint numCaptureDevNames
static

Definition at line 307 of file alsa.c.

Referenced by alc_alsa_deinit(), alc_alsa_probe(), and alsa_open_capture().

ALuint numDevNames
static

Definition at line 305 of file alsa.c.

Referenced by alc_alsa_deinit(), alc_alsa_probe(), and alsa_open_playback().