Skip to content

Commit

Permalink
Fix false-positive error (Audio playback timeout)
Browse files Browse the repository at this point in the history
  • Loading branch information
tueddy committed Dec 12, 2023
1 parent 2234bca commit efc66af
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## DEV-branch

* 12.12.2023: Long press behaviour, execute cmd directly after longpress-time (#279), thanks to @Joe91 !
* 12.12.2023: Fix false-positive error (Audio playback timeout)
* 10.12.2023: Distribute vTaskDelay() in main loop to avoid rare audio dropouts
* 10.12.2023: Fix wrong states on PE output pins (and SD-card failure on restart) #278, thanks to @36b6fp6s !
* 09.12.2023: Fix webstream playlist abort when track fails (#276), thanks to @laszloh !
Expand Down
18 changes: 12 additions & 6 deletions src/AudioPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,13 +840,19 @@ void AudioPlayer_Task(void *parameter) {
}

// If error occured: move to the next track in the playlist
if (gPlayProperties.playMode != NO_PLAYLIST && gPlayProperties.playMode != BUSY && !audio->isRunning() && !gPlayProperties.pausePlay) {
if ((millis() - playbackTimeoutStart) > playbackTimeout) {
// Audio playback timed out, move on to the next
System_IndicateError();
gPlayProperties.trackFinished = true;
playbackTimeoutStart = millis();
if (gPlayProperties.playMode != NO_PLAYLIST && gPlayProperties.playMode != BUSY) {
// we check for timeout
if (!audio->isRunning() && !gPlayProperties.pausePlay) {
if ((millis() - playbackTimeoutStart) > playbackTimeout) {
// Audio playback timed out, move on to the next
System_IndicateError();
gPlayProperties.trackFinished = true;
playbackTimeoutStart = millis();
}
}
} else {
// we are idle, update timeout so that we do not get a spurious error when launching into a playlist
playbackTimeoutStart = millis();
}
if ((System_GetOperationMode() == OPMODE_BLUETOOTH_SOURCE) && audio->isRunning()) {
// do not delay here, audio task is time critical in BT-Source mode
Expand Down
2 changes: 1 addition & 1 deletion src/revision.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once

#include "gitrevision.h"
constexpr const char softwareRevision[] = "Software-revision: 20231210-1-DEV";
constexpr const char softwareRevision[] = "Software-revision: 20231212-1-DEV";

0 comments on commit efc66af

Please sign in to comment.