Skip to content

Commit 8931f10

Browse files
committed
work around boot instability issue with a delay setting up codec in TTS
The `codec` seems to hang sometimes during `Setup8kStereo` at boot. Did not get to the bottom of it, but suspect that the RTC I2C init sequence is interfering with the codec init sequence. This might be resolved while also fixing #467, but for now, a short delay on boot works around the problem.
1 parent 23a9b0c commit 8931f10

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

services/tts/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ fn main() -> ! {
175175
}
176176
});
177177
let mut codec = codec::Codec::new(&xns).unwrap();
178+
tt.sleep_ms(150).unwrap(); // de-congest startup sequence; TODO: make this not a race condition with RTC access. might be related to #467 (insufficiently broad locking of the I2C bus)
178179
codec.setup_8k_stream().expect("couldn't setup stream");
179180
tt.sleep_ms(50).unwrap();
180181
codec.set_speaker_volume(VolumeOps::Set, Some(0.0)).unwrap();

0 commit comments

Comments
 (0)