Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 99590 - media-libs/sdl-mixer-1.2.6 with mikmod tries to use music.raw in $PWD
Summary: media-libs/sdl-mixer-1.2.6 with mikmod tries to use music.raw in $PWD
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Games
: 99004 101615 108164 114203 (view as bug list)
Depends on:
Reported: 2005-07-19 16:12 UTC by NightTwix
Modified: 2009-11-20 22:36 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---

Output of "emerge pygame -epv" (pyerror,8.37 KB, text/plain)
2005-07-23 16:32 UTC, NightTwix
sdl-mixer-1.2.6_libmikmod-register-only-drv_nos.patch (sdl-mixer-1.2.6_libmikmod-register-only-drv_nos.patch,337 bytes, patch)
2005-10-06 06:41 UTC, TGL
Details | Diff
gweled-0.7-no_disk_writer.patch (gweled-0.7-no_disk_writer.patch,635 bytes, patch)
2005-12-02 17:39 UTC, TGL
Details | Diff
libmikmod-cvs20051203-RegisterSomeDrivers.patch (libmikmod-cvs20051203-RegisterSomeDrivers.patch,2.73 KB, patch)
2005-12-03 05:55 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description NightTwix 2005-07-19 16:12:50 UTC
i.e. you cant start games-arcade/pydance-1.0.3 with media-libs/sdl-mixer-1.2.6
you get an error "pygame.error: mixer system not initialized" as user.
even if user is in games and audio groups. 
if you start the game as root it works fine.

Downgrading to media-libs/sdl-mixer-1.2.5-r1 fixes(workarounds?) the problem.

On the forums i found other people having similar problems with 1.2.6

Reproducible: Always
Steps to Reproduce:
1. emerge sdl-mixer pydance
2. start pydance as user

# emerge info
Portage (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.5-
r0, 2.6.12-gentoo-r4fnord i686)
System uname: 2.6.12-gentoo-r4fnord i686 AMD Athlon(tm) XP 3000+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.10
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:, 2.6.11-r2
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/
share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /
usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/
defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
FEATURES="autoconfig distlocks sandbox sfperms strict"
USE="3dnow 3dnowext 7zip X aalib acl acpi alsa apache2 apm arts audiofile avi 
bash-completion berkdb bidi bitmap-fonts bzlib cairo cdr crypt curl dga directfb 
divx4linux dlloader elf emboss encode esd ethereal fam fbcon flac font-server 
foomaticdb fortran ftp gbdm gdbm geoip gif glitz glut gnome gpm gstreamer gtk 
gtk2 gtkhtml guile hal imagemagick imlib jpeg jpeg2k kde libg++ libwww lua lzo 
mad maildir mikmod mime mmx mmxext motif mozilla mp3 mpeg mppe-mppc mysql 
ncurses network nls noamazon nocd nptl nvidia ode offensive ogg oggvorbis opengl 
oss pam pcre pdflib perl php png prelude python qt quicktime readline real rtc 
ruby samba sasl sdl slang smux snmp sockets speex spell sse sse2 ssl stream svga 
tcltk tcpd tga tiff toolbar truetype truetype-fonts type1-fonts unicode usb vcd 
vhosts videos visualisation vlm vorbis win32codecs wmf x86 xine xml xml2 xmms 
xrandr xv xvid xvmc zlib userland_GNU kernel_linux elibc_glibc"
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2005-07-19 16:29:58 UTC
works fine here as user.

Can I see the output from "emerge -evp pydance" please?
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2005-07-19 16:31:10 UTC
oh, and remerge pygame and see if that helps.
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2005-07-22 14:52:35 UTC
reopen after doing those things.
Comment 4 NightTwix 2005-07-23 16:32:25 UTC
Created attachment 64165 [details]
Output of "emerge pygame -epv"
Comment 5 NightTwix 2005-07-23 16:35:16 UTC
I've attached the output of "emerge pydance -epv" 
remerging pydance didn't solve it

I still get the same error when i use sdl-mixer-1.2.6
Comment 6 Mr. Bones. (RETIRED) gentoo-dev 2005-07-23 17:18:27 UTC
works fine here with 1.2.6.  it's something specific to your system.
Comment 7 NightTwix 2005-07-23 17:44:52 UTC
(In reply to comment #6)
> works fine here with 1.2.6.  it's something specific to your system.

Maybe it's the nvidia nforce2 chipset? It's an onboard soundcard...
Well, other applications/games work even with 1.2.6
Comment 8 Mr. Bones. (RETIRED) gentoo-dev 2005-07-23 18:26:02 UTC
try doing:

emerge --newuse -v world
Comment 9 NightTwix 2005-08-02 05:08:38 UTC
the problem is the 'mikmod' useflag resulting in a permissions problem


Comment 10 SpanKY gentoo-dev 2005-08-02 21:34:02 UTC
need to research why this happens and how to fix it ... do we need to patch
packages or libraries or what ...
Comment 11 SpanKY gentoo-dev 2005-08-02 21:34:06 UTC
*** Bug 99004 has been marked as a duplicate of this bug. ***
Comment 12 SpanKY gentoo-dev 2005-08-07 17:27:37 UTC
*** Bug 101615 has been marked as a duplicate of this bug. ***
Comment 13 Mr. Bones. (RETIRED) gentoo-dev 2005-10-05 07:50:10 UTC
*** Bug 108164 has been marked as a duplicate of this bug. ***
Comment 14 TGL 2005-10-06 06:40:50 UTC
Imho, the problem with "music.raw" is that SDL_mixer calls
"RegisterAllDrivers()" on libmikmod, which makes a whole bunch of useless sound
drivers to initialize (including the RAW output one, hence the music.raw file).
 When using the internal mikmod code (the one included in SDL_mixer tarball),
there is no such issue because it's a stripped down version which don't have all
this drivers.  But it seems that's not an option to go back to using this code
(see sdl-mixer/ChangeLog - bug #51852). 

Anyway, since SDL_mixer won't actually use this output drivers (it has its own
sound output code using SDL), I suggest this call is changed to
"RegisterDriver(&drv_nos)" (see attached patch).  The "drv_nos" is a dummy
driver which won't access any device or file, and is enough for SDL_mixer needs
(ie., decoding some mod files).

I've tested my patch with sdl-mixer-1.2.6 and games-arcade/ceferino without
issue.  If you know other games which use some mod music file through
SDL_mixer+libmikmod, please tell me so that i can test them too.
Comment 15 TGL 2005-10-06 06:41:44 UTC
Created attachment 69982 [details, diff]
Comment 16 TGL 2005-10-06 07:31:25 UTC
Patched sdl-mixer-1.2.6 now successfully tested (music plays fine and no
music.raw is created) with the following games, which were all the ones i had
with some *.{mod,xm,it} files in CONTENTS and rdepending on sdl-mixer:
Comment 17 TGL 2005-10-06 07:36:54 UTC
Oh, and games-puzzle/enigma-0.92 too, which uses a .s3m music file.
Comment 18 SpanKY gentoo-dev 2005-10-10 08:02:28 UTC
seems upstream cvs sdl-mixer has already done the same

fixed in 1.2.6-r1, thanks for the patch
Comment 19 Mr. Bones. (RETIRED) gentoo-dev 2005-12-01 16:28:37 UTC
*** Bug 114203 has been marked as a duplicate of this bug. ***
Comment 20 Craig Duquette 2005-12-02 16:34:36 UTC
I'm still having issues with gweled creating the music.raw. I don't have
sdl-mixer install on my system, so I'm not sure if my bug is related to this one.
Comment 21 TGL 2005-12-02 17:38:45 UTC
I can reproduce your issue with gweled if I unload my alsa modules
(`/etc/init.d/alsasound stop`). It's actually much worst than the sdl-mixer bug,
because the file is really written to (500MB after a few minutes...), whereas
with sdl-mixer it was just created but 0-sized. If a supported sound driver like
Alsa is available, then i get real sound and no "music.raw" file.

I will attach a patch which changes the way gweled registers libmikmod sound
drivers. Like in the sdl-mixer patch, it's a matter of avoiding
MikMod_RegisterAllDrivers(). I've only kept "esd", "alsa", "oss" and "nos" (as a
fallback). Maybe more should be added (complete list is in /usr/include/mikmod.h
or `info mikmod`), i'm not sure how useful some can be under Gentoo. Note that
it doesn't seem to be a problem to register some drivers which are actually not
supported by libmikmod because of USE flags (I have USE=-esd for instance).

Oh, and if you don't get reaction on this bug (would be understandable since
it's marked FIXED), maybe you could reopen bug #108164 (being its owner) and
attach this patch there.
Comment 22 TGL 2005-12-02 17:39:27 UTC
Created attachment 73965 [details, diff]
Comment 23 TGL 2005-12-03 05:55:34 UTC
Created attachment 73982 [details, diff]

Here is a small patch for libmikmod which adds a
"MikMod_RegisterSomeDrivers(int)" function to the API, to ease registering of
"only available and useful drivers". For instance, in the case of Gweled, which
should play sounds only through a daemon or an HW driver, the
"MikMod_RegisterAllDrivers()" call could have been replaced by:

// only register drivers we can hear:
// fallback to nosound:

That would have been cleaner than my previous patch which enumerates all
drivers one by one, probably missing some valuable ones and including some
which are not supported.

Do you think that's something worth sending upstream?
Comment 24 SpanKY gentoo-dev 2005-12-29 00:29:16 UTC
the libmikmod patch i think is worthy to pursue upstream, the gweled one is not