mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
jack: add PIPEWIRE_RATE env variable
So that you can make pipewire switch samplerates.
This commit is contained in:
parent
888716a871
commit
ac919e2a10
2 changed files with 10 additions and 2 deletions
|
|
@ -3183,6 +3183,8 @@ jack_client_t * jack_client_open (const char *client_name,
|
||||||
|
|
||||||
if ((str = getenv("PIPEWIRE_LATENCY")) != NULL)
|
if ((str = getenv("PIPEWIRE_LATENCY")) != NULL)
|
||||||
pw_properties_set(client->props, PW_KEY_NODE_LATENCY, str);
|
pw_properties_set(client->props, PW_KEY_NODE_LATENCY, str);
|
||||||
|
if ((str = getenv("PIPEWIRE_RATE")) != NULL)
|
||||||
|
pw_properties_set(client->props, PW_KEY_NODE_RATE, str);
|
||||||
if ((str = pw_properties_get(client->props, PW_KEY_NODE_LATENCY)) != NULL) {
|
if ((str = pw_properties_get(client->props, PW_KEY_NODE_LATENCY)) != NULL) {
|
||||||
uint32_t num, denom;
|
uint32_t num, denom;
|
||||||
if (sscanf(str, "%u/%u", &num, &denom) == 2 && denom != 0) {
|
if (sscanf(str, "%u/%u", &num, &denom) == 2 && denom != 0) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
# DEALINGS IN THE SOFTWARE.
|
# DEALINGS IN THE SOFTWARE.
|
||||||
#
|
#
|
||||||
|
|
||||||
SAMPLERATE=48000
|
DEFAULT_SAMPLERATE=48000
|
||||||
|
|
||||||
while getopts 'hr:vs:p:' param ; do
|
while getopts 'hr:vs:p:' param ; do
|
||||||
case $param in
|
case $param in
|
||||||
|
|
@ -55,7 +55,7 @@ while getopts 'hr:vs:p:' param ; do
|
||||||
echo " -h show brief help"
|
echo " -h show brief help"
|
||||||
echo " -r <remote> remote daemon name"
|
echo " -r <remote> remote daemon name"
|
||||||
echo " -v verbose debug info"
|
echo " -v verbose debug info"
|
||||||
echo " -s samplerate (default \"$SAMPLERATE\")"
|
echo " -s samplerate (default \"$DEFAULT_SAMPLERATE\")"
|
||||||
echo " -p period in samples"
|
echo " -p period in samples"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
@ -65,6 +65,12 @@ done
|
||||||
shift $(( OPTIND - 1 ))
|
shift $(( OPTIND - 1 ))
|
||||||
|
|
||||||
if [ -n "$PERIOD" ]; then
|
if [ -n "$PERIOD" ]; then
|
||||||
|
if [ -n "$SAMPLERATE" ]; then
|
||||||
|
PIPEWIRE_RATE="1/$SAMPLERATE"
|
||||||
|
export PIPEWIRE_RATE
|
||||||
|
else
|
||||||
|
SAMPLERATE=$DEFAULT_SAMPLERATE
|
||||||
|
fi
|
||||||
PIPEWIRE_LATENCY="$PERIOD/$SAMPLERATE"
|
PIPEWIRE_LATENCY="$PERIOD/$SAMPLERATE"
|
||||||
export PIPEWIRE_LATENCY
|
export PIPEWIRE_LATENCY
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue