Skip to content

Commit c7be60a

Browse files
committed
Update to roc-toolkit 0.4
1 parent cc73fa5 commit c7be60a

16 files changed

+477
-832
lines changed

CHANGES.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [v0.0.2][v0.0.2] - 14 Jun 2024
4+
5+
* Use roc-toolkit from master
6+
* Fix compatibility with roc-toolkit 0.4
7+
* Update documentation
8+
9+
[v0.0.2]: https://github.com/roc-streaming/roc-vad/releases/tag/v0.0.2
10+
311
## [v0.0.1][v0.0.1] - 09 May 2024
412

513
* Initial release

README.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,7 @@ When you create sender virtual device using `roc-vad device add sender`, the fol
471471
| --latency-backend | disabled | latency tuner backend (default, niq) | for sender-side latency tuner |
472472
| --latency-profile | disabled | latency tuner profile (default, intact, responsive, gradual) | for sender-side latency tuner |
473473
| --target-latency | disabled | target latency (e.g. 123ms) | for sender-side latency tuner |
474-
| --min-latency | disabled | minimum latency (e.g. 123ms) | for sender-side latency tuner |
475-
| --max-latency | disabled | maximum latency (e.g. 123ms) | for sender-side latency tuner |
474+
| --latency-tolerance | disabled | maximum latency deviation (e.g. 123ms) | for sender-side latency tuner |
476475

477476
### Receiver options
478477

@@ -494,8 +493,7 @@ When you create receiver virtual device using `roc-vad device add receiver`, the
494493
| --latency-backend | selected automatically | latency tuner backend (default, niq) | |
495494
| --latency-profile | selected automatically | latency tuner profile (default, intact, responsive, gradual) | |
496495
| --target-latency | 200ms | target latency (e.g. 123ms) | |
497-
| --min-latency | selected automatically | minimum latency (e.g. 123ms) | |
498-
| --max-latency | selected automatically | maximum latency (e.g. 123ms) | |
496+
| --latency-tolerance | selected automatically | maximum latency deviation (e.g. 123ms) | |
499497
| --no-play-timeout | selected automatically | no playback timeout (e.g. 123ms) | |
500498
| --choppy-play-timeout | selected automatically | choppy playback timeout (e.g. 123ms) | |
501499

@@ -582,8 +580,7 @@ Both sender and receiver latency is affected by `--device-buffer` option, which
582580
Receiver-side parameters essential for latency are:
583581

584582
* `--target-latency` - which latency should be maintained
585-
* `--min-latency` - which minimum latency causes session restart
586-
* `--max-latency` - which maximum latency causes session restart
583+
* `--latency-tolerance` - maximum allowed deviation of current latency from target
587584

588585
You can also force specific latency tuner settings (by default they're auto-selected based on target latency):
589586

RPC.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@ Parameters of receiver device.
224224
| resampler_backend | [RvResamplerBackend](#rvpb-RvResamplerBackend) | optional | Resampling algorithm. Keep unset to use default. |
225225
| resampler_profile | [RvResamplerProfile](#rvpb-RvResamplerProfile) | optional | Resampling quality. Keep unset to use default. |
226226
| target_latency | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Target latency. Keep unset to use default. |
227-
| min_latency | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Minimum latency. Keep unset to use default. |
228-
| max_latency | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Maximum latency. Keep unset to use default. |
227+
| latency_tolerance | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Maximum deviation of latency from target. Keep unset to disable. |
229228
| no_playback_timeout | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Timeout for the lack of playback. Keep unset to use default. |
230229
| choppy_playback_timeout | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Timeout for choppy playback. Keep unset to use default. |
231230

@@ -253,8 +252,7 @@ Parameters of sender device.
253252
| resampler_backend | [RvResamplerBackend](#rvpb-RvResamplerBackend) | optional | Resampling algorithm. Keep unset to use default. |
254253
| resampler_profile | [RvResamplerProfile](#rvpb-RvResamplerProfile) | optional | Resampling quality. Keep unset to use default. |
255254
| target_latency | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Target latency. Use only if you need sender-side latency tuning. Keep unset to disable. |
256-
| min_latency | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Minimum latency. Use only if you need sender-side latency tuning. Keep unset to disable. |
257-
| max_latency | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Maximum latency. Use only if you need sender-side latency tuning. Keep unset to disable. |
255+
| latency_tolerance | [google.protobuf.Duration](#google-protobuf-Duration) | optional | Maximum deviation of latency from target. Use only if you need sender-side latency tuning. Keep unset to disable. |
258256

259257

260258

cmake/dependencies.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set(SCONS_CMD
3232
)
3333
ExternalProject_Add(roc_lib
3434
GIT_REPOSITORY "https://github.com/roc-streaming/roc-toolkit.git"
35-
GIT_TAG "8f75c4b336f81bfaa13229e3605697b180154929"
35+
GIT_TAG "master"
3636
GIT_SHALLOW OFF
3737
GIT_PROGRESS ON
3838
UPDATE_DISCONNECTED ON

driver/device_defs.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ struct DeviceSenderConfig
7171
roc_resampler_profile resampler_profile = ROC_RESAMPLER_PROFILE_DEFAULT;
7272

7373
int64_t target_latency_ns = 0;
74-
int64_t min_latency_ns = 0;
75-
int64_t max_latency_ns = 0;
74+
int64_t latency_tolerance_ns = 0;
7675
};
7776

7877
// Network parameters of sender device.
@@ -87,8 +86,7 @@ struct DeviceReceiverConfig
8786
roc_resampler_profile resampler_profile = ROC_RESAMPLER_PROFILE_DEFAULT;
8887

8988
int64_t target_latency_ns = 0;
90-
int64_t min_latency_ns = 0;
91-
int64_t max_latency_ns = 0;
89+
int64_t latency_tolerance_ns = 0;
9290

9391
int64_t no_playback_timeout_ns = 0;
9492
int64_t choppy_playback_timeout_ns = 0;

driver/receiver.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ Receiver::Receiver(const std::string& device_uid,
5757
net_receiver_config.resampler_profile = device_receiver_config.resampler_profile;
5858

5959
net_receiver_config.target_latency = device_receiver_config.target_latency_ns;
60-
net_receiver_config.min_latency = device_receiver_config.min_latency_ns;
61-
net_receiver_config.max_latency = device_receiver_config.max_latency_ns;
60+
net_receiver_config.latency_tolerance = device_receiver_config.latency_tolerance_ns;
6261

6362
net_receiver_config.no_playback_timeout =
6463
device_receiver_config.no_playback_timeout_ns;

driver/rpc_serdes.cpp

+17-34
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,11 @@ void device_info_from_rpc(DeviceInfo& out, const rvpb::RvDeviceInfo& in)
228228
"RvSenderConfig.target_latency", in.sender_config().target_latency());
229229
}
230230

231-
// min_latency
232-
if (in.sender_config().has_min_latency()) {
233-
out.sender_config->min_latency_ns = nanoseconds_from_rpc(
234-
"RvSenderConfig.min_latency", in.sender_config().min_latency());
235-
}
236-
237-
// max_latency
238-
if (in.sender_config().has_max_latency()) {
239-
out.sender_config->max_latency_ns = nanoseconds_from_rpc(
240-
"RvSenderConfig.max_latency", in.sender_config().max_latency());
231+
// latency_tolerance
232+
if (in.sender_config().has_latency_tolerance()) {
233+
out.sender_config->latency_tolerance_ns =
234+
nanoseconds_from_rpc("RvSenderConfig.latency_tolerance",
235+
in.sender_config().latency_tolerance());
241236
}
242237
}
243238

@@ -289,16 +284,11 @@ void device_info_from_rpc(DeviceInfo& out, const rvpb::RvDeviceInfo& in)
289284
"RvReceiverConfig.target_latency", in.receiver_config().target_latency());
290285
}
291286

292-
// min_latency
293-
if (in.receiver_config().has_min_latency()) {
294-
out.receiver_config->min_latency_ns = nanoseconds_from_rpc(
295-
"RvReceiverConfig.min_latency", in.receiver_config().min_latency());
296-
}
297-
298-
// max_latency
299-
if (in.receiver_config().has_max_latency()) {
300-
out.receiver_config->max_latency_ns = nanoseconds_from_rpc(
301-
"RvReceiverConfig.max_latency", in.receiver_config().max_latency());
287+
// latency_tolerance
288+
if (in.receiver_config().has_latency_tolerance()) {
289+
out.receiver_config->latency_tolerance_ns =
290+
nanoseconds_from_rpc("RvReceiverConfig.latency_tolerance",
291+
in.receiver_config().latency_tolerance());
302292
}
303293

304294
// no_playback_timeout
@@ -417,13 +407,9 @@ void device_info_to_rpc(rvpb::RvDeviceInfo& out, const DeviceInfo& in)
417407
*out.mutable_sender_config()->mutable_target_latency() = nanoseconds_to_rpc(
418408
"RvSenderConfig.target_latency", in.sender_config->target_latency_ns);
419409

420-
// min_latency
421-
*out.mutable_sender_config()->mutable_min_latency() = nanoseconds_to_rpc(
422-
"RvSenderConfig.min_latency", in.sender_config->min_latency_ns);
423-
424-
// max_latency
425-
*out.mutable_sender_config()->mutable_max_latency() = nanoseconds_to_rpc(
426-
"RvSenderConfig.max_latency", in.sender_config->max_latency_ns);
410+
// latency_tolerance
411+
*out.mutable_sender_config()->mutable_latency_tolerance() = nanoseconds_to_rpc(
412+
"RvSenderConfig.latency_tolerance", in.sender_config->latency_tolerance_ns);
427413
}
428414

429415
// receiver_config
@@ -468,13 +454,10 @@ void device_info_to_rpc(rvpb::RvDeviceInfo& out, const DeviceInfo& in)
468454
*out.mutable_receiver_config()->mutable_target_latency() = nanoseconds_to_rpc(
469455
"RvReceiverConfig.target_latency", in.receiver_config->target_latency_ns);
470456

471-
// min_latency
472-
*out.mutable_receiver_config()->mutable_min_latency() = nanoseconds_to_rpc(
473-
"RvReceiverConfig.min_latency", in.receiver_config->min_latency_ns);
474-
475-
// max_latency
476-
*out.mutable_receiver_config()->mutable_max_latency() = nanoseconds_to_rpc(
477-
"RvReceiverConfig.max_latency", in.receiver_config->max_latency_ns);
457+
// latency_tolerance
458+
*out.mutable_receiver_config()->mutable_latency_tolerance() =
459+
nanoseconds_to_rpc("RvReceiverConfig.latency_tolerance",
460+
in.receiver_config->latency_tolerance_ns);
478461

479462
// no_playback_timeout
480463
*out.mutable_receiver_config()->mutable_no_playback_timeout() =

driver/sender.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ Sender::Sender(const std::string& device_uid,
6969
net_sender_config.resampler_profile = device_sender_config.resampler_profile;
7070

7171
net_sender_config.target_latency = device_sender_config.target_latency_ns;
72-
net_sender_config.min_latency = device_sender_config.min_latency_ns;
73-
net_sender_config.max_latency = device_sender_config.max_latency_ns;
72+
net_sender_config.latency_tolerance = device_sender_config.latency_tolerance_ns;
7473

7574
if ((err = roc_sender_open(net_context_, &net_sender_config, &net_sender_)) < 0) {
7675
throw std::invalid_argument(

0 commit comments

Comments
 (0)