Skip to content

Fix boot loop on single-core targets (ESP32-S2, C3/C6/H2) by guarding task pinning - #4

Closed
tortfeaser wants to merge 81 commits into
luar123:masterfrom
tortfeaser:fix/single-core-task-pinning
Closed

tortfeaser wants to merge 81 commits into
luar123:masterfrom
tortfeaser:fix/single-core-task-pinning

Conversation

@tortfeaser

Copy link
Copy Markdown

Fixes a boot loop on single-core ESP32 targets. start_player() and
start_snapcast() both call xTaskCreatePinnedToCore(..., 1) unconditionally.
On single-core parts (S2, and the RISC-V C3/C6/H2 family) there is no core 1,
so the xCoreID < configNUMBER_OF_CORES assert in
freertos_tasks_c_additions.h fires immediately and the chip resets in a
loop.

Reported and reproduced on a LOLIN S2 Mini (ESP32-S2FN4R2) via
esphome/esphome#14389; the same underlying pinning issue was independently
hit on an ESP32-C5 in the same thread.

This guards both call sites on CONFIG_FREERTOS_NUMBER_OF_CORES == 1,
falling back to a plain xTaskCreate (unpinned) only on single-core targets.
Multi-core boards keep the existing pinned-task behaviour unchanged.

Tested on: LOLIN S2 Mini (ESP32-S2), boot loop resolved — ran 20+ seconds
without a reset, past the point where the original assert previously fired
immediately on boot.

CarlosDerSeher and others added 30 commits October 31, 2024 12:31
enable both interfaces if configured from menuconfig

Signed-off-by: Karl Osterseher <karli_o@gmx.at>
…on config

change printf to ESP_LOGI in net_functions
add missing components to network interface

Signed-off-by: Karl Osterseher <karli_o@gmx.at>
add sdkconfig.defaults
change some warnings to verbose
in player if more than 16 bits are selected in i2s use I2S_MCLK_MULTIPLE_384
remove stream tags, add client info message to snapcast protocol

Signed-off-by: Karl Osterseher <karli_o@gmx.at>
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
add OTA instructions
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
…component

- add i2s channel delete to deinit_player()
- improve network interface component
  store IP and connection status of interfaces
- improve UI http server

Signed-off-by: Karl Osterseher <karli_o@gmx.at>
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
add support for mixing stereo to mono through dsp_processor (fixes CarlosDerSeher#106)
add sdkconfigs to github action workflow
suppress warnings from flac git submodule
remove unused variable and address some compiler warnings
remove some dead code

Signed-off-by: Karl Osterseher <karl_osterseher@gmx.at>
…running during upgrade

wait for free space in flac write callback if none can be aquired.

Signed-off-by: Karl Osterseher <karl_osterseher@gmx.at>
* Fix #include statement in main.c
* Fix typing in es8388.c
* Fix i2c_bus_write_data function
* Remove uneeded log statement
Signed-off-by: Karl Osterseher <karl_osterseher@gmx.at>
…er#141)

* [tas5805m] Add configuration for mono mixing (CarlosDerSeher#115)

When bridge mode is active, by default, only the left input channel is send
to the output.

With the configuration, you can choose either the left or the right channel,
or a "mono" configuration which mix the two input channel.

Co-authored-by: Alex <alex@alexlg.org>

* Allow using pcm510a without dedicated mute pin. (CarlosDerSeher#120)

If the pin number is set to a value <0, no GPIO actions are performed.

* Added sdkconfig for Olimex PoE Board and PCM5102A (CarlosDerSeher#128)

* Add example config for Wireless-Tag WT32-ETH01 board with PCM5102A DAC (CarlosDerSeher#130)

Co-authored-by: mat <mat@devtal.de>

* Update mute state in player task (CarlosDerSeher#134)

* Fix issue where 100% volume is not restored after reboot (CarlosDerSeher#137)

* Fix idf 5.4/5.5 build errors (CarlosDerSeher#139)

* fix idf 5.4 build errors

* Remove errors from flac and opus

* close CarlosDerSeher#126

---------

Co-authored-by: Jordi <jordiag@kth.se>

* Update default settings for snapcast. Does not contain dac/wifi/user settings

* Update readme (CarlosDerSeher#142)

* Update README, fix typos

* Add AI-Thinker board to README

* Make TAS5805M power down pin configurable (CarlosDerSeher#140)

* Make TAS5805M power down pin configurable
   defaults to pin 33
   defaults to pin 17 on esp32s3

* Fix soft volume

* Fix sdkconfig defaults. Disable ethernet

---------

Co-authored-by: Alexandre Thomazo <alex@thomazo.info>
Co-authored-by: Alex <alex@alexlg.org>
Co-authored-by: bg nerilex <bg@nerilex.org>
Co-authored-by: sneu14 <62690888+sneu14@users.noreply.github.com>
Co-authored-by: matmemo <33166560+matmemo@users.noreply.github.com>
Co-authored-by: mat <mat@devtal.de>
Co-authored-by: Manuel Blatt <45859907+blattm@users.noreply.github.com>
Co-authored-by: Jordi <jordiag@kth.se>
CarlosDerSeher and others added 28 commits February 9, 2026 22:19
update some template sdkconfigs

Signed-off-by: CarlosDerSeher <karl_osterseher@gmx.at>
…her#183)

This PR adds comprehensive DAC configuration and equalizer support for the TAS5805M chip with a web UI.

Major Features:
- TAS5805M DAC settings page with configurable parameters:
  * Bridge mode, modulation mode, switching frequency
  * Analog and digital volume control
  * Mixer implementation with compensation gains
  * Fault monitoring and fault reset
- 15-band parametric equalizer with two modes:
  * Manual 15-band EQ control with per-band gains
  * HF and LF filter presets for quick bi-amp configuration
  * Real-time updates and visualization
- New dedicated settings component (tas5805m_settings) for persistence
- All settings persist to NVS and restore on boot

Architecture Improvements:
- Created dedicated tas5805m_settings component
- DAC UI in the dedicated HTML tab
- Data-driven front-end with settings-ui.js renderer

Bug Fixes:
- Fixed EQ UI showing 0 gains before music starts
- Fixed channel gains not restoring on reboot
- Fixed NULL semaphore crashes during player restart
- Fixed DSP init ordering (semaphore creation before use)
- Fixed NULL pointer checks in mDNS and player
- Fixed WiFi power save interfering with low-latency audio
- Fixed settings persistence and restoration

Technical Details:
- Extended partitions.csv for additional storage
- Settings stored in NVS with proper restoration
- DSP processor coordination with I2S clock requirements
- Delayed settings application after DAC initialization
- Proper semaphore and mutex protection

Co-authored-by: andriy.malyshenko <andriy@sonocotta.com>
Co-authored-by: Andriy Malyshenko <andriy@sonocotta.com>, craigmillard86 <craigmillard@gmail.com>
* separate dac_control_task
* move base message parsing out of main
* ensure now is set like before
* refactor time sync variables
* move time sync message handling in own method
* remove unused variables
* clarify variable name
* add TAG to parser
* move parsing of time message to parser file
* callback for server settings
* server settings parsing moved
* callback codec headers
* move codec header parsing
* moved unknown message parsing
* separate wire chunk handling function
* move parsing of wire chunk
* parser reset function
* move typed message callbacks out of parsing functions
* move base message handling out of parsing function
* move process_data function out of http_get_task
* receive_data function
* fill buffer function
* smaller variable scope for receive_data
* move code to connection handler
* setup_network function
* move setup_network to connection_handler
* move resetting of netbuf into receive_data function
* prepare transition to state machine for connection
* connection handling as state machine
* move data processing out of network state machine
* move connection_ensure_byte to connection handler
* create connection struct
* use connection struct in connection_ensure_byte
* move connection handling into base message parser
* simplify base message parsing
* simplify unknown message parsing
* simplify time message parsing
* simplify server message parsing
* simplify codec header parsing
* simplify wire chunk parsing
* remove base_message and time_message parameters from process_data by using local scope
* local scope for wire_chnk parameter
* don't pass decoderChunk via parameters
* use fixed length for codecString to simplify memory management
* clearer parameter and variable names in codec header handling
* improve codec header error handling
* local scope for serverSettingsString
* reorder parse_codec_header_message parameters
* local scope for codecPayload
* Add mDNS dep and handle IPv4-only mDNS addr

Add `mdns` to the component private requirements because optional seems not to work.

* Update components/snapclient/connection_handler.c

---------

Co-authored-by: luar123 <49960470+luar123@users.noreply.github.com>
The static server (CONFIG_SNAPSERVER_HOST) was only run through
ipaddr_aton(), which parses numeric IP literals, so a DNS hostname
failed outright. Fall back to netconn_gethostbyname() when it is not a
numeric IP, so the configured host may be a hostname resolved on the
device network.

Build-shim branch based on 1dfe76a (the commit the esphome integration
pins); the upstream-master version of this fix is on nameresolution-addition.

Assisted-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Co-authored-by: Mirko Vogt <foss@mirko.in>
start_player() and start_snapcast() both call xTaskCreatePinnedToCore(..., 1)
unconditionally. On single-core parts (S2, and the RISC-V C3/C6/H2 family)
there is no core 1, so the xCoreID < configNUMBER_OF_CORES assert in
freertos_tasks_c_additions.h fires immediately and the chip resets in a loop.

Guard both call sites on CONFIG_FREERTOS_NUMBER_OF_CORES == 1, falling back
to a plain xTaskCreate (unpinned) only on single-core targets. Multi-core
boards keep the existing pinned-task behaviour unchanged.

Reported and reproduced on a LOLIN S2 Mini (ESP32-S2FN4R2) via
esphome/esphome#14389; the same underlying pinning issue was independently
hit on an ESP32-C5 in the same thread.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tortfeaser tortfeaser closed this Sep 21, 2026
@tortfeaser

Copy link
Copy Markdown
Author

Sorry, I opened this against the wrong branch.

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.