mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
can't adjust dmix's buffer size, so print a message when it seems it's
likely to be an issue
This commit is contained in:
parent
3fb03fc2be
commit
6705140f76
2 changed files with 4 additions and 8 deletions
|
@ -45,7 +45,7 @@ QF_ALSA_NEED (snd_pcm_uframes_t, snd_pcm_hw_params_set_period_size_near, (snd_pc
|
|||
QF_ALSA_NEED (unsigned int, snd_pcm_hw_params_set_rate_near, (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir))
|
||||
#else
|
||||
QF_ALSA_NEED (int, snd_pcm_hw_params_get_buffer_size, (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val))
|
||||
QF_ALSA_NEED (int, snd_pcm_hw_params_set_buffer_size, (snd_pcm_t *pcm, const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val))
|
||||
QF_ALSA_NEED (int, snd_pcm_hw_params_set_buffer_size, (snd_pcm_t *pcm, const snd_pcm_hw_params_t *params, snd_pcm_uframes_t val))
|
||||
QF_ALSA_NEED (int, snd_pcm_hw_params_get_period_size, (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir))
|
||||
QF_ALSA_NEED (int, snd_pcm_hw_params_set_access, (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access))
|
||||
QF_ALSA_NEED (int, snd_pcm_hw_params_set_period_size_near, (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir))
|
||||
|
|
|
@ -338,13 +338,9 @@ SNDDMA_Init (void)
|
|||
goto error;
|
||||
}
|
||||
if (buffer_size != round_buffer_size (buffer_size)) {
|
||||
buffer_size = round_buffer_size (buffer_size);
|
||||
err = qfsnd_pcm_hw_params_set_buffer_size (pcm, hw, &buffer_size);
|
||||
if (0 > err) {
|
||||
Sys_Printf ("ALSA: unable to set buffer size. %s\n",
|
||||
qfsnd_strerror (err));
|
||||
goto error;
|
||||
}
|
||||
Sys_Printf ("ALSA: WARNING: non-power of 2 buffer size. sound may be unsatisfactory\n");
|
||||
Sys_Printf ("recommend using either the plughw, or hw devices or adjusting dmix\n");
|
||||
Sys_Printf ("to have a power of 2 buffer size\n");
|
||||
}
|
||||
|
||||
sn.samples = buffer_size * sn.channels; // mono samples in buffer
|
||||
|
|
Loading…
Reference in a new issue