diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-07-31 21:24:23 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-07-31 21:24:23 +0200 |
commit | 4f3193dbefd5f82955a672c7473bf86d780afafc (patch) | |
tree | 5efa0b903451a17d1f7041708a0f9f76c7cc635f /src/modules | |
parent | 4ccbc4dbe27b286b548ad27435c390131075fc8b (diff) |
allow global tsched setting for all modules loaded by module-hal
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/module-alsa-sink.c | 2 | ||||
-rw-r--r-- | src/modules/module-hal-detect.c | 23 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c index 8e66f796..aad6801e 100644 --- a/src/modules/module-alsa-sink.c +++ b/src/modules/module-alsa-sink.c @@ -1148,7 +1148,7 @@ int pa__init(pa_module*m) { } if (pa_modargs_get_value_boolean(ma, "tsched", &use_tsched) < 0) { - pa_log("Failed to parse timer_scheduling argument."); + pa_log("Failed to parse tsched argument."); goto fail; } diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c index ab5b206f..5354717e 100644 --- a/src/modules/module-hal-detect.c +++ b/src/modules/module-hal-detect.c @@ -56,9 +56,11 @@ PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_LOAD_ONCE(TRUE); #if defined(HAVE_ALSA) && defined(HAVE_OSS) -PA_MODULE_USAGE("api=<alsa or oss>"); +PA_MODULE_USAGE("api=<alsa or oss> " + "tsched=<enable system timer based scheduling mode?>"); #elif defined(HAVE_ALSA) -PA_MODULE_USAGE("api=<alsa>"); +PA_MODULE_USAGE("api=<alsa> " + "tsched=<enable system timer based scheduling mode?>"); #elif defined(HAVE_OSS) PA_MODULE_USAGE("api=<oss>"); #endif @@ -76,6 +78,9 @@ struct userdata { pa_dbus_connection *connection; pa_hashmap *devices; const char *capability; +#ifdef HAVE_ALSA + pa_bool_t use_tsched; +#endif }; struct timerdata { @@ -88,6 +93,9 @@ struct timerdata { static const char* const valid_modargs[] = { "api", +#ifdef HAVE_ALSA + "tsched", +#endif NULL }; @@ -189,12 +197,12 @@ static pa_module* hal_device_load_alsa(struct userdata *u, const char *udi, char *sink_name = pa_sprintf_malloc("alsa_output.%s", strip_udi(udi)); module_name = "module-alsa-sink"; - args = pa_sprintf_malloc("device_id=%u sink_name=%s", card, *sink_name); + args = pa_sprintf_malloc("device_id=%u sink_name=%s tsched=%i", card, *sink_name, (int) u->use_tsched); } else { *source_name = pa_sprintf_malloc("alsa_input.%s", strip_udi(udi)); module_name = "module-alsa-source"; - args = pa_sprintf_malloc("device_id=%u source_name=%s", card, *source_name); + args = pa_sprintf_malloc("device_id=%u source_name=%s tsched=%i", card, *source_name, (int) u->use_tsched); } pa_log_debug("Loading %s with arguments '%s'", module_name, args); @@ -724,6 +732,7 @@ int pa__init(pa_module*m) { int n = 0; pa_modargs *ma; const char *api; + pa_bool_t use_tsched = TRUE; pa_assert(m); @@ -734,6 +743,11 @@ int pa__init(pa_module*m) { goto fail; } + if (pa_modargs_get_value_boolean(ma, "tsched", &use_tsched) < 0) { + pa_log("Failed to parse tsched argument."); + goto fail; + } + if ((api = pa_modargs_get_value(ma, "api", NULL))) { int good = 0; @@ -775,6 +789,7 @@ int pa__init(pa_module*m) { u->connection = conn; u->devices = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); u->capability = api; + u->use_tsched = use_tsched; m->userdata = u; #ifdef HAVE_ALSA |