Commit e146cd9a authored by Sam Lantinga's avatar Sam Lantinga

Updated the QNX audio code for QNX 6.2 (thanks Travis!)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40419
parent 2da1f62f
Date: Sun, 16 Jun 2002 00:59:13 -0300
From: Travis <smallfri@bigfoot.com>
To: slouken@libsdl.org
Subject: NTO Audio Fixes
/* /*
SDL - Simple DirectMedia Layer SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
...@@ -20,10 +25,6 @@ ...@@ -20,10 +25,6 @@
slouken@libsdl.org slouken@libsdl.org
*/ */
/* Allow access to a raw mixing buffer */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sched.h> #include <sched.h>
#include <sys/asoundlib.h> #include <sys/asoundlib.h>
#include <sys/select.h>
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
...@@ -46,14 +48,10 @@ ...@@ -46,14 +48,10 @@
/* The tag name used by NTO audio */ /* The tag name used by NTO audio */
#define DRIVER_NAME "nto" #define DRIVER_NAME "nto"
/* default card and device numbers as listed in dev/snd */
static int card_no = 0;
static int device_no = 0;
/* default channel communication parameters */ /* default channel communication parameters */
#define DEFAULT_CPARAMS_RATE 22050 #define DEFAULT_CPARAMS_RATE 22050
#define DEFAULT_CPARAMS_VOICES 1 #define DEFAULT_CPARAMS_VOICES 1
#define DEFAULT_CPARAMS_FRAG_SIZE 4096 //was 512 #define DEFAULT_CPARAMS_FRAG_SIZE 4096
#define DEFAULT_CPARAMS_FRAGS_MIN 1 #define DEFAULT_CPARAMS_FRAGS_MIN 1
#define DEFAULT_CPARAMS_FRAGS_MAX 1 #define DEFAULT_CPARAMS_FRAGS_MAX 1
...@@ -78,7 +76,7 @@ static void init_pcm_cparams(snd_pcm_channel_params_t* cparams) ...@@ -78,7 +76,7 @@ static void init_pcm_cparams(snd_pcm_channel_params_t* cparams)
cparams->channel = SND_PCM_CHANNEL_PLAYBACK; cparams->channel = SND_PCM_CHANNEL_PLAYBACK;
cparams->mode = SND_PCM_MODE_BLOCK; cparams->mode = SND_PCM_MODE_BLOCK;
cparams->start_mode = SND_PCM_START_DATA; //_FULL cparams->start_mode = SND_PCM_START_DATA;
cparams->stop_mode = SND_PCM_STOP_STOP; cparams->stop_mode = SND_PCM_STOP_STOP;
cparams->format.format = SND_PCM_SFMT_S16_LE; cparams->format.format = SND_PCM_SFMT_S16_LE;
cparams->format.interleave = 1; cparams->format.interleave = 1;
...@@ -89,15 +87,14 @@ static void init_pcm_cparams(snd_pcm_channel_params_t* cparams) ...@@ -89,15 +87,14 @@ static void init_pcm_cparams(snd_pcm_channel_params_t* cparams)
cparams->buf.block.frags_max = DEFAULT_CPARAMS_FRAGS_MAX; cparams->buf.block.frags_max = DEFAULT_CPARAMS_FRAGS_MAX;
} }
/* Audio driver bootstrap functions */
static int Audio_Available(void) static int Audio_Available(void)
/* {
/*
See if we can open a nonblocking channel. See if we can open a nonblocking channel.
Return value '1' means we can. Return value '1' means we can.
Return value '0' means we cannot. Return value '0' means we cannot.
*/ */
{
int available; int available;
int rval; int rval;
snd_pcm_t *handle; snd_pcm_t *handle;
...@@ -105,37 +102,32 @@ static int Audio_Available(void) ...@@ -105,37 +102,32 @@ static int Audio_Available(void)
available = 0; available = 0;
handle = NULL; handle = NULL;
//JB modified to take advantage of software mixer rval = snd_pcm_open_preferred(&handle, NULL, NULL, OPEN_FLAGS);
rval = snd_pcm_open_preferred(&handle, &card_no, &device_no, OPEN_FLAGS);
if (rval >= 0) if (rval >= 0){
{
available = 1; available = 1;
if ((rval = snd_pcm_close(handle)) < 0) if ((rval = snd_pcm_close(handle)) < 0){
{
SDL_SetError("snd_pcm_close failed: %s\n",snd_strerror(rval)); SDL_SetError("snd_pcm_close failed: %s\n",snd_strerror(rval));
available = 0; available = 0;
} }
} }
else else{
{
SDL_SetError("snd_pcm_open failed: %s\n", snd_strerror(rval)); SDL_SetError("snd_pcm_open failed: %s\n", snd_strerror(rval));
} }
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr,"AudioAvailable rtns %d\n", available); fprintf(stderr,"AudioAvailable rtns %d\n", available);
#endif #endif
return(available); return(available);
} }
static void Audio_DeleteDevice(SDL_AudioDevice *device) static void Audio_DeleteDevice(SDL_AudioDevice *device)
{ {
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr,"Audio_DeleteDevice\n"); fprintf(stderr,"Audio_DeleteDevice\n");
#endif #endif
free(device->hidden); free(device->hidden);
free(device); free(device);
...@@ -144,9 +136,9 @@ static void Audio_DeleteDevice(SDL_AudioDevice *device) ...@@ -144,9 +136,9 @@ static void Audio_DeleteDevice(SDL_AudioDevice *device)
static SDL_AudioDevice *Audio_CreateDevice(int devindex) static SDL_AudioDevice *Audio_CreateDevice(int devindex)
{ {
SDL_AudioDevice *this; SDL_AudioDevice *this;
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr,"Audio_CreateDevice\n"); fprintf(stderr,"Audio_CreateDevice\n");
#endif #endif
/* Initialize all variables that we clean on shutdown */ /* Initialize all variables that we clean on shutdown */
this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice));
if ( this ) { if ( this ) {
...@@ -185,117 +177,92 @@ AudioBootStrap ALSA_bootstrap = { ...@@ -185,117 +177,92 @@ AudioBootStrap ALSA_bootstrap = {
/* This function waits until it is possible to write a full sound buffer */ /* This function waits until it is possible to write a full sound buffer */
static void NTO_WaitAudio(_THIS) static void NTO_WaitAudio(_THIS)
{ {
int rval; fd_set wfds;
int totalbytes,roomavail;
/*we consider a full sound buffer to be of size pcm_len bytes */
#ifdef DEBUG_AUDIO
fprintf(stderr,"NTO_WaitAudio\n");
#endif
while(1) FD_SET( audio_fd, &wfds );
{ switch( select( audio_fd + 1, NULL, &wfds, NULL, NULL ) )
memset(&cstatus, 0, sizeof(cstatus));
if( (rval = snd_pcm_plugin_status(audio_handle, &cstatus)) < 0 )
{ {
SDL_SetError("snd_pcm_plugin_status failed: %s\n", snd_strerror(rval)); case -1:
return; case 0:
} /* Error */
SDL_SetError("select() in NTO_WaitAudio failed: %s\n", strerror(errno));
totalbytes = csetup.buf.block.frag_size *csetup.buf.block.frags; break;
roomavail = totalbytes - cstatus.count; default:
if(FD_ISSET(audio_fd, &wfds))
#ifdef DEBUG_AUDIO
fprintf(stderr,"NTO_WaitAudio roomavail %d pcm_len %d\n",roomavail,pcm_len);
#endif
if ((roomavail >= pcm_len) || (roomavail < 0))
return; return;
SDL_Delay(10);
} }
} }
static void NTO_PlayAudio(_THIS) static void NTO_PlayAudio(_THIS)
{ {
int written, rval; int written, rval;
int towrite; int towrite;
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr, "NTO_PlayAudio\n"); fprintf(stderr, "NTO_PlayAudio\n");
#endif #endif
if( !this->enabled) if( !this->enabled){
return; return;
}
towrite = pcm_len; towrite = pcm_len;
/* Write the audio data, checking for EAGAIN (buffer full) and underrun */ /* Write the audio data, checking for EAGAIN (buffer full) and underrun */
do { do {
written = snd_pcm_plugin_write(audio_handle, pcm_buf, towrite); written = snd_pcm_plugin_write(audio_handle, pcm_buf, towrite);
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr, "NTO_PlayAudio: written = %d towrite = %d\n",written,towrite); fprintf(stderr, "NTO_PlayAudio: written = %d towrite = %d\n",written,towrite);
#endif #endif
if (written != towrite) if (written != towrite){
{ if ((errno == EAGAIN) || (errno == EWOULDBLOCK)){
if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
{
SDL_Delay(1); /* Let a little CPU time go by and try to write again */ SDL_Delay(1); /* Let a little CPU time go by and try to write again */
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr, "errno == EAGAIN written %d\n", written); fprintf(stderr, "errno == EAGAIN written %d\n", written);
#endif
towrite -= written; //we wrote some data towrite -= written; //we wrote some data
#endif
continue; continue;
} }
else if((errno == EINVAL) || (errno == EIO)) else if((errno == EINVAL) || (errno == EIO)){
{ if(errno == EIO){
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
if(errno == EIO)
fprintf(stderr,"snd_pcm_plugin_write failed EIO: %s\n", snd_strerror(written)); fprintf(stderr,"snd_pcm_plugin_write failed EIO: %s\n", snd_strerror(written));
if(errno == EINVAL) #endif
}
if(errno == EINVAL){
#ifdef DEBUG_AUDIO
fprintf(stderr,"snd_pcm_plugin_write failed EINVAL: %s\n", snd_strerror(written)); fprintf(stderr,"snd_pcm_plugin_write failed EINVAL: %s\n", snd_strerror(written));
#endif
#endif }
memset(&cstatus, 0, sizeof(cstatus)); memset(&cstatus, 0, sizeof(cstatus));
if( (rval = snd_pcm_plugin_status(audio_handle, &cstatus)) < 0 ) if( (rval = snd_pcm_plugin_status(audio_handle, &cstatus)) < 0 ){
{ #ifdef DEBUG_AUDIO
#ifdef DEBUG_AUDIO
fprintf(stderr, "snd_pcm_plugin_status failed %s\n",snd_strerror(rval)); fprintf(stderr, "snd_pcm_plugin_status failed %s\n",snd_strerror(rval));
#endif #endif
SDL_SetError("snd_pcm_plugin_status failed: %s\n", snd_strerror(rval)); SDL_SetError("snd_pcm_plugin_status failed: %s\n", snd_strerror(rval));
return; return;
} }
if ( (cstatus.status == SND_PCM_STATUS_UNDERRUN) || if ( (cstatus.status == SND_PCM_STATUS_UNDERRUN) || (cstatus.status == SND_PCM_STATUS_READY) ){
(cstatus.status == SND_PCM_STATUS_READY) ) #ifdef DEBUG_AUDIO
{
#ifdef DEBUG_AUDIO
fprintf(stderr, "buffer underrun\n"); fprintf(stderr, "buffer underrun\n");
#endif #endif
if ( (rval = snd_pcm_plugin_prepare (audio_handle,SND_PCM_CHANNEL_PLAYBACK)) < 0 ) if ( (rval = snd_pcm_plugin_prepare (audio_handle,SND_PCM_CHANNEL_PLAYBACK)) < 0 ){
{ #ifdef DEBUG_AUDIO
#ifdef DEBUG_AUDIO
fprintf(stderr, "NTO_PlayAudio: prepare failed %s\n",snd_strerror(rval)); fprintf(stderr, "NTO_PlayAudio: prepare failed %s\n",snd_strerror(rval));
#endif #endif
SDL_SetError("snd_pcm_plugin_prepare failed: %s\n",snd_strerror(rval) ); SDL_SetError("snd_pcm_plugin_prepare failed: %s\n",snd_strerror(rval) );
return; return;
} }
} }
continue; continue;
} }
else else{
{ #ifdef DEBUG_AUDIO
#ifdef DEBUG_AUDIO
fprintf(stderr, "NTO_PlayAudio: snd_pcm_plugin_write failed unknown errno %d %s\n",errno, snd_strerror(rval)); fprintf(stderr, "NTO_PlayAudio: snd_pcm_plugin_write failed unknown errno %d %s\n",errno, snd_strerror(rval));
#endif #endif
return; return;
} }
} }
...@@ -316,7 +283,7 @@ static Uint8 *NTO_GetAudioBuf(_THIS) ...@@ -316,7 +283,7 @@ static Uint8 *NTO_GetAudioBuf(_THIS)
{ {
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr, "NTO_GetAudioBuf: pcm_buf %X\n",(Uint8 *)pcm_buf); fprintf(stderr, "NTO_GetAudioBuf: pcm_buf %X\n",(Uint8 *)pcm_buf);
#endif #endif
return(pcm_buf); return(pcm_buf);
} }
...@@ -324,20 +291,18 @@ static void NTO_CloseAudio(_THIS) ...@@ -324,20 +291,18 @@ static void NTO_CloseAudio(_THIS)
{ {
int rval; int rval;
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr, "NTO_CloseAudio\n"); fprintf(stderr, "NTO_CloseAudio\n");
#endif #endif
this->enabled = 0; this->enabled = 0;
if ( audio_handle != NULL ) { if ( audio_handle != NULL ) {
if ((rval = snd_pcm_plugin_flush(audio_handle,SND_PCM_CHANNEL_PLAYBACK)) < 0) if ((rval = snd_pcm_plugin_flush(audio_handle,SND_PCM_CHANNEL_PLAYBACK)) < 0){
{
SDL_SetError("snd_pcm_plugin_flush failed: %s\n",snd_strerror(rval)); SDL_SetError("snd_pcm_plugin_flush failed: %s\n",snd_strerror(rval));
return; return;
} }
if ((rval = snd_pcm_close(audio_handle)) < 0) if ((rval = snd_pcm_close(audio_handle)) < 0){
{
SDL_SetError("snd_pcm_close failed: %s\n",snd_strerror(rval)); SDL_SetError("snd_pcm_close failed: %s\n",snd_strerror(rval));
return; return;
} }
...@@ -353,9 +318,9 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -353,9 +318,9 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
int twidth; int twidth;
int found; int found;
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr, "NTO_OpenAudio\n"); fprintf(stderr, "NTO_OpenAudio\n");
#endif #endif
audio_handle = NULL; audio_handle = NULL;
this->enabled = 0; this->enabled = 0;
...@@ -369,67 +334,51 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -369,67 +334,51 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
init_pcm_cparams(&cparams); init_pcm_cparams(&cparams);
/* Open the audio device */ /* Open the audio device */
rval = snd_pcm_open_preferred(&audio_handle, NULL, NULL, OPEN_FLAGS);
rval = snd_pcm_open_preferred(&audio_handle, &card_no, &device_no, OPEN_FLAGS);
if ( rval < 0 ) { if ( rval < 0 ) {
SDL_SetError("snd_pcm_open failed: %s\n", snd_strerror(rval)); SDL_SetError("snd_pcm_open failed: %s\n", snd_strerror(rval));
return(-1); return(-1);
} }
/* set to nonblocking mode */
if ((rval = snd_pcm_nonblock_mode(audio_handle, 1))<0) //I assume 1 means on
{
SDL_SetError("snd_pcm_nonblock_mode failed: %s\n", snd_strerror(rval));
return(-1);
}
/* enable count status parameter */ /* enable count status parameter */
if ((rval = snd_pcm_plugin_set_disable(audio_handle, PLUGIN_DISABLE_MMAP))<0) if ((rval = snd_pcm_plugin_set_disable(audio_handle, PLUGIN_DISABLE_MMAP))<0){
{
SDL_SetError("snd_pcm_plugin_set_disable failed: %s\n", snd_strerror(rval)); SDL_SetError("snd_pcm_plugin_set_disable failed: %s\n", snd_strerror(rval));
return(-1); return(-1);
} }
/* Try for a closest match on audio format */ /* Try for a closest match on audio format */
format = 0; format = 0;
found = 0; // can't use format as SND_PCM_SFMT_U8 = 0 in nto found = 0; /* can't use format as SND_PCM_SFMT_U8 = 0 in nto */
for ( test_format = SDL_FirstAudioFormat(spec->format); !found ; ) for ( test_format = SDL_FirstAudioFormat(spec->format); !found ; )
{ {
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr, "Trying format 0x%4.4x spec->samples %d\n", test_format,spec->samples); fprintf(stderr, "Trying format 0x%4.4x spec->samples %d\n", test_format,spec->samples);
#endif #endif
/* if match found set format to equivalent ALSA format */ /* if match found set format to equivalent ALSA format */
switch ( test_format ) { switch ( test_format ) {
case AUDIO_U8: case AUDIO_U8:
format = SND_PCM_SFMT_U8; format = SND_PCM_SFMT_U8;
cparams.buf.block.frag_size = spec->samples * spec->channels;
found = 1; found = 1;
break; break;
case AUDIO_S8: case AUDIO_S8:
format = SND_PCM_SFMT_S8; format = SND_PCM_SFMT_S8;
cparams.buf.block.frag_size = spec->samples * spec->channels;
found = 1; found = 1;
break; break;
case AUDIO_S16LSB: case AUDIO_S16LSB:
format = SND_PCM_SFMT_S16_LE; format = SND_PCM_SFMT_S16_LE;
cparams.buf.block.frag_size = spec->samples*2 * spec->channels;
found = 1; found = 1;
break; break;
case AUDIO_S16MSB: case AUDIO_S16MSB:
format = SND_PCM_SFMT_S16_BE; format = SND_PCM_SFMT_S16_BE;
cparams.buf.block.frag_size = spec->samples*2 * spec->channels;
found = 1; found = 1;
break; break;
case AUDIO_U16LSB: case AUDIO_U16LSB:
format = SND_PCM_SFMT_U16_LE; format = SND_PCM_SFMT_U16_LE;
cparams.buf.block.frag_size = spec->samples*2 * spec->channels;
found = 1; found = 1;
break; break;
case AUDIO_U16MSB: case AUDIO_U16MSB:
format = SND_PCM_SFMT_U16_BE; format = SND_PCM_SFMT_U16_BE;
cparams.buf.block.frag_size = spec->samples*2 * spec->channels;
found = 1; found = 1;
break; break;
default: default:
...@@ -454,10 +403,9 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -454,10 +403,9 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
/* Set mono or stereo audio (currently only two channels supported) */ /* Set mono or stereo audio (currently only two channels supported) */
cparams.format.voices = spec->channels; cparams.format.voices = spec->channels;
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr,"intializing channels %d\n", cparams.format.voices); fprintf(stderr,"intializing channels %d\n", cparams.format.voices);
#endif #endif
/* Set rate */ /* Set rate */
cparams.format.rate = spec->freq ; cparams.format.rate = spec->freq ;
...@@ -479,7 +427,7 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -479,7 +427,7 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
} }
else else
{ {
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr,"requested format: %d\n",cparams.format.format); fprintf(stderr,"requested format: %d\n",cparams.format.format);
fprintf(stderr,"requested frag size: %d\n",cparams.buf.block.frag_size); fprintf(stderr,"requested frag size: %d\n",cparams.buf.block.frag_size);
fprintf(stderr,"requested max frags: %d\n\n",cparams.buf.block.frags_max); fprintf(stderr,"requested max frags: %d\n\n",cparams.buf.block.frags_max);
...@@ -487,12 +435,12 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -487,12 +435,12 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
fprintf(stderr,"real format: %d\n", csetup.format.format ); fprintf(stderr,"real format: %d\n", csetup.format.format );
fprintf(stderr,"real frag size : %d\n", csetup.buf.block.frag_size ); fprintf(stderr,"real frag size : %d\n", csetup.buf.block.frag_size );
fprintf(stderr,"real max frags : %d\n", csetup.buf.block.frags_max ); fprintf(stderr,"real max frags : %d\n", csetup.buf.block.frags_max );
#endif // DEBUG_AUDIO #endif
} }
/*
/* Allocate memory to the audio buffer and initialize with silence Allocate memory to the audio buffer and initialize with silence (Note that
(Note that buffer size must be a multiple of fragment size, so find closest multiple) buffer size must be a multiple of fragment size, so find closest multiple)
*/ */
twidth = snd_pcm_format_width(format); twidth = snd_pcm_format_width(format);
...@@ -501,19 +449,17 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -501,19 +449,17 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
twidth = 0; twidth = 0;
} }
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr,"format is %d bits wide\n",twidth); fprintf(stderr,"format is %d bits wide\n",twidth);
#endif #endif
pcm_len = spec->size ; pcm_len = spec->size ;
#ifdef DEBUG_AUDIO
#ifdef DEBUG_AUDIO
fprintf(stderr,"pcm_len set to %d\n", pcm_len); fprintf(stderr,"pcm_len set to %d\n", pcm_len);
#endif #endif
if (pcm_len == 0) if (pcm_len == 0){
{
pcm_len = csetup.buf.block.frag_size; pcm_len = csetup.buf.block.frag_size;
} }
...@@ -524,13 +470,12 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -524,13 +470,12 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
} }
memset(pcm_buf,spec->silence,pcm_len); memset(pcm_buf,spec->silence,pcm_len);
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
fprintf(stderr,"pcm_buf malloced and silenced.\n"); fprintf(stderr,"pcm_buf malloced and silenced.\n");
#endif #endif
/* get the file descriptor */ /* get the file descriptor */
if( (audio_fd = snd_pcm_file_descriptor(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0) if( (audio_fd = snd_pcm_file_descriptor(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0){
{
fprintf(stderr, "snd_pcm_file_descriptor failed with error code: %d\n", audio_fd); fprintf(stderr, "snd_pcm_file_descriptor failed with error code: %d\n", audio_fd);
} }
...@@ -550,5 +495,3 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -550,5 +495,3 @@ static int NTO_OpenAudio(_THIS, SDL_AudioSpec *spec)
return(0); return(0);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment