Skip to content

Updates for Audio System#36

Open
Shadowtrance wants to merge 1 commit into
TactilityProject:mainfrom
Shadowtrance:updates-fixes
Open

Updates for Audio System#36
Shadowtrance wants to merge 1 commit into
TactilityProject:mainfrom
Shadowtrance:updates-fixes

Conversation

@Shadowtrance

@Shadowtrance Shadowtrance commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

And fix media keys after BT disabled change.

Summary by CodeRabbit

  • New Features

    • Media Keys now handles Bluetooth activation and shutdown more reliably, including automatic activation when Bluetooth is already enabled.
    • Sound effects now follow the system’s audio volume and enabled/disabled settings.
  • Bug Fixes

    • Improved Bluetooth and HID cleanup when leaving Media Keys.
    • Prevented stale Bluetooth events from affecting the interface.
  • Documentation

    • Updated sound engine guidance to reflect system-controlled volume settings.

And fix media keys after BT disabled change.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

SfxEngine 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)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the change but too generic to clearly convey the main updates. Use a more specific title that names the core changes, such as switching SfxEngine to audio_stream and updating MediaKeys Bluetooth teardown.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8ced6a1c-6bda-48ab-bbe9-b7785c2b79fb

📥 Commits

Reviewing files that changed from the base of the PR and between 8721a65 and 63b647a.

📒 Files selected for processing (7)
  • Apps/Breakout/main/Source/Breakout.cpp
  • Apps/MediaKeys/main/Source/MediaKeys.cpp
  • Apps/MediaKeys/main/Source/MediaKeys.h
  • Apps/TamaTac/main/Source/TamaTac.cpp
  • Libraries/SfxEngine/Include/SfxEngine.h
  • Libraries/SfxEngine/README.md
  • Libraries/SfxEngine/Source/SfxEngine.cpp
💤 Files with no reviewable changes (2)
  • Apps/TamaTac/main/Source/TamaTac.cpp
  • Apps/Breakout/main/Source/Breakout.cpp

Comment on lines 485 to 488
if (error != ERROR_NONE) {
ESP_LOGE(TAG, "I2S write error");
ESP_LOGE(TAG, "Audio stream write error");
self->running_ = false;
break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant