Updates for Audio System#36
Conversation
And fix media keys after BT disabled change.
📝 WalkthroughWalkthroughSfxEngine now uses the platform audio stream output instead of I2S, scales audio using cached system volume and enabled state, and removes app-level volume controls. Breakout and TamaTac no longer apply volume presets. MediaKeys centralizes Bluetooth cleanup, tracks device startup state, initializes devices through generic device APIs, responds to existing radio state, and auto-enables Bluetooth handling when shown. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8ced6a1c-6bda-48ab-bbe9-b7785c2b79fb
📒 Files selected for processing (7)
Apps/Breakout/main/Source/Breakout.cppApps/MediaKeys/main/Source/MediaKeys.cppApps/MediaKeys/main/Source/MediaKeys.hApps/TamaTac/main/Source/TamaTac.cppLibraries/SfxEngine/Include/SfxEngine.hLibraries/SfxEngine/README.mdLibraries/SfxEngine/Source/SfxEngine.cpp
💤 Files with no reviewable changes (2)
- Apps/TamaTac/main/Source/TamaTac.cpp
- Apps/Breakout/main/Source/Breakout.cpp
| if (error != ERROR_NONE) { | ||
| ESP_LOGE(TAG, "I2S write error"); | ||
| ESP_LOGE(TAG, "Audio stream write error"); | ||
| self->running_ = false; | ||
| break; |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Keep failed audio tasks eligible for cleanup.
Setting running_ = false makes stop() return at Line 571 without closing audioStreamHandle_ or deleting msgQueue_. A subsequent start() can overwrite those leaked resources or fail because the previous stream remains open.
Make stop() idempotently clean owned resources regardless of running_, and account for an audio task that exited before the stop semaphore was created.
And fix media keys after BT disabled change.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation