Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 99590

Summary: media-libs/sdl-mixer-1.2.6 with mikmod tries to use music.raw in $PWD
Product: Gentoo Linux Reporter: NightTwix <nighttwix>
Component: [OLD] GamesAssignee: Gentoo Games <games>
Status: RESOLVED FIXED    
Severity: normal CC: arc, cduquette, denilsonsa, flash3001, only_bugzilla_automail.era.ssokolow, tom.gl, world.root
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Output of "emerge pygame -epv"
sdl-mixer-1.2.6_libmikmod-register-only-drv_nos.patch
gweled-0.7-no_disk_writer.patch
libmikmod-cvs20051203-RegisterSomeDrivers.patch

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
3.




# emerge info
Portage 2.0.51.22-r2 (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/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.8.1-r1, 2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
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"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.linux.ee/pub/gentoo/distfiles/"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
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"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, 
PORTDIR_OVERLAY
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
revdep-rebuild
Comment 9 NightTwix 2005-08-02 05:08:38 UTC
the problem is the 'mikmod' useflag resulting in a permissions problem

see: http://bugs.gentoo.org/show_bug.cgi?id=99004

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]
sdl-mixer-1.2.6_libmikmod-register-only-drv_nos.patch
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:
games-arcade/supertux-0.1.3
games-action/glaxium-0.5
games-arcade/ceferino-0.96
games-arcade/frozen-bubble-1.0.0-r5
games-arcade/criticalmass-0.9.12
games-fps/cube-20050829
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]
gweled-0.7-no_disk_writer.patch
Comment 23 TGL 2005-12-03 05:55:34 UTC
Created attachment 73982 [details, diff]
libmikmod-cvs20051203-RegisterSomeDrivers.patch

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:
MikMod_RegisterSomeDrivers(DRIVERS_SET_NETWORK | DRIVERS_SET_HARDWARE);
// fallback to nosound:
MikMod_RegisterDriver(&drv_nos);

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