From 9c5c15c1bd09be27175b65f30793875268cb2321 Mon Sep 17 00:00:00 2001 From: Victor Gaydov Date: Fri, 14 Jun 2024 01:26:04 +0400 Subject: [PATCH] Fix compatibility with roc-toolkit 0.4 --- README.md | 11 ++++------- src/module-roc-sink-input.c | 16 ++++------------ src/module-roc-sink.c | 16 ++++------------ 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 9f8a2dd..b71c307 100644 --- a/README.md +++ b/README.md @@ -190,8 +190,7 @@ Roc sink input supports several options: | latency\_backend | selected automatically | latency tuner backend (default, niq) | | | latency\_profile | selected automatically | latency tuner profile (default, intact, responsive, gradual) | | | target\_latency\_msec | 200 | target latency in milliseconds | | -| min\_latency\_msec | selected automatically | minimum latency in milliseconds | | -| max\_latency\_msec | selected automatically | maximum latency in milliseconds | | +| latency\_tolerance\_msec | selected automatically | maximum latency deviation in milliseconds | | | io\_latency\_msec | 40 | playback latency in milliseconds | | | no\_play_timeout\_msec | selected automatically | no playback timeout in milliseconds | | | choppy\_play_timeout\_msec | selected automatically | choppy playback timeout in milliseconds | | @@ -252,8 +251,7 @@ Roc sink supports several options: | latency\_backend | disabled | latency tuner backend (default, niq) | for sender-side latency tuner | | latency\_profile | disabled | latency tuner profile (default, intact, responsive, gradual) | for sender-side latency tuner | | target\_latency\_msec | disabled | target latency in milliseconds | for sender-side latency tuner | -| min\_latency\_msec | disabled | minimum latency in milliseconds | for sender-side latency tuner | -| max\_latency\_msec | disabled | maximum latency in milliseconds | for sender-side latency tuner | +| latency\_tolerance\_msec | disabled | maximum latency deviation in milliseconds | for sender-side latency tuner | Here is how you can create a Roc sink from command line: @@ -321,9 +319,8 @@ This parameter should be provided on **both sender and receiver** and have **exa Essential receiver-side (`module-roc-sink-input`) parameters are: -* `target_latency` - which latency should be maintained -* `min_latency` - which minimum latency causes session restart -* `max_latency` - which maximum latency causes session restart +* `target_latency_msec` - which latency should be maintained +* `latency_tolerance_msec` - maximum allowed deviation from target latency You can also force specific latency tuner settings (by default they're auto-selected based on target latency): diff --git a/src/module-roc-sink-input.c b/src/module-roc-sink-input.c index 2c2a21f..0d46459 100644 --- a/src/module-roc-sink-input.c +++ b/src/module-roc-sink-input.c @@ -51,8 +51,7 @@ PA_MODULE_USAGE("local_ip= " "latency_backend=default|niq " "latency_profile=default|intact|responsive|gradual " "target_latency_msec= " - "min_latency_msec= " - "max_latency_msec= " + "latency_tolerance_msec= " "io_latency_msec= " "no_play_timeout_msec= " "choppy_play_timeout_msec="); @@ -90,8 +89,7 @@ static const char* const roc_sink_input_modargs[] = { "latency_backend", "latency_profile", "target_latency_msec", - "min_latency_msec", - "max_latency_msec", + "latency_tolerance_msec", "io_latency_msec", "no_play_timeout_msec", "choppy_play_timeout_msec", @@ -288,14 +286,8 @@ int pa__init(pa_module* m) { goto error; } - if (rocpulse_parse_duration_msec_ll(&receiver_config.min_latency, 1, args, - "min_latency_msec", "0") - < 0) { - goto error; - } - - if (rocpulse_parse_duration_msec_ll(&receiver_config.max_latency, 1, args, - "max_latency_msec", "0") + if (rocpulse_parse_duration_msec_ll(&receiver_config.latency_tolerance, 1, args, + "latency_tolerance_msec", "0") < 0) { goto error; } diff --git a/src/module-roc-sink.c b/src/module-roc-sink.c index 9c61f46..d6bb109 100644 --- a/src/module-roc-sink.c +++ b/src/module-roc-sink.c @@ -56,8 +56,7 @@ PA_MODULE_USAGE("remote_ip= " "latency_backend=default|niq " "latency_profile=default|intact|responsive|gradual " "target_latency_msec= " - "min_latency_msec= " - "max_latency_msec="); + "latency_tolerance_msec="); static const char* const roc_sink_modargs[] = { "remote_ip", @@ -82,8 +81,7 @@ static const char* const roc_sink_modargs[] = { "latency_backend", "latency_profile", "target_latency_msec", - "min_latency_msec", - "max_latency_msec", + "latency_tolerance_msec", NULL, }; @@ -354,14 +352,8 @@ int pa__init(pa_module* m) { goto error; } - if (rocpulse_parse_duration_msec_ll(&sender_config.min_latency, 1, args, - "min_latency_msec", "0") - < 0) { - goto error; - } - - if (rocpulse_parse_duration_msec_ll(&sender_config.max_latency, 1, args, - "max_latency_msec", "0") + if (rocpulse_parse_duration_msec_ll(&sender_config.latency_tolerance, 1, args, + "latency_tolerance_msec", "0") < 0) { goto error; }