| Summary: | Infinite loop playing short/invalid midi with timidity | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | Ralph Versteegen <teeemcee> |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 2.0.4 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | A zero-length MIDI file | ||
I forgot to say: I stepped through music_pcm_getaudio with gdb and saw that in the following loop len = 8192, volume = MIX_MAX_VOLUME but consumed = 0.
while (len > 0 && !done) {
int consumed = GetSome(context, dst, len, &done);
if (consumed < 0) {
break;
}
if (volume == MIX_MAX_VOLUME) {
dst += consumed;
} else {
SDL_MixAudioFormat(snd, dst, music_spec.format, (Uint32)consumed, volume);
snd += consumed;
}
len -= consumed;
}
Also forgot: repro steps: play with "playmus -l GURGU.mid", then try to quit with Ctrl-C. It won't. |
Created attachment 4730 [details] A zero-length MIDI file When playing the attached MIDI file using SDL_mixer's Timidity backend the "SDLAudioP2" thread gets stuck in an infinite loop in music_pcm_getaudio and the program will freeze when calling Mix_LockAudio Happens on both x86 and x86_64 Linux (presumably OS-independent). Present in latest SDL_mixer hg rev, 2.0.3 and 2.0.4. (gdb) bt #0 0xf7f3b8e8 in __lll_lock_wait () from /lib/libpthread.so.0 #1 0xf7f32459 in pthread_mutex_lock () from /lib/libpthread.so.0 #2 0xf7e5dccf in ?? () from /usr/lib/libSDL2-2.0.so.0 #3 0xf7d85636 in ?? () from /usr/lib/libSDL2-2.0.so.0 #4 0xf7d52812 in Mix_LockAudio () from /usr/lib/libSDL2_mixer-2.0.so.0 #5 0xf7d539c5 in Mix_FreeMusic () from /usr/lib/libSDL2_mixer-2.0.so.0 (gdb) bt #0 0xf7d5adf3 in Timidity_Start () from /usr/lib/libSDL2_mixer-2.0.so.0 #1 0xf7d57ad0 in TIMIDITY_GetSome () from /usr/lib/libSDL2_mixer-2.0.so.0 #2 0xf7d52d9a in music_pcm_getaudio () from /usr/lib/libSDL2_mixer-2.0.so.0 #3 0xf7d5799c in TIMIDITY_GetAudio () from /usr/lib/libSDL2_mixer-2.0.so.0 #4 0xf7d52ee8 in music_mixer () from /usr/lib/libSDL2_mixer-2.0.so.0 #5 0xf7d50ffa in mix_channels () from /usr/lib/libSDL2_mixer-2.0.so.0 #6 0xf7d844f6 in ?? () from /usr/lib/libSDL2-2.0.so.0 #7 0xf7de861b in ?? () from /usr/lib/libSDL2-2.0.so.0 #8 0xf7e5d54b in ?? () from /usr/lib/libSDL2-2.0.so.0 #9 0xf7f2f517 in start_thread () from /lib/libpthread.so.0 #10 0xf77bd146 in clone () from /lib/libc.so.6 There's likely something wrong with the file. Timidity plays a single note, ADLMIDI plays nothing.