mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
allow global tsched setting for all modules loaded by module-hal
This commit is contained in:
parent
4ccbc4dbe2
commit
4f3193dbef
2 changed files with 20 additions and 5 deletions
|
|
@ -1148,7 +1148,7 @@ int pa__init(pa_module*m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pa_modargs_get_value_boolean(ma, "tsched", &use_tsched) < 0) {
|
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;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,11 @@ PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers
|
||||||
PA_MODULE_VERSION(PACKAGE_VERSION);
|
PA_MODULE_VERSION(PACKAGE_VERSION);
|
||||||
PA_MODULE_LOAD_ONCE(TRUE);
|
PA_MODULE_LOAD_ONCE(TRUE);
|
||||||
#if defined(HAVE_ALSA) && defined(HAVE_OSS)
|
#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)
|
#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)
|
#elif defined(HAVE_OSS)
|
||||||
PA_MODULE_USAGE("api=<oss>");
|
PA_MODULE_USAGE("api=<oss>");
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -76,6 +78,9 @@ struct userdata {
|
||||||
pa_dbus_connection *connection;
|
pa_dbus_connection *connection;
|
||||||
pa_hashmap *devices;
|
pa_hashmap *devices;
|
||||||
const char *capability;
|
const char *capability;
|
||||||
|
#ifdef HAVE_ALSA
|
||||||
|
pa_bool_t use_tsched;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct timerdata {
|
struct timerdata {
|
||||||
|
|
@ -88,6 +93,9 @@ struct timerdata {
|
||||||
|
|
||||||
static const char* const valid_modargs[] = {
|
static const char* const valid_modargs[] = {
|
||||||
"api",
|
"api",
|
||||||
|
#ifdef HAVE_ALSA
|
||||||
|
"tsched",
|
||||||
|
#endif
|
||||||
NULL
|
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));
|
*sink_name = pa_sprintf_malloc("alsa_output.%s", strip_udi(udi));
|
||||||
|
|
||||||
module_name = "module-alsa-sink";
|
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 {
|
} else {
|
||||||
*source_name = pa_sprintf_malloc("alsa_input.%s", strip_udi(udi));
|
*source_name = pa_sprintf_malloc("alsa_input.%s", strip_udi(udi));
|
||||||
|
|
||||||
module_name = "module-alsa-source";
|
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);
|
pa_log_debug("Loading %s with arguments '%s'", module_name, args);
|
||||||
|
|
@ -724,6 +732,7 @@ int pa__init(pa_module*m) {
|
||||||
int n = 0;
|
int n = 0;
|
||||||
pa_modargs *ma;
|
pa_modargs *ma;
|
||||||
const char *api;
|
const char *api;
|
||||||
|
pa_bool_t use_tsched = TRUE;
|
||||||
|
|
||||||
pa_assert(m);
|
pa_assert(m);
|
||||||
|
|
||||||
|
|
@ -734,6 +743,11 @@ int pa__init(pa_module*m) {
|
||||||
goto fail;
|
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))) {
|
if ((api = pa_modargs_get_value(ma, "api", NULL))) {
|
||||||
int good = 0;
|
int good = 0;
|
||||||
|
|
||||||
|
|
@ -775,6 +789,7 @@ int pa__init(pa_module*m) {
|
||||||
u->connection = conn;
|
u->connection = conn;
|
||||||
u->devices = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
|
u->devices = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
|
||||||
u->capability = api;
|
u->capability = api;
|
||||||
|
u->use_tsched = use_tsched;
|
||||||
m->userdata = u;
|
m->userdata = u;
|
||||||
|
|
||||||
#ifdef HAVE_ALSA
|
#ifdef HAVE_ALSA
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue