8000
Skip to content

[speaker] Media player fixes for IDF5.4 - #10088

Merged
kahrendt merged 2 commits into
esphome:devfrom
kahrendt:speaker-mp-idf5_4-fixes
Aug 5, 2025
Merged

[speaker] Media player fixes for IDF5.4#10088
kahrendt merged 2 commits into
esphome:devfrom
kahrendt:speaker-mp-idf5_4-fixes

Conversation

@kahrendt
@kahrendt kahrendt commented Aug 5, 2025
Copy link
Copy Markdown
Contributor

What does this implement/fix?

IDF5.4 changed the maximum values for certain sdkconfig options we set to optimize wifi, so most reverted to their default values. This PR modifies them (and simplifies them) based on a different example from Espressif for high throughput.

esp_http_client seems to crash when the calling task's stack is in PSRAM. This PR forces the task that uses esp_http_client to always run in internal memory, even if task_stack_in_psram is enabled. The decoder task still functions correctly with its stack in PSRAM.

Types of changes

  • Bugfix (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)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable): not applicable

Pull request in esphome-docs with documentation (if applicable): not applicable

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx
  • nRF52840

Example entry for config.yaml:

# Example config.yaml

media_player:
  - platform: speaker
    id: external_media_player
    name: Media Player
    internal: False
    task_stack_in_psram: true
    volume_increment: 0.05
    volume_min: 0.4
    volume_max: 0.85
    announcement_pipeline:
      speaker: announcement_resampling_speaker
      format: FLAC # FLAC is the least processor intensive codec
      num_channels: 1 # Stereo audio is unnecessary for announcements
      sample_rate: 48000

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@github-actions
github-actions Bot commented Aug 5, 2025
Copy link
Copy Markdown
Contributor

To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file:

external_components:
  - source: github://pr#10088
    components: [speaker]
    refresh: 1h

(Added by the PR bot)

@codecov-commenter
codecov-commenter commented Aug 5, 2025
Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 60.21%. Comparing base (58a088e) to head (1bef5fb).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #10088   +/-   ##
=======================================
  Coverage   60.21%   60.21%           
=======================================
  Files          51       51           
  Lines       10375    10375           
  Branches     1381     1381           
=======================================
  Hits         6247     6247           
  Misses       3772     3772           
  Partials      356      356           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kahrendt
kahrendt marked this pull request as ready for review August 5, 2025 16:38
@github-actions
github-actions Bot requested a review from synesthesiam August 5, 2025 16:38
@github-actions
github-actions Bot commented Aug 5, 2025
Copy link
Copy Markdown
Contributor

πŸ‘‹ Hi there! I've automatically requested reviews from codeowners based on the files changed in this PR.

@synesthesiam - You've been requested to review this PR as codeowner(s) of 2 file(s) that were modified. Thanks for your time! πŸ™

@kahrendt kahrendt added this to the 2025.8.0b1 milestone Aug 5, 2025
@kahrendt
kahrendt merged commit d443a97 into esphome:dev Aug 5, 2025
35 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 7, 2025
@kahrendt
kahrendt deleted the speaker-mp-idf5_4-fixes branch February 19, 2026 20:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0