Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 20, 2025

This PR fixes a race condition where AutoPlaylist would disable itself when AutoChange applied presets, interpreting them as manual user changes.

Problem

When both AutoPlaylist and AutoChange are enabled, AutoPlaylist would sometimes disable itself with the message:

AutoPlaylist: disable due to manual change of playlist from 2 to -1, preset:5

This occurred because:

  1. AutoPlaylist detects sound and applies the music playlist using applyPreset(id, CALL_MODE_NOTIFICATION)
  2. AutoChange then applies a different preset using applyPreset(newpreset) without specifying a call mode
  3. The different call modes cause AutoPlaylist to detect the AutoChange action as a "manual" change
  4. AutoPlaylist disables itself to avoid interfering with what it thinks is user input

Solution

The fix ensures both AutoPlaylist and AutoChange use the same call mode by changing:

applyPreset(newpreset);

to:

applyPreset(newpreset, CALL_MODE_NOTIFICATION);

This makes both systems use CALL_MODE_NOTIFICATION, ensuring consistency and preventing AutoPlaylist from misinterpreting AutoChange actions as manual interventions.

Testing

  • Web UI builds successfully without errors
  • Change is minimal and surgical (single parameter addition)
  • Maintains consistency with existing changePlaylist() behavior

Fixes #256.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.registry.nm1.platformio.org
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/pio run --list-targets (dns block)
  • api.registry.platformio.org
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/pio run --list-targets (dns block)
  • collector.platformio.org
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/pio run --list-targets (dns block)
  • wled00
    • Triggering command: node tools/cdata.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Auto Playlist is being disabled by autochange when switching from ambient to music playlist Fix AutoPlaylist race condition with AutoChange preset applications Sep 20, 2025
@Copilot Copilot AI requested a review from netmindz September 20, 2025 11:41
Copilot finished work on behalf of netmindz September 20, 2025 11:41
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.

Auto Playlist is being disabled by autochange when switching from ambient to music playlist

2 participants