mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
Add PIPEWIRE_QUANTUM env variable
That tries to both set the buffersize and the samplerate of the graph. Document them in README.md Also add the same env variables to pw-stream and pw-filter.
This commit is contained in:
parent
f4021c7f44
commit
0bc3d1444a
5 changed files with 43 additions and 5 deletions
|
|
@ -1222,6 +1222,17 @@ filter_new(struct pw_context *context, const char *name,
|
|||
}
|
||||
if ((str = getenv("PIPEWIRE_LATENCY")) != NULL)
|
||||
pw_properties_set(props, PW_KEY_NODE_LATENCY, str);
|
||||
if ((str = getenv("PIPEWIRE_RATE")) != NULL)
|
||||
pw_properties_set(props, PW_KEY_NODE_RATE, str);
|
||||
if ((str = getenv("PIPEWIRE_QUANTUM")) != NULL) {
|
||||
struct spa_fraction q;
|
||||
if (sscanf(str, "%u/%u", &q.num, &q.denom) == 2 && q.denom != 0) {
|
||||
pw_properties_setf(props, PW_KEY_NODE_RATE,
|
||||
"1/%u", q.denom);
|
||||
pw_properties_setf(props, PW_KEY_NODE_LATENCY,
|
||||
"%u/%u", q.num, q.denom);
|
||||
}
|
||||
}
|
||||
|
||||
spa_hook_list_init(&impl->hooks);
|
||||
this->properties = props;
|
||||
|
|
|
|||
|
|
@ -1358,6 +1358,17 @@ stream_new(struct pw_context *context, const char *name,
|
|||
}
|
||||
if ((str = getenv("PIPEWIRE_LATENCY")) != NULL)
|
||||
pw_properties_set(props, PW_KEY_NODE_LATENCY, str);
|
||||
if ((str = getenv("PIPEWIRE_RATE")) != NULL)
|
||||
pw_properties_set(props, PW_KEY_NODE_RATE, str);
|
||||
if ((str = getenv("PIPEWIRE_QUANTUM")) != NULL) {
|
||||
struct spa_fraction q;
|
||||
if (sscanf(str, "%u/%u", &q.num, &q.denom) == 2 && q.denom != 0) {
|
||||
pw_properties_setf(props, PW_KEY_NODE_RATE,
|
||||
"1/%u", q.denom);
|
||||
pw_properties_setf(props, PW_KEY_NODE_LATENCY,
|
||||
"%u/%u", q.num, q.denom);
|
||||
}
|
||||
}
|
||||
|
||||
spa_hook_list_init(&impl->hooks);
|
||||
this->properties = props;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue