SDL_mixer mod playing test

Hello,
I have already signaled a problem about playing mods
with SDL_mixer some days ago. I have uploaded a test
program that compares output between SDL_Mixer and the
mikmod player on an example .mod . It’s linux only and
requires the mikmod player.

To run the test,
tar -zxvf testmod.tar.gz
cd testmod
make
./run_test.sh

Please get it at
http://lnx.tutore.org/tmp/testmod.tar.gz

and listen carefully. I hear a slight background
crackling noise when playing with SDL_Mixer, no such
noise when playing with mikmod.

The mod has low volumes, so you might need to increase
it on your speakers or whatever before the test.

Claudio___________________________________
Nuovo Yahoo! Messenger: E’ molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica
Scaricalo ora!
http://it.messenger.yahoo.it

Hello,
I have already signaled a problem about playing mods
with SDL_mixer some days ago. I have uploaded a test
program that compares output between SDL_Mixer and the
mikmod player on an example .mod . It’s linux only and
requires the mikmod player.

Can you do me a favor? Try uninstalling SDL_mixer and build this version
from code: http://www.libsdl.org/cvs/SDL_mixer-1.2.7.tar.gz

To configure it, please use the --disable-music-libmikmod flag.

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Can you do me a favor? Try uninstalling SDL_mixer
and build this version
from code:
http://www.libsdl.org/cvs/SDL_mixer-1.2.7.tar.gz

To configure it, please use the
–disable-music-libmikmod flag.

See ya!
-Sam Lantinga, Software Engineer, Blizzard
Entertainment

Tested using both
http://www.libsdl.org/cvs/SDL_mixer-1.2.7.tar.gz and
current cvs. The results are the same.

Here are the results:

  1. with --disable-music-libmikmod:

Now Mix_LoadMUS returns NULL for .mod files.

  1. without --disable-music-libmikmod:

Mix_OpenAudio never returns. Here’s the backtrace:

Breakpoint 3, open_music (mixer=0x40120788) at
music.c:398
398 if ( MikMod_Init() ) {
(gdb) s

Program received signal SIGINT, Interrupt.
0x400af93b in open () from /lib/libpthread.so.0
(gdb) bt
#0 0x400af93b in open () from /lib/libpthread.so.0
#1 0x405a8df8 in JCR_LIST () from
/usr/local/lib/libmikmod.so.3
#2 0xffffffc0 in ?? ()
#3 0x4056d4b6 in OSS_IsThere () from
/usr/local/lib/libmikmod.so.3
#4 0x4058b60e in _mm_init () from
/usr/local/lib/libmikmod.so.3
#5 0x4058a5f1 in MikMod_Init () from
/usr/local/lib/libmikmod.so.3
#6 0x400fb9c7 in open_music (mixer=0x40120788) at
music.c:398
#7 0x400f9020 in Mix_OpenAudio (frequency=44100,
format=32784, nchannels=2,
chunksize=1024) at mixer.c:299
#8 0x080488dc in main (argc=2, argv=0xbffff6f4) at
testmod.c:25
(gdb)

I’ll stick with 1.2.6 for the moment even though .mod
files play with some noise :slight_smile:

Claudio___________________________________
Nuovo Yahoo! Messenger: E’ molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica
Scaricalo ora!
http://it.messenger.yahoo.it

Sam,

I swear I didn’t affect the old code with the libmikmod patch.
I just reviewed the cvs diff to make sure…

it may be a newer version of libmikmod than 3.1.10…for when
he installs with libmikmod instead of the built-in mikmod.

but that doesn’t explain any noise from the included mikmod src.

it would be interesting to know what version of libmikmod he has.
I may have missed it in a previous email…

-LIM-

I ran the test with SDL_mixer from CVS with no problems. (comments below)

Can you do me a favor? Try uninstalling SDL_mixer
and build this version
from code:
http://www.libsdl.org/cvs/SDL_mixer-1.2.7.tar.gz

To configure it, please use the
–disable-music-libmikmod flag.

See ya!
-Sam Lantinga, Software Engineer, Blizzard
Entertainment

Tested using both
http://www.libsdl.org/cvs/SDL_mixer-1.2.7.tar.gz and
current cvs. The results are the same.

Here are the results:

  1. with --disable-music-libmikmod:

Now Mix_LoadMUS returns NULL for .mod files.

It sounds like the MOD support didn’t get built…

I think I had the wrong tarball on the server. Try this one:
http://www.libsdl.org/cvs/SDL_mixer-1.2.7.tar.gz
MD5 checksum: 4d5f276486751653bcb09f7e133ad497

Make sure that MUSIC_MOD is in the CFLAGS after configuring it.

  1. without --disable-music-libmikmod:

Mix_OpenAudio never returns. Here’s the backtrace:

Yuck, thanks. I’m disabling the libmikmod support by default.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Jonathan Atkins wrote:

it may be a newer version of libmikmod than
3.1.10…for when
he installs with libmikmod instead of the built-in
mikmod.

but that doesn’t explain any noise from the included
mikmod src.

it would be interesting to know what version of
libmikmod he has.

I have tried 3.1.10, 3.1.11a and 3.2.0b2.

Sam Lantinga wrote:

I ran the test with SDL_mixer from CVS with no
problems.

Thanks for running the test; of course here I have a
diff :slight_smile:
I can record the two outputs here so you can hear the
noise if it makes sense [I guess default==no].
I’ll try to dig into the code and try to figure out if
mikmod does something different.

  1. with --disable-music-libmikmod:

Now Mix_LoadMUS returns NULL for .mod files.

It sounds like the MOD support didn’t get built…

Make sure that MUSIC_MOD is in the CFLAGS after
configuring it.

Thanks (guess it’s MOD_MUSIC). There seems to be a
problem in the configure.in at least in 1.2.6 and in
1.2.7 since I had to specify --enable-music-mod
manually to get MOD_MUSIC defined (should fallback
gracefully I think).

I try to point it out for 1.2.7 (relevant extracts
from configure.in:102~) fwiw:

no_libmikmod=no
AC_ARG_ENABLE(music-libmikmod,
[helpstring],enable_music_libmikmod=no)

if test x$enable_music_libmikmod = xyes; then

ok, set no_libmikmod to yes/no based on test

fi

missing else? If enable_music_libmikmod==no then

no_libmikmod is not altered, so its value is still
’no’. Probably should be ‘yes’ instead.

AC_ARG_ENABLE(music-mod,
[helpstr],enable_music_mod=$no_libmikmod)

enable_music_mod default is set to $no_libmikmod, so

the problem arises

Claudio___________________________________
Nuovo Yahoo! Messenger: E’ molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica
Scaricalo ora!
http://it.messenger.yahoo.it

Thanks for running the test; of course here I have a
diff :slight_smile:
I can record the two outputs here so you can hear the
noise if it makes sense [I guess default==no].

No, I believe you. :slight_smile: I just don’t understand how we could be running the
same code and getting different aural results.

Thanks (guess it’s MOD_MUSIC). There seems to be a
problem in the configure.in at least in 1.2.6 and in
1.2.7 since I had to specify --enable-music-mod
manually to get MOD_MUSIC defined (should fallback
gracefully I think).

Whoops, please try the updated version to see if this is fixed:
http://www.libsdl.org/cvs/SDL_mixer-1.2.7.tar.gz

Out of curiousity, what audio driver is SDL using? Do other SDL apps
sound bad? How about other files?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam Lantinga wrote:

Whoops, please try the updated version to see if this
is fixed:
http://www.libsdl.org/cvs/SDL_mixer-1.2.7.tar.gz

Yes, it’s fixed.

Out of curiousity, what audio driver is SDL using?

OSS

Do other SDL apps sound bad?

I think they sound fine, but I think they are not
loading .mod files. Also if you don’t know how a music
should sound it’s hard to notice the problem.

How about other files?

If you mean other file types, they’re ok (I use .mp3
and .wav with SDL_mixer with np)

If you mean other .mods, the problem seems to be
always there, but there are some “frequencies” where
it’s much more recognizable.

I’ve played with soundtracker and built a tiny module
with a few notes, where the noise is audible on the
third note (a D EQU re).

I could not resist the temptation to rewrite the
output I get as .wav using SDL_AUDIODRIVER=file and
-draw for mikmod and using sox.

You can get the module, the new test and the audio I
get at

http://lnx.tutore.org/tmp/testmod.tar.gz (2526820
bytes)

or

http://lnx.tutore.org/tmp/testmod.tar.bz2 (1529921
bytes)

I had this thought, could it be that some high
frequencies trigger a problem with signed/unsigned
16bit integer? I ask because the sound I hear is
something like a very very high frequency. Sorry,
probably crazy idea.

Claudio___________________________________
Nuovo Yahoo! Messenger: E’ molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica
Scaricalo ora!
http://it.messenger.yahoo.it