From c1e947f6b40a1cfbf54062c87abd392c2629bab7 Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Thu, 18 Dec 2025 12:22:18 +0100 Subject: [PATCH 1/2] Remote camera/microphone validation --- internal/orchestrator/orchestrator.go | 14 +++++++++++--- internal/orchestrator/provision.go | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/orchestrator/orchestrator.go b/internal/orchestrator/orchestrator.go index 8eb26001..7eb80e68 100644 --- a/internal/orchestrator/orchestrator.go +++ b/internal/orchestrator/orchestrator.go @@ -59,9 +59,11 @@ var ( const ( DefaultDockerStopTimeoutSeconds = 5 - CameraDevice = "camera" - MicrophoneDevice = "microphone" - SpeakerDevice = "speaker" + CameraDevice = "camera" + RemoteCameraDevice = "remote_camera" + MicrophoneDevice = "microphone" + RemoteMicrophoneDevice = "remote_microphone" + SpeakerDevice = "speaker" ) type AppStreamMessage struct { @@ -1090,6 +1092,12 @@ func validateDevices(res *deviceResult, requiredDeviceClasses map[string]any) er if len(requiredDeviceClasses) > 0 { for class := range requiredDeviceClasses { switch class { + case RemoteCameraDevice: + // Remote camera does not require a local camera device to be present + continue + case RemoteMicrophoneDevice: + // Remote microphone does not require a local microphone device to be present + continue case CameraDevice: if !res.hasVideoDevice { return fmt.Errorf("no camera found") diff --git a/internal/orchestrator/provision.go b/internal/orchestrator/provision.go index babac0ce..b4b8d2eb 100644 --- a/internal/orchestrator/provision.go +++ b/internal/orchestrator/provision.go @@ -275,6 +275,8 @@ func generateMainComposeFile( // 6. Collect all the required device classes from the app descriptor if len(app.Descriptor.RequiredDevices) > 0 { + // Required devices defined at app level take precedence over brick defined ones + requiredDeviceClasses := make(map[string]any) for _, deviceClass := range app.Descriptor.RequiredDevices { requiredDeviceClasses[deviceClass] = true } From 57e2217bb0dc4096ceb026e19465f82606dd7306 Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Thu, 18 Dec 2025 16:56:21 +0100 Subject: [PATCH 2/2] fix var overloading --- internal/orchestrator/provision.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/orchestrator/provision.go b/internal/orchestrator/provision.go index b4b8d2eb..41eaf280 100644 --- a/internal/orchestrator/provision.go +++ b/internal/orchestrator/provision.go @@ -276,7 +276,7 @@ func generateMainComposeFile( // 6. Collect all the required device classes from the app descriptor if len(app.Descriptor.RequiredDevices) > 0 { // Required devices defined at app level take precedence over brick defined ones - requiredDeviceClasses := make(map[string]any) + requiredDeviceClasses = make(map[string]any) for _, deviceClass := range app.Descriptor.RequiredDevices { requiredDeviceClasses[deviceClass] = true }