|
|
a7e41e |
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
|
|
|
a7e41e |
index 20150dd..3b20682 100644
|
|
|
a7e41e |
--- a/alsaloop/alsaloop.c
|
|
|
a7e41e |
+++ b/alsaloop/alsaloop.c
|
|
|
a7e41e |
@@ -195,6 +195,7 @@ void help(void)
|
|
|
a7e41e |
"-w,--workaround use workaround (serialopen)\n"
|
|
|
a7e41e |
"-U,--xrun xrun profiling\n"
|
|
|
a7e41e |
"-W,--wake process wake timeout in ms\n"
|
|
|
a7e41e |
+"-z,--syslog use syslog for errors\n"
|
|
|
a7e41e |
);
|
|
|
a7e41e |
printf("\nRecognized sample formats are:");
|
|
|
a7e41e |
for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) {
|
|
|
a7e41e |
@@ -334,6 +335,14 @@ static int add_oss_mixers(struct loopback *loop,
|
|
|
a7e41e |
return 0;
|
|
|
a7e41e |
}
|
|
|
a7e41e |
|
|
|
a7e41e |
+static void enable_syslog(void)
|
|
|
a7e41e |
+{
|
|
|
a7e41e |
+ if (!use_syslog) {
|
|
|
a7e41e |
+ use_syslog = 1;
|
|
|
a7e41e |
+ openlog("alsaloop", LOG_NDELAY|LOG_PID, LOG_DAEMON);
|
|
|
a7e41e |
+ }
|
|
|
a7e41e |
+}
|
|
|
a7e41e |
+
|
|
|
a7e41e |
static int parse_config_file(const char *file, snd_output_t *output);
|
|
|
a7e41e |
|
|
|
a7e41e |
static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|
|
a7e41e |
@@ -368,6 +377,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|
|
a7e41e |
{"ossmixer", 1, NULL, 'O'},
|
|
|
a7e41e |
{"workaround", 1, NULL, 'w'},
|
|
|
a7e41e |
{"xrun", 0, NULL, 'U'},
|
|
|
a7e41e |
+ {"syslog", 0, NULL, 'z'},
|
|
|
a7e41e |
{NULL, 0, NULL, 0},
|
|
|
a7e41e |
};
|
|
|
a7e41e |
int err, morehelp;
|
|
|
a7e41e |
@@ -405,7 +415,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|
|
a7e41e |
while (1) {
|
|
|
a7e41e |
int c;
|
|
|
a7e41e |
if ((c = getopt_long(argc, argv,
|
|
|
a7e41e |
- "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:",
|
|
|
a7e41e |
+ "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:z",
|
|
|
a7e41e |
long_option, NULL)) < 0)
|
|
|
a7e41e |
break;
|
|
|
a7e41e |
switch (c) {
|
|
|
a7e41e |
@@ -417,8 +427,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|
|
a7e41e |
break;
|
|
|
a7e41e |
case 'd':
|
|
|
a7e41e |
daemonize = 1;
|
|
|
a7e41e |
- use_syslog = 1;
|
|
|
a7e41e |
- openlog("alsaloop", LOG_NDELAY|LOG_PID, LOG_DAEMON);
|
|
|
a7e41e |
+ enable_syslog();
|
|
|
a7e41e |
break;
|
|
|
a7e41e |
case 'P':
|
|
|
a7e41e |
arg_pdevice = strdup(optarg);
|
|
|
a7e41e |
@@ -561,6 +570,9 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|
|
a7e41e |
if (cmdline)
|
|
|
a7e41e |
arg_default_wake = arg_wake;
|
|
|
a7e41e |
break;
|
|
|
a7e41e |
+ case 'z':
|
|
|
a7e41e |
+ enable_syslog();
|
|
|
a7e41e |
+ break;
|
|
|
a7e41e |
}
|
|
|
a7e41e |
}
|
|
|
a7e41e |
|