Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301047 - media-sound/madplay-0.15.2b-r1 may monopolize ALSA sound devices
Summary: media-sound/madplay-0.15.2b-r1 may monopolize ALSA sound devices
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Sound Team
Depends on:
Reported: 2010-01-15 02:37 UTC by Phil Stracchino (Unix Ronin)
Modified: 2010-01-26 15:52 UTC (History)
0 users

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


Note You need to log in before you can comment on or make changes to this bug.
Description Phil Stracchino (Unix Ronin) 2010-01-15 02:37:07 UTC
I have two almost identically configured machines here both running 10.0/desktop profile on AthlonXP processors.  Both are configured with ALSA sound using the in-kernel drivers in Linux 2.6.32-gentoo-r1.  The laptop has an ALi M5451 sound chipset, the desktop has Crystal Media CM8738.  Both have media-sound/alsa-tools-1.0.20-r1 and media-sound/alsa-utils-1.0.20-r5.  On the laptop, with the ALi M5451 chipset, madplay shares the sound device properly with a default ALSA configuration.  On the desktop, with the CM8738 chipset, madplay monopolizes the ALSA sound device even if ALSA is configured to use dmix.  Simultaneous play with madplay and another source is possible on the CM8738 machine only by using media-sound/esound and building madplay with esd support.

Reproducible: Always

Steps to Reproduce:
I don't know whether the problem can be reproduced at all on different hardware.  But here's an example ofthe problem:
1. Start an mp3 playing with madplay
2. Start a .wav file playing with aplay

Actual Results:  
On the laptop (M5451), aplay works and the .wav file plays.
On the desktop (CM8738), aplay fails and reports:
ALSA lib pcm_dmix.c:1008:(snd_pcm_dmix_open) unable to open slave
aplay: main:608: audio open error: Device or resource busy

This is in spite of the desktop being configured with dmix in an attempt to work around the problem.

Expected Results:  
the .wav should play on both machines.

Portage (default/linux/x86/10.0/desktop, gcc-4.3.4, glibc-2.11-r1, 2.6.32-gentoo-r1 i686)
System uname: Linux-2.6.32-gentoo-r1-i686-AMD_Athlon-TM-_XP_2400+-with-gentoo-1.12.13
Timestamp of tree: Thu, 14 Jan 2010 06:45:01 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.9-r2
dev-lang/python:     2.6.4, 3.1.1-r1
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2, 1.11.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.27-r2
CFLAGS="-O2 -march=athlon-xp -mtune=athlon-xp -mfpmath=sse -pipe"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=athlon-xp -mtune=athlon-xp -mfpmath=sse -pipe"
FEATURES="distcc distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="                                                 "
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="3dnow 3dnowext X a52 aac acl acpi aim alsa apm audacious audiofile bash-completion berkdb bidi branding bzip2 cairo cdda cddb cdparanoia cdr cdrom cli consolekit cracklib crypt cups curl cxx dbus dirac dri dts dvd dvdr emboss encode esd evo exif ffmpeg firefox flac fltk fortran gadu gcj gd gdbm gif gpg gpm grub gstreamer gtk gtk2-perl hal iconv id3tag imagemagick ipv6 ithreads jabber java jfs jpeg jpeg2k kde ldap libnotify live loop-aes mad matroska md5sum mikmod mmx mmxext mng modules mp3 mp4 mpeg mudflap mysql ncurses netpbm nls nptl nptlonly nsplugin offensive ogg ogg123 opengl openmp pam pcre pdf perl pidgin png ppds pppd python qt3 qt3support qt4 quicktime readline reflection schroedinger sdl sdl-image session silc skins sox speex spell spl sql sse ssh ssl startup-notification stream svg sysfs t1lib tcpd tga theora threads thunar tiff tk tools truetype twolame unicode usb utils v4l v4l2 vlm vorbis win32codecs x264 x86 xanim xface xfs xft xml xorg xorgmodule xpm xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="mga vesa vga"
Comment 1 Rafał Mużyło 2010-01-15 23:40:26 UTC
While rather unrelated, I think following
procedure similar to one described here:

may give some useful input for this bug.
Comment 2 Phil Stracchino (Unix Ronin) 2010-01-16 04:13:51 UTC
I don't at this moment remember what the exact problem was, but I could not get madplay and pulseaudio to play nicely on this sound hardware.  That pretty much precludes this method of diagnosis.  If I remember rightly, madplay and PA were fighting over the device; if madplay was playing, PA couldn't start, while if PA was running, madplay couldn't play.  (madplay does not have pulseaudio support.)  The only way I managed to get madplay working non-exclusively on ALSA on this sound hardware was to run esound AND pulseaudio, and rebuild madplay with esd support, but that combination was horribly unstable - esound would stop responding about every 20 to 30 minutes.  I'd switch to mpg123, except that madplay sounds so much better, and mpg123 falls over when the system is heavily loaded.