fix(mcp): use audio-stream instead of direct I2S - fixes fast mp3/voice playback

- old optimization bypassed audio-stream resampler (16k direct -> MCLK 4.096MHz vs 11.29MHz native)
- brick game correct because it used audio_stream path
- now MCP uses audio_stream_open_output/input + read/write matching native logger stack
- falls back to direct I2S only if audio-stream device missing
This commit is contained in:
Adolfo Reyna
2026-07-18 18:30:19 -04:00
parent c3abe79c90
commit 9a307e522d
2 changed files with 120 additions and 31 deletions
@@ -6,6 +6,7 @@
#include <string>
#include <vector>
#include <tactility/device.h>
#include <tactility/drivers/audio_stream.h>
namespace tt::mcp {
@@ -25,6 +26,8 @@ struct McpSystemState {
// Audio device status
Device* i2sDevice = nullptr;
Device* audioStreamDevice = nullptr;
AudioStreamHandle audioHandle = nullptr;
volatile bool audioBusy = false;
volatile bool audioRunning = false; // Used to abort play/record loop