diff --git a/examples/chef/common/clusters/audio-output/AudioOutputManager.cpp b/examples/chef/common/clusters/audio-output/AudioOutputManager.cpp
index 65df8db..776baf5 100644
--- a/examples/chef/common/clusters/audio-output/AudioOutputManager.cpp
+++ b/examples/chef/common/clusters/audio-output/AudioOutputManager.cpp
@@ -16,15 +16,21 @@
  *    limitations under the License.
  */
 
+#include <app-common/zap-generated/attributes/Accessors.h>
+#include <app/AttributeValueEncoder.h>
 #include <app/util/config.h>
+#include <map>
+
 #ifdef MATTER_DM_PLUGIN_AUDIO_OUTPUT_SERVER
 #include "AudioOutputManager.h"
 
+using namespace chip;
 using namespace chip::app;
 using namespace chip::app::Clusters::AudioOutput;
 using chip::app::AttributeValueEncoder;
+using chip::Protocols::InteractionModel::Status;
 
-AudioOutputManager::AudioOutputManager()
+AudioOutputManager::AudioOutputManager(chip::EndpointId endpoint) : mEndpoint(endpoint)
 {
     struct OutputData outputData1(1, chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi, "HDMI 1");
     mOutputs.push_back(outputData1);
@@ -32,13 +38,17 @@
     mOutputs.push_back(outputData2);
     struct OutputData outputData3(3, chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi, "HDMI 3");
     mOutputs.push_back(outputData3);
-
-    mCurrentOutput = 1;
 }
 
 uint8_t AudioOutputManager::HandleGetCurrentOutput()
 {
-    return mCurrentOutput;
+    uint8_t currentOutput = 1;
+    Status status         = Attributes::CurrentOutput::Get(mEndpoint, &currentOutput);
+    if (Status::Success != status)
+    {
+        ChipLogError(Zcl, "Unable to get CurrentOutput attribute, err:0x%x", to_underlying(status));
+    }
+    return currentOutput;
 }
 
 CHIP_ERROR AudioOutputManager::HandleGetOutputList(AttributeValueEncoder & aEncoder)
@@ -72,11 +82,27 @@
     {
         if (outputData.index == index)
         {
-            mCurrentOutput = index;
+            // Sync the CurrentOutput to attribute storage while reporting changes
+            Status status = Attributes::CurrentOutput::Set(mEndpoint, index);
+            if (Status::Success != status)
+            {
+                ChipLogError(Zcl, "CurrentOutput is not stored successfully, err:0x%x", to_underlying(status));
+            }
             return true;
         }
     }
 
     return false;
 }
+
+static std::map<chip::EndpointId, std::unique_ptr<AudioOutputManager>> gAudioOutputManagerInstance{};
+
+void emberAfAudioOutputClusterInitCallback(EndpointId endpoint)
+{
+    ChipLogProgress(Zcl, "TV Linux App: AudioOutput::SetDefaultDelegate, endpoint=%x", endpoint);
+
+    gAudioOutputManagerInstance[endpoint] = std::make_unique<AudioOutputManager>(endpoint);
+
+    SetDefaultDelegate(endpoint, gAudioOutputManagerInstance[endpoint].get());
+}
 #endif // MATTER_DM_PLUGIN_AUDIO_OUTPUT_SERVER
diff --git a/examples/chef/common/clusters/audio-output/AudioOutputManager.h b/examples/chef/common/clusters/audio-output/AudioOutputManager.h
index ad64b7c..93c94d6 100644
--- a/examples/chef/common/clusters/audio-output/AudioOutputManager.h
+++ b/examples/chef/common/clusters/audio-output/AudioOutputManager.h
@@ -27,7 +27,7 @@
     using OutputInfoType = chip::app::Clusters::AudioOutput::Structs::OutputInfoStruct::Type;
 
 public:
-    AudioOutputManager();
+    AudioOutputManager(chip::EndpointId endpoint);
 
     uint8_t HandleGetCurrentOutput() override;
     CHIP_ERROR HandleGetOutputList(chip::app::AttributeValueEncoder & aEncoder) override;
@@ -54,6 +54,6 @@
     };
 
 protected:
-    uint8_t mCurrentOutput = 1;
+    chip::EndpointId mEndpoint;
     std::vector<struct OutputData> mOutputs;
 };
diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp
index 513bb41..5cbe80a 100644
--- a/examples/chef/common/stubs.cpp
+++ b/examples/chef/common/stubs.cpp
@@ -270,17 +270,6 @@
  */
 void emberAfOnOffClusterInitCallback(EndpointId endpoint) {}
 
-#ifdef MATTER_DM_PLUGIN_AUDIO_OUTPUT_SERVER
-#include "audio-output/AudioOutputManager.h"
-static AudioOutputManager audioOutputManager;
-
-void emberAfAudioOutputClusterInitCallback(EndpointId endpoint)
-{
-    ChipLogProgress(Zcl, "TV Linux App: AudioOutput::SetDefaultDelegate");
-    AudioOutput::SetDefaultDelegate(endpoint, &audioOutputManager);
-}
-#endif
-
 #ifdef MATTER_DM_PLUGIN_CHANNEL_SERVER
 #include "channel/ChannelManager.h"
 static ChannelManager channelManager;
