diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/cmdline.c | 5 | ||||
-rw-r--r-- | src/daemon/cpulimit.c | 2 | ||||
-rw-r--r-- | src/daemon/daemon-conf.c | 27 | ||||
-rwxr-xr-x | src/daemon/default.pa.in | 2 | ||||
-rwxr-xr-x | src/daemon/esdcompat.in | 2 | ||||
-rw-r--r-- | src/daemon/main.c | 1 | ||||
-rwxr-xr-x | src/daemon/system.pa.in | 6 |
7 files changed, 33 insertions, 12 deletions
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c index f6cdcdc8..4854affc 100644 --- a/src/daemon/cmdline.c +++ b/src/daemon/cmdline.c @@ -145,7 +145,8 @@ void pa_cmdline_help(const char *argv0) { " this time passed\n" " --log-level[=LEVEL] Increase or set verbosity level\n" " -v Increase the verbosity level\n" - " --log-target={auto,syslog,stderr} Specify the log target\n" + " --log-target={auto,syslog,stderr,file:PATH}\n" + " Specify the log target\n" " --log-meta[=BOOL] Include code location in log messages\n" " --log-time[=BOOL] Include timestamps in log messages\n" " --log-backtrace=FRAMES Include a backtrace in log messages\n" @@ -318,7 +319,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d case ARG_LOG_TARGET: if (pa_daemon_conf_set_log_target(conf, optarg) < 0) { - pa_log(_("Invalid log target: use either 'syslog', 'stderr' or 'auto'.")); + pa_log(_("Invalid log target: use either 'syslog', 'stderr' or 'auto' or a valid file name 'file:<path>'.")); goto fail; } break; diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index c1c2a6f6..9e22d7e8 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -86,7 +86,7 @@ static struct sigaction sigaction_prev; static pa_bool_t installed = FALSE; /* The current state of operation */ -static enum { +static enum { PHASE_IDLE, /* Normal state */ PHASE_SOFT /* After CPU overload has been detected */ } phase = PHASE_IDLE; diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index f640b039..9b530a80 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -28,6 +28,7 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <fcntl.h> #ifdef HAVE_SCHED_H #include <sched.h> @@ -180,6 +181,9 @@ pa_daemon_conf* pa_daemon_conf_new(void) { void pa_daemon_conf_free(pa_daemon_conf *c) { pa_assert(c); + + pa_log_set_fd(-1); + pa_xfree(c->script_commands); pa_xfree(c->dl_search_path); pa_xfree(c->default_script_file); @@ -225,6 +229,23 @@ int pa_daemon_conf_set_log_level(pa_daemon_conf *c, const char *string) { c->log_level = PA_LOG_WARN; else if (pa_startswith(string, "err")) c->log_level = PA_LOG_ERROR; + else if (pa_startswith(string, "file:")) { + char file_path[512]; + int log_fd; + + pa_strlcpy(file_path, string + 5, sizeof(file_path)); + + /* Open target file with user rights */ + if ((log_fd = open(file_path, O_RDWR|O_TRUNC|O_CREAT, S_IRWXU)) >= 0) { + c->auto_log_target = 0; + c->log_target = PA_LOG_FD; + pa_log_set_fd(log_fd); + } + else { + printf("Failed to open target file %s, error : %s\n", file_path, pa_cstrerror(errno)); + return -1; + } + } else return -1; @@ -307,8 +328,8 @@ static int parse_resample_method(const char *filename, unsigned line, const char return 0; } -static int parse_rlimit(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) { #ifdef HAVE_SYS_RESOURCE_H +static int parse_rlimit(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) { struct pa_rlimit *r = data; pa_assert(filename); @@ -329,12 +350,10 @@ static int parse_rlimit(const char *filename, unsigned line, const char *section r->is_set = k >= 0; r->value = k >= 0 ? (rlim_t) k : 0; } -#else - pa_log_warn(_("[%s:%u] rlimit not supported on this platform."), filename, line); -#endif return 0; } +#endif static int parse_sample_format(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) { pa_daemon_conf *c = data; diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in index ace0f09e..32ba5826 100755 --- a/src/daemon/default.pa.in +++ b/src/daemon/default.pa.in @@ -39,7 +39,7 @@ load-module module-card-restore load-module module-augment-properties ### Load audio drivers statically (it's probably better to not load -### these drivers manually, but instead use module-hal-detect -- +### these drivers manually, but instead use module-udev-detect -- ### see below -- for doing this automatically) #load-module module-alsa-sink #load-module module-alsa-source device=hw:1,0 diff --git a/src/daemon/esdcompat.in b/src/daemon/esdcompat.in index 66501803..41a12a02 100755 --- a/src/daemon/esdcompat.in +++ b/src/daemon/esdcompat.in @@ -59,7 +59,7 @@ Ignored directives: -terminate terminate esd daemone after last client exits -nobeeps disable startup beeps -trust start esd even if use of /tmp/.esd can be insecure - -port PORT listen for connections at PORT (only for tcp/ip) + -port PORT listen for connections at PORT (only for tcp/ip) -bind ADDRESS binds to ADDRESS (only for tcp/ip) EOF exit 0 diff --git a/src/daemon/main.c b/src/daemon/main.c index 243e7c0a..533c4c32 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -966,6 +966,7 @@ int main(int argc, char *argv[]) { c->cpu_info.cpu_type = PA_CPU_X86; if (pa_cpu_init_arm(&(c->cpu_info.flags.arm))) c->cpu_info.cpu_type = PA_CPU_ARM; + pa_cpu_init_orc(c->cpu_info); } pa_assert_se(pa_signal_init(pa_mainloop_get_api(mainloop)) == 0); diff --git a/src/daemon/system.pa.in b/src/daemon/system.pa.in index 0ca32bd3..aaefd1d1 100755 --- a/src/daemon/system.pa.in +++ b/src/daemon/system.pa.in @@ -20,11 +20,11 @@ # mode. ### Automatically load driver modules depending on the hardware available -.ifexists module-hal-detect@PA_SOEXT@ -load-module module-hal-detect +.ifexists module-udev-detect@PA_SOEXT@ +load-module module-udev-detect .else ### Alternatively use the static hardware detection module (for systems that -### lack HAL support) +### lack udev support) load-module module-detect .endif |