mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
pcm: direct: allow users to configure different period sizes
This patch allows the effective period size to be a multiple of the slave-pcm period size. Allowing only exact multiple of original period size is achieved by borrowing code from the kernel hwrules implementation. This patch is intended to save cpu workload when for example, the slave operates with very small periods but a user does not need that small periods. This feature is enabled by default and can be disabled by adding config option 'var_periodsize 0'. Signed-off-by: Alexander Jahn <ajahn@de.adit-jv.com> Signed-off-by: Andreas Pape <apape@de.adit-jv.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
9ed4075f05
commit
0a61c79681
5 changed files with 84 additions and 10 deletions
|
|
@ -147,12 +147,14 @@ struct snd_pcm_direct {
|
|||
int tread: 1;
|
||||
int timer_need_poll: 1;
|
||||
unsigned int timer_events;
|
||||
unsigned int timer_ticks;
|
||||
int server_fd;
|
||||
pid_t server_pid;
|
||||
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 max_periods; /* max periods (-1 = fixed periods, 0 = max buffer size) */
|
||||
int var_periodsize; /* allow variable period size if max_periods is != -1*/
|
||||
unsigned int channels; /* client's channels */
|
||||
unsigned int *bindings;
|
||||
union {
|
||||
|
|
@ -326,6 +328,7 @@ struct snd_pcm_direct_open_conf {
|
|||
int ipc_gid;
|
||||
int slowptr;
|
||||
int max_periods;
|
||||
int var_periodsize;
|
||||
snd_config_t *slave;
|
||||
snd_config_t *bindings;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue