From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Aug 13 06:20:21 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A2F7316A4DE for ; Sun, 13 Aug 2006 06:20:21 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 206A643D45 for ; Sun, 13 Aug 2006 06:20:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k7D6KI7v005005 for ; Sun, 13 Aug 2006 06:20:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k7D6KIKN004989; Sun, 13 Aug 2006 06:20:18 GMT (envelope-from gnats) Resent-Date: Sun, 13 Aug 2006 06:20:18 GMT Resent-Message-Id: <200608130620.k7D6KIKN004989@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jean-Yves Lefort Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED0A716A4DF for ; Sun, 13 Aug 2006 06:18:48 +0000 (UTC) (envelope-from jylefort@brutele.be) Received: from mirapoint5.brutele.be (mirapoint5.brutele.be [212.68.199.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id B016743D46 for ; Sun, 13 Aug 2006 06:18:47 +0000 (GMT) (envelope-from jylefort@brutele.be) Received: from host-212-68-244-243.brutele.be (host-212-68-244-243.brutele.be [212.68.244.243]) by mirapoint5.brutele.be (MOS 3.7.5-GA) with ESMTP id ELO09311; Sun, 13 Aug 2006 08:18:42 +0200 (CEST) Received: from jsite.lefort.net (jsite.lefort.net [192.168.1.2]) by gateway.lefort.net (Postfix) with ESMTP id A6C335531; Sun, 13 Aug 2006 08:18:41 +0200 (CEST) Received: by jsite.lefort.net (Postfix, from userid 1000) id DAD5AC0ED; Sun, 13 Aug 2006 08:18:40 +0200 (CEST) Message-Id: <20060813061840.DAD5AC0ED@jsite.lefort.net> Date: Sun, 13 Aug 2006 08:18:40 +0200 (CEST) From: Jean-Yves Lefort To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: erik@smluc.org Subject: ports/101960: Update port: audio/openal (customizable audio buffer size) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jean-Yves Lefort List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 06:20:21 -0000 >Number: 101960 >Category: ports >Synopsis: Update port: audio/openal (customizable audio buffer size) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sun Aug 13 06:20:18 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Jean-Yves Lefort >Release: FreeBSD 6.1-RELEASE i386 >Organization: >Environment: System: FreeBSD jsite.lefort.net 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Tue May 9 22:34:08 CEST 2006 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386 >Description: - Allow to customize the audio buffer size (see pkg-message for the point). - Take maintainership. >How-To-Repeat: >Fix: diff -ruN /usr/ports/audio/openal/Makefile openal/Makefile --- /usr/ports/audio/openal/Makefile Wed Jul 5 19:54:22 2006 +++ openal/Makefile Sun Aug 13 08:07:04 2006 @@ -7,12 +7,12 @@ PORTNAME= openal PORTVERSION= 20060211 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= audio MASTER_SITES= http://openal.org/openal_webstf/downloads/ DISTVERSION= 0.0.8 -MAINTAINER= erik@smluc.org +MAINTAINER= jylefort@FreeBSD.org COMMENT= A 3D positional spatialized sound library GNU_CONFIGURE= yes @@ -87,5 +87,8 @@ s|Libs: |&${PTHREAD_LIBS} |;\ s|Cflags: |&${PTHREAD_CFLAGS} |' \ ${WRKSRC}/admin/pkgconfig/openal.pc.in + +post-install: + @${CAT} ${PKGMESSAGE} .include diff -ruN /usr/ports/audio/openal/files/patch-src-backends-alc_backend_bsd.c openal/files/patch-src-backends-alc_backend_bsd.c --- /usr/ports/audio/openal/files/patch-src-backends-alc_backend_bsd.c Sun Apr 23 21:46:44 2006 +++ openal/files/patch-src-backends-alc_backend_bsd.c Sun Aug 13 07:59:51 2006 @@ -1,5 +1,5 @@ ---- src/backends/alc_backend_bsd.c.orig Sat Apr 22 12:25:15 2006 -+++ src/backends/alc_backend_bsd.c Sat Apr 22 12:26:15 2006 +--- src/backends/alc_backend_bsd.c.orig Thu Jan 5 16:11:20 2006 ++++ src/backends/alc_backend_bsd.c Sun Aug 13 07:39:16 2006 @@ -9,7 +9,10 @@ */ #include "al_siteconfig.h" @@ -11,49 +11,55 @@ #include #include #include -@@ -113,7 +114,6 @@ +@@ -113,7 +116,6 @@ */ static void *grab_write_native(void) { - const char *dsppath = "/dev/dsp"; + const char *dsppath = "/dev/dsp"; - int divisor = _alSpot(_AL_DEF_BUFSIZ) | (2<<16); - - dsp_fd = open(dsppath, O_WRONLY | O_NONBLOCK); - -@@ -126,10 +126,6 @@ - perror("fcntl"); - } - + + dsp_fd = open(dsppath, O_WRONLY | O_NONBLOCK); + +@@ -126,10 +128,6 @@ + perror("fcntl"); + } + - if(ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &divisor) < 0) { - perror("ioctl SETFRAGMENT"); - } - - FD_ZERO(&dsp_fd_set); - FD_SET(dsp_fd, &dsp_fd_set); - -@@ -318,10 +314,11 @@ + FD_ZERO(&dsp_fd_set); + FD_SET(dsp_fd, &dsp_fd_set); + +@@ -318,10 +316,12 @@ } - + static ALboolean set_write_native(UNUSED(void *handle), - UNUSED(unsigned int *bufsiz), + unsigned int *bufsiz, - ALenum *fmt, - unsigned int *speed) { - ALuint channels = _alGetChannelsFromFormat(*fmt); + ALenum *fmt, + unsigned int *speed) { + ALuint channels = _alGetChannelsFromFormat(*fmt); + int divisor; - - if(dsp_fd < 0) { - return AL_FALSE; -@@ -363,6 +360,23 @@ - - - *fmt = BSD2ALFMT(*fmt, channels); ++ char *custom_bufsiz; + + if(dsp_fd < 0) { + return AL_FALSE; +@@ -363,6 +363,28 @@ + + + *fmt = BSD2ALFMT(*fmt, channels); + -+ if(ioctl(dsp_fd, SNDCTL_DSP_GETBLKSIZE, bufsiz) < 0) { ++ custom_bufsiz = getenv("OPENAL_BUFFER_SIZE"); ++ if (custom_bufsiz != NULL) ++ *bufsiz = atoi(custom_bufsiz); ++ else { ++ if(ioctl(dsp_fd, SNDCTL_DSP_GETBLKSIZE, bufsiz) < 0) { +#ifdef DEBUG_MAXIMUS -+ fprintf(stderr, "blksize %d\n", *bufsiz); -+ perror("get_devsp blksize ioctl"); ++ fprintf(stderr, "blksize %d\n", *bufsiz); ++ perror("get_devsp blksize ioctl"); +#endif -+ return AL_FALSE; ++ return AL_FALSE; ++ } + } + + divisor = _alSpot(*bufsiz) | (2<<16); @@ -64,6 +70,6 @@ +#endif + return AL_FALSE; + } - - return AL_TRUE; + + return AL_TRUE; } diff -ruN /usr/ports/audio/openal/pkg-message openal/pkg-message --- /usr/ports/audio/openal/pkg-message Thu Jan 1 01:00:00 1970 +++ openal/pkg-message Sun Aug 13 08:06:42 2006 @@ -0,0 +1,14 @@ +=============================================================================== +If you hear cracks and pops with some applications, adjust the +OPENAL_BUFFER_SIZE environment variable, for instance: + + export OPENAL_BUFFER_SIZE=8192 + fgfs + +If the OPENAL_BUFFER_SIZE environment variable is not set, the default sound +card buffer size is used. + +Increasing the audio buffer size increases the audio latency but decreases the +CPU usage; decreasing the audio buffer size decreases the audio latency but +increases the CPU usage (which can cause cracks and pops). +=============================================================================== >Release-Note: >Audit-Trail: >Unformatted: