Hello community, here is the log from the commit of package openal checked in at Thu Feb 28 02:01:51 CET 2008. -------- --- openal/openal.changes 2007-09-13 15:56:03.000000000 +0200 +++ /mounts/work_src_done/STABLE/openal/openal.changes 2008-02-27 14:04:23.000000000 +0100 @@ -1,0 +2,5 @@ +Wed Feb 27 14:04:10 CET 2008 - prusnak@suse.cz + +- added libvorbis-devel to BuildRequires [#362737] + +------------------------------------------------------------------- Old: ---- gcc-4.2.diff openal-5.1-support.diff openal-alsa-backend-fix.diff openal-device-auto-select.diff openal-pkgconfig.patch openal-speaker-config.diff New: ---- openal-0.0.8-5.1-support.diff openal-0.0.8-alsa-backend-fix.diff openal-0.0.8-device-auto-select.diff openal-0.0.8-gcc-4.2.diff openal-0.0.8-pkgconfig.patch openal-0.0.8-speaker-config.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openal.spec ++++++ --- /var/tmp/diff_new_pack.u20900/_old 2008-02-28 02:01:33.000000000 +0100 +++ /var/tmp/diff_new_pack.u20900/_new 2008-02-28 02:01:33.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package openal (Version 0.0.8) # -# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -10,26 +10,27 @@ # norootforbuild + Name: openal %define DISTRIBUTABLE 1 -BuildRequires: SDL-devel alsa-devel esound-devel gcc-c++ nasm -License: LGPL v2 or later +BuildRequires: SDL-devel alsa-devel esound-devel gcc-c++ libvorbis-devel nasm +License: LGPL v2.1 or later Group: System/Libraries -Autoreqprov: on +AutoReqProv: on Version: 0.0.8 -Release: 84 -URL: http://www.openal.org/ +Release: 134 +Url: http://www.openal.org/ Icon: openal.xpm Summary: Open Audio Library Source: %{name}-%{version}.tar.bz2 -Source2: openalrc +Source1: openalrc Patch0: %{name}-%{version}-floatmul.patch -Patch1: gcc-4.2.diff -Patch2: openal-alsa-backend-fix.diff -Patch3: openal-5.1-support.diff -Patch4: openal-speaker-config.diff -Patch5: openal-device-auto-select.diff -Patch6: openal-pkgconfig.patch +Patch1: %{name}-%{version}-gcc-4.2.diff +Patch2: %{name}-%{version}-alsa-backend-fix.diff +Patch3: %{name}-%{version}-5.1-support.diff +Patch4: %{name}-%{version}-speaker-config.diff +Patch5: %{name}-%{version}-device-auto-select.diff +Patch6: %{name}-%{version}-pkgconfig.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -45,7 +46,7 @@ %package devel Summary: Static libraries, header files and tests for freealut library -Requires: %{name} = %{version} glibc-devel alsa-devel +Requires: %{name} = %{version} glibc-devel alsa-devel libvorbis-devel Group: Development/Libraries/C and C++ %description devel @@ -74,7 +75,7 @@ %ifarch ia64 LDFLAGS=-Wl,-relax \ %endif -./configure --prefix=%{_prefix} --libdir=%{_libdir} \ +%configure \ --enable-optimization \ --enable-alsa \ --enable-arts \ @@ -94,14 +95,12 @@ make DESTDIR=$RPM_BUILD_ROOT install # # configuration -install -m 755 -d $RPM_BUILD_ROOT/etc -install -m 644 $RPM_SOURCE_DIR/openalrc $RPM_BUILD_ROOT/etc/ +install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir} +install -m 644 $RPM_SOURCE_DIR/openalrc $RPM_BUILD_ROOT%{_sysconfdir} -%post -%run_ldconfig +%post -p /sbin/ldconfig -%postun -%run_ldconfig +%postun -p /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT @@ -109,161 +108,163 @@ %files %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog NOTES README TODO -/etc/openalrc -%{_libdir}/libopenal.so.* +%{_sysconfdir}/openalrc +%{_libdir}/*.so.* %files devel %defattr(-,root,root) -%{_prefix}/bin/*-config +%{_bindir}/*-config %{_includedir}/AL -%{_libdir}/libopenal.*a -%{_libdir}/libopenal.so +%{_libdir}/*a +%{_libdir}/*.so %{_libdir}/pkgconfig/*.pc %changelog -* Thu Sep 13 2007 - sbrabec@suse.cz +* Wed Feb 27 2008 prusnak@suse.cz +- added libvorbis-devel to BuildRequires [#362737] +* Thu Sep 13 2007 sbrabec@suse.cz - Fixed pkgconfig file (#237223, patch from Andreas Hanke). -* Thu Jul 05 2007 - meissner@suse.de +* Thu Jul 05 2007 meissner@suse.de - mark that we use alsa by explicitly buildrequire and requires in the -devel package. -* Thu Jun 28 2007 - tiwai@suse.de +* Thu Jun 28 2007 tiwai@suse.de - auto device-selection per speaker-num configuration. -* Tue Jun 26 2007 - tiwai@suse.de +* Tue Jun 26 2007 tiwai@suse.de - add 5.1/7.1 speaker support - fix ALSA backend - add speaker-position config in ~/.openalrc. -* Sat Jun 09 2007 - dmueller@suse.de +* Sat Jun 09 2007 dmueller@suse.de - add patch to fix build with gcc 4.2 -* Fri Feb 16 2007 - prusnak@suse.cz +* Fri Feb 16 2007 prusnak@suse.cz - fixed crash in mixer (floatmul.patch) [#245470] -* Mon Oct 23 2006 - sbrabec@suse.cz +* Mon Oct 23 2006 sbrabec@suse.cz - Updated to version 0.0.8: * First official release. -* Fri Sep 01 2006 - anosek@suse.cz +* Fri Sep 01 2006 anosek@suse.cz - fixed some compiler warnings [#185960] (openal-warnings.patch) -* Wed Jun 14 2006 - dmueller@suse.de +* Thu Jun 15 2006 dmueller@suse.de - build parallel -* Fri Mar 17 2006 - tiwai@suse.de +* Fri Mar 17 2006 tiwai@suse.de - Fixes for ALSA support (#159064) o Fixed the handling of ALSA PCM parameters. Now working with dmix, too. o Changed the default ALSA PCM device to "default". o Fixed possible open errors after reopening dmix. -* Thu Mar 09 2006 - bk@suse.de +* Thu Mar 09 2006 bk@suse.de - Add esound-devel to BuildRequires (was implicily by SDL-devel) - added gcc-c++ to BuildRequires -* Wed Jan 25 2006 - mls@suse.de +* Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires -* Tue Nov 29 2005 - sbrabec@suse.cz +* Tue Nov 29 2005 sbrabec@suse.cz - Updated to 2005-11-29 CVS snapshot of 1.0 branch (Linux_Spec1-0). - Fixed bad declaration (#133984). -* Mon Aug 01 2005 - sbrabec@suse.cz +* Mon Aug 01 2005 sbrabec@suse.cz - Updated to 2005-08-01 CVS snapshot of branch Linux_Spec1-0. -* Tue Mar 15 2005 - sbrabec@suse.cz +* Tue Mar 15 2005 sbrabec@suse.cz - Removed incorrect ALSA flags (#72855). -* Thu Feb 03 2005 - sbrabec@suse.cz +* Thu Feb 03 2005 sbrabec@suse.cz - Updated to 2005-01-06 CVS snapshot (version 0.0.8). -* Fri Jan 21 2005 - ro@suse.de +* Fri Jan 21 2005 ro@suse.de - disable arch-asm (does not compile ATM) -* Fri Jan 21 2005 - sbrabec@suse.cz +* Fri Jan 21 2005 sbrabec@suse.cz - Updated to 2005-01-06 CVS snapshot. -* Thu Sep 02 2004 - sbrabec@suse.cz +* Thu Sep 02 2004 sbrabec@suse.cz - Updated to actual CVS snapshot. -* Wed Apr 28 2004 - ro@suse.de +* Wed Apr 28 2004 ro@suse.de - added -fno-strict-aliasing -* Sat Jan 10 2004 - adrian@suse.de +* Sat Jan 10 2004 adrian@suse.de - add %%defattr -* Tue Dec 09 2003 - ro@suse.de +* Tue Dec 09 2003 ro@suse.de - build with alsa compatibility defines -* Mon Oct 06 2003 - ro@suse.de +* Mon Oct 06 2003 ro@suse.de - added glib2, glib2-devel to neededforbuild (arts) -* Mon Aug 11 2003 - sbrabec@suse.cz +* Mon Aug 11 2003 sbrabec@suse.cz - Updated to actual CVS snapshot. -* Thu Jul 31 2003 - ro@suse.de +* Thu Jul 31 2003 ro@suse.de - include sys/time.h before alsa -* Thu Apr 24 2003 - ro@suse.de +* Thu Apr 24 2003 ro@suse.de - fix install_info --delete call and move from preun to postun -* Mon Feb 10 2003 - sbrabec@suse.cz +* Mon Feb 10 2003 sbrabec@suse.cz - Use %%install_info (bug #23445). -* Mon Feb 10 2003 - sbrabec@suse.cz +* Mon Feb 10 2003 sbrabec@suse.cz - Updated to 20030131 CVS snapshot. -* Wed Oct 30 2002 - sbrabec@suse.cz +* Wed Oct 30 2002 sbrabec@suse.cz - Updated to actual CVS version. - Fixed compiler warnings. -* Fri Aug 30 2002 - pmladek@suse.cz +* Fri Aug 30 2002 pmladek@suse.cz - fixed dependency of the devel subpackage on the main package (used %%version) -* Fri Jul 05 2002 - kukuk@suse.de +* Fri Jul 05 2002 kukuk@suse.de - Use %%ix86 macro -* Mon Apr 08 2002 - pmladek@suse.cz +* Mon Apr 08 2002 pmladek@suse.cz - arch specific assembler is only for i386 - fixed includes for ia64 -* Wed Apr 03 2002 - pmladek@suse.cz +* Wed Apr 03 2002 pmladek@suse.cz - used some pieces from old patches - fixed to compile with autoconf-2.53: - fixed acinclude.m4, used aclocal - some fixes in configure.in - cleaned up spec file - removed boom.mp3 to avoid potential license problems -* Wed Feb 20 2002 - ro@suse.de +* Wed Feb 20 2002 ro@suse.de - removed kdelibs3-artsd from neededforbuild (artsd is there anyway) -* Sat Feb 16 2002 - sndirsch@suse.de +* Sat Feb 16 2002 sndirsch@suse.de - enabled optimization and arch specific assembler -* Fri Feb 15 2002 - sndirsch@suse.de +* Fri Feb 15 2002 sndirsch@suse.de - added SMPEG/SDL support to get MP3 playback support (required by VegaStrike) -* Fri Feb 15 2002 - ro@suse.de +* Fri Feb 15 2002 ro@suse.de - changed neededforbuild <kdelibs3-artsd> to <arts arts-devel> -* Fri Feb 08 2002 - bk@suse.de +* Fri Feb 08 2002 bk@suse.de - (re)enable optimisations and move prepare stuff to %%prep -* Thu Feb 07 2002 - sndirsch@suse.de +* Thu Feb 07 2002 sndirsch@suse.de - added Ogg/Vorbis and Capture support - removed compiler flags "-Werror -pedantic-errors" -* Thu Feb 07 2002 - sndirsch@suse.de +* Thu Feb 07 2002 sndirsch@suse.de - added support for aRTs and esound daemon - added global config file + a small patch to read this one -* Wed Feb 06 2002 - tiwai@suse.de +* Wed Feb 06 2002 tiwai@suse.de - added ALSA 0.9.0 support. see README.alsa. - clean up spec file, using %%_libdir. - removed SDL. -* Fri Feb 01 2002 - sndirsch@suse.de +* Sat Feb 02 2002 sndirsch@suse.de - updated to CVS sources of 20020201 (required for vegastrike) - disabled patches (not required any more) -* Fri Jan 11 2002 - pmladek@suse.cz +* Fri Jan 11 2002 pmladek@suse.cz - devel package created - used macro %%{_librdir} to fix for lib64 -* Wed Aug 08 2001 - ro@suse.de +* Wed Aug 08 2001 ro@suse.de - changed neededforbuild <sdl> to <SDL> - changed neededforbuild <sdl-devel> to <SDL-devel> -* Tue May 22 2001 - pmladek@suse.cz +* Tue May 22 2001 pmladek@suse.cz - fixed include files on ia64 - fixed preprocessor warnigs by patch for alpha -* Tue May 08 2001 - mfabian@suse.de +* Tue May 08 2001 mfabian@suse.de - bzip2 sources -* Thu Apr 19 2001 - pmladek@suse.cz +* Thu Apr 19 2001 pmladek@suse.cz - fixed to compile on axp -* Wed Apr 04 2001 - schwab@suse.de +* Wed Apr 04 2001 schwab@suse.de - Pass -relax to linker on ia64. - Fix makefile to use LDFLAGS. - Remove -fPIC when building non-library object. -* Mon Mar 26 2001 - ro@suse.de +* Mon Mar 26 2001 ro@suse.de - changed neededforbuild <sdl> to <sdl sdl-devel> -* Thu Nov 30 2000 - ro@suse.de +* Thu Nov 30 2000 ro@suse.de - added suse-update-config -* Mon Nov 06 2000 - ro@suse.de +* Mon Nov 06 2000 ro@suse.de - fixed neededforbuild -* Thu Jun 08 2000 - cihlar@suse.cz +* Thu Jun 08 2000 cihlar@suse.cz - uncommented %%clean -* Tue May 09 2000 - smid@suse.cz +* Tue May 09 2000 smid@suse.cz - buildroot added - upgrade to version from 08.05.2000 -* Tue Apr 11 2000 - sndirsch@suse.de +* Tue Apr 11 2000 sndirsch@suse.de - removed '-Werror' and '-pedantic-erros' compiler flags -* Mon Mar 27 2000 - uli@suse.de +* Mon Mar 27 2000 uli@suse.de - renamed dif for easier maintenance - __linux -> __linux__ - now uses RPM_OPT_FLAGS Wed Mar 15 19:31:35 CET 2000 - added test demos -* Thu Mar 09 2000 - sndirsch@suse.de +* Thu Mar 09 2000 sndirsch@suse.de - created package ++++++ openal-0.0.8-5.1-support.diff ++++++ # HG changeset patch # User tiwai # Date 1182851747 -7200 # Node ID 0db436732d7dcfa45d2d25885eaf071d884a673b # Parent abe8ba9de91a4d173209ec750df3de6f3e7389fb Add 5.1 support diff -r abe8ba9de91a -r 0db436732d7d include/AL/alext.h --- a/include/AL/alext.h Tue Jun 26 11:53:00 2007 +0200 +++ b/include/AL/alext.h Tue Jun 26 11:55:47 2007 +0200 @@ -17,6 +17,13 @@ extern "C" { /* four point formats */ #define AL_FORMAT_QUAD8_LOKI 0x10004 #define AL_FORMAT_QUAD16_LOKI 0x10005 + +/* five point formats */ +#define AL_FORMAT_51_8 0x10006 +#define AL_FORMAT_51_16 0x10007 +/* seven point formats */ +#define AL_FORMAT_71_8 0x10008 +#define AL_FORMAT_71_16 0x10009 /** * token extensions, base 0x20000 diff -r abe8ba9de91a -r 0db436732d7d src/al_buffer.c --- a/src/al_buffer.c Tue Jun 26 11:53:00 2007 +0200 +++ b/src/al_buffer.c Tue Jun 26 11:55:47 2007 +0200 @@ -383,6 +383,10 @@ void alBufferData( ALuint bid, case AL_FORMAT_STEREO16: case AL_FORMAT_QUAD8_LOKI: case AL_FORMAT_QUAD16_LOKI: + case AL_FORMAT_51_8: + case AL_FORMAT_51_16: + case AL_FORMAT_71_8: + case AL_FORMAT_71_16: case AL_FORMAT_IMA_ADPCM_MONO16_EXT: case AL_FORMAT_IMA_ADPCM_STEREO16_EXT: break; @@ -458,11 +462,13 @@ void alBufferData( ALuint bid, { void *temp_copies[_ALC_MAX_CHANNELS] = { NULL }; ALboolean success = AL_TRUE; + int chs; /* don't use realloc */ _alBufferFreeOrigBuffers(buf); - for(i = 0; i < _alGetChannelsFromFormat(buf->format); i++) + chs = _alGetChannelsFromFormat(buf->format); + for(i = 0; i < chs; i++) { temp_copies[i] = malloc(retsize); success = (temp_copies[i] != NULL) ? AL_TRUE : AL_FALSE; @@ -472,7 +478,7 @@ void alBufferData( ALuint bid, { free(cdata); - for(i = 0; i < _alGetChannelsFromFormat(buf->format); i++) + for(i = 0; i < chs; i++) { free(temp_copies[i]); } @@ -487,43 +493,18 @@ void alBufferData( ALuint bid, return; } - switch(_alGetChannelsFromFormat(buf->format)) + switch (chs) { case 1: - for(i = 0; i < elementsof(buf->orig_buffers); i++) + case 2: + case 4: + case 6: + case 8: + for(i = 0; i < elementsof(buf->orig_buffers);) { - buf->orig_buffers[i] = temp_copies[0]; - } - - break; - case 2: - for(i = 0; i < elementsof(buf->orig_buffers); i += 2) - { - buf->orig_buffers[i] = temp_copies[0]; - buf->orig_buffers[i+1] = temp_copies[1]; - } - - break; - case 4: - assert(elementsof(buf->orig_buffers) >= 4); - for(i = 0; i < elementsof(buf->orig_buffers); i += 4) - { - buf->orig_buffers[i] = temp_copies[0]; - buf->orig_buffers[i+1] = temp_copies[1]; - buf->orig_buffers[i+2] = temp_copies[2]; - buf->orig_buffers[i+3] = temp_copies[3]; - } - break; - case 6: - assert(elementsof(buf->orig_buffers) >= 6); - for(i = 0; i < elementsof(buf->orig_buffers); i += 6) - { - buf->orig_buffers[i] = temp_copies[0]; - buf->orig_buffers[i+1] = temp_copies[1]; - buf->orig_buffers[i+2] = temp_copies[2]; - buf->orig_buffers[i+3] = temp_copies[3]; - buf->orig_buffers[i+4] = temp_copies[4]; - buf->orig_buffers[i+5] = temp_copies[5]; + int j; + for (j = 0; j < chs; j++, i++) + buf->orig_buffers[i] = temp_copies[0]; } break; diff -r abe8ba9de91a -r 0db436732d7d src/al_ext.c --- a/src/al_ext.c Tue Jun 26 11:53:00 2007 +0200 +++ b/src/al_ext.c Tue Jun 26 11:55:47 2007 +0200 @@ -875,6 +875,18 @@ getExtensionEnumValue( ALenum *value, co } else if (strcmp(name, "AL_FORMAT_QUAD8_LOKI") == 0) { *value = AL_FORMAT_QUAD8_LOKI; return AL_TRUE; + } else if (strcmp(name, "AL_FORMAT_51_16") == 0) { + *value = AL_FORMAT_51_16; + return AL_TRUE; + } else if (strcmp(name, "AL_FORMAT_51_8") == 0) { + *value = AL_FORMAT_51_8; + return AL_TRUE; + } else if (strcmp(name, "AL_FORMAT_71_16") == 0) { + *value = AL_FORMAT_71_16; + return AL_TRUE; + } else if (strcmp(name, "AL_FORMAT_71_8") == 0) { + *value = AL_FORMAT_71_8; + return AL_TRUE; } else { return AL_FALSE; } diff -r abe8ba9de91a -r 0db436732d7d src/al_main.c --- a/src/al_main.c Tue Jun 26 11:53:00 2007 +0200 +++ b/src/al_main.c Tue Jun 26 11:55:47 2007 +0200 @@ -248,6 +248,12 @@ ALenum _al_AC2ALFMT( ALuint acformat, AL ALenum _al_AC2ALFMT( ALuint acformat, ALuint channels ) { switch( acformat ) { case AUDIO_U8: + if(channels == 8) { + return AL_FORMAT_71_8; + } + if(channels == 6) { + return AL_FORMAT_51_8; + } if(channels == 4) { return AL_FORMAT_QUAD8_LOKI; } @@ -260,6 +266,12 @@ ALenum _al_AC2ALFMT( ALuint acformat, AL break; case AUDIO_S16LSB: case AUDIO_S16MSB: + if(channels == 8) { + return AL_FORMAT_71_16; + } + if(channels == 6) { + return AL_FORMAT_51_16; + } if(channels == 4) { return AL_FORMAT_QUAD16_LOKI; } @@ -288,10 +300,14 @@ ALenum _al_AC2ALFMT( ALuint acformat, AL */ ALushort _al_AL2ACFMT( ALenum alformat ) { switch( alformat ) { + case AL_FORMAT_71_8: + case AL_FORMAT_51_8: case AL_FORMAT_QUAD8_LOKI: case AL_FORMAT_STEREO8: case AL_FORMAT_MONO8: return AUDIO_U8; + case AL_FORMAT_71_16: + case AL_FORMAT_51_16: case AL_FORMAT_QUAD16_LOKI: case AL_FORMAT_STEREO16: case AL_FORMAT_MONO16: @@ -324,6 +340,12 @@ ALubyte _alGetChannelsFromFormat(ALenum case AL_FORMAT_QUAD8_LOKI: case AL_FORMAT_QUAD16_LOKI: return 4; + case AL_FORMAT_51_8: + case AL_FORMAT_51_16: + return 6; + case AL_FORMAT_71_8: + case AL_FORMAT_71_16: + return 8; default: break; } @@ -365,6 +387,20 @@ ALenum _al_formatscale(ALenum format, AL default: return -1; } break; + case 6: + switch(fmt_bits) { + case 8: return AL_FORMAT_51_8; break; + case 16: return AL_FORMAT_51_16; break; + default: return -1; + } + break; + case 8: + switch(fmt_bits) { + case 8: return AL_FORMAT_71_8; break; + case 16: return AL_FORMAT_71_16; break; + default: return -1; + } + break; default: #ifdef DEBUG_CONVERT fprintf(stderr, @@ -580,6 +616,14 @@ ALenum _al_AL2FMT(ALuint channels, ALuin case 4: if(bits == 8) return AL_FORMAT_QUAD8_LOKI; if(bits == 16) return AL_FORMAT_QUAD16_LOKI; + break; + case 6: + if(bits == 8) return AL_FORMAT_51_8; + if(bits == 16) return AL_FORMAT_51_16; + break; + case 8: + if(bits == 8) return AL_FORMAT_71_8; + if(bits == 16) return AL_FORMAT_71_16; break; } @@ -719,6 +763,10 @@ ALboolean _al_RAWFORMAT(ALenum format) case AL_FORMAT_STEREO8: case AL_FORMAT_QUAD16_LOKI: case AL_FORMAT_QUAD8_LOKI: + case AL_FORMAT_51_8: + case AL_FORMAT_51_16: + case AL_FORMAT_71_8: + case AL_FORMAT_71_16: return AL_TRUE; default: break; @@ -738,6 +786,8 @@ ALbyte _alGetBitsFromFormat(ALenum forma case AL_FORMAT_MONO16: case AL_FORMAT_STEREO16: case AL_FORMAT_QUAD16_LOKI: + case AL_FORMAT_51_16: + case AL_FORMAT_71_16: case AL_FORMAT_IMA_ADPCM_MONO16_EXT: case AL_FORMAT_IMA_ADPCM_STEREO16_EXT: return 16; @@ -745,6 +795,8 @@ ALbyte _alGetBitsFromFormat(ALenum forma case AL_FORMAT_MONO8: case AL_FORMAT_STEREO8: case AL_FORMAT_QUAD8_LOKI: + case AL_FORMAT_51_8: + case AL_FORMAT_71_8: return 8; break; } diff -r abe8ba9de91a -r 0db436732d7d src/al_source.c --- a/src/al_source.c Tue Jun 26 11:53:00 2007 +0200 +++ b/src/al_source.c Tue Jun 26 11:55:47 2007 +0200 @@ -58,6 +58,9 @@ static void _alMonoifyOffset1to4(ALshort static void _alMonoifyOffset1to4(ALshort **dstref, ALuint offset, ALvoid *src, ALuint ssize); static void _alMonoifyOffset2to4(ALshort **dstref, ALuint offset, ALvoid *src, ALuint ssize); static void _alMonoifyOffset4to4(ALshort **dstref, ALuint offset, ALvoid *src, ALuint ssize); +static void _alMonoifyOffsetNtoN( ALshort **dsts, ALuint offset, + ALvoid *srcp, ALuint size, + ALuint dstchan, ALuint srcchan); /* * Channelify functions copy the PCM data from srcs[0..nc-1] into an @@ -67,6 +70,8 @@ static void _alMonoifyOffset4to4(ALshort */ static void _alChannelify2Offset(ALshort *dst, ALuint offset, ALshort **srcs, ALuint size); static void _alChannelify4Offset(ALshort *dst, ALuint offset, ALshort **srcs, ALuint size); +static void _alChannelifyNOffset( ALshort *dst, ALuint offset, + ALshort **srcs, ALuint size, int nchan ); /* static data */ static ALshort *stereoptr = NULL; /* @@ -1850,6 +1855,16 @@ void _alMonoifyOffset(ALshort **dstref, void _alMonoifyOffset(ALshort **dstref, ALuint offset, ALvoid *srcp, ALuint size, ALuint dc, ALuint sc) { switch( dc ) { + case 6: + case 8: + if (sc == 1 || sc == 2 || sc == 4) + _alMonoifyOffsetNtoN(dstref, offset, srcp, size, dc, sc); + else { + fprintf(stderr, "unhandled Monoify (dc %d sc %d)\n", + dc, sc); + break; + } + break; case 4: switch(sc) { case 1: @@ -1901,6 +1916,28 @@ void _alMonoifyOffset(ALshort **dstref, return; } +static void _alMonoifyOffsetNtoN( ALshort **dsts, ALuint offset, + ALvoid *srcp, ALuint size, + ALuint dstchan, ALuint srcchan) { + ALshort *src = (ALshort *) srcp; + ALshort *dst[_ALC_MAX_CHANNELS]; + + int len = size / sizeof *src; + int i, j, n; + + offset /= sizeof **dsts; + for (i = 0; i < dstchan; i++) + dst[i] = dsts[0] + offset; + + for(i = 0; i < len; i++) { + for (n = 0; n < dstchan; ) + for (j = 0; j < srcchan; j++, n++) + dst[n][i] = src[j]; + src += srcchan; + } + +} + static void _alMonoifyOffset1to4( ALshort **dsts, ALuint offset, ALvoid *srcp, ALuint size) { ALshort *src = (ALshort *) srcp; @@ -2069,9 +2106,16 @@ void _alChannelifyOffset( ALshort *dst, { switch( nc ) { + case 6: + case 8: + case 4: + _alChannelifyNOffset(dst, offset, srcs, size, nc); + break; +#if 0 case 4: _alChannelify4Offset(dst, offset, srcs, size); break; +#endif case 2: _alChannelify2Offset(dst, offset, srcs, size); break; @@ -2144,6 +2188,25 @@ void _alChannelify4Offset( ALshort *dst, } +void _alChannelifyNOffset( ALshort *dst, ALuint offset, + ALshort **srcs, ALuint size, int nchan ) { + ALshort *src[_ALC_MAX_CHANNELS]; + ALuint i, j; + + for (i = 0; i < nchan; i++) + src[i] = &srcs[i][offset / sizeof *srcs]; + + size /= sizeof *dst; /* we need sample offsets */ + + for (i = 0; i < size; i++ ) { + for (j = 0; j < nchan; j++) { + *dst++ = *src[j]; + src[j]++; + } + } + + return; +} /* * alDeleteSources( ALsizei n, ALuint *sources ) diff -r abe8ba9de91a -r 0db436732d7d src/al_types.h --- a/src/al_types.h Tue Jun 26 11:53:00 2007 +0200 +++ b/src/al_types.h Tue Jun 26 11:55:47 2007 +0200 @@ -21,7 +21,7 @@ #include <stddef.h> #include <sys/types.h> -#define _ALC_MAX_CHANNELS 6 +#define _ALC_MAX_CHANNELS 8 #define _ALC_MAX_FILTERS 9 #define _ALF_MAX_NAME 15 diff -r abe8ba9de91a -r 0db436732d7d src/alc/alc_speaker.c --- a/src/alc/alc_speaker.c Tue Jun 26 11:53:00 2007 +0200 +++ b/src/alc/alc_speaker.c Tue Jun 26 11:55:47 2007 +0200 @@ -159,28 +159,45 @@ void _alcSpeakerInit( ALuint cid ) { num = _alcGetNumSpeakers(cid); - /* fourpoint */ - - if (num >= 4) - { - sdis *= M_SQRT1_2; - + switch (num) { + case 5: + case 6: + /* 5.0 */ + cc->_speaker_pos[ALS_CENTER].pos[2] += sdis; + cc->_speaker_pos[ALS_LFE].pos[2] += sdis; + sdis *= 0.70710678; + cc->_speaker_pos[ALS_LEFT].pos[0] -=sdis; cc->_speaker_pos[ALS_LEFT].pos[2] += sdis; + cc->_speaker_pos[ALS_RIGHT].pos[0] += sdis; cc->_speaker_pos[ALS_RIGHT].pos[2] += sdis; - cc->_speaker_pos[ALS_LEFTS].pos[0] -= sdis; cc->_speaker_pos[ALS_LEFTS].pos[2] -= sdis; - cc->_speaker_pos[ALS_RIGHTS].pos[0] += sdis; cc->_speaker_pos[ALS_RIGHTS].pos[2] -= sdis; - } - - /* stereo */ - - if (num >= 2) - { + break; + + case 4: + /* fourpoint */ + sdis *= M_SQRT1_2; + cc->_speaker_pos[ALS_LEFT].pos[0] -= sdis; - cc->_speaker_pos[ALS_RIGHT].pos[0] += sdis; + cc->_speaker_pos[ALS_LEFT].pos[2] += sdis; + cc->_speaker_pos[ALS_RIGHT].pos[0] += sdis; + cc->_speaker_pos[ALS_RIGHT].pos[2] += sdis; + + cc->_speaker_pos[ALS_LEFTS].pos[0] -= sdis; + cc->_speaker_pos[ALS_LEFTS].pos[2] -= sdis; + + cc->_speaker_pos[ALS_RIGHTS].pos[0] += sdis; + cc->_speaker_pos[ALS_RIGHTS].pos[2] -= sdis; + break; + + case 3: + case 2: + /* stereo */ + cc->_speaker_pos[ALS_LEFT].pos[0] -= sdis; + cc->_speaker_pos[ALS_RIGHT].pos[0] += sdis; + break; } return; } diff -r abe8ba9de91a -r 0db436732d7d src/alc/alc_speaker.h --- a/src/alc/alc_speaker.h Tue Jun 26 11:53:00 2007 +0200 +++ b/src/alc/alc_speaker.h Tue Jun 26 11:55:47 2007 +0200 @@ -18,7 +18,9 @@ typedef enum { ALS_LEFT, ALS_RIGHT, ALS_LEFTS, - ALS_RIGHTS + ALS_RIGHTS, + ALS_CENTER, + ALS_LFE } _alcSpeakerEnum; /* diff -r abe8ba9de91a -r 0db436732d7d src/backends/alc_backend_alsa.c --- a/src/backends/alc_backend_alsa.c Tue Jun 26 11:53:00 2007 +0200 +++ b/src/backends/alc_backend_alsa.c Tue Jun 26 11:55:47 2007 +0200 @@ -234,9 +234,11 @@ static ALboolean set_read_alsa( void *ha return AL_FALSE; - if ((*fmt == AL_FORMAT_QUAD8_LOKI) || (*fmt == AL_FORMAT_STEREO8)) + if ((*fmt == AL_FORMAT_QUAD8_LOKI) || (*fmt == AL_FORMAT_STEREO8) || + *fmt == AL_FORMAT_51_8 || *fmt == AL_FORMAT_71_8) *fmt = AL_FORMAT_MONO8; - if ((*fmt == AL_FORMAT_QUAD16_LOKI) || (*fmt == AL_FORMAT_STEREO16)) + if ((*fmt == AL_FORMAT_QUAD16_LOKI) || (*fmt == AL_FORMAT_STEREO16) || + *fmt == AL_FORMAT_51_16 || *fmt == AL_FORMAT_71_16) *fmt = AL_FORMAT_MONO16; ai->channels = 1; @@ -664,9 +666,13 @@ static int AL2ALSAFMT(ALenum format) { case AL_FORMAT_STEREO8: return SND_PCM_FORMAT_U8; case AL_FORMAT_MONO8: return SND_PCM_FORMAT_U8; case AL_FORMAT_QUAD8_LOKI: return SND_PCM_FORMAT_U8; + case AL_FORMAT_51_8: return SND_PCM_FORMAT_U8; + case AL_FORMAT_71_8: return SND_PCM_FORMAT_U8; case AL_FORMAT_STEREO16: return SND_PCM_FORMAT_S16; case AL_FORMAT_MONO16: return SND_PCM_FORMAT_S16; case AL_FORMAT_QUAD16_LOKI: return SND_PCM_FORMAT_S16; + case AL_FORMAT_51_16: return SND_PCM_FORMAT_S16; + case AL_FORMAT_71_16: return SND_PCM_FORMAT_S16; default: break; } ++++++ openal-0.0.8-alsa-backend-fix.diff ++++++ ++++ 696 lines (skipped) ++++++ openal-0.0.8-device-auto-select.diff ++++++ # HG changeset patch # User tiwai # Date 1183026187 -7200 # Node ID 3fe389df1d6c3f950a668a27852320dbe9e1d8c3 # Parent ccda65649e9791066e706f1c516c1e8daa921b70 Select ALSA device appropriately according to the given speaker-num config. diff -r ccda65649e97 -r 3fe389df1d6c src/backends/alc_backend_alsa.c --- a/src/backends/alc_backend_alsa.c Tue Jun 26 13:53:52 2007 +0200 +++ b/src/backends/alc_backend_alsa.c Thu Jun 28 12:23:07 2007 +0200 @@ -120,6 +120,7 @@ static void get_out_device_name(char *re static void get_out_device_name(char *retref, size_t retsize) { Rcvar rcv; + const char *defdev; assert(retref); @@ -135,7 +136,33 @@ static void get_out_device_name(char *re } } - strncpy(retref, DEFAULT_DEVICE, retsize); + defdev = DEFAULT_DEVICE; + rcv = rc_lookup("speaker-num"); + if (rcv && rc_type(rcv) == ALRC_INTEGER) { + ALint s = rc_toint(rcv ); + switch (s) { + case 2: + defdev = "default"; + break; + case 4: + defdev = "plug:surround40"; + break; + case 5: + defdev = "plug:surround50"; + break; + case 6: + defdev = "plug:surround51"; + break; + case 7: + defdev = "plug:surround70"; + break; + case 8: + defdev = "plug:surround71"; + break; + } + } + + strncpy(retref, defdev, retsize); retref[retsize - 1] = '\0'; } ++++++ openal-0.0.8-gcc-4.2.diff ++++++ void parameter must be "void" now, not a typedef of void see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9278 --- common/include/AL/alc.h +++ common/include/AL/alc.h @@ -187,7 +187,7 @@ ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context ); ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context ); -ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( ALCvoid ); +ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void ); ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context ); @@ -248,7 +248,7 @@ typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *cont typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context ); typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context ); typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context ); -typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( ALCvoid ); +typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void ); typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context ); typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename ); typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device ); ++++++ openal-0.0.8-pkgconfig.patch ++++++ --- admin/pkgconfig/openal.pc.in +++ admin/pkgconfig/openal.pc.in @@ -5,7 +5,6 @@ Name: OpenAL Description: OpenAL is a cross-platform 3D audio API. -Requires: @requirements@ Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lopenal Cflags: -I${includedir} ++++++ openal-0.0.8-speaker-config.diff ++++++ # HG changeset patch # User tiwai # Date 1182858832 -7200 # Node ID ccda65649e9791066e706f1c516c1e8daa921b70 # Parent 0db436732d7dcfa45d2d25885eaf071d884a673b Add speaker-position configuration. diff -r 0db436732d7d -r ccda65649e97 src/alc/alc_speaker.c --- a/src/alc/alc_speaker.c Tue Jun 26 11:55:47 2007 +0200 +++ b/src/alc/alc_speaker.c Tue Jun 26 13:53:52 2007 +0200 @@ -16,6 +16,7 @@ #include <AL/al.h> #include <AL/alc.h> +#include "al_config.h" #include "al_debug.h" #include "al_main.h" #include "al_vector.h" @@ -110,6 +111,117 @@ void _alcSpeakerMove( ALuint cid ) { return; } +struct speaker_preset { + ALfloat spk[_ALC_MAX_CHANNELS][3]; +}; + +static struct speaker_preset speaker_pos_preset[_ALC_MAX_CHANNELS] = { + { /* mono */ + { { 0, 0, 0 } } + }, + { /* stereo */ + { { -1, 0, 0 }, + { 1, 0, 0 } }, + }, + { /* 2.1 */ + { { -M_SQRT1_2, 0, M_SQRT1_2 }, + { M_SQRT1_2, 0, M_SQRT1_2 }, + { 0, 0, 1 } }, + }, + { /* 4.0 */ + { { -M_SQRT1_2, 0, M_SQRT1_2 }, + { M_SQRT1_2, 0, M_SQRT1_2 }, + { -M_SQRT1_2, 0, -M_SQRT1_2 }, + { M_SQRT1_2, 0, -M_SQRT1_2 } }, + }, + { /* 5.0 */ + { { -0.5, 0, 0.8860254 }, + { 0.5, 0, 0.8860254 }, + { -0.93969262, 0, -0.34202014 }, + { 0.93969262, 0, -0.34202014 }, + { 0, 0, 1 } }, + }, + { /* 5.1 */ + { { -0.5, 0, 0.8860254 }, + { 0.5, 0, 0.8860254 }, + { -0.93969262, 0, -0.34202014 }, + { 0.93969262, 0, -0.34202014 }, + { 0, 0, 1 }, + { 0, 0, 1 } }, + }, + { /* 7.0 */ + { { -0.5, 0, 0.8860254 }, + { 0.5, 0, 0.8860254 }, + { -0.5, 0, -0.8860254 }, + { 0.5, 0, -0.8860254 }, + { 0, 0, 1 }, + { 0, 0, 1 }, + { -1, 0, 0 }, + { 1, 0, 0 } }, + }, + { /* 7.1 */ + { { -0.5, 0, 0.8860254 }, + { 0.5, 0, 0.8860254 }, + { -0.5, 0, -0.8860254 }, + { 0.5, 0, -0.8860254 }, + { 0, 0, 1 }, + { 0, 0, 1 }, + { -1, 0, 0 }, + { 1, 0, 0 } }, + }, +}; + +static struct speaker_preset speaker_pos; +static int speaker_init = 0; + +static void init_speaker_position(int num_speakers) +{ + Rcvar spos; + int ch, idx; + + if (speaker_init == num_speakers) + return; + + speaker_pos = speaker_pos_preset[num_speakers - 1]; + speaker_init = num_speakers; + + spos = rc_lookup("speaker-position"); + if (!spos) + return; + + ch = 0; + for (; spos; spos = rc_cdr(spos)) { + Rcvar pos = rc_car(spos); + + if (rc_type(pos) != ALRC_CONSCELL) { + _alDebug(ALD_CONTEXT, __FILE__, __LINE__, + "alc_speaker_init: bad type %s for speaker-position", + rc_typestr(rc_type(pos))); + return; + } + idx = 0; + for (; pos; pos = rc_cdr(pos)) { + Rcvar valp = rc_car(pos); + ALfloat val; + if (rc_type(valp) != ALRC_INTEGER && + rc_type(valp) != ALRC_FLOAT) { + _alDebug(ALD_CONTEXT, __FILE__, __LINE__, + "alc_speaker_init: bad type %s for speaker-position", + rc_typestr(rc_type(valp))); + return; + } + val = rc_tofloat(valp); + speaker_pos.spk[ch][idx] = val; + if (idx == 2) + break; + idx++; + } + ch++; + if (ch >= num_speakers) + break; + } +} + /* * _alcSpeakerInit( ALuint cid ) * @@ -121,8 +233,8 @@ void _alcSpeakerInit( ALuint cid ) { AL_context *cc; AL_listener *lis; ALfloat *lpos; - ALfloat sdis; /* scaled distance */ - ALuint i; + ALfloat sdis; + ALuint i, j; ALuint num; cc = _alcGetContext( cid ); @@ -142,64 +254,15 @@ void _alcSpeakerInit( ALuint cid ) { lpos = lis->position; - /* - * A speaker distance of one simplifies the math later. - */ - sdis = 1.0f; - - _alDebug(ALD_CONTEXT, __FILE__, __LINE__, - "_alcSpeakerInit: ( sdis %f )", sdis ); - - for (i = 0; i < _ALC_MAX_CHANNELS; i++) - { - cc->_speaker_pos[i].pos[0] = lpos[0]; - cc->_speaker_pos[i].pos[1] = lpos[1]; - cc->_speaker_pos[i].pos[2] = lpos[2]; - } - num = _alcGetNumSpeakers(cid); - - switch (num) { - case 5: - case 6: - /* 5.0 */ - cc->_speaker_pos[ALS_CENTER].pos[2] += sdis; - cc->_speaker_pos[ALS_LFE].pos[2] += sdis; - sdis *= 0.70710678; - cc->_speaker_pos[ALS_LEFT].pos[0] -=sdis; - cc->_speaker_pos[ALS_LEFT].pos[2] += sdis; - cc->_speaker_pos[ALS_RIGHT].pos[0] += sdis; - cc->_speaker_pos[ALS_RIGHT].pos[2] += sdis; - cc->_speaker_pos[ALS_LEFTS].pos[0] -= sdis; - cc->_speaker_pos[ALS_LEFTS].pos[2] -= sdis; - cc->_speaker_pos[ALS_RIGHTS].pos[0] += sdis; - cc->_speaker_pos[ALS_RIGHTS].pos[2] -= sdis; - break; - - case 4: - /* fourpoint */ - sdis *= M_SQRT1_2; - - cc->_speaker_pos[ALS_LEFT].pos[0] -= sdis; - cc->_speaker_pos[ALS_LEFT].pos[2] += sdis; - cc->_speaker_pos[ALS_RIGHT].pos[0] += sdis; - cc->_speaker_pos[ALS_RIGHT].pos[2] += sdis; - - cc->_speaker_pos[ALS_LEFTS].pos[0] -= sdis; - cc->_speaker_pos[ALS_LEFTS].pos[2] -= sdis; - - cc->_speaker_pos[ALS_RIGHTS].pos[0] += sdis; - cc->_speaker_pos[ALS_RIGHTS].pos[2] -= sdis; - break; - - case 3: - case 2: - /* stereo */ - cc->_speaker_pos[ALS_LEFT].pos[0] -= sdis; - cc->_speaker_pos[ALS_RIGHT].pos[0] += sdis; - break; - } - return; + init_speaker_position(num); + + sdis = 1.0; + for (i = 0; i < num; i++) { + for (j = 0; j < 3; j++) + cc->_speaker_pos[i].pos[j] = lpos[j] + + sdis * speaker_pos.spk[i][j]; + } } /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de