alsaaudio.c revision d72aa6b0dab3e9b60aa78bfca99c767c48a406b0
970N/A#include "Builtins.h"
1666N/A#include "alsa_stubs.h"
1391N/A#include "audio_int.h"
1549N/Atypedef struct ALSAVoiceOut {
1666N/Atypedef struct ALSAVoiceIn {
493N/A int size_in_usec_in;
98N/A int size_in_usec_out;
98N/A const char *pcm_name_in;
1089N/A const char *pcm_name_out;
156N/A unsigned int buffer_size_in;
493N/A unsigned int period_size_in;
493N/A unsigned int buffer_size_out;
493N/A unsigned int period_size_out;
1466N/A#ifdef HIGH_LATENCY
1666N/A#ifdef HIGH_LATENCY
970N/Astruct alsa_params_req {
1592N/A unsigned long buffer_size;
98N/A unsigned long period_size;
1089N/Astruct alsa_params_obt {
1391N/A case AUD_FMT_S8:
970N/A return SND_PCM_FORMAT_S8;
1391N/A case AUD_FMT_U8:
1391N/A return SND_PCM_FORMAT_U8;
1391N/A case AUD_FMT_S16:
1666N/A return SND_PCM_FORMAT_S16_LE;
1391N/A case AUD_FMT_U16:
1666N/A return SND_PCM_FORMAT_U16_LE;
1666N/A case AUD_FMT_S32:
1666N/A return SND_PCM_FORMAT_S32_LE;
1666N/A case AUD_FMT_U32:
1666N/A return SND_PCM_FORMAT_U32_LE;
1391N/A#ifdef DEBUG_AUDIO
1400N/A return SND_PCM_FORMAT_U8;
1666N/A case SND_PCM_FORMAT_S8:
1666N/A *endianness = 0;
1666N/A case SND_PCM_FORMAT_U8:
1666N/A *endianness = 0;
1666N/A case SND_PCM_FORMAT_S16_LE:
1666N/A *endianness = 0;
1400N/A case SND_PCM_FORMAT_U16_LE:
1666N/A *endianness = 0;
970N/A case SND_PCM_FORMAT_S16_BE:
1666N/A case SND_PCM_FORMAT_U16_BE:
1666N/A case SND_PCM_FORMAT_S32_LE:
1666N/A *endianness = 0;
1666N/A case SND_PCM_FORMAT_U32_LE:
1666N/A *endianness = 0;
case SND_PCM_FORMAT_S32_BE:
case SND_PCM_FORMAT_U32_BE:
int err;
if (err < 0) {
if (err < 0) {
if (err < 0) {
&handle,
if (err < 0) {
#ifndef VBOX
if (err < 0) {
#ifndef VBOX
goto err;
if (err < 0) {
#ifndef VBOX
goto err;
if (err < 0) {
#ifndef VBOX
goto err;
if (err < 0) {
#ifndef VBOX
goto err;
if (err < 0) {
#ifndef VBOX
goto err;
#ifndef VBOX
goto err;
if (!buffer_size) {
if (buffer_size) {
if (period_size) {
if (err < 0) {
#ifndef VBOX
goto err;
if (err < 0) {
#ifndef VBOX
goto err;
if (period_size_f) {
dir = 0;
&minval,
&dir
if (err < 0) {
#ifndef VBOX
err,
typ,
minval);
#ifndef VBOX
if (err < 0) {
#ifndef VBOX
goto err;
#ifdef VBOX
if (err < 0) {
#ifndef VBOX
typ);
dolog (
typ,
if (err < 0) {
#ifndef VBOX
goto err;
if (err < 0) {
#ifndef VBOX
goto err;
if (err < 0) {
#ifndef VBOX
goto err;
#ifdef VBOX
dir = 0;
if (err < 0)
goto err;
if (err < 0) {
(void *) handle);
goto err;
int bytes_per_sec;
#ifdef DEBUG
err:
if (err < 0) {
(void *) handle);
if (avail < 0) {
if (avail < 0) {
return avail;
int samples;
if (!live) {
if (avail < 0) {
while (samples) {
while (len) {
if (written <= 0) {
switch (written) {
goto exit;
case -EPIPE:
len);
goto exit;
case -EAGAIN:
goto exit;
goto exit;
exit:
return decr;
int endianness;
int err;
if (err) {
static int alsa_voice_ctl (snd_pcm_t *handle, const char *typ, int pauseit) /* VBOX: s/pause/pauseit/; -Wshadow */
int err;
if (pauseit) {
if (err < 0) {
if (err < 0) {
switch (cmd) {
case VOICE_ENABLE:
case VOICE_DISABLE:
int endianness;
int err;
if (err) {
int decr;
int add;
int len;
if (!dead) {
if (avail < 0) {
if (!decr) {
void *src;
while (len) {
if (nread <= 0) {
switch (nread) {
goto exit;
case -EPIPE:
goto exit;
case -EAGAIN:
goto exit;
len,
goto exit;
exit:
return read_samples;
switch (cmd) {
case VOICE_ENABLE:
case VOICE_DISABLE:
#ifdef VBOX
static void *alsa_audio_init (void)
#ifdef VBOX
int rc;
return NULL;
return &conf;
(void) opaque;