Skip to content

Commit

Permalink
fix: Adjust VS1053 task priority and stream buffer size
Browse files Browse the repository at this point in the history
    Increased task priority for VS1053's track_feed to 10, matching the priority of i2sFeed.
    Increased the stream buffer size for VS1053_TRACK to 4098 * 32.
  • Loading branch information
tobiasguyer committed Nov 7, 2024
1 parent 3c14707 commit d620c1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion targets/esp32/components/VS1053/src/VS1053.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ esp_err_t VS1053_SINK::init(spi_host_device_t SPI,
load_user_code(PLUGIN, PLUGIN_SIZE);
#endif
vTaskDelay(100 / portTICK_PERIOD_MS);
xTaskCreate(vs_feed, "track_feed", 4098 * 4, (void*)this, 1, &task_handle);
xTaskCreate(vs_feed, "track_feed", 4098 * 4, (void*)this, 10, &task_handle);
//xTaskCreatePinnedToCore(vs_feed, "track_feed", 1028 * 20, (void*)this, 1, &task_handle, 1);
return ESP_OK;
}
Expand Down
4 changes: 2 additions & 2 deletions targets/esp32/main/VSPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ VSPlayer::VSPlayer(std::shared_ptr<cspot::DeviceStateHandler> handler,
[this](uint8_t* data, size_t bytes, size_t trackId,
bool STORAGE_VOLATILE) {
if (!this->track) {
this->track = std::make_shared<VS1053_TRACK>(trackId, 4098 * 16);
this->track = std::make_shared<VS1053_TRACK>(trackId, 4098 * 32);
this->vsSink->new_track(this->track);
BELL_LOG(error, "VSPlayer", "New track_id (%d)", trackId);
}
if (trackId != this->track->track_id) {
this->vsSink->soft_stop_feed();
this->track = std::make_shared<VS1053_TRACK>(trackId, 4098 * 16);
this->track = std::make_shared<VS1053_TRACK>(trackId, 4098 * 32);
this->vsSink->new_track(this->track);
BELL_LOG(error, "VSPlayer", "New track_id (%d)", trackId);
}
Expand Down

0 comments on commit d620c1a

Please sign in to comment.