2004-09-17 20:06:17 +00:00
|
|
|
#ifndef foodaemonconfhfoo
|
|
|
|
|
#define foodaemonconfhfoo
|
2004-09-13 23:28:30 +00:00
|
|
|
|
|
|
|
|
/***
|
2006-06-19 21:53:48 +00:00
|
|
|
This file is part of PulseAudio.
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2007-02-13 15:35:19 +00:00
|
|
|
Copyright 2004-2006 Lennart Poettering
|
|
|
|
|
Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
2004-11-14 14:58:54 +00:00
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
2009-03-03 20:23:02 +00:00
|
|
|
by the Free Software Foundation; either version 2.1 of the License,
|
2004-09-13 23:28:30 +00:00
|
|
|
or (at your option) any later version.
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is distributed in the hope that it will be useful, but
|
2004-09-13 23:28:30 +00:00
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
2004-11-14 14:58:54 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2006-06-19 21:53:48 +00:00
|
|
|
along with PulseAudio; if not, write to the Free Software
|
2004-09-13 23:28:30 +00:00
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
2009-02-21 16:32:42 +01:00
|
|
|
#include <pulse/sample.h>
|
|
|
|
|
#include <pulse/channelmap.h>
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
#include <pulsecore/log.h>
|
2007-11-01 00:34:43 +00:00
|
|
|
#include <pulsecore/macro.h>
|
2009-06-16 19:03:22 +03:00
|
|
|
#include <pulsecore/core.h>
|
2008-05-15 23:34:41 +00:00
|
|
|
#include <pulsecore/core-util.h>
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2006-07-20 01:25:37 +00:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
|
#include <sys/resource.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-11-21 21:31:28 +00:00
|
|
|
/* The actual command to execute */
|
2006-01-11 01:17:39 +00:00
|
|
|
typedef enum pa_daemon_conf_cmd {
|
2004-11-21 21:31:28 +00:00
|
|
|
PA_CMD_DAEMON, /* the default */
|
2008-06-11 17:38:50 +00:00
|
|
|
PA_CMD_START,
|
2004-11-21 21:31:28 +00:00
|
|
|
PA_CMD_HELP,
|
|
|
|
|
PA_CMD_VERSION,
|
|
|
|
|
PA_CMD_DUMP_CONF,
|
|
|
|
|
PA_CMD_DUMP_MODULES,
|
|
|
|
|
PA_CMD_KILL,
|
2007-10-28 19:13:50 +00:00
|
|
|
PA_CMD_CHECK,
|
|
|
|
|
PA_CMD_DUMP_RESAMPLE_METHODS,
|
|
|
|
|
PA_CMD_CLEANUP_SHM
|
2006-01-27 16:25:31 +00:00
|
|
|
} pa_daemon_conf_cmd_t;
|
2004-09-14 17:52:11 +00:00
|
|
|
|
2006-07-20 01:25:37 +00:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
|
|
|
typedef struct pa_rlimit {
|
|
|
|
|
rlim_t value;
|
2007-11-01 00:34:43 +00:00
|
|
|
pa_bool_t is_set;
|
2006-07-20 01:25:37 +00:00
|
|
|
} pa_rlimit;
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-06-19 22:11:49 +00:00
|
|
|
/* A structure containing configuration data for the PulseAudio server . */
|
2006-01-11 01:17:39 +00:00
|
|
|
typedef struct pa_daemon_conf {
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_daemon_conf_cmd_t cmd;
|
2007-11-01 00:34:43 +00:00
|
|
|
pa_bool_t daemonize,
|
2004-09-13 23:28:30 +00:00
|
|
|
fail,
|
|
|
|
|
high_priority,
|
2007-11-01 00:34:43 +00:00
|
|
|
realtime_scheduling,
|
2004-09-13 23:28:30 +00:00
|
|
|
disallow_module_loading,
|
2006-07-19 17:44:19 +00:00
|
|
|
use_pid_file,
|
2006-07-25 20:51:15 +00:00
|
|
|
system_instance,
|
2006-08-19 01:20:13 +00:00
|
|
|
no_cpu_limit,
|
2007-11-21 01:30:40 +00:00
|
|
|
disable_shm,
|
2008-05-15 23:34:41 +00:00
|
|
|
disable_remixing,
|
2008-09-05 16:04:42 +03:00
|
|
|
disable_lfe_remixing,
|
2008-08-06 19:39:12 +02:00
|
|
|
load_default_script_file,
|
2008-10-21 19:15:41 +02:00
|
|
|
disallow_exit,
|
|
|
|
|
log_meta,
|
2009-01-27 04:39:07 +01:00
|
|
|
log_time,
|
2009-06-07 00:43:03 +02:00
|
|
|
flat_volumes,
|
2010-10-15 13:05:17 +03:00
|
|
|
lock_memory,
|
|
|
|
|
sync_volume;
|
2009-06-16 19:03:22 +03:00
|
|
|
pa_server_type_t local_server_type;
|
2007-11-01 00:34:43 +00:00
|
|
|
int exit_idle_time,
|
|
|
|
|
scache_idle_time,
|
|
|
|
|
auto_log_target,
|
|
|
|
|
realtime_priority,
|
|
|
|
|
nice_level,
|
|
|
|
|
resample_method;
|
2004-09-13 23:28:30 +00:00
|
|
|
char *script_commands, *dl_search_path, *default_script_file;
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_log_target_t log_target;
|
|
|
|
|
pa_log_level_t log_level;
|
2008-10-21 19:15:41 +02:00
|
|
|
unsigned log_backtrace;
|
2004-11-04 21:27:12 +00:00
|
|
|
char *config_file;
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2006-07-20 01:25:37 +00:00
|
|
|
#ifdef HAVE_SYS_RESOURCE_H
|
2009-02-26 16:48:58 +11:00
|
|
|
pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core;
|
|
|
|
|
#ifdef RLIMIT_RSS
|
|
|
|
|
pa_rlimit rlimit_rss;
|
|
|
|
|
#endif
|
2009-01-27 00:48:53 +01:00
|
|
|
#ifdef RLIMIT_NOFILE
|
|
|
|
|
pa_rlimit rlimit_nofile;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RLIMIT_AS
|
|
|
|
|
pa_rlimit rlimit_as;
|
|
|
|
|
#endif
|
2006-07-20 01:25:37 +00:00
|
|
|
#ifdef RLIMIT_NPROC
|
|
|
|
|
pa_rlimit rlimit_nproc;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RLIMIT_MEMLOCK
|
|
|
|
|
pa_rlimit rlimit_memlock;
|
|
|
|
|
#endif
|
2008-05-15 23:34:41 +00:00
|
|
|
#ifdef RLIMIT_LOCKS
|
|
|
|
|
pa_rlimit rlimit_locks;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RLIMIT_SIGPENDING
|
|
|
|
|
pa_rlimit rlimit_sigpending;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RLIMIT_MSGQUEUE
|
|
|
|
|
pa_rlimit rlimit_msgqueue;
|
|
|
|
|
#endif
|
2007-11-01 00:34:43 +00:00
|
|
|
#ifdef RLIMIT_NICE
|
|
|
|
|
pa_rlimit rlimit_nice;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RLIMIT_RTPRIO
|
|
|
|
|
pa_rlimit rlimit_rtprio;
|
|
|
|
|
#endif
|
2008-05-15 23:34:41 +00:00
|
|
|
#ifdef RLIMIT_RTTIME
|
|
|
|
|
pa_rlimit rlimit_rttime;
|
|
|
|
|
#endif
|
2006-07-20 01:25:37 +00:00
|
|
|
#endif
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-10-28 19:13:50 +00:00
|
|
|
unsigned default_n_fragments, default_fragment_size_msec;
|
2010-10-15 13:05:17 +03:00
|
|
|
unsigned sync_volume_safety_margin_usec;
|
|
|
|
|
int sync_volume_extra_delay_usec;
|
2007-10-28 19:13:50 +00:00
|
|
|
pa_sample_spec default_sample_spec;
|
2009-02-21 16:32:42 +01:00
|
|
|
pa_channel_map default_channel_map;
|
2008-10-01 01:14:36 +02:00
|
|
|
size_t shm_size;
|
2006-01-11 01:17:39 +00:00
|
|
|
} pa_daemon_conf;
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2004-11-21 21:31:28 +00:00
|
|
|
/* Allocate a new structure and fill it with sane defaults */
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_daemon_conf* pa_daemon_conf_new(void);
|
|
|
|
|
void pa_daemon_conf_free(pa_daemon_conf*c);
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2004-11-21 21:31:28 +00:00
|
|
|
/* Load configuration data from the specified file overwriting the
|
|
|
|
|
* current settings in *c. If filename is NULL load the default daemon
|
|
|
|
|
* configuration file */
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename);
|
2004-11-21 21:31:28 +00:00
|
|
|
|
|
|
|
|
/* Pretty print the current configuration data of the daemon. The
|
|
|
|
|
* returned string has to be freed manually. The output of this
|
|
|
|
|
* function may be parsed with pa_daemon_conf_load(). */
|
2006-01-11 01:17:39 +00:00
|
|
|
char *pa_daemon_conf_dump(pa_daemon_conf *c);
|
2004-11-21 21:31:28 +00:00
|
|
|
|
|
|
|
|
/* Load the configuration data from the process' environment
|
|
|
|
|
* overwriting the current settings in *c. */
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_daemon_conf_env(pa_daemon_conf *c);
|
2004-09-13 23:28:30 +00:00
|
|
|
|
2004-11-21 21:31:28 +00:00
|
|
|
/* Set these configuration variables in the structure by passing a string */
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string);
|
|
|
|
|
int pa_daemon_conf_set_log_level(pa_daemon_conf *c, const char *string);
|
|
|
|
|
int pa_daemon_conf_set_resample_method(pa_daemon_conf *c, const char *string);
|
2009-06-12 07:16:05 +03:00
|
|
|
int pa_daemon_conf_set_local_server_type(pa_daemon_conf *c, const char *string);
|
2004-09-17 20:43:40 +00:00
|
|
|
|
2008-05-15 23:34:41 +00:00
|
|
|
const char *pa_daemon_conf_get_default_script_file(pa_daemon_conf *c);
|
|
|
|
|
FILE *pa_daemon_conf_open_default_script_file(pa_daemon_conf *c);
|
|
|
|
|
|
2004-09-13 23:28:30 +00:00
|
|
|
#endif
|