http://bugs.winehq.org/show_bug.cgi?id=28723
--- Comment #100 from Andrew Eikum aeikum@codeweavers.com 2011-12-19 10:09:24 CST --- (In reply to comment #98)
Please always post the actual ALSA periods so we know the values. 1024 is huge as I've rarely seen buffers over 2s, that would imply a 2ms period -- possible (I've seen 1ms) but I'd expect set_period_near 10ms not to yield 2ms. Also, please say whether you used set_period or set_buffer, as I'm slowly getting confused. Have you been using plug:dmix, PA with handle_underrun or another device?
Certainly, sorry for being vague. I'm using PA with handle_underrun for the following. I gathered the following clicking the Test Audio button in winecfg. All of them have (with your period clamping patch applied, shared mode): alsa_period_us = This->mmdev_period_rt / 10; snd_pcm_hw_params_set_period_time_near(This->pcm_handle, This->hw_params, &alsa_period_us, NULL);
(1) set_buffer_size_min({any of 1,2,3,4} * mmdev_period_frames) set_buffer_size_near(4 * mmdev_period_frames)
ALSA period: 441 frames ALSA buffer: 1764 frames MMDevice period: 441 frames MMDevice buffer: 4410 frames
(2) set_buffer_size_min({any of 1,2,3} * mmdev_period_frames) set_buffer_size_near(3 * mmdev_period_frames)
err:alsa:AudioClient_Initialize ALSA period: 441 frames err:alsa:AudioClient_Initialize ALSA buffer: 1323 frames err:alsa:AudioClient_Initialize MMDevice period: 441 frames err:alsa:AudioClient_Initialize MMDevice buffer: 4410 frames
Also, I'm wondering why we should insist on such tiny buffers. 100ms should be equally fine from an audio POV. I'm still thinking about the lead-in idea from comment #58, esp. since we must not forget about bug #29056, "ALSA won't start without a full period".
This is why I was advocating for set_buffer_size_min(4xperiod) or similar. You raised the point that PA (and possibly other plugins) might behave better with smaller ALSA buffer sizes.
(In reply to comment #99)
set_period_near(10ms) set_hw_params_periods(3); or 4 may be a better choice for the current driver.
Indeed. I'll experiment with this today. It seems to most clearly express what we want.
With "set_period_near(10ms)" you actually mean "set_period_near(mmdev_period)", with your clamping patch applied, right?