mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
pcm: direct: correctly apply existing interval settings
Feature 'variable periodsize' allows to extend user period size up to buffer_size/2 independent of slave period. On enlargement of the settings for period_time.max and period_size.max the setting for openmax was not updated. This lead to the effect, that if the slave period itself had openmax set it was still set on the extended size. Configuration of a period matching half buffer size was thus rejected. Example for failure: period size of 384 (half buffer size) is requested which is rejected and rounded down to 352: PERIOD_SIZE: [32 352] BUFFER_SIZE: [64 768] When correctly applying the openmax setting: PERIOD_SIZE: [32 384] BUFFER_SIZE: [64 768] Signed-off-by: Andreas Pape <apape@de.adit-jv.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
198eb642bc
commit
5394f605bc
1 changed files with 6 additions and 2 deletions
|
|
@ -929,10 +929,14 @@ int snd_pcm_direct_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||||
return err;
|
return err;
|
||||||
if (dshare->var_periodsize) {
|
if (dshare->var_periodsize) {
|
||||||
/* more tolerant settings... */
|
/* more tolerant settings... */
|
||||||
if (dshare->shmptr->hw.buffer_size.max / 2 > period_size.max)
|
if (dshare->shmptr->hw.buffer_size.max / 2 > period_size.max) {
|
||||||
period_size.max = dshare->shmptr->hw.buffer_size.max / 2;
|
period_size.max = dshare->shmptr->hw.buffer_size.max / 2;
|
||||||
if (dshare->shmptr->hw.buffer_time.max / 2 > period_time.max)
|
period_size.openmax = dshare->shmptr->hw.buffer_size.openmax;
|
||||||
|
}
|
||||||
|
if (dshare->shmptr->hw.buffer_time.max / 2 > period_time.max) {
|
||||||
period_time.max = dshare->shmptr->hw.buffer_time.max / 2;
|
period_time.max = dshare->shmptr->hw.buffer_time.max / 2;
|
||||||
|
period_time.openmax = dshare->shmptr->hw.buffer_time.openmax;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = hw_param_interval_refine_one(params, SND_PCM_HW_PARAM_PERIOD_SIZE,
|
err = hw_param_interval_refine_one(params, SND_PCM_HW_PARAM_PERIOD_SIZE,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue