Fix buffer size handling of direct plugins

Introduce "max_periods" option to specify the max number of periods
per buffer to each plugin.

- When max_periods = -1, the fixed buffer size as the slave size is
  used (old behavior).
- When max_periods = 0 (or 1), the number of periods is variable
  between 2 and the slave buffer size.
- When max_periods greater than 2 is given, it specifies the max
  periods of that pcm explicitly.

When no option is given in the PCM defintion, the value
"defaults.pcm.dmix_max_periods" is referred as default.
The default value is 0, as defined in alsa.conf.
You can override this in ~/.asoundrc or /etc/asound.conf as you like.
This commit is contained in:
Takashi Iwai 2006-04-06 18:49:11 +02:00
parent 33d69ef33b
commit 1128efc7d4
7 changed files with 41 additions and 56 deletions

View file

@ -57,7 +57,7 @@ defaults.pcm.nonblock 1
defaults.pcm.ipc_key 5678293
defaults.pcm.ipc_gid audio
defaults.pcm.ipc_perm 0660
defaults.pcm.dmix_variable_buffer true
defaults.pcm.dmix_max_periods 0
defaults.pcm.front.card defaults.pcm.card
defaults.pcm.front.device defaults.pcm.device
defaults.pcm.rear.card defaults.pcm.card

View file

@ -92,9 +92,4 @@ pcm.!dmix {
default 16
}
}
# Allow apps different buffer sizes
variable_buffer_size {
@func refer
name defaults.pcm.dmix_variable_buffer
}
}