http://bugs.winehq.org/show_bug.cgi?id=28723
--- Comment #125 from Raymond superquad.vortex2@gmail.com 2012-01-24 19:30:27 CST --- (In reply to comment #124)
One thing I've had in mind for several weeks now is whether we should switch wineALSA's default period to 20ms
alsa default "dmix" has a fixed period size which return 21.333 ms period time
I don't really understand the current code
This->alsa_bufsize_frames = This->mmdev_period_frames * 4;
and what is the reason to check (err < 0)
if((err = snd_pcm_hw_params_set_period_time_near(This->pcm_handle, This->hw_params, &alsa_period_us, NULL)) < 0) WARN("Unable to set period time near %u: %d (%s)\n", alsa_period_us, err, snd_strerror(err)); /* ALSA updates the output variable alsa_period_us */
This->mmdev_period_frames = MulDiv(fmt->nSamplesPerSec, This->mmdev_period_rt, 10000000);
This->bufsize_frames = MulDiv(duration, fmt->nSamplesPerSec, 10000000);
/* Buffer 4 ALSA periods if large enough, else 4 mmdevapi periods */ This->alsa_bufsize_frames = This->mmdev_period_frames * 4; if(err < 0 || alsa_period_us < period / 10) err = snd_pcm_hw_params_set_buffer_size_near(This->pcm_handle, This->hw_params, &This->alsa_bufsize_frames); else{ unsigned int periods = 4; err = snd_pcm_hw_params_set_periods_near(This->pcm_handle, This->hw_params, &periods, NULL); }