Commit ·
a62bbe4
1
Parent(s): b9e2e76
fix: reduce noise suppression for better microphone sensitivity
Browse files- Changed _optimize_microphone_settings() to focus on reducing noise suppression
- Set PP_MIN_NS to 0.2 (was default ~0.5-0.7) for less aggressive filtering
- Set PP_MIN_NN to 0.2 for better noise floor estimation
- Removed AGC gain changes that were not addressing the root cause
- Reference: reachy_mini/src/reachy_mini/media/audio_control_utils.py
reachy_mini_ha_voice/voice_assistant.py
CHANGED
|
@@ -225,8 +225,11 @@ class VoiceAssistantService:
|
|
| 225 |
def _optimize_microphone_settings(self) -> None:
|
| 226 |
"""Optimize ReSpeaker microphone settings for voice recognition.
|
| 227 |
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
|
|
|
| 230 |
"""
|
| 231 |
if self.reachy_mini is None:
|
| 232 |
return
|
|
@@ -243,33 +246,23 @@ class VoiceAssistantService:
|
|
| 243 |
_LOGGER.debug("ReSpeaker device not found")
|
| 244 |
return
|
| 245 |
|
| 246 |
-
#
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
except Exception as e:
|
| 251 |
-
_LOGGER.debug("Could not enable AGC: %s", e)
|
| 252 |
-
|
| 253 |
-
# Set higher AGC max gain for better sensitivity (default is ~15dB)
|
| 254 |
-
try:
|
| 255 |
-
respeaker.write("PP_AGCMAXGAIN", [25.0]) # Increase to 25dB
|
| 256 |
-
_LOGGER.info("AGC max gain set to 25dB")
|
| 257 |
-
except Exception as e:
|
| 258 |
-
_LOGGER.debug("Could not set AGC max gain: %s", e)
|
| 259 |
-
|
| 260 |
-
# Set AGC desired level (target output level)
|
| 261 |
try:
|
| 262 |
-
respeaker.write("
|
| 263 |
-
_LOGGER.info("
|
| 264 |
except Exception as e:
|
| 265 |
-
_LOGGER.debug("Could not set
|
| 266 |
|
| 267 |
-
#
|
|
|
|
| 268 |
try:
|
| 269 |
-
respeaker.write("
|
| 270 |
-
_LOGGER.info("
|
| 271 |
except Exception as e:
|
| 272 |
-
_LOGGER.debug("Could not set
|
| 273 |
|
| 274 |
_LOGGER.info("Microphone settings optimized for voice recognition")
|
| 275 |
|
|
|
|
| 225 |
def _optimize_microphone_settings(self) -> None:
|
| 226 |
"""Optimize ReSpeaker microphone settings for voice recognition.
|
| 227 |
|
| 228 |
+
The main issue affecting voice recognition is that the default noise suppression
|
| 229 |
+
level (PP_MIN_NS) is too aggressive, which can filter out quiet speech.
|
| 230 |
+
This method reduces noise suppression to improve microphone sensitivity.
|
| 231 |
+
|
| 232 |
+
Reference: reachy_mini/src/reachy_mini/media/audio_control_utils.py
|
| 233 |
"""
|
| 234 |
if self.reachy_mini is None:
|
| 235 |
return
|
|
|
|
| 246 |
_LOGGER.debug("ReSpeaker device not found")
|
| 247 |
return
|
| 248 |
|
| 249 |
+
# Reduce noise suppression - this is the main fix for microphone sensitivity
|
| 250 |
+
# PP_MIN_NS controls minimum noise suppression threshold
|
| 251 |
+
# Lower values = less aggressive noise suppression = better voice pickup
|
| 252 |
+
# Default is typically around 0.5-0.7, we reduce it to 0.2 for voice commands
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
try:
|
| 254 |
+
respeaker.write("PP_MIN_NS", [0.2])
|
| 255 |
+
_LOGGER.info("Noise suppression reduced (PP_MIN_NS=0.2) for better voice pickup")
|
| 256 |
except Exception as e:
|
| 257 |
+
_LOGGER.debug("Could not set PP_MIN_NS: %s", e)
|
| 258 |
|
| 259 |
+
# Also reduce PP_MIN_NN (minimum noise floor estimation)
|
| 260 |
+
# This helps in quieter environments
|
| 261 |
try:
|
| 262 |
+
respeaker.write("PP_MIN_NN", [0.2])
|
| 263 |
+
_LOGGER.info("Noise floor threshold reduced (PP_MIN_NN=0.2)")
|
| 264 |
except Exception as e:
|
| 265 |
+
_LOGGER.debug("Could not set PP_MIN_NN: %s", e)
|
| 266 |
|
| 267 |
_LOGGER.info("Microphone settings optimized for voice recognition")
|
| 268 |
|