WebRTC streamer and vhost-user-input backend processes communicate with a client-server protocol - #3111
Open
jemoreira wants to merge 6 commits into
Open
WebRTC streamer and vhost-user-input backend processes communicate with a client-server protocol#3111jemoreira wants to merge 6 commits into
jemoreira wants to merge 6 commits into
Conversation
The webRTC streamer can connect to a unix socket for each input device to inject input events and receive status feedback, in addition to the existing approach based on receiving the connection as an inherited file descriptor. The behavior is chosen base on command line flags passed by run_cvd. Bug: b/552079861
and implement it with the existing socket pair connected to stdin. Bug: b/552079861
The vhost-user-input process accepts a UNIX socket's fd via command line flag. When given, events are not read from stdin, but instead from clients connected to that unix socket. Multiple clients can connect at the same time and the server guarantees that each group of events ending in a SYN_REPORT event is delivered to the VMM atomically. Bug: b/552079861
webrtc connects to a unix socket hosted by vhu-input instead of through a socket pair inherited from run_cvd. run_cvd unconditionally enables this behavior, assuming that webRTC and cf_vhost_user_input are already substituted everywhere run_cvd is substituted. Bug: b/552079861
jemoreira
enabled auto-merge
August 28, 2026 02:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cf_vhost_user_inputlistens on a UNIX socket server it inherits fromrun_cvd.webRTCconnects to this server to inject input events (mouse, touch, keyboard, etc) to the device backends. This enables the input backend to receive events from sources outside the streamer process.In addition to the protocol change, the device backend ensures all groups of events sent to the guest driver end in a
SYN_REPORT. TheseSYN_REPORTevents are used to group events from multiple sources so that the driver receives a valid flow of events.The behavior is enabled by run_cvd by the flags it launches
webRTCandcf_vhost_user_inputwith. When therun_cvdbinary is not substituted, events are sent via a socket pair as before. It would be a problem ifrun_cvdwas substituted butwebRTCorcf_vhost_user_inputwas not, but this situation is extremely unlikely since the latter have been substituted for a while now.Bug: b/552079861