Skip to content

feat(t-deck): Add audio output and sdcard support #417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 28, 2025

Conversation

finger563
Copy link
Contributor

Description

  • Update espp::TDeck to support audio output with same API as espp::EspBox for interoperability
  • Update espp::TDeck to support sdcard configuration
  • Update t-deck example to demonstrate audio the same way that the esp-box example does

Motivation and Context

Improves the utility and functionality of the device to better support the T-Deck. This is also part of the work to allow the esp-box-emu project to run on the TDeck.

How has this been tested?

Build and run t-deck/example on a TDeck and ensure it works and the sound plays correctly.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

CleanShot 2025-04-28 at 10 31 15

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Update `espp::TDeck` to support audio output with same API as `espp::EspBox` for interoperability
* Update t-deck example to demonstrate audio the same way that the esp-box example does

Improves the utility and functionality of the device to better support the T-Deck. This is also part of the work to allow the esp-box-emu project to run on the TDeck.

Build and run `t-deck/example` on a TDeck and ensure it works and the sound plays correctly.
@finger563 finger563 self-assigned this Apr 28, 2025
@finger563 finger563 requested a review from Copilot April 28, 2025 15:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@finger563 finger563 requested a review from Copilot April 28, 2025 15:36
Copy link

✅Static analysis result - no issues found! ✅

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds audio output and SD card support to the TDeck platform while updating related documentation and example code.

  • Adds SPI bus initialization for shared LCD, SD card, and audio support.
  • Implements I2S-based audio playback and SD card mounting functionality.
  • Updates the t-deck example to demonstrate audio controls alongside existing features.

Reviewed Changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
components/t-deck/src/t-deck.cpp Adds SPI bus initialization and configures CS pins for peripherals.
components/t-deck/src/sdcard.cpp Implements SD card initialization with FAT filesystem mounting.
components/t-deck/src/buttons.cpp Introduces boot button initialization with interrupt support.
components/t-deck/src/audio.cpp Adds I2S audio support, audio task callback, and playback functions.
components/t-deck/include/t-deck.hpp Updates header to expose new audio and SD card APIs.
components/t-deck/example/main/t_deck_example.cpp Updates example to load and play audio, and demonstrate volume/mute control.
components/esp-box/include/esp-box.hpp Minor update to alias definitions for consistency.
Files not reviewed (2)
  • components/t-deck/CMakeLists.txt: Language not supported
  • components/t-deck/example/main/CMakeLists.txt: Language not supported
Comments suppressed due to low confidence (1)

components/t-deck/src/audio.cpp:170

  • The flag 'has_sound' is set to true after queuing audio but is never reset, which may cause subsequent calls to block indefinitely. Consider resetting this flag once the audio task completes processing.
  play_audio_task_handle_ = xTaskGetCurrentTaskHandle();

@finger563 finger563 requested a review from Copilot April 28, 2025 15:51
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@finger563 finger563 requested review from Copilot April 28, 2025 15:54
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@finger563 finger563 merged commit de510bf into main Apr 28, 2025
76 of 77 checks passed
@finger563 finger563 deleted the feat/t-deck-audio-support branch April 28, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant