Skip to content

Commit

Permalink
work around boot instability issue with a delay setting up codec in TTS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bunnie committed Dec 24, 2023
1 parent 23a9b0c commit 8931f10
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions services/tts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ fn main() -> ! {
}
});
let mut codec = codec::Codec::new(&xns).unwrap();
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)
codec.setup_8k_stream().expect("couldn't setup stream");
tt.sleep_ms(50).unwrap();
codec.set_speaker_volume(VolumeOps::Set, Some(0.0)).unwrap();
Expand Down

0 comments on commit 8931f10

Please sign in to comment.