Bug 95192

Summary: update audio/openal + dependant ports
Product: Ports & Packages Reporter: Oliver Lehmann <oliver>
Component: Individual Port(s)Assignee: Oliver Lehmann <oliver>
Status: Closed FIXED    
Severity: Affects Only Me CC: oliver
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
openal.diff none

Description Oliver Lehmann freebsd_committer 2006-04-01 10:50:15 UTC
	update audio/openal to 0.0.8
	See PR ports/95193 for the new port audio/freealut
	Involved maintainers:
		erik@smluc.org		OK	audio/openal			remove files/patch-src_arch_bsd_bsd__dsp.c after patch!
		acardenas@bsd.org.pe	OK	audio/py-openal
					OK	games/glest
					OK	games/excido
					OK	graphics/crystalspace
		guy@device.dyndns.org		games/scorched3d
		jylefort@FreeBSD.org		games/simgear
						games/trigger
		alejandro@varnet.biz	OK	games/warzone2100
Comment 1 Oliver Lehmann freebsd_committer 2006-04-01 10:52:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->oliver

assign to me
Comment 2 Oliver Lehmann 2006-04-01 10:55:28 UTC
Hi,

could you please take a look at http://www.freebsd.org/cgi/query-pr.cgi?pr=95192
and approve if the changes to your port(s) is/are OK for you?

Thank you very much!

-- 
 Oliver Lehmann
  http://www.pofo.de/
  http://wishlist.ans-netz.de/
Comment 3 Jose Alonso Cardenas Marquez 2006-04-01 11:26:13 UTC
On Sat, 1 Apr 2006 11:55:28 +0200
Oliver Lehmann <lehmann@ans-netz.de> wrote:

> Hi,
> 
> could you please take a look at http://www.freebsd.org/cgi/query-pr.cgi?pr=95192
> and approve if the changes to your port(s) is/are OK for you?
> 
> Thank you very much!
> 
> -- 
>  Oliver Lehmann
>   http://www.pofo.de/
>   http://wishlist.ans-netz.de/
> 

It's ok for me, thanks :), One question, Will affect to all openal dependant ports?, because I have other ports using openal.

Greetings
ACM
-- 
Grupo de Usuarios *BSD Peru - BSDPeru
http://www.bsd.org.pe
Comment 4 Alejandro Pulver 2006-04-01 14:47:01 UTC
On Sat, 1 Apr 2006 11:55:28 +0200
Oliver Lehmann <lehmann@ans-netz.de> wrote:

> Hi,
> 
> could you please take a look at
> http://www.freebsd.org/cgi/query-pr.cgi?pr=95192 and approve if the
> changes to your port(s) is/are OK for you?
> 
> Thank you very much!
> 


I agree with the changes. And I have some questions:

I would like to know if it will affect all OpenAL ports. I made a
"portsearch -D openal" and it returned 53 ports.

If freealut depends on OpenAL, why are both dependencies needed (it is
like ogg/vorbis)?

Also if this freealut dependency is optional, a variable like
USE_OPENAL could be put in bsd.port.mk, so freealut can be controled
for all ports with something like WITHOUT_FREEALUT.

Thanks and Best Regards,
Ale
Comment 5 Jean-Yves Lefort freebsd_committer 2006-04-01 20:20:01 UTC
On Sat, 1 Apr 2006 11:55:28 +0200
Oliver Lehmann <lehmann@ans-netz.de> wrote:

> could you please take a look at http://www.freebsd.org/cgi/query-pr.cgi?pr=95192
> and approve if the changes to your port(s) is/are OK for you?


Are you sure that the bsd_dsp.c patch is no longer needed (commit log below)?

- 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.

-- 
Jean-Yves Lefort

jylefort@FreeBSD.org
http://lefort.be.eu.org/
Comment 6 Oliver Lehmann 2006-04-02 20:40:52 UTC
Alejandro Pulver wrote:

> If freealut depends on OpenAL, why are both dependencies needed (it is
> like ogg/vorbis)?

Because Freealut was seperated from OpenAL (splitted into two pieces of
software) so most application who used both things are now needing both
libs. The non-changed openal dependent ports are compiling without
freealut
-- 
 Oliver Lehmann
  http://www.pofo.de/
  http://wishlist.ans-netz.de/
Comment 7 Oliver Lehmann 2006-04-02 20:41:38 UTC
Jose Alonso Cardenas Marquez wrote:


> It's ok for me, thanks :), One question, Will affect to all openal
> dependant ports?, because I have other ports using openal.

I tested all ports which are directly depending on openal. And only
modified those who where not compiling "out of the box"

-- 
 Oliver Lehmann
  http://www.pofo.de/
  http://wishlist.ans-netz.de/
Comment 8 Oliver Lehmann 2006-04-02 20:45:08 UTC
Jean-Yves Lefort wrote:

> Are you sure that the bsd_dsp.c patch is no longer needed (commit log below)?
> 
> - 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.

Thanks for noting this, I'll incorporate the old (dropped) patch with my
new one.


-- 
 Oliver Lehmann
  http://www.pofo.de/
  http://wishlist.ans-netz.de/
Comment 9 Oliver Lehmann freebsd_committer 2006-04-03 08:18:09 UTC
Hi Jean-Yves, 

can we agree on that merged patch which replaces your 
patch-src_arch_bsd_bsd__dsp.c and my patch-src-backends-alc_backend_bsd.c? 

 --- src/backends/alc_backend_bsd.c.orig	Thu Jan  5 16:11:20 2006
+++ src/backends/alc_backend_bsd.c	Mon Apr  3 09:13:44 2006
@@ -10,6 +10,7 @@
 #include "al_siteconfig.h"

 #include <AL/al.h>
+#include <AL/alext.h>
 #include <assert.h>
 #include <fcntl.h>
 #include <sys/soundcard.h>
@@ -113,7 +114,6 @@
  */
 static 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 +126,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 @@
 }

 static ALboolean set_write_native(UNUSED(void *handle),
 -				  UNUSED(unsigned int *bufsiz),
+				  unsigned int *bufsiz,
 				  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);
+
+	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;
 }
Comment 10 Erik Greenwald 2006-04-03 15:07:28 UTC
Looks good to me. If you want me to take maintainership of the freealut
port at any time, just let me know. Also, if there is anything I can do
to make the dependant ports go easier, I'm willing to help. (I'm not
sure depending on their numbers is the best route... The 0.0.8 moniker
was added in configure.ac revision 1.4 2005/03/20. configure.ac is
currently at revision 1.79, and was at 1.76 on 2006/2/11. I don't 
believe the number is being updated.)

Thanks!

 -Erik
Comment 11 Oliver Lehmann freebsd_committer 2006-04-03 15:35:13 UTC
Erik Greenwald wrote:

> Looks good to me. If you want me to take maintainership of the freealut
> port at any time, just let me know. Also, if there is anything I can do
> to make the dependant ports go easier, I'm willing to help. (I'm not
> sure depending on their numbers is the best route... The 0.0.8 moniker
> was added in configure.ac revision 1.4 2005/03/20. configure.ac is
> currently at revision 1.79, and was at 1.76 on 2006/2/11. I don't 
> believe the number is being updated.)

Ok, thanks so far for the response. I've worked on freealut for my
games/ember since it really needs it. If it is OK for you I'll hand the
maintainership of freealut up to you since I guess it might be easier for
updating either openal or freealut in the future if the maintainership is
in one hand.

-- 
 Oliver Lehmann
  http://www.pofo.de/
  http://wishlist.ans-netz.de/
Comment 12 Oliver Lehmann freebsd_committer 2006-04-23 14:49:47 UTC
State Changed
From-To: open->closed

committed