diff --git a/src/ipa/simple/algorithms/agc.cpp b/src/ipa/simple/algorithms/agc.cpp
index a13a755280..e9bcb2c032 100644
--- a/src/ipa/simple/algorithms/agc.cpp
+++ b/src/ipa/simple/algorithms/agc.cpp
@@ -67,8 +67,8 @@ Agc::Agc()
 
 void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, double exposureMSV)
 {
-	int32_t &exposure = frameContext.sensor.exposure;
-	double &again = frameContext.sensor.gain;
+	int32_t exposure = frameContext.sensor.exposure;
+	double again = frameContext.sensor.gain;
 
 	double error = kExposureOptimal - exposureMSV;
 
@@ -115,6 +115,9 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou
 	again = std::clamp(again, context.configuration.agc.againMin,
 			   context.configuration.agc.againMax);
 
+	frameContext.agc.exposure = exposure;
+	frameContext.agc.gain = again;
+
 	context.activeState.agc.exposure = exposure;
 	context.activeState.agc.again = again;
 
@@ -150,8 +153,8 @@ void Agc::process(IPAContext &context,
 		 * Use the new exposure and gain values calculated the last time
 		 * there were valid stats.
 		 */
-		frameContext.sensor.exposure = context.activeState.agc.exposure;
-		frameContext.sensor.gain = context.activeState.agc.again;
+		frameContext.agc.exposure = context.activeState.agc.exposure;
+		frameContext.agc.gain = context.activeState.agc.again;
 		return;
 	}
 
diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h
index 8ccfacb46a..d35fb1e91d 100644
--- a/src/ipa/simple/ipa_context.h
+++ b/src/ipa/simple/ipa_context.h
@@ -66,6 +66,11 @@ struct IPAActiveState {
 struct IPAFrameContext : public FrameContext {
 	Matrix<float, 3, 3> ccm;
 
+	struct {
+		int32_t exposure;
+		double gain;
+	} agc;
+
 	struct {
 		int32_t exposure;
 		double gain;
diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp
index 2a41b5bac8..22702638bb 100644
--- a/src/ipa/simple/soft_simple.cpp
+++ b/src/ipa/simple/soft_simple.cpp
@@ -320,10 +320,11 @@ void IPASoftSimple::processStats(const uint32_t frame,
 
 	ControlList ctrls(sensorInfoMap_);
 
-	auto &againNew = frameContext.sensor.gain;
-	ctrls.set(V4L2_CID_EXPOSURE, frameContext.sensor.exposure);
-	ctrls.set(V4L2_CID_ANALOGUE_GAIN,
-		  static_cast<int32_t>(camHelper_ ? camHelper_->gainCode(againNew) : againNew));
+	int32_t againNew = camHelper_
+		? camHelper_->gainCode(frameContext.agc.gain)
+		: static_cast<int32_t>(frameContext.agc.gain);
+	ctrls.set(V4L2_CID_EXPOSURE, frameContext.agc.exposure);
+	ctrls.set(V4L2_CID_ANALOGUE_GAIN, againNew);
 
 	setSensorControls.emit(ctrls);
 }
