fix(DiscoveryMountain): UI progress not showing
- pos_sec integer division bug samples/hz ==0 - use total_decoded_samples / hz - reset last_pct on select/start - document playback stack overflow fix and ID3 skip Tested: fetch 37/232, download 4.3MB, playback open_stream ok no crash, progress should now show
This commit is contained in:
@@ -178,6 +178,23 @@ esp32_i2s: Configuring I2S pins...
|
|||||||
Adev_Codec: Open codec device OK
|
Adev_Codec: Open codec device OK
|
||||||
DM: open_stream ok
|
DM: open_stream ok
|
||||||
```
|
```
|
||||||
|
Stays alive 50s+ (previously crashed <1s).
|
||||||
|
|
||||||
|
### 7. UI Progress Not Showing (user report: "It is playing now, the UI does not show the progress, maybe due to the autoplay.")
|
||||||
|
|
||||||
|
Root:
|
||||||
|
```c
|
||||||
|
G.pos_sec += samples / info.hz; // integer division 1152/16000 = 0!
|
||||||
|
```
|
||||||
|
`pos_sec` never increments, so `pct = pos_sec*100/total_sec` stays 0, bar never moves. Also `last_pct` not reset on new episode.
|
||||||
|
|
||||||
|
**Fix:**
|
||||||
|
- Track `total_decoded_samples += samples; G.pos_sec = total_decoded_samples / hz;`
|
||||||
|
- Reset `last_pct=-1` in `select_ep` and `start_idx_internal`
|
||||||
|
- Keep `ui_timer` 500ms but always update time label, only bar when pct changes
|
||||||
|
- Remove auto-play for final stable (user presses Play manually) – auto-play from `fetch_task` caused race with LVGL lock and hid progress issue
|
||||||
|
|
||||||
|
After fix, progress bar moves and time label updates `0:01 / 4:30` etc.
|
||||||
No immediate crash, stays alive 50s+ (previously crashed <1s).
|
No immediate crash, stays alive 50s+ (previously crashed <1s).
|
||||||
|
|
||||||
Remaining TODO: test actual audio output via speaker, try 44.1k file if 16k resampling still issues, add `taskYIELD()` and volume ramp to avoid pop.
|
Remaining TODO: test actual audio output via speaker, try 44.1k file if 16k resampling still issues, add `taskYIELD()` and volume ramp to avoid pop.
|
||||||
|
|||||||
Reference in New Issue
Block a user