diff options
author | jylefort <jylefort@FreeBSD.org> | 2005-11-24 14:49:56 +0800 |
---|---|---|
committer | jylefort <jylefort@FreeBSD.org> | 2005-11-24 14:49:56 +0800 |
commit | de71cf8e887df430a25542561eb815f5452c7226 (patch) | |
tree | aa63ad460649b5aa24619c8e8e048aea627b2a29 /audio | |
parent | 80935b40ee15108df7d9917398310897ca021f03 (diff) | |
download | freebsd-ports-graphics-de71cf8e887df430a25542561eb815f5452c7226.tar.gz freebsd-ports-graphics-de71cf8e887df430a25542561eb815f5452c7226.tar.zst freebsd-ports-graphics-de71cf8e887df430a25542561eb815f5452c7226.zip |
- Fix OSS support:
OpenAL uses a buffer size of 1024 bytes, which is too small on
some systems and/or with some applications, causing heavy drops in
the audio output. I solve the problem by using the value returned
by SNDCTL_DSP_GETBLKSIZE rather than 1024.
- Add options for enabling aRts, esd, SDL, vorbis and smpeg support
- Enable capture
- Fix info file handling (install in post-install, and do not use
install-info since bsd.port.mk takes care of it)
PR: ports/88728
Submitted by: jylefort
Approved by: maintainer timeout (15 days)
Diffstat (limited to 'audio')
-rw-r--r-- | audio/openal/Makefile | 54 | ||||
-rw-r--r-- | audio/openal/files/patch-src_arch_bsd_bsd__dsp.c | 58 |
2 files changed, 107 insertions, 5 deletions
diff --git a/audio/openal/Makefile b/audio/openal/Makefile index f3d7f75e836..a2c4fb2706e 100644 --- a/audio/openal/Makefile +++ b/audio/openal/Makefile @@ -7,6 +7,7 @@ PORTNAME= openal PORTVERSION= 20050401 +PORTREVISION= 1 CATEGORIES= audio MASTER_SITES= http://math.missouristate.edu/~erik/files/fbsd/\ http://www.smluc.org/~erik/files/fbsd/ @@ -19,16 +20,59 @@ INFO= openal WRKSRC= ${WRKDIR}/${DISTNAME}/linux GNU_CONFIGURE= yes CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL} +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib" +CONFIGURE_ARGS= --enable-capture USE_GMAKE= yes USE_GNOME= pkgconfig +WANT_SDL= yes INSTALLS_SHLIB= yes USE_REINPLACE= yes +OPTIONS= ARTS "aRts backend" off \ + ESD "esd backend" off \ + SDL "SDL backend" off \ + VORBIS "vorbis support" off \ + SMPEG "smpeg support" off + +.include <bsd.port.pre.mk> + +.if defined(WITH_SMPEG) +WITH_SDL= yes # smpeg requires SDL +.endif + +.if defined(WITH_ARTS) +LIB_DEPENDS+= artsc.0:${PORTSDIR}/audio/arts +CONFIGURE_ARGS+=--enable-arts +.endif + +.if defined(WITH_ESD) +USE_GNOME+= esound +CONFIGURE_ARGS+=--enable-esd +.endif + +.if defined(WITH_SDL) +USE_SDL+= sdl +CONFIGURE_ENV+= HAVESDL="${SDL_CONFIG}" +CONFIGURE_ARGS+=--enable-sdl +.endif + +.if defined(WITH_VORBIS) +LIB_DEPENDS+= vorbisfile.4:${PORTSDIR}/audio/libvorbis +CONFIGURE_ARGS+=--enable-vorbis +.endif + +.if defined(WITH_SMPEG) +LIB_DEPENDS+= smpeg.1:${PORTSDIR}/multimedia/smpeg +CONFIGURE_ARGS+=--enable-smpeg +.endif + post-patch: - @${REINPLACE_CMD} -e "s/-pthread/${PTHREAD_LIBS}/" ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's/-pthread/${PTHREAD_LIBS}/; \ + /CPPFLAGS=/ d' ${WRKSRC}/configure + @${REINPLACE_CMD} -e '/#include/ s|SDL/||' \ + ${WRKSRC}/src/extensions/al_ext_mp3.c -pre-install: - @${INSTALL_DATA} ${WRKSRC}/doc/openal.info ${PREFIX}/info - @install-info ${PREFIX}/info/openal.info ${PREFIX}/info/dir +post-install: + ${INSTALL_DATA} ${WRKSRC}/doc/openal.info ${PREFIX}/info -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/audio/openal/files/patch-src_arch_bsd_bsd__dsp.c b/audio/openal/files/patch-src_arch_bsd_bsd__dsp.c new file mode 100644 index 00000000000..ce94d0ee810 --- /dev/null +++ b/audio/openal/files/patch-src_arch_bsd_bsd__dsp.c @@ -0,0 +1,58 @@ +--- src/arch/bsd/bsd_dsp.c.orig Wed Nov 9 13:15:27 2005 ++++ src/arch/bsd/bsd_dsp.c Wed Nov 9 14:09:12 2005 +@@ -113,7 +113,6 @@ + */ + void *grab_write_native(void) { + const char *dsppath = "/dev/dsp"; +- int divisor = _alSpot(_AL_DEF_BUFSIZ) | (2<<16); + + dsp_fd = open(dsppath, O_WRONLY | O_NONBLOCK); + +@@ -126,10 +125,6 @@ + perror("fcntl"); + } + +- if(ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &divisor) < 0) { +- perror("ioctl SETFRAGMENT"); +- } +- + _alBlitBuffer = native_blitbuffer; + + FD_ZERO(&dsp_fd_set); +@@ -320,10 +315,11 @@ + } + + ALboolean set_write_native(UNUSED(void *handle), +- UNUSED(unsigned int *bufsiz), ++ unsigned int *bufsiz, + ALenum *fmt, + unsigned int *speed) { + ALuint channels = _al_ALCHANNELS(*fmt); ++ int divisor; + + if(dsp_fd < 0) { + return AL_FALSE; +@@ -365,6 +361,23 @@ + + + *fmt = BSD2ALFMT(*fmt, channels); ++ ++ if(ioctl(dsp_fd, SNDCTL_DSP_GETBLKSIZE, bufsiz) < 0) { ++#ifdef DEBUG_MAXIMUS ++ fprintf(stderr, "blksize %d\n", *bufsiz); ++ perror("get_devsp blksize ioctl"); ++#endif ++ return AL_FALSE; ++ } ++ ++ divisor = _alSpot(*bufsiz) | (2<<16); ++ if(ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &divisor) < 0) { ++#ifdef DEBUG_MAXIMUS ++ fprintf(stderr, "divisor %d\n", divisor); ++ perror("set_devsp fragment ioctl"); ++#endif ++ return AL_FALSE; ++ } + + return AL_TRUE; + } |