Initial commit

This commit is contained in:
Seth Hillbrand
2026-02-15 12:50:49 -08:00
commit c17ab8607c
61 changed files with 11607 additions and 0 deletions
+215
View File
@@ -0,0 +1,215 @@
# yolocam-ctl CLI User Guide
Command-line tool for controlling the YoloCam S3 camera on Linux.
## Prerequisites
1. YoloCam S3 connected via USB
2. CDC NCM network interface configured (host at 192.168.126.11, camera at 192.168.126.10)
3. `yolocam-lib` installed: `cd yolocam-lib && pip install -e .`
## Connection Setup
The camera exposes a CDC NCM network adapter over USB. Most Linux systems auto-configure
this via NetworkManager/DHCP. If not:
```bash
# Find the USB network interface
ip link show
# Configure manually
sudo ip link set usb0 up
sudo ip addr add 192.168.126.11/24 dev usb0
```
Verify connectivity:
```bash
yolocam-ctl status
```
## Commands
### status
Show camera connection status including USB detection, network, and firmware info.
```bash
yolocam-ctl status
```
Output:
```
YoloCam S3 Status
────────────────────────────────────
USB Device: Connected
Network: Interface configured
Control Port: Reachable (192.168.126.10:12345)
Firmware: YunxiCamera-ch131b-0.0.6
Serial: 524A25501202
ID: ...
```
### list
List all available camera parameters with read/write access and descriptions.
```bash
yolocam-ctl list
yolocam-ctl --json list # JSON output
```
Parameters are categorized: Image Quality, Zoom, Exposure, White Balance, Focus,
Video, Lens Correction, HDMI, Color / Tuning, Audio, LED / Indicator, AI Features,
Streaming, Device Info.
Access types:
- **RW** -- read and write
- **RO** -- read-only
- **WO** -- write-only (set commands only)
### get
Read one or more camera parameters.
```bash
yolocam-ctl get brightness
yolocam-ctl get brightness contrast saturation
yolocam-ctl --json get exposure-mode exposure-iso exposure-time
```
### get-all
Read all readable parameters. Automatically handles reconnection if the camera
stops responding.
```bash
yolocam-ctl get-all
yolocam-ctl --json get-all
```
### set
Set a camera parameter by name and value.
```bash
yolocam-ctl set brightness 60
yolocam-ctl set contrast 55
yolocam-ctl set exposure-mode 1 # 0=Auto, 1=Manual
yolocam-ctl set focus-mode 3 # 1=AFS, 2=Manual, 3=AFC, 4=Face
yolocam-ctl set hdr 1 # Enable HDR
yolocam-ctl set zoom 2.5 # 2.5x digital zoom (range 1.0-4.0)
```
### iso
Set ISO by actual value.
```bash
yolocam-ctl iso 400
yolocam-ctl iso 1600
```
Valid values: 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250,
1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, 9600, 12800.
### shutter
Set shutter speed by denominator.
```bash
yolocam-ctl shutter 60 # 1/60s
yolocam-ctl shutter 1000 # 1/1000s
yolocam-ctl shutter 8000 # 1/8000s
```
Valid denominators: 25, 30, 50, 60, 80, 100, 125, 160, 200, 250, 320, 400,
500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000.
### wb-temp
Set white balance color temperature in Kelvin.
```bash
yolocam-ctl wb-temp 5500 # Daylight
yolocam-ctl wb-temp 3200 # Tungsten
yolocam-ctl wb-temp 7500 # Shade
```
Range: 2000K to 10000K. Requires `wb-mode` set to 0 (Manual).
### aperture
Set aperture by f-stop value. Finds the nearest supported value.
```bash
yolocam-ctl aperture 2.8
yolocam-ctl aperture F4.0
```
Note: The S3 has a fixed lens; aperture control applies to compatible YoloLiv lenses.
### raw
Send a raw protobuf command by numeric Command ID.
```bash
yolocam-ctl raw 7 # GET CID_BRIGHTNESS (CID 7)
yolocam-ctl raw 7 50 # SET CID_BRIGHTNESS to 50
```
Useful for exploring undocumented commands. See the proto file for all CID values.
### init
Run the full camera initialization sequence.
```bash
yolocam-ctl init
```
Sends heartbeat, queries firmware version, frame rate, aperture range, lens status,
USB version, and HDMI format.
### probe
Quick connectivity check verifying the wire format protocol works.
```bash
yolocam-ctl probe
```
### monitor
Watch real-time camera notifications (NOTIFY messages).
```bash
yolocam-ctl monitor
```
Shows timestamped notifications including parameter changes, face detection boxes,
recording state changes, and other events. Press Ctrl+C to stop.
## Global Options
| Option | Default | Description |
|--------|---------|-------------|
| `--ip` | 192.168.126.10 | Camera IP address |
| `--port` | 12345 | Camera control port |
| `--timeout` | 5.0 | Socket timeout in seconds |
| `--json` | off | Output in JSON format |
## Troubleshooting
**Connection refused**
- Check USB connection: `lsusb | grep 46f8:0855`
- Ensure network interface is up: `ip addr show`
- Try `yolocam-ctl status` for diagnostics
**Camera stops responding**
- The camera overwhelms easily with rapid requests
- Restart the camera app: `telnet 192.168.126.10` then `/app/bin/live_camera_app &`
- Or power-cycle the camera
**Timeout errors**
- Add `--timeout 10` for slow operations
- Some parameters (set-only) do not return responses
+138
View File
@@ -0,0 +1,138 @@
# YoloCam S3 Device Access
Technical reference for direct device access to the YoloCam S3 via Telnet and FTP
over the CDC NCM USB network interface.
## Network Setup
The camera exposes a CDC NCM (USB Ethernet) adapter alongside the UVC video interface.
When plugged in, the host system should auto-configure via DHCP.
| Role | IP Address | Subnet |
|------|------------|--------|
| Camera | 192.168.126.10 | /24 |
| Host | 192.168.126.11 | /24 |
If DHCP fails, configure manually:
```bash
sudo ip link set usb0 up
sudo ip addr add 192.168.126.11/24 dev usb0
ping 192.168.126.10
```
## Services
| Port | Protocol | Service | Credentials |
|------|----------|---------|-------------|
| 21 | TCP | FTP (BusyBox ftpd) | root / yunxi.tv |
| 23 | TCP | Telnet | root / yunxi.tv |
| 12345 | TCP | Camera control (protobuf) | None |
## Telnet Access
```bash
telnet 192.168.126.10
# Login: root
# Password: yunxi.tv
```
The shell is BusyBox ash. Standard coreutils are available as BusyBox applets.
### Hardware
| Property | Value |
|----------|-------|
| SoC | HiSilicon HI3519DV500 |
| Architecture | aarch64 |
| C library | musl libc |
| OS | BusyBox Linux |
| Firmware | YunxiCamera-ch131b-0.0.6 |
### Filesystem Layout
```
/app/bin/live_camera_app Main camera application (aarch64 ELF)
/app/ Application directory
/app_data/tuning/ Persistent tuning files (CLUT, scene presets)
/tmp/ Temporary runtime files
```
CLUT files are persisted as `/app_data/tuning/clut_{version}_{scene_id}.info` where
version and scene_id are integers (typically `clut_0_0.info`).
### Camera Application Management
The camera application (`live_camera_app`) handles all protocol communication, video
encoding, and ISP pipeline control. It binds TCP port 12345 for the control protocol.
**Check if running:**
```
ps | grep live_camera
```
**Restart the application:**
```
killall live_camera_app
/app/bin/live_camera_app &
```
Restarting is the primary recovery method when the camera stops responding to protocol
commands (typically caused by rapid-fire requests overwhelming the application).
**View application output:**
```
/app/bin/live_camera_app
```
Running in the foreground prints ISP and protocol debug messages to the console.
### System Information
```
cat /proc/cpuinfo # SoC details
cat /proc/meminfo # RAM usage
cat /proc/version # Kernel version
df -h # Disk usage
mount # Mounted filesystems
ifconfig # Network interfaces
```
## FTP Access
FTP provides read/write access to the camera filesystem. Useful for downloading
tuning files, logs, or firmware images.
```bash
ftp 192.168.126.10
# User: root
# Password: yunxi.tv
```
Or with a command-line client:
```bash
lftp -u root,yunxi.tv 192.168.126.10
```
### Common FTP Operations
**Download a CLUT tuning file:**
```
get /app_data/tuning/clut_0_0.info
```
**Browse the application directory:**
```
ls /app/bin/
```
## Caveats
- The camera has limited resources. Avoid running memory-intensive commands via telnet.
- Writing to flash storage (`/app/`, `/app_data/`) persists across reboots. Be careful
with modifications to these paths.
- `/tmp/` is a tmpfs and is cleared on reboot.
- The telnet and FTP services are always active on the CDC NCM interface. There is no
way to disable them without modifying the firmware.
- All access is as root with no privilege separation.
+167
View File
@@ -0,0 +1,167 @@
# YoloCam GUI User Guide
PySide6 desktop application for controlling the YoloCam S3 camera with live video preview.
## Prerequisites
1. YoloCam S3 connected via USB
2. CDC NCM network interface configured (camera at 192.168.126.10)
3. System packages:
```bash
sudo apt install python3-pyside6.qtcore python3-pyside6.qtgui \
python3-pyside6.qtwidgets python3-opencv
```
4. `yolocam-lib` installed: `cd yolocam-lib && pip install -e .`
**Important**: Use PySide6 from `apt`, not from `pip`. The pip version conflicts
with system Qt6 libraries.
## Launching
```bash
cd yolocam-gui
python run.py
```
The application auto-connects to the camera on startup and displays the UVC video feed.
## Interface Layout
```
┌──────┬─────────────────────┬──────────────────────────────────┐
│ │ │ │
│ Side │ Panel Area │ Video Feed │
│ bar │ (scrollable) │ (live UVC) │
│ │ │ │
│ [1] │ │ │
│ [2] │ │ │
│ [3] │ │ │
│ [4] │ │ │
│ [5] │ │ │
│ │ │ │
├──────┴─────────────────────┴──────────────────────────────────┤
│ Status bar │
└───────────────────────────────────────────────────────────────┘
```
## Panels
### 1. Camera Parameters (Ctrl+1)
Collapsible sections for all camera settings:
**Image Quality** -- Brightness, Sharpness (-10 to 30), Contrast, Saturation, Hue, Gamma
**Exposure** -- Mode (Auto/Manual), EV compensation, ISO, Shutter speed, Aperture,
Exposure Lock, Anti-flicker, Dynamic Range, HDR
**White Balance** -- Mode (Auto/Manual), Color Temperature (2000-10000K), WB Offset,
WB Lock
**Focus** -- Mode (AFS/Manual/AFC/Face), Focus Level (Large/Medium/Small), CAF toggle
**Zoom** -- Digital zoom slider (1.0x to 4.0x)
**Graphics** -- Noise Reduction (Close/Weak/Middle/Strong), Shading Correction
**Audio** -- Volume, Noise Reduction, Auto Gain, Mic Type, Reverb, Delay
### 2. Color Grading (Ctrl+2)
HSV color wheel with two grading modes:
**Fast Mode** -- Two-point color remapping. Click a source color region, drag to
the destination color. The shift propagates across the color space with linear falloff.
Multiple drags can be stacked. Changes are applied as a 3D Color LUT on the camera's ISP.
- Left-click: create a new color shift or drag an existing point
- Right-click: delete a drag point
- Hover over existing points to see which will be selected (enlarges)
- Reset Grid button: clear all adjustments
**Professional Mode** -- Per-point polar grid of draggable control points for
fine-grained HSV adjustments across the color space.
**HSV Sliders** -- Direct numeric control of Hue (0-360), Saturation (0-100),
Brightness (0-100).
**Color LUT** -- Enable/disable CLUT on camera, adjust intensity (0-255), reset grading.
**Tuning** -- Brightness and Color Temperature fine-tuning.
Switching from Fast to Professional mode syncs the grid state so professional mode
shows the result of fast mode edits.
### 3. Console (Ctrl+3)
Protocol console showing raw command/response traffic.
### 4. Stream (Ctrl+4)
Streaming and recording controls.
### 5. Settings (Ctrl+5)
Application configuration.
## Keyboard Shortcuts
| Shortcut | Action |
|----------|--------|
| Ctrl+Q | Quit |
| Ctrl+1 | Camera Parameters panel |
| Ctrl+2 | Color Grading panel |
| Ctrl+3 | Console panel |
| Ctrl+4 | Stream panel |
| Ctrl+5 | Settings panel |
| Ctrl+Shift+C | Toggle camera connection |
| F11 | Toggle fullscreen |
## Menu Bar
**YoloCam**
- Connect to Camera / Disconnect (Ctrl+Shift+C)
- Quit (Ctrl+Q)
**View**
- Panel shortcuts (Ctrl+1 through Ctrl+5)
- Toggle Fullscreen (F11)
## Color Grading Workflow
### Quick Color Correction (Fast Mode)
1. Select "Fast" mode at the top of the Color panel
2. Click on the color you want to change on the wheel
3. Drag to the target color
4. Release to commit. The CLUT is computed and sent to the camera
5. Add more adjustments by clicking and dragging other color regions
6. Use the Reset Grid button to start over
### Precise Color Grading (Professional Mode)
1. Select "Professional" mode
2. Drag individual grid points to shift specific color regions
3. Right-click a point to reset it to its home position
4. Right-click empty space to reset the entire grid
### Using the LUT Controls
1. Enable CLUT in the Color LUT section
2. Adjust Intensity (0-255) to control how strongly the LUT is applied
3. Use "Reset Color Grading" to clear the LUT and start fresh
## Troubleshooting
**Black video feed** -- The UVC device is auto-detected by VID/PID (46f8:0855).
Check `ls /dev/video*` and ensure the camera USB connection is stable.
**"Disconnected" in status bar** -- The camera may have dropped the TCP connection.
Use Ctrl+Shift+C to reconnect, or restart the application.
**Slider changes not applying** -- Ensure the camera is connected (status bar shows
"Connected"). Some parameters require specific modes (e.g., manual exposure mode for
ISO/shutter control).
**Color grading not visible** -- Enable CLUT in the Color LUT section and set
intensity above 0.
+508
View File
@@ -0,0 +1,508 @@
# YoloCam S3 Protocol Technical Reference
Complete documentation of the YoloCam S3 camera control protocol.
## Hardware Overview
| Property | Value |
|----------|-------|
| Manufacturer | YoloLiv (Yunxi Technology) |
| Model | YoloCam S3 |
| USB VID:PID | 46f8:0855 |
| SoC | HiSilicon HI3519DV500 |
| Architecture | aarch64, musl libc |
| OS | BusyBox Linux |
| Camera app | `/app/bin/live_camera_app` |
| Firmware | YunxiCamera-ch131b-0.0.6 |
| Sys code | 1188 |
### USB Interfaces
The camera is a composite USB device with two functional interfaces:
| Interface | Class | Function |
|-----------|-------|----------|
| 0-1 | CDC NCM | Network adapter (camera: 192.168.126.10, host: 192.168.126.11/24 via DHCP) |
| 2-3 | UVC | Video Class webcam (live video feed) |
### Network Services
On the CDC NCM network (192.168.126.10):
| Port | Service | Credentials |
|------|---------|-------------|
| 21 | FTP | root:yunxi.tv |
| 23 | Telnet | root:yunxi.tv |
| 12345 | Control protocol (TCP) | None |
## Wire Format
All control communication uses TCP on port 12345. Each message is wrapped in a
dual-envelope wire format.
### Frame Structure
```
Offset Size Field Description
────── ──── ──────────────────── ─────────────────────────────────────
0 1 outer_start Always 0x08
1 1 client_type 0x01 for client->camera, 0x00 for camera->client
2 2 padding Always 0x00 0x00
4 4 inner_size Little-endian uint32: proto_size + 8
8 1 inner_start Always 0xA5
9 4 proto_size Big-endian uint32: serialized protobuf length
13 1 header_checksum XOR of bytes [8..12] (inner_start + proto_size)
14 N payload Serialized protobuf Message
14+N 1 data_checksum XOR of all payload bytes
15+N 1 inner_end Always 0x5A
```
Total frame size: `16 + proto_size` bytes.
### Checksum Algorithm
Simple XOR of all bytes in the specified range:
```python
def xor_checksum(data: bytes) -> int:
result = 0
for b in data:
result ^= b
return result
```
The header checksum covers bytes 8-12 (inner start flag + 4-byte proto_size).
The data checksum covers the entire protobuf payload.
### Example Frame
Setting brightness to 50 (`CID_BRIGHTNESS = 7`, `value = 50`):
```
Protobuf Message:
type: TYPE_SET (2)
id: CID_BRIGHTNESS (7)
body: { int_val: 50 }
Serialized protobuf (hex): 08 02 28 07 32 02 08 32
proto_size = 8
Wire frame (hex):
08 01 00 00 10 00 00 00 Outer: start=0x08, client=0x01, inner_size=16
A5 00 00 00 08 AD Inner: start=0xA5, proto_size=8, hdr_xor=0xAD
08 02 28 07 32 02 08 32 Payload: protobuf bytes
0B 5A Trailer: data_xor=0x0B, end=0x5A
```
## Protobuf Schema
Package: `tv.yunxi.protobuf`
### Message Wrapper
```protobuf
message Message {
MessageType type = 1; // Request type
uint32 seq = 2; // Sequence number (echoed in response)
uint32 timeout = 3; // Request timeout (ms), typically 3000
uint32 resp_code = 4; // Response code (200=OK, 100=unsupported/out-of-range)
CommandId id = 5; // Which command
CommandBody body = 6; // Payload
}
```
### Message Types
| Value | Name | Description |
|-------|------|-------------|
| 1 | TYPE_REQUEST | Client reads a parameter (GET) |
| 2 | TYPE_SET | Client writes a parameter (SET) |
| 3 | TYPE_POST | Client sends data (file transfer, CLUT upload) |
| 4 | TYPE_RESPONSE | Camera response to any request |
| 5 | TYPE_NOTIFY | Asynchronous camera notification |
### Response Codes
| Code | Meaning |
|------|---------|
| 200 | Success |
| 100 | Unsupported command or value out of range |
### Command Body
```protobuf
message CommandBody {
oneof value {
uint32 int_val = 1;
string str_val = 2;
ManualExposureParams exposure_params = 3;
WhiteBalanceManual white_balance_manual = 4;
TransportFile transport_file = 5;
Size size = 6;
Range range = 7;
Rect rect = 8;
FileInfo file_info = 9;
VersionInfo version_info = 10;
UpgradeEvent upgrade_event = 11;
LensStatusEvent lens_event = 12;
WhiteBalanceOffset white_balance_offset = 13;
RectF rect_f = 14;
LensInfo lens_info = 15;
TuningFileInfo tuning_file_info = 16;
TuningParam tuning_param = 17;
ListInt list_int = 18;
ListRectF list_rect_f = 19;
LensDetail lens_detail = 20;
LensAmend lens_amend = 21;
LensReset lens_reset = 22;
BleScanParam ble_scan_param = 23;
AdvInfo adv_info = 24;
LightConnection light_connection = 25;
LightStatus light_status = 26;
LightParam light_param = 27;
LightConnectedList light_connected_list = 28;
IndicatorCtl indicator_ctl = 29;
RawImgInfo raw_img_info = 30;
TuningClutFile tuning_clut_file = 31;
WlanConf wlan_conf = 32;
StreamParam stream_param = 33;
DiskInfo disk_info = 34;
PtzCtrl ptz_ctrl = 35;
DumpPdParam dump_pd_param = 36;
RCEvent rc_event = 37;
WifiScanResults wifi_list = 38;
AiTrackingCtrl ai_tracking_ctrl = 39;
AiParams ai_params = 40;
VideoStatus video_status = 41;
DrawInfoList draw_info_list = 42;
AdvInfoList adv_list = 43;
LensVersionInfo lens_version_info = 44;
}
}
```
## Command Reference
### Image Quality
| CID | Name | Type | Range | Default | Description |
|-----|------|------|-------|---------|-------------|
| 7 | CID_BRIGHTNESS | int | 0-100 | 50 | Image brightness |
| 8 | CID_SHARPNESS | int | -10 to 30 | 5 | Sharpness. Wire encoding: 0-30 sent as-is, -1 to -10 sent as 61-70 |
| 9 | CID_CONTRAST | int | 0-100 | 50 | Contrast |
| 10 | CID_SATURATION | int | 0-100 | 50 | Color saturation |
| 11 | CID_HUE | int | 0-100 | 50 | Hue. Wire protocol 0-100 maps to UI 0-360 via `hue * 100 / 360` |
| 12 | CID_GAMMA | int | 0-100 | 50 | Gamma correction |
### Zoom
| CID | Name | Type | Range | Default | Description |
|-----|------|------|-------|---------|-------------|
| 13 | CID_ZOOM | int | 50-98 (raw) | 50 | Digital zoom. Conversion: `mult = 0.0625 * raw - 2.125`. Raw 50 = 1.0x, 98 = 4.0x |
| 112 | CID_ZOOM_SPEED | int | 1-5 | 3 | Zoom animation speed (set-only) |
### Exposure
| CID | Name | Type | Range | Default | Description |
|-----|------|------|-------|---------|-------------|
| 14 | CID_EXPOSURE_MODE | int | 0-1 | 0 | 0=Auto, 1=Manual |
| 15 | CID_EXPOSURE_EV | int | 0-16 | 8 | EV compensation. 8 = 0EV |
| 16 | CID_ANTI_FLICKER | int | 0-2 | 0 | 0=Off, 1=50Hz, 2=60Hz |
| 17 | CID_EXPOSURE_ISO | int | actual | 400 | ISO value sent directly (100, 125, ..., 12800) |
| 18 | CID_EXPOSURE_TIME | int | microseconds | 16666 | Shutter in microseconds (16666=1/60s, 1000=1/1000s, 125=1/8000s) |
| 20 | CID_EXPOSURE_APERTURE | int | 0-31 | 10 | Aperture index. 0=F1.0, 10=F2.8, 31=F32.0 |
| 98 | CID_ENABLE_HDR | int | 0-1 | 0 | HDR toggle |
| 102 | CID_DYNAMIC_RANGE | int | 0-100 | 50 | Dynamic range |
| 106 | CID_EXPOSURE_LOCK | int | 0-1 | 0 | Lock exposure |
#### Shutter Speed Table
| Denominator | Microseconds | | Denominator | Microseconds |
|-------------|--------------|--|-------------|--------------|
| 1/8000 | 125 | | 1/500 | 2000 |
| 1/6400 | 156 | | 1/400 | 2500 |
| 1/5000 | 200 | | 1/320 | 3125 |
| 1/4000 | 250 | | 1/250 | 4000 |
| 1/3200 | 312 | | 1/200 | 5000 |
| 1/2500 | 400 | | 1/160 | 6250 |
| 1/2000 | 500 | | 1/125 | 8000 |
| 1/1600 | 625 | | 1/100 | 10000 |
| 1/1250 | 800 | | 1/80 | 12500 |
| 1/1000 | 1000 | | 1/60 | 16666 |
| 1/800 | 1250 | | 1/50 | 20000 |
| 1/640 | 1562 | | 1/30 | 33333 |
| | | | 1/25 | 40000 |
#### ISO Values
100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000,
2500, 3200, 4000, 5000, 6400, 8000, 9600, 12800
### White Balance
| CID | Name | Type | Range | Default | Description |
|-----|------|------|-------|---------|-------------|
| 21 | CID_WHITE_BALANCE_MODE | int | 0-1 | 1 | 0=Manual, 1=Auto |
| 22 | CID_WHITE_BALANCE_TEMPERATURE | int | 2000-10000 | 5500 | Color temp in Kelvin |
| 33 | CID_WHITE_BALANCE_OFFSET | WhiteBalanceOffset | | | R/B offset (body.white_balance_offset) |
| 104 | CID_WHITE_BALANCE_LOCK | int | 0-1 | 0 | Lock WB |
| 105 | CID_WHITE_BALANCE_TEMPERATURE_SHIFT | int | 0-128 | 64 | WB temp shift |
### Focus
| CID | Name | Type | Range | Default | Description |
|-----|------|------|-------|---------|-------------|
| 23 | CID_FOCUS_MODE | int | 1-4 | 1 | 1=AFS, 2=Manual, 3=AFC, 4=Face |
| 38 | CID_FOCUS_RECT_LEVEL | int | 0-2 | 0 | 0=Large, 1=Medium, 2=Small |
| 42 | CID_ENABLE_CAF | int | 0-1 | 0 | Continuous AF |
| 47 | CID_TRIGGER_SPEED | int | | | AF trigger speed |
| 111 | CID_MANU_FOCUS_CODE | int | | | Manual focus step (set-only) |
| 214 | CID_ENABLE_FACE_ROI | int | 0-1 | 0 | Face-detect ROI (set-only) |
### Audio
| CID | Name | Type | Range | Default | Description |
|-----|------|------|-------|---------|-------------|
| 73 | CID_AU_VOLUME | int | 0-100 | 50 | Audio volume |
| 75 | CID_AU_DENOISE | int | 0-3 | 2 | 0=Close, 1=Weak, 2=Middle, 3=Strong |
| 76 | CID_AU_REVERB | int | 0-3 | 0 | 0=Close, 1=Weak, 2=Middle, 3=Strong |
| 77 | CID_AU_DELAY | int | 0-400 | 0 | Audio delay in ms |
| 78 | CID_AU_AUTO_GAIN | int | 0-1 | 0 | Auto gain toggle |
| 79 | CID_AU_MIC_TYPE | int | 0-1 | 0 | 0=Line, 1=Mic (set-only) |
### Video / Streaming
| CID | Name | Type | Range | Description |
|-----|------|------|-------|-------------|
| 5 | CID_FRAME_RATE | int | 25/30/50/60 | Frame rate |
| 6 | CID_RESOLUTION | int | | Resolution setting |
| 202 | CID_STREAM_CFG | StreamConfig | | Stream configuration (set-only) |
| 203 | CID_STREAMING_START | int | | Start streaming |
| 204 | CID_STREAMING_STOP | int | | Stop streaming |
| 205 | CID_RECORDING_START | int | | Start recording |
| 206 | CID_RECORDING_STOP | int | | Stop recording |
| 211 | CID_ENABLE_UVC | int | 0-1 | UVC output (set-only) |
### HDMI
| CID | Name | Type | Range | Default | Description |
|-----|------|------|-------|---------|-------------|
| 61 | CID_HDMI_OUTPUT_FORMAT | int | 0-3 | 0 | 0=Auto, 1=4K, 2=1080p, 3=720p |
| 65 | CID_HDMI_COLOR_SPACE | int | 0-2 | 0 | 0=Auto, 1=RGB, 2=YUV422 |
### Color LUT (CLUT)
| CID | Name | Type | Description |
|-----|------|------|-------------|
| 94 | CID_ENABLE_CLUT | int (0/1) | Enable/disable 3D color LUT on ISP |
| 95 | CID_CLUT_FILE | TuningClutFile | Upload CLUT data (5508 uint32 entries) |
| 96 | CID_CLUT_ATTR | int (0-255) | CLUT blend intensity |
| 53 | CID_TUNING | TuningParam | Image tuning (brightness, curve, color_temp) |
#### CLUT Data Format
The ISP uses a 17x17x17 3D color lookup table stored as 5508 uint32 entries in an
interleaved octant layout. Each uint32 packs three signed 10-bit RGB delta values
in s0.9 fixed-point format (range [-1.0, +0.998]).
**Entry packing**: `(R_delta << 20) | (G_delta << 10) | B_delta`
Each 10-bit delta is interpreted as signed fixed-point divided by 512:
- Value 0: no change
- Value 511: +0.998 (maximum positive delta)
- Value 512 (0x200): -1.0 (maximum negative delta, two's complement)
**Octant interleaving**: The 4913 grid nodes (17^3) are grouped into 8 octants based
on the parity of (x, y, z) indices. Octant = `(x&1) + ((y&1)<<1) + ((z&1)<<2)`.
| Octant | Even/Odd pattern | Size | Cumulative offset |
|--------|-----------------|------|-------------------|
| 0 | (E,E,E) | 729 (9x9x9) | 0 |
| 1 | (O,E,E) | 648 (8x9x9) | 729 |
| 2 | (E,O,E) | 648 (9x8x9) | 1377 |
| 3 | (O,O,E) | 576 (8x8x9) | 2025 |
| 4 | (E,E,O) | 648 (9x9x8) | 2601 |
| 5 | (O,E,O) | 576 (8x9x8) | 3249 |
| 6 | (E,O,O) | 576 (9x8x8) | 3825 |
| 7 | (O,O,O) | 512 (8x8x8) | 4401 |
Total: 729+648+648+576+648+576+576+512 = 4913 entries (with 595 padding to 5508).
**Upload via protobuf**: CLUT data is sent using `TuningClutFile` message on
`CID_CLUT_FILE (95)` as a TYPE_POST:
```protobuf
message TuningClutFile {
uint32 clut_size = 1; // Always 5508
repeated uint32 clut_data = 2; // The CLUT entries
string hsv_data = 3; // JSON string with HSV grid state
string extra = 4; // Additional metadata
string updataflag = 5; // Update flag
}
```
### AI Features
| CID | Name | Type | Range | Default | Description |
|-----|------|------|-------|---------|-------------|
| 99 | CID_AI_TRACKING_CTRL | AiTrackingCtrl | 0-2 | 2 | 0=Portrait, 1=Thing, 2=Off |
| 59 | CID_FACE_BOUNDING_BOXES | ListRectF | | | Face detection boxes (NOTIFY, fires constantly) |
### Device Info (Read-Only)
| CID | Name | Response Type | Description |
|-----|------|--------------|-------------|
| 1 | CID_VERSION_INFO | VersionInfo | Firmware version, serial, unique ID, sys_code |
| 60 | CID_USB_VERSION | int | USB protocol version |
| 48 | CID_LENS_STATUS | int | Lens connection status |
| 63 | CID_GET_LENS_DETAIL | LensDetail | Lens ID, aperture, focal, serial, drive times |
| 113 | CID_LENS_VERSION | LensVersionInfo | Lens firmware version |
| 210 | CID_VIDEO_STATUS_CHANGED | VideoStatus | Video pipeline status |
| 103 | CID_AU_VERSION | int | Audio module version |
| 301 | CID_DISK_INFO | DiskInfo | SD card total/available size, filesystem type |
| 213 | CID_LOWPOWER_STATUS | int | Low power status |
| 31 | CID_RANGE_OF_APERTURE | Range | Min/max aperture for current lens |
| 32 | CID_RANGE_OF_EXP_TIME | Range | Min/max exposure time range |
### Notifications
| CID | Name | Description |
|-----|------|-------------|
| 59 | CID_FACE_BOUNDING_BOXES | Face detection rectangles (high frequency, suppress in logs) |
| 209 | CID_DURATION_CHANGED | Recording duration update |
| 210 | CID_VIDEO_STATUS_CHANGED | Video pipeline state change |
| 207 | CID_STREAMING_STOPPED | Streaming stopped |
| 208 | CID_RECORDING_FINISHED | Recording finished |
| 303 | CID_DISK_EVENT | SD card insertion/removal |
### Heartbeat
The camera requires a periodic heartbeat to maintain the control connection:
```
CID_STREAM_HEARTBEAT (215) = 1, sent every 30 seconds
```
If the heartbeat stops, the camera may drop the TCP connection.
## Communication Patterns
### GET (Read Parameter)
```
Client -> Camera:
Message {
type: TYPE_REQUEST (1)
seq: N
timeout: 3000
id: CID_BRIGHTNESS (7)
}
Camera -> Client:
Message {
type: TYPE_RESPONSE (4)
seq: N
resp_code: 200
id: CID_BRIGHTNESS (7)
body: { int_val: 50 }
}
```
### SET (Write Parameter)
```
Client -> Camera:
Message {
type: TYPE_SET (2)
seq: N
timeout: 3000
id: CID_BRIGHTNESS (7)
body: { int_val: 60 }
}
Camera -> Client:
Message {
type: TYPE_RESPONSE (4)
seq: N
resp_code: 200
id: CID_BRIGHTNESS (7)
}
```
### POST (Send Complex Data)
Used for CLUT uploads, file transfers, and other structured data:
```
Client -> Camera:
Message {
type: TYPE_POST (3)
seq: N
timeout: 3000
id: CID_CLUT_FILE (95)
body: {
tuning_clut_file: {
clut_size: 5508
clut_data: [0, 0, 0, ..., 5508 entries]
hsv_data: "{\"hue\": [...], \"sat\": [...]}"
}
}
}
```
### NOTIFY (Camera Event)
Unsolicited messages from camera to client:
```
Camera -> Client:
Message {
type: TYPE_NOTIFY (5)
id: CID_FACE_BOUNDING_BOXES (59)
body: { list_rect_f: { values: [...] } }
}
```
## Camera Behavior Notes
### Rate Limiting
The camera overwhelms easily with rapid requests. After approximately 25+ rapid
requests without delays, it stops responding to all commands except CID_VERSION_INFO.
Mitigation:
- Insert 100ms+ delays between requests
- Use single persistent TCP connections
- Restart `live_camera_app` via telnet if camera becomes unresponsive
### Recovery
If the camera stops responding:
```bash
telnet 192.168.126.10
# Login: root / yunxi.tv
killall live_camera_app
/app/bin/live_camera_app &
```
Or power-cycle the camera.
### Set-Only Parameters
Some parameters only accept SET commands and return resp_code=100 for GET:
CID_ZOOM_SPEED, CID_MANU_FOCUS_CODE, CID_ENABLE_FACE_ROI, CID_SCENE,
CID_STREAM_CFG, CID_ENABLE_UVC, CID_AU_MIC_TYPE, CID_INDICATOR_CTL
### Filesystem
The camera's filesystem (accessible via FTP at root:yunxi.tv):
```
/app/bin/live_camera_app Main camera application
/app/ Application directory
/tmp/ Temporary files (CLUT saves go here)
```
CLUT files are persisted as `/tmp/clut_0_0.info` on the camera's filesystem.
Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 KiB