Re: [pulseaudio-discuss] [PATCH 4/5] daemon-conf: Add sync volume parameters to daemon-conf

2010-10-14 Thread Colin Guthrie
'Twas brillig, and o...@iki.fi at 13/10/10 17:40 did gyre and gimble:
 From: Jyri Sarha jyri.sa...@nokia.com
 
 Signed-off-by: Jyri Sarha jyri.sa...@nokia.com
 Reviewed-by: Tanu Kaskinen tanu.kaski...@digia.com

Reviewd-by: Colin Guthrie cguth...@mandriva.org


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 4/5] daemon-conf: Add sync volume parameters to daemon-conf

2010-10-13 Thread o...@iki.fi
From: Jyri Sarha jyri.sa...@nokia.com

Signed-off-by: Jyri Sarha jyri.sa...@nokia.com
Reviewed-by: Tanu Kaskinen tanu.kaski...@digia.com
---
 src/daemon/daemon-conf.c |9 +
 src/daemon/daemon-conf.h |5 -
 src/daemon/daemon.conf.in|4 
 src/daemon/main.c|3 +++
 src/modules/alsa/alsa-sink.c |1 +
 src/modules/module-udev-detect.c |2 +-
 src/pulsecore/core.c |4 
 src/pulsecore/core.h |3 +++
 src/pulsecore/sink.c |6 ++
 9 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 79dd49a..74e8135 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -89,8 +89,11 @@ static const pa_daemon_conf default_conf = {
 .no_cpu_limit = TRUE,
 .disable_shm = FALSE,
 .lock_memory = FALSE,
+.sync_volume = TRUE,
 .default_n_fragments = 4,
 .default_fragment_size_msec = 25,
+.sync_volume_safety_margin_usec = 8000,
+.sync_volume_extra_delay_usec = 0,
 .default_sample_spec = { .format = PA_SAMPLE_S16NE, .rate = 44100, 
.channels = 2 },
 .default_channel_map = { .channels = 2, .map = { PA_CHANNEL_POSITION_LEFT, 
PA_CHANNEL_POSITION_RIGHT } },
 .shm_size = 0
@@ -508,6 +511,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char 
*filename) {
 { enable-shm, pa_config_parse_not_bool, 
c-disable_shm, NULL },
 { flat-volumes,   pa_config_parse_bool, 
c-flat_volumes, NULL },
 { lock-memory,pa_config_parse_bool, 
c-lock_memory, NULL },
+{ enable-sync-volume, pa_config_parse_bool, 
c-sync_volume, NULL },
 { exit-idle-time, pa_config_parse_int,  
c-exit_idle_time, NULL },
 { scache-idle-time,   pa_config_parse_int,  
c-scache_idle_time, NULL },
 { realtime-priority,  parse_rtprio, c, NULL },
@@ -523,6 +527,8 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char 
*filename) {
 { default-channel-map,parse_channel_map,ci,  NULL },
 { default-fragments,  parse_fragments,  c, NULL },
 { default-fragment-size-msec, parse_fragment_size_msec, c, NULL },
+{ sync-volume-safety-margin-usec, pa_config_parse_unsigned, 
c-sync_volume_safety_margin_usec, NULL },
+{ sync-volume-extra-delay-usec, pa_config_parse_int, 
c-sync_volume_extra_delay_usec, NULL },
 { nice-level, parse_nice_level, c, NULL },
 { disable-remixing,   pa_config_parse_bool, 
c-disable_remixing, NULL },
 { enable-remixing,pa_config_parse_not_bool, 
c-disable_remixing, NULL },
@@ -706,6 +712,7 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
 pa_strbuf_printf(s, enable-shm = %s\n, pa_yes_no(!c-disable_shm));
 pa_strbuf_printf(s, flat-volumes = %s\n, pa_yes_no(c-flat_volumes));
 pa_strbuf_printf(s, lock-memory = %s\n, pa_yes_no(c-lock_memory));
+pa_strbuf_printf(s, enable-sync-volume = %s\n, 
pa_yes_no(c-sync_volume));
 pa_strbuf_printf(s, exit-idle-time = %i\n, c-exit_idle_time);
 pa_strbuf_printf(s, scache-idle-time = %i\n, c-scache_idle_time);
 pa_strbuf_printf(s, dl-search-path = %s\n, 
pa_strempty(c-dl_search_path));
@@ -722,6 +729,8 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
 pa_strbuf_printf(s, default-channel-map = %s\n, 
pa_channel_map_snprint(cm, sizeof(cm), c-default_channel_map));
 pa_strbuf_printf(s, default-fragments = %u\n, c-default_n_fragments);
 pa_strbuf_printf(s, default-fragment-size-msec = %u\n, 
c-default_fragment_size_msec);
+pa_strbuf_printf(s, sync-volume-safety-margin-usec = %u\n, 
c-sync_volume_safety_margin_usec);
+pa_strbuf_printf(s, sync-volume-extra-delay-usec = %d\n, 
c-sync_volume_extra_delay_usec);
 pa_strbuf_printf(s, shm-size-bytes = %lu\n, (unsigned long) c-shm_size);
 pa_strbuf_printf(s, log-meta = %s\n, pa_yes_no(c-log_meta));
 pa_strbuf_printf(s, log-time = %s\n, pa_yes_no(c-log_time));
diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h
index 41c3c4b..9fd6aba 100644
--- a/src/daemon/daemon-conf.h
+++ b/src/daemon/daemon-conf.h
@@ -75,7 +75,8 @@ typedef struct pa_daemon_conf {
 log_meta,
 log_time,
 flat_volumes,
-lock_memory;
+lock_memory,
+sync_volume;
 pa_server_type_t local_server_type;
 int exit_idle_time,
 scache_idle_time,
@@ -127,6 +128,8 @@ typedef struct pa_daemon_conf {
 #endif
 
 unsigned default_n_fragments, default_fragment_size_msec;
+unsigned sync_volume_safety_margin_usec;
+int sync_volume_extra_delay_usec;
 pa_sample_spec default_sample_spec;
 pa_channel_map default_channel_map;
 size_t shm_size;
diff --git a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in
index 5de27ed..9beba85 100644