Files
koboldcpp/otherarch
askmyteapot f9c02610b3 Multi-thread MP3 - Ace-Step (#2233)
* Experimental Multi-thread MP3

I used Deepseek V4 Flash to come up with a method of making the MP3 conversion with Ace-step multi-threaded.

I built and tested. Resulting MP3 doesnt have any glitches and generates almost instantly (compared to dozens of seconds previously)

* Implement WBRUNA suggestion

Updated as suggested

* further tidyup

Both issues fixed:

fprintf removed from encode_chunk (line 651) — it now just returns "" silently on failure. Error reporting moved to call sites:
Single-threaded (line 689-692): checks mp3_data.empty() and logs once
Multi-threaded (line 722-742): uses std::atomic<int> init_failures{0}, each thread does fetch_add(1) on failure, then after join a single fprintf reports the count. No interleaved output.
No leftover encode call outside threads — all chunks are encoded inside threads (lines 724-732). No results[0] = encode_chunk(...) exists between splitting and joining.

* Overlap by 1 frame

Overlapping by 1 frame from the previous chunk and discarding appears to have resolved the audible boundary glitch.

* Improve multi-threading logic in audio encoding

Refactor thread count calculation and chunk partitioning logic for audio encoding.

---------

Co-authored-by: LostRuins Concedo <39025047+LostRuins@users.noreply.github.com>
2026-05-26 21:36:22 +08:00
..
2026-05-23 09:46:11 +08:00
2026-04-30 17:28:11 +08:00
2026-03-05 12:32:31 +08:00
2026-01-23 14:09:46 +08:00
2026-05-26 21:36:22 +08:00