mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Try to fix period_time/period_size problems for direct plugin slaves
This commit is contained in:
parent
00fba04f01
commit
b7e8f57314
4 changed files with 16 additions and 3 deletions
|
|
@ -1044,6 +1044,7 @@ snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
|
|||
* \param pcm PCM handle
|
||||
* \param frames wanted skip in frames
|
||||
* \return a positive number for actual skip otherwise a negative error code
|
||||
* \retval 0 means no action
|
||||
*/
|
||||
#ifndef DOXYGEN
|
||||
snd_pcm_sframes_t INTERNAL(snd_pcm_forward)(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
|
||||
|
|
|
|||
|
|
@ -1206,7 +1206,7 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
|
|||
params.format = SND_PCM_FORMAT_S16;
|
||||
params.rate = 48000;
|
||||
params.channels = 2;
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
params.period_time = -1;
|
||||
params.buffer_time = -1;
|
||||
bsize = psize = -1;
|
||||
params.periods = 3;
|
||||
|
|
@ -1223,6 +1223,10 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (err < 0)
|
||||
return err;
|
||||
|
||||
/* set a reasonable default */
|
||||
if (psize == -1 && params.period_time == -1)
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
|
||||
/* sorry, limited features */
|
||||
if (params.format != SND_PCM_FORMAT_S16 &&
|
||||
params.format != SND_PCM_FORMAT_S32) {
|
||||
|
|
|
|||
|
|
@ -874,7 +874,7 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
|||
params.format = SND_PCM_FORMAT_S16;
|
||||
params.rate = 48000;
|
||||
params.channels = 2;
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
params.period_time = -1;
|
||||
params.buffer_time = -1;
|
||||
bsize = psize = -1;
|
||||
params.periods = 3;
|
||||
|
|
@ -890,6 +890,10 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (err < 0)
|
||||
return err;
|
||||
|
||||
/* set a reasonable default */
|
||||
if (psize == -1 && params.period_time == -1)
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
|
||||
params.period_size = psize;
|
||||
params.buffer_size = bsize;
|
||||
err = snd_pcm_dshare_open(pcmp, name, ipc_key, ipc_perm, ¶ms, bindings, slowptr, root, sconf, stream, mode);
|
||||
|
|
|
|||
|
|
@ -824,7 +824,7 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
|
|||
params.format = SND_PCM_FORMAT_S16;
|
||||
params.rate = 48000;
|
||||
params.channels = 2;
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
params.period_time = -1;
|
||||
params.buffer_time = -1;
|
||||
bsize = psize = -1;
|
||||
params.periods = 3;
|
||||
|
|
@ -840,6 +840,10 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (err < 0)
|
||||
return err;
|
||||
|
||||
/* set a reasonable default */
|
||||
if (psize == -1 && params.period_time == -1)
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
|
||||
params.period_size = psize;
|
||||
params.buffer_size = bsize;
|
||||
err = snd_pcm_dsnoop_open(pcmp, name, ipc_key, ipc_perm, ¶ms, bindings, slowptr, root, sconf, stream, mode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue