RSDK-13693 Remove Reconfigurable#40
Merged
Merged
Conversation
The Reconfigurable base class was removed from viam-cpp-sdk (commit 571407760), so we need to drop our use of it before we can bump the SDK. With Reconfigurable gone, a config change now tears down and reconstructs the component instance instead of transitioning in place. While here, simplify the now-redundant context-change handling in Microphone::get_audio: - Drop the `is_reconfigure` parameter on `setup_stream_params` (the only caller now always passes `false`). - Drop the inner `setup_stream_params` re-run on context change. The watchdog restarts a stream with the same format, so chunk sizes and MP3 encoder state are still valid. - Drop `StreamGuard` / `active_streams_` (only used to warn during reconfigure).
seanavery
approved these changes
May 20, 2026
seanavery
left a comment
There was a problem hiding this comment.
Looking good! Love to see the red diffs :)
Do we need to update watchdog.hpp at all to remove reconfigure refs?
Are we planning on bumping the SDK in this PR before merging?
|
|
||
| ### Reconfiguration Behavior | ||
|
|
||
| The microphone component supports reconfiguration - you can change stream attributes without restarting the audio stream RPC calls. When you reconfigure: |
There was a problem hiding this comment.
Should we have a short note here explaining the new "reconfigure" contract?
Any config change will terminate in-flight get_audio streams. Client needs to handle error and resubmit a get_audio request
Collaborator
Author
I will bump in the next PR to add playstream implementation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reconfigurablewas removed fromviam-cpp-sdk(commit571407760), so audio-poc must drop it before the SDK can be bumped past0.36.0. - which we need to add the PlayStream APIReconfigurablebase class andreconfigure()methods fromSpeakerandMicrophone.<viam/sdk/resource/reconfigurable.hpp>includes fromdiscovery.{cpp,hpp}andmp3_encoder.hpp.Microphone::get_audionow that the only audio_context_ swap is via the watchdog (same format, so no need to re-runsetup_stream_paramsor rebuild the MP3 encoder on context change).StreamGuard/active_streams_(only used to warn during reconfigure).MicrophoneTest, Reconfigure*tests.Behavior change
Previously, a config change called
reconfigure()on the live component and activeget_audio()/play()calls would transition under it. Now the SDK destroys the component and constructs a fresh one on any config change; in-flight RPCs are canceled and clients must reconnect.Test plan
viam-cpp-sdk/0.21.0).