Commit 335f70fa authored by Sam Lantinga's avatar Sam Lantinga

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
parent 86dfb899
...@@ -507,16 +507,18 @@ static int ALSA_OpenAudio(_THIS, SDL_AudioSpec *spec) ...@@ -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);
SDL_NAME(snd_pcm_hw_params_get_buffer_size)(hwparams, &bufsize);
fprintf(stderr, "ALSA: period size = %ld, periods = %u, buffer size = %lu\n", persize, periods, bufsize); SDL_NAME(snd_pcm_hw_params_get_period_size)(hwparams, &persize, &dir);
} SDL_NAME(snd_pcm_hw_params_get_periods)(hwparams, &periods, &dir);
#endif
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);
......
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