Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 90425 - media-libs/sdl-mixer-1.2.6 uses mikmod incorrectly
Summary: media-libs/sdl-mixer-1.2.6 uses mikmod incorrectly
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-25 13:27 UTC by Tyler Montbriand
Modified: 2005-04-26 08:36 UTC (History)
0 users

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


Attachments
sdl-mixer mikmod patch (SDL_mixer_mikmod.patch,339 bytes, patch)
2005-04-25 13:29 UTC, Tyler Montbriand
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Montbriand 2005-04-25 13:27:26 UTC
sdl-mixer's internal mikmod library has only SDL and nosound backends, but when
it links to an external libmikmod, it could include many backends like oss, etc.
Ergo when SDL tells libmikmod to initialize, it can potentially do something
silly -- initialize lots of it's own internal audio backends when SDL won't use
anything but mikmod's nosound output.

Usually this is just a waste of resources;  when SDL's using OSS output on the default device, the sound device will be opened twice before everything goes
on it's merry way.  But if mikmod happens to open a busy audio device, it will
hang until it's kill -9'ed.  This tends to rear it's head when SDL is being
instructed to use a specific audio device and mikmod tries a different one.

I've fixed this bug and sent the patch upstream.  I'll also attach it here,
since it might be a while until the next release of SDL_mixer.

Reproducible: Always
Steps to Reproduce:
(requires two sound devices, in this case /dev/sound/dsp's my cheap onboard
  sound and /dev/sound/dsp1's my REAL soundcard)

1.  Park artsd on /dev/sound/dsp
2.  export AUDIODEV="/dev/sound/dsp1"
3.  strace blobwars
Actual Results:  
The program will open TWO audio devices then hang -- opening /dev/sound/dsp
*after* SDL *succeeds* in opening /dev/sound/dsp1!  This is because mikmod is
attempting to initialize it's OSS audio backend for no good reason.

Expected Results:  
sdl-mixer does not need anything other than mikmod's nosound output driver.  It
shouldn't initialize all the mikmod audio backends, just the one it needs.

Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3-20050110,
glibc-2.3.4.20041102-r0, 2.6.5 x86_64)
=================================================================
System uname: 2.6.5 x86_64 AMD Opteron(tm) Processor 242
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.2.3-r5,dev-lang/python-2.3.4 [2.3.4 (#1,
Jun 29 2004, 09:40:45)]
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.2.3-r5, 2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CFLAGS="-O2 -m64 -mmmx -momit-leaf-frame-pointer -fomit-frame-pointer -pipe
-ffast-math -fmerge-all-constants"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown
/usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -m64 -mmmx -momit-leaf-frame-pointer -fomit-frame-pointer -pipe
-ffast-math -fmerge-all-constants"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox strict"
GENTOO_MIRRORS="http://mirrors.tds.net/gentoo ftp://mirrors.tds.net/gentoo
ftp://ftp.ndlug.nd.edu/pub/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/var/backup"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X aalib acpi alsa arts berkdb bitmap-fonts cdr crypt cups curl dga
dvd esd fam flac font-server foomaticdb fortran gdbm ggi gif gpm gtk guile
imagemagick imlib innodb ipv6 java jp2 jpeg kde libwww lzw lzw-tiff mad mikmod
motif mp3 mysql ncurses nls nptl ogg opengl oss pam pdflib perl png ppds python
qt readline sandbox scanner sdl slang speex ssl tcltk tcpd tiff truetype
truetype-fonts
type1-fonts usb userlocales vorbis xml xml2 xmms xpm xrandr xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Tyler Montbriand 2005-04-25 13:29:13 UTC
Created attachment 57218 [details, diff]
sdl-mixer mikmod patch

Applies to SDL_mixer-1.2.6.  Causes sdl-mixer to only initialize the "nosound"
backend when linked to an external mikmod library.
Comment 2 SpanKY gentoo-dev 2005-04-26 08:36:24 UTC
this change needs to be made upstream before we add it to our local ebuilds

i'd suggest you start up a thread on the libsdl lists and once it's been integrated upstream, come back and yell at us for not accepting it earlier ;)