Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1cc2a85
feat: Unified Ethernet interface with settings manager and web UI
craigmillard86 Feb 12, 2026
11d6c49
Add player state and refactor inter task communication
luar123 Feb 15, 2026
d736928
Merge branch 'develop' of https://github.com/CarlosDerSeher/snapclien…
craigmillard86 Feb 19, 2026
ac46f3f
Merge luar123/player_state + fix 4 critical issues
craigmillard86 Feb 20, 2026
25fc8c2
Fix: Restore required includes in snapcast_protocol_parser.c
craigmillard86 Feb 20, 2026
3706883
Revert README.md to match luar123/player_state version
craigmillard86 Feb 20, 2026
62842df
Remove local Claude Code config file from commits
craigmillard86 Feb 20, 2026
ebf7a14
Add .claude to .gitignore to exclude local IDE config
craigmillard86 Feb 20, 2026
bb97646
Revert .gitignore to match luar123/player_state
craigmillard86 Feb 20, 2026
dfe124a
maximize partitions
luar123 Feb 20, 2026
2074ba9
Fix dead lock in deinit_player. Refactor callbacks and check for NULL
luar123 Feb 20, 2026
6d01fd1
Merge luar123/player_state latest update - Fix deadlock in deinit_player
craigmillard86 Feb 21, 2026
5836146
Unified Ethernet/WiFi MAC, player state fixes, and boot-time improvem…
craigmillard86 Feb 24, 2026
3d5841f
Fix correctness bugs from code review and Copilot findings
craigmillard86 Feb 25, 2026
81b97a7
Merge branch 'develop' into player_state
luar123 Feb 28, 2026
d4923a9
Keep volume in settings struct
luar123 Feb 28, 2026
4d4f250
Merge remote-tracking branch 'upstream/develop' into player_state
luar123 Feb 28, 2026
61a54a7
Move log message so it does not spam the logs when paused
luar123 Feb 28, 2026
029bf60
fix
luar123 Feb 28, 2026
b3c9532
Set CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
luar123 Feb 28, 2026
b6daa59
fix state cb
luar123 Mar 1, 2026
00dcd40
Merge remote-tracking branch 'upstream/develop' into player_state
luar123 Mar 3, 2026
db77bee
fix
luar123 Mar 3, 2026
4a9335d
Merge remote-tracking branch 'upstream/develop' into player_state
luar123 Mar 11, 2026
cf4f984
Apply volume/mute only while playing
luar123 Mar 29, 2026
5ec9a48
Use snapcast state instead of player state
luar123 Mar 28, 2026
4915458
Add i2s lock
luar123 Mar 29, 2026
a274fa1
Refactor handling of scSettings object
luar123 Mar 30, 2026
9805edd
Merge luar123/player_state (a274fa1) - command-based state machine
craigmillard86 Apr 3, 2026
5170a17
Fix build break and correctness issues from code review
craigmillard86 Apr 3, 2026
5c19771
Replace reconnect polling with sc_restart_snapcast() commands
craigmillard86 Apr 3, 2026
c4250e8
Resolve luar123 review comments on reconnect polling PR
craigmillard86 Apr 7, 2026
f840181
Fix audio not restarting after network reconnection
craigmillard86 Apr 8, 2026
f138c63
Fix Ethernet reconnection: restart DHCP and clean up IPv6 on disconnect
craigmillard86 Apr 8, 2026
86dad5d
Merge upstream/develop: PR #203 (snapcast state refactor), #218, #219…
craigmillard86 May 26, 2026
2842a65
Revert reset_connection_state helper and hoisted statics
craigmillard86 May 26, 2026
9afbedd
Address Copilot review comments on PR #225
craigmillard86 May 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions components/lightsnapcast/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,17 @@ int init_player(i2s_std_gpio_config_t pin_config0_, i2s_port_t i2sNum_, void (*s

// create message queue to inform task of changed settings
snapcastSettingQueueHandle = xQueueCreate(1, sizeof(playerSetting_t));
if (snapcastSettingQueueHandle == NULL) {
ESP_LOGE(TAG, "Failed to create snapcast settings queue");
return -1;
}

if (playerStateMux == NULL) {
playerStateMux = xSemaphoreCreateMutex();
xSemaphoreGive(playerStateMux);
}


// create semaphore for time diff buffer to server
if (latencyBufSemaphoreHandle == NULL) {
latencyBufSemaphoreHandle = xSemaphoreCreateMutex();
Expand Down Expand Up @@ -593,6 +598,15 @@ int start_player() {
entries -= ((i2sDmaBufMaxLen * i2sDmaBufCnt) / scSet->chkInFrames);

pcmChkQHdl = xQueueCreate(entries, sizeof(pcm_chunk_message_t *));
if (pcmChkQHdl == NULL) {
ESP_LOGE(TAG, "Failed to create pcm chunk queue (%d entries)", entries);
tg0_timer_deinit();
#if CONFIG_PM_ENABLE
esp_pm_lock_release(player_pm_lock_handle);
#endif
playerStarted = false;
return -1;
}

ESP_LOGI(TAG, "created new queue with %d", entries);
}
Expand Down Expand Up @@ -1544,10 +1558,16 @@ static void player_task(void *pvParameters) {
// so we can save a little RAM here
entries -= (i2sDmaBufMaxLen * i2sDmaBufCnt) / __scSet.chkInFrames;

QueueHandle_t newQHdl = xQueueCreate(entries, sizeof(pcm_chunk_message_t *));
if (newQHdl == NULL) {
// Don't overwrite pcmChkQHdl with NULL — surrounding code (and other
// tasks) would then dereference a NULL handle. Abort the player task
// here, same pattern as the player_setup_i2s failure above.
ESP_LOGE(TAG, "Failed to create pcm chunk queue (%d entries); aborting player task", entries);
return;
}
queueCreatedWithChkInFrames = __scSet.chkInFrames;

pcmChkQHdl = xQueueCreate(entries, sizeof(pcm_chunk_message_t *));

pcmChkQHdl = newQHdl;
ESP_LOGI(TAG, "created new queue with %d", entries);
}

Expand Down
2 changes: 1 addition & 1 deletion components/lightsnapcast/snapcast_protocol_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ parser_return_state_t parse_codec_header_message(
if (!read_data(parser, (uint8_t *)codecString, sizeof(codecString)-1)) return PARSER_RESTART_CONNECTION;

codecString[sizeof(codecString)-1] = 0; // null terminate
ESP_LOGE(TAG, "Codec : %s... not supported", codecString);
ESP_LOGE(TAG, "Codec : %s... not supported (length: %lu)", codecString, codecStringLen);
ESP_LOGI(TAG,
"Change encoder codec to "
"opus, flac or pcm in "
Expand Down
19 changes: 17 additions & 2 deletions components/network_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
idf_component_register(SRCS "network_interface.c" "eth_interface.c" "wifi_interface.c"
set(SRCS "network_interface.c" "wifi_interface.c")

# Only include Ethernet interface if Ethernet is enabled
if(CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET OR CONFIG_SNAPCLIENT_USE_SPI_ETHERNET)
list(APPEND SRCS "eth_interface.c")
endif()

set(PRIV_DEPS driver esp_wifi esp_eth esp_netif esp_timer nvs_flash improv_wifi settings_manager lwip)

# ping is only needed when Ethernet is enabled (used by eth_interface.c)
if(CONFIG_SNAPCLIENT_USE_INTERNAL_ETHERNET OR CONFIG_SNAPCLIENT_USE_SPI_ETHERNET)
list(APPEND PRIV_DEPS ping)
endif()

idf_component_register(SRCS ${SRCS}
INCLUDE_DIRS "include"
PRIV_REQUIRES driver esp_wifi esp_eth esp_netif esp_timer nvs_flash improv_wifi)
PRIV_INCLUDE_DIRS "priv_include"
PRIV_REQUIRES ${PRIV_DEPS})
Loading
Loading