diff options
author | Chris Robinson <[email protected]> | 2019-04-26 16:20:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-04-26 16:20:27 -0700 |
commit | b29be3b39ea2d128f9b380fb8d079815ed707c7c (patch) | |
tree | b80796dac687008e7a010a0f46571069fcc52b65 /Alc/backends | |
parent | f23ff0394d8ae58dc12f8d1076fe5cd9dfde383d (diff) |
Set the ALSA period size first
Diffstat (limited to 'Alc/backends')
-rw-r--r-- | Alc/backends/alsa.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/backends/alsa.cpp b/Alc/backends/alsa.cpp index 969708ab..a2937658 100644 --- a/Alc/backends/alsa.cpp +++ b/Alc/backends/alsa.cpp @@ -734,12 +734,12 @@ ALCboolean AlsaPlayback::reset() else if(snd_pcm_hw_params_set_rate_resample(mPcmHandle, hp, 1) < 0) ERR("Failed to enable ALSA resampler\n"); CHECK(snd_pcm_hw_params_set_rate_near(mPcmHandle, hp, &rate, nullptr)); - /* set buffer time (implicitly constrains period/buffer parameters) */ - if((err=snd_pcm_hw_params_set_buffer_time_near(mPcmHandle, hp, &bufferLen, nullptr)) < 0) - ERR("snd_pcm_hw_params_set_buffer_time_near failed: %s\n", snd_strerror(err)); - /* set period time (implicitly sets buffer size/bytes/time and period size/bytes) */ + /* set period time (implicitly constrains period/buffer parameters) */ if((err=snd_pcm_hw_params_set_period_time_near(mPcmHandle, hp, &periodLen, nullptr)) < 0) ERR("snd_pcm_hw_params_set_period_time_near failed: %s\n", snd_strerror(err)); + /* set buffer time (implicitly sets buffer size/bytes/time and period size/bytes) */ + if((err=snd_pcm_hw_params_set_buffer_time_near(mPcmHandle, hp, &bufferLen, nullptr)) < 0) + ERR("snd_pcm_hw_params_set_buffer_time_near failed: %s\n", snd_strerror(err)); /* install and prepare hardware configuration */ CHECK(snd_pcm_hw_params(mPcmHandle, hp)); |