*** 0.5 ***
- more complete pactl/parec
-- fix tcp/native in regard to latencies
-- add client config file
-- remove autospawn stuff in conf.c
-- make resampler configurable
+- fix tcp/native in regard to latencies (i.e. latency interpolation)
*** 0.6 ****
- per-channel volume
struct pa_client_conf *c = pa_xmemdup(&default_conf, sizeof(default_conf));
c->daemon_binary = pa_xstrdup(POLYPAUDIO_BINARY);
- c->extra_arguments = pa_xstrdup("--daemonize=yes --log-target=syslog");
+ c->extra_arguments = pa_xstrdup("--log-target=syslog --exit-idle-time=5");
return c;
}
## commented out. Use either ; or # for commenting
## Path to the polypaudio daemon to run when autospawning.
-; daemon_binary = @POLYPAUDIO_BINARY@
+; daemon-binary = @POLYPAUDIO_BINARY@
## Extra arguments to pass to the polypaudio daemon
-; extra_arguments = --daemonize=yes --log-target=syslog
+; extra-arguments = --log-target=syslog --exit-idle-time=5
## The default sink to connect to
-; default_sink =
+; default-sink =
## The default source to connect to
-; default_source =
+; default-source =
## The default sever to connect to
-; default_server =
+; default-server =
## Autospawn daemons?
; autospawn = 0
ARG_LOAD,
ARG_FILE,
ARG_DL_SEARCH_PATH,
+ ARG_RESAMPLE_METHOD
};
static struct option long_options[] = {
{"load", 1, 0, ARG_LOAD},
{"file", 1, 0, ARG_FILE},
{"dl-search-path", 1, 0, ARG_DL_SEARCH_PATH},
+ {"resample-method", 1, 0, ARG_RESAMPLE_METHOD},
{NULL, 0, 0, 0}
};
" --module-idle-time=SECS Unload autoloaded modules when idle and this time passed\n"
" --scache-idle-time=SECS Unload autoloaded samples when idle and this time passed\n"
" --log-target={auto,syslog,stderr} Specify the log target\n"
- " -p, --dl-search-path=PATH Set the search path for dynamic shared objects (plugins)\n\n"
+ " -p, --dl-search-path=PATH Set the search path for dynamic shared objects (plugins)\n"
+ " --resample-method=[METHOD] Use the specified resampling method\n\n"
" -L, --load=\"MODULE ARGUMENTS\" Load the specified plugin module with the specified argument\n"
" -F, --file=FILENAME Run the specified script\n"
break;
case ARG_LOG_TARGET:
- if (!strcmp(optarg, "syslog")) {
- conf->auto_log_target = 0;
- conf->log_target = PA_LOG_SYSLOG;
- } else if (!strcmp(optarg, "stderr")) {
- conf->auto_log_target = 0;
- conf->log_target = PA_LOG_STDERR;
- } else if (!strcmp(optarg, "auto"))
- conf->auto_log_target = 1;
- else {
+ if (pa_daemon_conf_set_log_target(conf, optarg) < 0) {
pa_log(__FILE__": Invalid log target: use either 'syslog', 'stderr' or 'auto'.\n");
goto fail;
}
case ARG_SCACHE_IDLE_TIME:
conf->scache_idle_time = atoi(optarg);
break;
+
+ case ARG_RESAMPLE_METHOD:
+ if (pa_daemon_conf_set_resample_method(conf, optarg) < 0) {
+ pa_log(__FILE__": Invalid resample method '%s'.\n", optarg);
+ goto fail;
+ }
+ break;
default:
goto fail;
pa_xfree(c);
}
-int parse_log_target(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
- struct pa_daemon_conf *c = data;
- assert(filename && lvalue && rvalue && data);
-
- if (!strcmp(rvalue, "auto"))
+int pa_daemon_conf_set_log_target(struct pa_daemon_conf *c, const char *string) {
+ assert(c && string);
+
+ if (!strcmp(string, "auto"))
c->auto_log_target = 1;
- else if (!strcmp(rvalue, "syslog")) {
+ else if (!strcmp(string, "syslog")) {
c->auto_log_target = 0;
c->log_target = PA_LOG_SYSLOG;
- } else if (!strcmp(rvalue, "stderr")) {
+ } else if (!strcmp(string, "stderr")) {
c->auto_log_target = 0;
c->log_target = PA_LOG_STDERR;
- } else {
- pa_log(__FILE__": [%s:%u] Invalid log target '%s'.\n", filename, line, rvalue);
+ } else
return -1;
- }
return 0;
+
}
-int parse_resample_method(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
- struct pa_daemon_conf *c = data;
- assert(filename && lvalue && rvalue && data);
+int pa_daemon_conf_set_resample_method(struct pa_daemon_conf *c, const char *string) {
+ assert(c && string);
- if (!strcmp(rvalue, "sinc-best-quality"))
+ if (!strcmp(string, "sinc-best-quality"))
c->resample_method = SRC_SINC_BEST_QUALITY;
- else if (!strcmp(rvalue, "sinc-medium-quality"))
+ else if (!strcmp(string, "sinc-medium-quality"))
c->resample_method = SRC_SINC_MEDIUM_QUALITY;
- else if (!strcmp(rvalue, "sinc-fastest"))
+ else if (!strcmp(string, "sinc-fastest"))
c->resample_method = SRC_SINC_FASTEST;
- else if (!strcmp(rvalue, "zero-order-hold"))
+ else if (!strcmp(string, "zero-order-hold"))
c->resample_method = SRC_ZERO_ORDER_HOLD;
- else if (!strcmp(rvalue, "linear"))
+ else if (!strcmp(string, "linear"))
c->resample_method = SRC_LINEAR;
- else {
+ else
+ return -1;
+
+ return 0;
+}
+
+int parse_log_target(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
+ struct pa_daemon_conf *c = data;
+ assert(filename && lvalue && rvalue && data);
+
+ if (pa_daemon_conf_set_log_target(c, rvalue) < 0) {
+ pa_log(__FILE__": [%s:%u] Invalid log target '%s'.\n", filename, line, rvalue);
+ return -1;
+ }
+
+ return 0;
+}
+
+int parse_resample_method(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
+ struct pa_daemon_conf *c = data;
+ assert(filename && lvalue && rvalue && data);
+
+ if (pa_daemon_conf_set_resample_method(c, rvalue) < 0) {
pa_log(__FILE__": [%s:%u] Inavalid resample method '%s'.\n", filename, line, rvalue);
return -1;
}
char *pa_daemon_conf_dump(struct pa_daemon_conf *c);
int pa_daemon_conf_env(struct pa_daemon_conf *c);
+int pa_daemon_conf_set_log_target(struct pa_daemon_conf *c, const char *string);
+int pa_daemon_conf_set_resample_method(struct pa_daemon_conf *c, const char *string);
+
#endif
putenv(t);
argv[n++] = c->conf->daemon_binary;
-
+ argv[n++] = "--daemonize=yes";
+
snprintf(t, sizeof(t), "-Lmodule-native-protocol-fd fd=%i", fds[1]);
- argv[n++] = pa_xstrdup(t);
+ argv[n++] = t;
while (n < MAX_ARGS) {
char *a;
if (!(a = pa_split_spaces(c->conf->extra_arguments, &state)))
break;
-
+
argv[n++] = a;
}
const char *current = *state ? *state : c;
size_t l;
- if (*current)
+ if (!*current)
return NULL;
current += strspn(current, WHITESPACE);