Date: Wed, 9 Jan 2002 00:37:37 -0800 (PST) From: John Merryweather Cooper <john_m_cooper@yahoo.com> To: FreeBSD-gnats-submit@freebsd.org Cc: lioux@freebsd.org Subject: ports/33722: [PATCH] Fix xsidplay /dev/sound/dsp bug and takeover Message-ID: <20020109083737.5D0BC15503@johncoop.MSHOME>
next in thread | raw e-mail | index | archive | help
>Number: 33722 >Category: ports >Synopsis: [PATCH] Fix xsidplay /dev/sound/dsp bug and takeover >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jan 09 00:40:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: John Merryweather Cooper >Release: FreeBSD 4.5-PRERELEASE i386 >Organization: >Environment: System: FreeBSD johncoop.MSHOME 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #46: Tue Jan 8 01:42:55 PST 2002 jmcoopr@johncoop.MSHOME:/usr/obj/usr/src/sys/JOHNCOOP i386 >Description: audio/xsidplay has a bug that reveals itself under certain circumstances when another program has just obtained/released /dev/dsp. xsidplay will attempt to fall back to /dev/sound/dsp, but this device does not exist on FreeBSD causing numerous problems. Also, I believe an X program belongs in the X PREFIX, and an audio program with sample audio files is much more fun to play with. I'll takeover as maintainer. >How-To-Repeat: Play a sound on X with some other program (a GNOME sound event will do), and then immediately start xsidplay from a window and attempt to play a sample file. If you're lucky, you'll get an error message about not being able to open /dev/sound/dsp--which does not exist on FreeBSD. If you're not lucky, you may crash. >Fix: Summary of changes: # 'xsidplay.new/Makefile' | 0 # 'xsidplay.new/files/patch-src::audio::AudioDriver.cpp' | 0 # 'xsidplay.new/files/patch-src::audio::linux::AudioDriver.cpp' | 0 # 'xsidplay.new/pkg-plist' | 0 # ./Makefile | 17 ++++--- # ./files/patch-src::audio::AudioDriver.cpp | 13 +++++ # ./files/patch-src::audio::linux::AudioDriver.cpp | 13 +++++ # ./pkg-plist | 23 ++++++++++ # 8 files changed, 60 insertions(+), 6 deletions(-) The patch: # This is a patch for xsidplay to update it to xsidplay.new # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # If you have a decent Bourne-type shell: # STEP 2: Run the shell with this file as input. # If you don't have such a shell, you may need to manually create # the files as shown below. # STEP 3: Run the 'patch' program with this file as input. # # These are the commands needed to create/delete files/directories: # touch 'files/patch-src::audio::AudioDriver.cpp' chmod 0644 'files/patch-src::audio::AudioDriver.cpp' touch 'files/patch-src::audio::linux::AudioDriver.cpp' chmod 0644 'files/patch-src::audio::linux::AudioDriver.cpp' # # This command terminates the shell and need not be executed manually. exit # #### End of Preamble #### #### Patch data follows #### diff -u 'xsidplay/Makefile' 'xsidplay.new/Makefile' Index: ./Makefile --- ./Makefile Tue Dec 25 02:51:12 2001 +++ ./Makefile Tue Jan 8 23:29:19 2002 @@ -2,20 +2,22 @@ # Date created: 28 November 1999 # Whom: Anders Nordby <anders@fix.no> # -# $FreeBSD: ports/audio/xsidplay/Makefile,v 1.17 2001/12/24 10:37:43 dirk Exp $ +# $FreeBSD$ # PORTNAME= xsidplay PORTVERSION= 1.6.4.3 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= audio emulators MASTER_SITES= http://www.geocities.com/SiliconValley/Lakes/5147/sidplay/packages/ EXTRACT_SUFX= .tgz -MAINTAINER= ports@FreeBSD.org +MAINTAINER= jmcoopr@webmail.bmi.net LIB_DEPENDS= sidplay.1:${PORTSDIR}/audio/libsidplay +USE_X_PREFIX= yes USE_QT_VER= 2 USE_GMAKE= yes GNU_CONFIGURE= yes @@ -39,12 +41,15 @@ @${PERL} -pi -e 's|/usr/share|${PREFIX}|g' ${WRKSRC}/xsidplay.1 do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/src/xsidplay ${PREFIX}/bin - ${INSTALL_MAN} ${WRKSRC}/xsidplay.1 ${MANPREFIX}/man/man1 + @${INSTALL_PROGRAM} ${WRKSRC}/src/xsidplay ${PREFIX}/bin + @${INSTALL_DATA} ${WRKSRC}/xsidplay.xpm ${PREFIX}/share/pixmaps + @${INSTALL_MAN} ${WRKSRC}/xsidplay.1 ${MANPREFIX}/man/man1 .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/*.faq ${DOCSDIR} + @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} + @${INSTALL_DATA} ${WRKSRC}/*.faq ${DOCSDIR} + @${MKDIR} ${EXAMPLESDIR} + @${INSTALL_DATA} ${WRKSRC}/example-sidtunes/*.sid ${EXAMPLESDIR} .endif .include <bsd.port.post.mk> diff -u /dev/null 'xsidplay.new/files/patch-src::audio::AudioDriver.cpp' Index: ./files/patch-src::audio::AudioDriver.cpp --- ./files/patch-src::audio::AudioDriver.cpp Wed Dec 31 16:00:00 1969 +++ ./files/patch-src::audio::AudioDriver.cpp Tue Jan 8 21:53:26 2002 @@ -0,0 +1,33 @@ +--- src/audio/AudioDriver.cpp Thu Nov 29 19:15:31 2001 ++++ src/audio/AudioDriver.cpp.new Tue Jan 8 21:52:35 2002 +@@ -43,11 +43,28 @@ + #include "AudioDriver.h" + + #if defined(HAVE_NETBSD) +-const char *AudioDriver::AUDIODEVICE[] = { "/dev/audio" }; +-#else ++const char *AudioDriver::AUDIODEVICE[] = { "/dev/audio", "" }; ++#elif defined(HAVE_FREEBSD) ++const char *AudioDriver::AUDIODEVICE[] = { ++ "/dev/dsp", ++ "/dev/audio", ++ "/dev/dsp0", ++ "/dev/audio0", ++ "/dev/dsp0.0", ++ "/dev/dsp0.1", ++ "/dev/dsp0.2", ++ "/dev/dsp0.3", ++ "/dev/audio0.0", ++ "/dev/audio0.1", ++ "/dev/audio0.2", ++ "/dev/audio0.3", ++ "" ++}; ++#elif defined(HAVE_LINUX) + const char *AudioDriver::AUDIODEVICE[] = { + "/dev/dsp", + "/dev/sound/dsp", ++ "" + }; + #endif + diff -u /dev/null 'xsidplay.new/files/patch-src::audio::linux::AudioDriver.cpp' Index: ./files/patch-src::audio::linux::AudioDriver.cpp --- ./files/patch-src::audio::linux::AudioDriver.cpp Wed Dec 31 16:00:00 1969 +++ ./files/patch-src::audio::linux::AudioDriver.cpp Tue Jan 8 22:11:52 2002 @@ -0,0 +1,33 @@ +--- src/audio/linux/AudioDriver.cpp Thu Nov 29 19:15:31 2001 ++++ src/audio/linux/AudioDriver.cpp.new Tue Jan 8 21:52:35 2002 +@@ -43,11 +43,28 @@ + #include "AudioDriver.h" + + #if defined(HAVE_NETBSD) +-const char *AudioDriver::AUDIODEVICE[] = { "/dev/audio" }; +-#else ++const char *AudioDriver::AUDIODEVICE[] = { "/dev/audio", "" }; ++#elif defined(HAVE_FREEBSD) ++const char *AudioDriver::AUDIODEVICE[] = { ++ "/dev/dsp", ++ "/dev/audio", ++ "/dev/dsp0", ++ "/dev/audio0", ++ "/dev/dsp0.0", ++ "/dev/dsp0.1", ++ "/dev/dsp0.2", ++ "/dev/dsp0.3", ++ "/dev/audio0.0", ++ "/dev/audio0.1", ++ "/dev/audio0.2", ++ "/dev/audio0.3", ++ "" ++}; ++#elif defined(HAVE_LINUX) + const char *AudioDriver::AUDIODEVICE[] = { + "/dev/dsp", + "/dev/sound/dsp", ++ "" + }; + #endif + diff -u 'xsidplay/pkg-plist' 'xsidplay.new/pkg-plist' Index: ./pkg-plist --- ./pkg-plist Sun Dec 2 11:27:50 2001 +++ ./pkg-plist Tue Jan 8 23:27:49 2002 @@ -1,5 +1,28 @@ bin/xsidplay +share/pixmaps/xsidplay.xpm %%PORTDOCS%%share/doc/xsidplay/README %%PORTDOCS%%share/doc/xsidplay/STIL.faq %%PORTDOCS%%share/doc/xsidplay/hv_sids.faq +%%PORTDOCS%%share/examples/xsidplay/Baby_Of_Can_Guru.sid +%%PORTDOCS%%share/examples/xsidplay/C-demo_tune.sid +%%PORTDOCS%%share/examples/xsidplay/Compleeto.sid +%%PORTDOCS%%share/examples/xsidplay/Connect_4.sid +%%PORTDOCS%%share/examples/xsidplay/Dignified.sid +%%PORTDOCS%%share/examples/xsidplay/G_I_Hero.sid +%%PORTDOCS%%share/examples/xsidplay/Galway-tune.sid +%%PORTDOCS%%share/examples/xsidplay/Game_On_Issue_11_89.sid +%%PORTDOCS%%share/examples/xsidplay/Lightforce.sid +%%PORTDOCS%%share/examples/xsidplay/Martinism.sid +%%PORTDOCS%%share/examples/xsidplay/Metropolis.sid +%%PORTDOCS%%share/examples/xsidplay/Microwave.sid +%%PORTDOCS%%share/examples/xsidplay/PayDay-Ingame_tune.sid +%%PORTDOCS%%share/examples/xsidplay/Platou.sid +%%PORTDOCS%%share/examples/xsidplay/Rage_03.sid +%%PORTDOCS%%share/examples/xsidplay/Rambo_First_Blood_Part_II.sid +%%PORTDOCS%%share/examples/xsidplay/SYS4096.sid +%%PORTDOCS%%share/examples/xsidplay/Startrash.sid +%%PORTDOCS%%share/examples/xsidplay/Sweet.sid +%%PORTDOCS%%share/examples/xsidplay/Think_Now.sid +%%PORTDOCS%%share/examples/xsidplay/Zybernix.sid %%PORTDOCS%%@dirrm share/doc/xsidplay +%%PORTDOCS%%@dirrm share/examples/xsidplay #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Wed Jan 9 00:27:52 2002 # Generated by : makepatch 2.00 # Recurse directories : Yes # p 'Makefile' 1258 1010561359 0100644 # c 'files/patch-src::audio::AudioDriver.cpp' 0 1010555606 0100644 # c 'files/patch-src::audio::linux::AudioDriver.cpp' 0 1010556712 0100644 # p 'pkg-plist' 172 1010561269 0100644 #### End of ApplyPatch data #### #### End of Patch kit [created: Wed Jan 9 00:27:52 2002] #### #### Checksum: 204 6971 24828 #### >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020109083737.5D0BC15503>