dmix - Allow more flexible buffer sizes

With the patch, dmix allows apps to use more flexible buffer sizes.
The max buffer size is unlimited, and the minimal buffer size is
(period size * 2).  The buffer size is aligned to period size.

The period size is still bound to the period size of slave PCM.

To back to the old behavior (the fixed buffer size), you can set

   defaults.pcm.dmix_variable_buffer false

in your configuration.
This commit is contained in:
Takashi Iwai 2006-03-21 10:27:35 +00:00
parent 8ef339762a
commit 7e6c920836
7 changed files with 83 additions and 57 deletions

View file

@ -117,6 +117,7 @@ struct snd_pcm_direct {
snd_timer_t *timer; /* timer used as poll_fd */
int interleaved; /* we have interleaved buffer */
int slowptr; /* use slow but more precise ptr updates */
int variable_buffer_size; /* allow the variable buffer size */
unsigned int channels; /* client's channels */
unsigned int *bindings;
union {
@ -196,6 +197,7 @@ struct snd_pcm_direct_open_conf {
mode_t ipc_perm;
int ipc_gid;
int slowptr;
int variable_buffer_size;
snd_config_t *slave;
snd_config_t *bindings;
};