Attached patch fixes media-sound/sidplay-2.0.9 ALSA driver to use the ALSA 1.x API. Also, the patch adds --with-alsa switch for the configure script. Please apply.
Created attachment 63229 [details] sidplay-2.0.9 ALSA and configure patch
Created attachment 63230 [details] sidlplay-2.0.9-r1 ebuild
The patch file is 8KiB so it should probably be put somewhere in the net so that it doesn't bloat the portage tree.
I get the following error when emerging: Making all in alsa make[3]: Entering directory `/var/tmp/portage/sidplay-2.0.9-r1/work/sidplay-2.0. 9/src/audio/alsa' if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -march=athlon -mmmx -m3dnow -mno- sse -O2 -fmessage-length=0 -I../../../include -DHAVE_UNIX -DHAVE_UNIX -MT audiodrv.o -MD -MP -MF ".deps/audiodrv.Tpo" -c -o audiodrv.o audiodrv.cpp; \ then mv -f ".deps/audiodrv.Tpo" ".deps/audiodrv.Po"; else rm -f ".deps/audiodrv. Tpo"; exit 1; fi audiodrv.cpp: In member function `virtual void* Audio_ALSA::open(AudioConfig&, const char*)': audiodrv.cpp:162: error: jump to label `open_error' audiodrv.cpp:118: error: fr
I get the following error when emerging: Making all in alsa make[3]: Entering directory `/var/tmp/portage/sidplay-2.0.9-r1/work/sidplay-2.0. 9/src/audio/alsa' if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -march=athlon -mmmx -m3dnow -mno- sse -O2 -fmessage-length=0 -I../../../include -DHAVE_UNIX -DHAVE_UNIX -MT audiodrv.o -MD -MP -MF ".deps/audiodrv.Tpo" -c -o audiodrv.o audiodrv.cpp; \ then mv -f ".deps/audiodrv.Tpo" ".deps/audiodrv.Po"; else rm -f ".deps/audiodrv. Tpo"; exit 1; fi audiodrv.cpp: In member function `virtual void* Audio_ALSA::open(AudioConfig&, const char*)': audiodrv.cpp:162: error: jump to label `open_error' audiodrv.cpp:118: error: från här audiodrv.cpp:121: error: crosses initialization of `unsigned int rate' audiodrv.cpp:162: error: jump to label `open_error' audiodrv.cpp:113: error: från här audiodrv.cpp:121: error: crosses initialization of `unsigned int rate' audiodrv.cpp:162: error: jump to label `open_error' audiodrv.cpp:108: error: från här audiodrv.cpp:121: error: crosses initialization of `unsigned int rate' audiodrv.cpp:162: error: jump to label `open_error' audiodrv.cpp:93: error: från här audiodrv.cpp:121: error: crosses initialization of `unsigned int rate' audiodrv.cpp:162: error: jump to label `open_error' audiodrv.cpp:88: error: från här audiodrv.cpp:121: error: crosses initialization of `unsigned int rate' audiodrv.cpp:162: error: jump to label `open_error' audiodrv.cpp:83: error: från här audiodrv.cpp:121: error: crosses initialization of `unsigned int rate' audiodrv.cpp:162: error: jump to label `open_error' audiodrv.cpp:74: error: från här audiodrv.cpp:121: error: crosses initialization of `unsigned int rate' make[3]: *** [audiodrv.o] Fel 1 make[3]: Leaving directory `/var/tmp/portage/sidplay-2.0.9-r1/work/sidplay-2.0. 9/src/audio/alsa' Here is my emerge --info: Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.4, glibc-2.3.5-r1, 2.6. 12-gentoo-r9 i686) ================================================================= System uname: 2.6.12-gentoo-r9 i686 AMD Athlon(tm) processor Gentoo Base System version 1.12.0_pre6 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [disabled] dev-lang/python: 2.3.4-r1, 2.4.1-r1 sys-apps/sandbox: 1.2.1-r2 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-r2 sys-devel/libtool: 1.5.18 virtual/os-headers: 2.6.11 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon -mmmx -m3dnow -mno-sse -O2 -fmessage-length=0" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /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/lib/X11/xkb / usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-march=athlon -mmmx -m3dnow -mno-sse -O2 -fmessage-length=0" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig candy distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://ftp.du.se/pub/os/gentoo http://ds.thn.htu.se/linux/gentoo http://mirror.pudas.net/gentoo" LANG="sv_SE" LC_ALL="sv_SE" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowext X a52 aac aalib acpi alsa asm avi bash-completion bigger-fonts bitmap-fonts bmp bzip2 ccache cdparanoia cdr cpudetection custom- cflags dga divx4linux doc dpms dvd eds encode exif ftp gif gimpprint glibc- omitfp glut gpm gstreamer gtk gtk2 icq imagemagick jabber javascript joystick jpeg justify lzw maps mikmod mmx mmxext mng mp3 mpeg mpeg4 mplayer ncurses nethack nls noplugin nptl nptlonly nvidia ogg oggvorbis opengl pam pdflib perl png python quicktime readline real scanner sdl ssl svg symlink tcltk tetex threads tiff truetype truetype-fonts type1-fonts v4l v4l2 vorbis wmf xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LDFLAGS, LINGUAS, MAKEOPTS
Created attachment 67869 [details, diff] corrected version of the sidplay-2.0.9-r1 alsa fix This patch has moved a definition of a variable in method virtual void* Audio_ALSA::open(AudioConfig&, const char*) in src/audio/alsa/audiodrv.cpp towards the top of the method to avoid being undefined when a horde of gotos execute a couple of lines down in the source code. The previous patch didn't get that.
have these changes been sent upstream, too?
(In reply to comment #6) > have these changes been sent upstream, too? I'll notify the maintainer of sidplay2 (sidplay2@yahoo.com) about this.
testing now, thanks... pleasse use 'epatch', make sure the DEPENDs are updated, and use '|| die' to exit if there are problems.
Created attachment 70811 [details] sidplay-2.0.9-r1.ebuild When using your patch, I get the following compilation problem: if x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -O2 -pipe -fomit-frame-pointer -march=athlon64 -I../../../include -MT audiodrv.o -MD -MP -MF ".deps/audiodrv.Tpo" -c -o audiodrv.o audiodrv.cpp; \ then mv -f ".deps/audiodrv.Tpo" ".deps/audiodrv.Po"; else rm -f ".deps/audiodrv.Tpo"; exit 1; fi In file included from audiodrv.h:27, from audiodrv.cpp:34: ../../../include/config.h:35:5: #error Platform not supported! make[3]: *** [audiodrv.o] Error 1 make[3]: Leaving directory `/mnt/raid0/tmp/portage/sidplay-2.0.9-r1/work/sidplay-2.0.9/src/audio/alsa'
Sidplay2 Maintainer: Merged a patch for comment 4 upstream. As for comment 9 your compile line is incorrect. Upstream code shows: if g++ -DHAVE_CONFIG_H -g -O2 -I../../../include -DHAVE_UNIX -I/home/swhite/root/include -DHAVE_UNIX -I/home/swhite/root/include -MT audiodrv.o -MD -MP -MF ".deps/audiodrv.Tpo" -c -o audiodrv.o audiodrv.cpp; \ then mv -f ".deps/audiodrv.Tpo" ".deps/audiodrv.Po"; else rm -f ".deps/audiodrv.Tpo"; exit 1; fi NOTE the -DHAVE_UNIX thats missing in your build. It should automatically be picked up from (the already built) libsidplay2.pc, or hardcoded on the line if you decided to override the library auto-detection (see sidplay2.m4).
The pc file is installed right, and we get: # pkg-config libsidplay2 --cflags -DHAVE_UNIX Which means that it's not getting picked up right when we build. We're doing nothing special... just patching, rerunning auto*, then ./configure --with-alsa && make. I'll look into it further when I get a chance, but that probably won't be for a while...
Maybe I didn't write something quite correctly but works on Mandrake. The magic is done here in my_macros.m4 (line 316 rev 1.6): dnl Get cflags and ldflags seperatly my_cxxflags=`$PKG_CONFIG --define-variable=includedir=$my_includedir --cflags lib$1` my_ldflags=`$PKG_CONFIG --define-variable=libdir=$my_libdir --libs lib$1` eval ${my_uname}_CXXFLAGS=\"$my_cxxflags\" eval ${my_uname}_LDFLAGS=\"$my_ldflags\" my_name should be set to uppercase LIBSIDPLAY2 and the eval line means we should end up assigning the cflags to LIBSIDPLAY2_CFLAGS. In sidplay2.m4 (line 116 rev 1.7) we AC_SUBST the variables to they will appear in the final Makefile, and also in configure.ac (line 136 rev 1.8) we add to the compile line: CXXFLAGS="$CXXFLAGS -I\$(top_srcdir)/include \ \$(LIBSIDPLAY2_CXXFLAGS) \$(LIBSIDUTILS_CXXFLAGS)" A few echos around those areas should find out what is going on.
Was this submitted upstream (if sidplay still has an upstream)?
(In reply to comment #13) > Was this submitted upstream (if sidplay still has an upstream)? > Yes, but no stable has been released since it was committed into the repo at 2005-07-18: revision 1.8 date: 2005/07/18 19:46:43; author: s_a_white; state: Exp; lines: +107 -9 Switch from obsolete alsa interface (patch by shd). The repo is at :pserver:anonymous@sidplay2.cvs.sourceforge.net:/cvsroot/sidplay2 co sidplay. Maybe we could snapshot the latest CVS version and distribute that.. Who knows, it might work better :-)
Sidplay2 Maintainer: Has anyone looked at the configuration issue in this bug? Is it libsidplay, a Gentoo tool or user issue? Once thats signed off I'll make a release as I consider it important enough to wait for resolution on.
# Samuli Suominen <ssuominen@gentoo.org> (19 Jul 2009) # Doesn't compile wrt #272602. ALSA support broken wrt #98769. # No upstream. Masked for removal.
Does this really have to be removed? It compiles completely fine on my system, it's the only commandline-sidplayer i know and i am often using it. Is there any nongui-alternative that i can implement in scripts and that also shows songinformation?
Yeah the same for me too. Are there any alternatives? Please consider this before removing :(
Unmasked since I've applied a patch from another bug for building this. Closing as UPSTREAM -> Use alsa's oss support for playing.