Enable the ALSA debug code via environment variable

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%404100
This commit is contained in:
Sam Lantinga 2009-10-17 07:04:58 +00:00
parent 86dfb8995b
commit 335f70faf3

View file

@ -507,16 +507,18 @@ static int ALSA_OpenAudio(_THIS, SDL_AudioSpec *spec)
return(-1); return(-1);
} }
/* This is useful for debugging... */ /* This is useful for debugging */
#ifdef DEBUG_PERIOD_SIZE if (getenv("SDL_AUDIO_ALSA_DEBUG_PERIOD_SIZE")) {
{ snd_pcm_uframes_t bufsize; snd_pcm_sframes_t persize; unsigned int periods; int dir; snd_pcm_uframes_t bufsize;
SDL_NAME(snd_pcm_hw_params_get_buffer_size)(hwparams, &bufsize); snd_pcm_sframes_t persize;
SDL_NAME(snd_pcm_hw_params_get_period_size)(hwparams, &persize, &dir); unsigned int periods; int dir;
SDL_NAME(snd_pcm_hw_params_get_periods)(hwparams, &periods, &dir);
fprintf(stderr, "ALSA: period size = %ld, periods = %u, buffer size = %lu\n", persize, periods, bufsize); SDL_NAME(snd_pcm_hw_params_get_buffer_size)(hwparams, &bufsize);
} SDL_NAME(snd_pcm_hw_params_get_period_size)(hwparams, &persize, &dir);
#endif SDL_NAME(snd_pcm_hw_params_get_periods)(hwparams, &periods, &dir);
fprintf(stderr, "ALSA: period size = %ld, periods = %u, buffer size = %lu\n", persize, periods, bufsize);
}
/* Set the software parameters */ /* Set the software parameters */
snd_pcm_sw_params_alloca(&swparams); snd_pcm_sw_params_alloca(&swparams);