Skip to content

camera-app (Linux): CameraAVStreamManager::OnAttributeChanged logs misleading "Unknown Attribute" for valid SDK-owned attributes #72986

Description

@lboue

Description

CameraAVStreamManager::OnAttributeChanged() in examples/camera-app/linux/src/clusters/camera-avstream-mgmt/camera-av-stream-manager.cpp logs a misleading message for attributes it doesn't explicitly handle:

[CAM] Attribute changed for AttributeId = 0x0000_000C
[CAM] Unknown Attribute with AttributeId = 0x0000_000C
...
[CAM] Attribute changed for AttributeId = 0x0000_000F
[CAM] Unknown Attribute with AttributeId = 0x0000_000F

This is triggered right after an AllocateVideoStream command (Cluster 0x551, Command 0x3).

Root cause

CameraAVStreamManagementCluster::mDelegate.OnAttributeChanged(attributeId) (declared in src/app/clusters/camera-av-stream-management-server/CameraAVStreamManagementCluster.h:311) is invoked by the SDK cluster implementation for any attribute it marks dirty internally, not only attributes the application needs to mirror onto the camera HAL.

0x0000000C and 0x0000000F correspond to CurrentFrameRate and AllocatedVideoStreams respectively (see zzz_generated/app-common/clusters/CameraAvStreamManagement/AttributeIds.h) — both are SDK-managed / read-only attributes, so there is legitimately nothing for the app to do in response. The switch in OnAttributeChanged() (camera-av-stream-manager.cpp:690-781) only has cases for attributes that need HAL synchronization (e.g. HDRModeEnabled, Viewport, SpeakerMuted, ...); anything else falls into default: and is logged as "Unknown Attribute", even though the attribute is perfectly valid — the app simply has no action to take for it.

This is not a functional bug (nothing breaks), just a confusing/noisy log message that could mislead someone debugging the app into thinking an attribute isn't recognized.

Other attributes of CameraAvStreamManagement likely to hit the same default: path for the same reason: AllocatedAudioStreams (0x10), AllocatedSnapshotStreams (0x11), StreamUsagePriorities (0x12), SupportedStreamUsages (0x0E), SnapshotCapabilities (0x0A), MaxNetworkBandwidth (0x0B), TwoWayTalkSupport (0x09).

Suggested fix

Either:

  1. Add explicit no-op case entries (with a short comment) in the switch for the SDK-owned/read-only attributes that don't require HAL sync, so the intent is explicit, or
  2. Reword/downgrade the default: log (e.g. from ChipLogProgress(Camera, "Unknown Attribute ...") to something like ChipLogDetail(Camera, "No HAL action for attribute ...")), since "unknown" is inaccurate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions