Android 14 has the ability to turn your phone into a USB webcam for your PC

One of the features we were expecting to see in Android 14 was the ability to turn your phone into a USB webcam for your PC. Google hasn’t talked about this feature yet, but we hope they still plan to ship it.

Here are some tidbits about Android 14’s USB webcam feature

So back in February, a reliable source discovered code changes in AOSP that hinted at a new “DeviceAsWebcam” service (which upon re-reading the code changes we now believe to be a separate system app) that “turns an Android device into a webcam.”

Android devices that support the UVC gadget mode (ie. the kernel is compiled with CONFIG_USB_CONFIGFS_F_UVC=y) can be set up to send camera frames to a /dev/video* node that a host device supporting UVC webcams can read from.

A dedicated DeviceAsWebcam app – which we should note has not yet been shipped on any Pixel builds – is what, we believe, would be responsible for actually using Android’s Camera API to forward frames.

Only system apps-like DeviceAsWebcam-would have permission to R/W data to the /dev/video* node. In fact, the USB configuration file for all Tensor & Tensor 2-based (but not SM7250) Pixels already set up the UVC function. Attached to this post is a snippet from init.gs101.usb.rc/init.gs201.usb.rc.

But since the DAW app is not present in current Android 14 beta builds, we can’t actually use this functionality, though we can surface the “Webcam” option in “USB Preferences” as shown in the first post. The “Webcam” option appears when the system property ro.usb.uvc.enabled is set to true. Settings call UsbManager#isUvcSupportEnabled(), which reads this property, to decide whether to show this option.

When you select “webcam”, UsbDeviceManager sets the USB config to “uvc” and the android.hardware.usb.action.USB_STATE broadcast is sent with the USB_FUNCTION_UVC boolean extra. DAW presumably listens for this broadcast to know when to start forwarding frames.

FOLLOW US ON – Telegram, Twitter, Facebook and Google News

Leave a Comment