Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement stream_events() rpc call #4

Open
gavv opened this issue Oct 9, 2024 · 0 comments
Open

Implement stream_events() rpc call #4

gavv opened this issue Oct 9, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Contributions are welcome

Comments

@gavv
Copy link
Member

gavv commented Oct 9, 2024

We need to given clients a way to subscribe for driver events, such as adding, deleting, or updating virtual devices. So that if one client (e.g. command-line tool) adds a device, another client (e.g. GUI) will be notified of that.

In driver_protocol.proto, we already have stream_logs() call that sends a stream of log entries from driver to client. Similarly, we can add stream_events() call, that would send a stream of event entry.

Each event entry could contain two fields:

  • event type (e.g.: DEVICE_ADDED, DEVICE_DELETED, DEVICE_UPDATED)
  • device uid

When a client calls stream_events(), we first should generate DEVICE_ADDED event for every device that is already present. That would allow client to monitor devices without race conditions (otherwise, if client gets device list before streaming, it can miss devices that appeared between device list request and streaming request).

In addition to RPC call, we need to add a command to CLI tool, say, roc-vad events. It should be similar to roc-vad logcat: connect to driver, call stream_events(), and print received events to console.

Related files:

  • rpc/driver_protocol.proto - defines RPC interface
  • driver/driver_service.cpp - implements RPC interface on driver side
  • driver/device_manager.cpp - implements adding/removing/updating devices; we need to add subscribe/unsubscribe feature here and use it from DriverService
  • tool/cmd_logcat.cpp - implements roc-vad logcat command

See also documentation in README and HACKING.md.

@gavv gavv added enhancement New feature or request good first issue Good for newcomers help wanted Contributions are welcome labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Contributions are welcome
Projects
None yet
Development

No branches or pull requests

1 participant