We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 568 - Native MIDI freezes.
Summary: Native MIDI freezes.
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: 1.2.8
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-15 08:46 UTC by Lukasz Pawelczyk
Modified: 2011-12-31 11:01 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukasz Pawelczyk 2008-03-15 08:46:58 UTC
When using SDL_mixer compiled with native midi support it freezes software that uses it. The only two examples I know that can use it this way are: dxx-rebirth and doomsday. I suspect its a bug in SDL_mixer cause both play fine when using timidity backend.

I'm using Audigy 2 ZS on alsa 1.0.14 with OSS emulation. Have no other problems with Native midi support on my system (both, by using alsa-synth and /dev/sequencer). Playmidi (which code I think is used in SDL_mixer) plays fine as well.
Comment 1 Lukasz Pawelczyk 2008-03-16 17:52:46 UTC
I didn't try to fix it, but I wrote alternative sequncer support for SDL-mixer based on alsa-seq. The code needs some cleanups but it already works very well. Would you be interested in its inclusion to SDL-mixer? I also got several questions about internal sdl-mixer functions behaviour. Error handling etc so this would fully follow sdl-mixer policy. Where could I ask them?
Comment 2 Sam Lantinga 2009-10-03 02:58:01 UTC
Sure, I'd love to get a patch for ALSA native midi.  You can ask the questions here, or send e-mail to the SDL mailing list.

Thanks!
Comment 3 Lukasz Pawelczyk 2009-10-03 04:35:12 UTC
Wow, that was a long time ago :-)

Ok, I'll try to get this patch out of attic, dust it off a little and see what can be done with it.

This patch is based on aplaymidi code which is GPL based but I had permission from it's author back then to relicense it to LGPL if it's going to be included in SDL_mixer.
Comment 4 Lukasz Pawelczyk 2009-10-27 07:57:33 UTC
Small update.

I've been working ont his code for the past few days. In general it is very close to be ready (finished lots of things that were left in my TODO 1.5 year ago). The only thing I'm still working on is gracefully stopping of ALSA events. I had some thread race previously that could crash ALSA on some occasions. I've managed to eliminate it but still as I look at that code there is very very rare case that could cause it to crash (although it didn't happen for me in practice).

Anyway I hope this will be ready soon.
Comment 5 manuel.montezelo 2011-12-28 09:49:56 UTC
Debian bug reports [1] and [2] seem related with this problem:

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498984
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=298982
Comment 6 Sam Lantinga 2011-12-31 11:01:35 UTC
I've removed the native MIDI code from SDL_mixer, since it was GPL and the new licensing is zlib.

Lukasz, if you have that ALSA patch ready, please submit a new bug with it attached and let me know! :)