[PERF] MP3 seeking gets progressively slower in long files with MiniAudio-backed decoder.
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- csharp
- Área
- performance
Línea de trabajo
Reproduce las mediciones de tiempo con el ejemplo de MP3 largo y con búsqueda, y luego sigue StreamDataProvider.Seek(...) a través de MiniAudioDecoder.Seek(...) hasta ma_decoder_seek_to_pcm_frame(...). Compara la ruta integrada de MiniAudio con FFMPEG si está disponible. Se considera terminado cuando las búsquedas posteriores ya no muestran la ralentización progresiva indicada, con mediciones que cubran las posiciones objetivo enumeradas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
1. Describe the Performance Issue
Seeking within long MP3 files appears to become progressively slower as the target position gets later in the file when using SoundFlow's built-in MiniAudio MP3 decoder path. I have not verified whether the issue exists when using the FFMPEG module.
2. Area of the Library Affected
The suspected culprit is:
SoundFlow’s built-in MiniAudio-backed MP3 decoder seek path, specifically:
StreamDataProvider.Seek(...)
→ MiniAudioDecoder.Seek(...)
→ ma_decoder_seek_to_pcm_frame(...)
3. Scenario Causing Slowness
Seeking within long MP3 files appears to become progressively slower as the target position gets later in the file when using SoundFlow's built-in MiniAudio MP3 decoder path.
In my app, Auzi, playback is using SoundFlow 1.4.1. Auzi delegates seeking directly to SoundFlow, and the slowdown appears to happen inside the MiniAudio decoder seek call rather than in the app's own playback layer.
4. Expected Performance
Seeking to an arbitrary position in a long MP3 should be roughly bounded and should not scale linearly with the target timestamp, at least when the input stream is seekable.
5. Actual Performance
For a long MP3 file, seeks near the beginning complete quickly, but seeks later in the file take much longer.
Example timings from the same file:
| Target position | Seek time |
|---|---|
| 00:00:30 | 21 ms |
| 00:10:00 | 391 ms |
| 00:30:00 | 809 ms |
| 01:00:00 | 1210 ms |
| 02:00:00 | 2421 ms |
This makes timeline scrubbing feel increasingly delayed on long MP3s.
6. Minimal Reproducible Example (MRE) (Highly Recommended)
A minimal repro should be possible with a long seekable MP3 file:
using System.Diagnostics;
using SoundFlow.Backends.MiniAudio;
using SoundFlow.Providers;
using SoundFlow.Structs;
using var engine = new MiniAudioEngine();
using var stream = File.OpenRead(args[0]);
using var provider = new StreamDataProvider(engine, AudioFormat.DvdHq, stream);
var formatInfo =
provider.FormatInfo
?? throw new InvalidOperationException(
"Stream data provider did not report audio format information."
);
foreach (var seconds in new[] { 30, 600, 1800, 3600, 7200 })
{
var sampleOffset = checked(seconds * provider.SampleRate * formatInfo.ChannelCount);
var sw = Stopwatch.StartNew();
provider.Seek(sampleOffset);
sw.Stop();
Console.WriteLine($"{TimeSpan.FromSeconds(seconds)}: {sw.ElapsedMilliseconds} ms");
}
7. Profiling Data (if available)
SoundFlow Version
1.4.1
.NET Version
.NET 10
Operating System
Windows 11, macOS Tahoe, Ubuntu 25.10
Architecture
Windows and Ubuntu (x64), macOS (ARM64)
Audio Backend Used (if known)
MiniAudioEngine usage varies by OS.
Specific Audio Hardware (if relevant)
No response
Audio Buffer Size / Sample Rate
No response
9. Additional Context
No response
Requirements Checklist
- I have searched the existing issues to ensure this performance issue has not already been reported.
- I have provided a clear description of the issue and the scenario.
- I have included performance metrics if possible.
- I have considered providing an MRE.
- I have completed the environment information.
- Lenguaje dominante
- C#
- Estrellas
- 520
- Forks
- 56
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de LSXPrime/SoundFlow
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
[BUG] WebRtcApmModifier: AEC silently does nothing - far-end (reverse) stream is never fed to APMAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Todos los issues de LSXPrime/SoundFlow
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
nightscout/nocturne#2135 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Devolutions/UniGetUI#5541 ·
Los mantenedores suelen responder en 1 día
-
[aw] PR Iteration Agent 🔧 failedAbiertoagentic-workflows Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
[誤判定]Abiertolinux アプリ: ブラウザー 再現済み 要トリアージ 誤判定
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
yksr-melt/Meltype#853 · 2 comentarios ·
Los mantenedores suelen responder en 1 día