Skip to content

Sending device model over ffi for client telemetry#966

Open
MaxHeimbrock wants to merge 8 commits intomainfrom
max/claude/device-model
Open

Sending device model over ffi for client telemetry#966
MaxHeimbrock wants to merge 8 commits intomainfrom
max/claude/device-model

Conversation

@MaxHeimbrock
Copy link
Contributor

@MaxHeimbrock MaxHeimbrock commented Mar 24, 2026

This is probably a breaking change.

Send device_model if set from ffi, otherwise send "Unknown"

Alternatively we could add it to some room options proto, but this follows the same pattern as sdk and sdk version, which is also client telemetry and set in the LiveKitInitialize of the ffi.

Enables: livekit/client-sdk-unity#201

@ladvoc
Copy link
Contributor

ladvoc commented Mar 24, 2026

From sync: this is technically a breaking change since it changes the C ABI. However, given that other client info is passed this way, I would say we should do the same here for consistency.

Copy link
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far, I've left a few questions and comments.

capture_logs: bool,
sdk: *const c_char,
sdk_version: *const c_char,
device_model: *const c_char,
Copy link
Contributor

@ladvoc ladvoc Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Unlike SDK version, not all clients will be able to populate this field. We can store this as Option<String> on the Rust side, mapping a null pointer to Option::None.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I do the mapping here?

I tried:

device_model: {
            if device_model.is_null() {
                None
            } else {
                let s = CStr::from_ptr(device_model).to_string_lossy().into_owned();
                if s.is_empty() {
                    None
                } else {
                    Some(s)
                }
            }

And that did not work when not filling the field from Unity side. I again end up with garbage in logs:

Image

Copy link
Contributor

@xianshijing-lk xianshijing-lk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two nits, lgtm if you address them.

MaxHeimbrock and others added 4 commits March 25, 2026 13:51
This change sends the device model in client telemetry when set from ffi, defaulting to 'Unknown' otherwise.
@MaxHeimbrock MaxHeimbrock force-pushed the max/claude/device-model branch from a0091d4 to ec16a71 Compare March 25, 2026 12:51
@MaxHeimbrock
Copy link
Contributor Author

I moved the field over to the general signaling options instead of the SDK options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants