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:
- 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
- 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.
Description
CameraAVStreamManager::OnAttributeChanged()inexamples/camera-app/linux/src/clusters/camera-avstream-mgmt/camera-av-stream-manager.cpplogs a misleading message for attributes it doesn't explicitly handle:This is triggered right after an
AllocateVideoStreamcommand (Cluster 0x551, Command 0x3).Root cause
CameraAVStreamManagementCluster::mDelegate.OnAttributeChanged(attributeId)(declared insrc/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.0x0000000Cand0x0000000Fcorrespond toCurrentFrameRateandAllocatedVideoStreamsrespectively (seezzz_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. TheswitchinOnAttributeChanged()(camera-av-stream-manager.cpp:690-781) only has cases for attributes that need HAL synchronization (e.g.HDRModeEnabled,Viewport,SpeakerMuted, ...); anything else falls intodefault: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
CameraAvStreamManagementlikely to hit the samedefault:path for the same reason:AllocatedAudioStreams(0x10),AllocatedSnapshotStreams(0x11),StreamUsagePriorities(0x12),SupportedStreamUsages(0x0E),SnapshotCapabilities(0x0A),MaxNetworkBandwidth(0x0B),TwoWayTalkSupport(0x09).Suggested fix
Either:
caseentries (with a short comment) in theswitchfor the SDK-owned/read-only attributes that don't require HAL sync, so the intent is explicit, ordefault:log (e.g. fromChipLogProgress(Camera, "Unknown Attribute ...")to something likeChipLogDetail(Camera, "No HAL action for attribute ...")), since "unknown" is inaccurate.