diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-04-06 18:49:11 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2006-04-06 18:49:11 +0200 |
commit | 1128efc7d4edf488735b7769211d99e5d4fa1ad3 (patch) | |
tree | d0f2adf5bd81fa2cc732c5048cdef71f9777be56 /src/pcm/pcm_dsnoop.c | |
parent | 33d69ef33be28a4d205a852462c25c67d2f51707 (diff) | |
download | alsa-lib-1128efc7d4edf488735b7769211d99e5d4fa1ad3.tar.gz |
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.
Diffstat (limited to 'src/pcm/pcm_dsnoop.c')
-rw-r--r-- | src/pcm/pcm_dsnoop.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c index 8ef83494..4d44e76f 100644 --- a/src/pcm/pcm_dsnoop.c +++ b/src/pcm/pcm_dsnoop.c @@ -544,7 +544,7 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, pcm->private_data = dsnoop; dsnoop->state = SND_PCM_STATE_OPEN; dsnoop->slowptr = opts->slowptr; - dsnoop->variable_buffer_size = opts->variable_buffer_size; + dsnoop->max_periods = opts->max_periods; dsnoop->sync_ptr = snd_pcm_dsnoop_sync_ptr; if (first_instance) { @@ -707,10 +707,9 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, struct slave_params params; struct snd_pcm_direct_open_conf dopen; int bsize, psize; - int ipc_offset; int err; - err = snd_pcm_direct_parse_open_conf(conf, &dopen); + err = snd_pcm_direct_parse_open_conf(root, conf, stream, &dopen); if (err < 0) return err; @@ -741,13 +740,6 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, params.period_size = psize; params.buffer_size = bsize; - ipc_offset = snd_pcm_direct_get_slave_ipc_offset(root, sconf, stream); - if (ipc_offset < 0) { - snd_config_delete(sconf); - return ipc_offset; - } - dopen.ipc_key += ipc_offset; - err = snd_pcm_dsnoop_open(pcmp, name, &dopen, ¶ms, root, sconf, stream, mode); if (err < 0) |