Skip to content

Commit

Permalink
Fix compatibility with roc-toolkit 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed Jun 13, 2024
1 parent 2c6384a commit 9c5c15c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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):

Expand Down
16 changes: 4 additions & 12 deletions src/module-roc-sink-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ PA_MODULE_USAGE("local_ip=<local receiver ip> "
"latency_backend=default|niq "
"latency_profile=default|intact|responsive|gradual "
"target_latency_msec=<target latency in milliseconds> "
"min_latency_msec=<minimum latency in milliseconds> "
"max_latency_msec=<maximum latency in milliseconds> "
"latency_tolerance_msec=<maximum latency deviation in milliseconds> "
"io_latency_msec=<playback latency in milliseconds> "
"no_play_timeout_msec=<no playback timeout in milliseconds> "
"choppy_play_timeout_msec=<choppy playback timeout in milliseconds>");
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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;
}
Expand Down
16 changes: 4 additions & 12 deletions src/module-roc-sink.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ PA_MODULE_USAGE("remote_ip=<remote receiver ip> "
"latency_backend=default|niq "
"latency_profile=default|intact|responsive|gradual "
"target_latency_msec=<target latency in milliseconds> "
"min_latency_msec=<minimum latency in milliseconds> "
"max_latency_msec=<maximum latency in milliseconds>");
"latency_tolerance_msec=<maximum latency deviation in milliseconds>");

static const char* const roc_sink_modargs[] = {
"remote_ip",
Expand All @@ -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,
};

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 9c5c15c

Please sign in to comment.