View previous topic :: View next topic |
Author |
Message |
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Sat Dec 06, 2003 2:59 am Post subject: 5.1 Surround with ALSA and OpenAL. [ALSA VoIP added] |
|
|
I've put up a how-to on getting 5.1 surround working with ALSA and games that use OpenAL. (read: UT2003, UT2004, ArmyOps, etc.) This works on my Sound Blaster Live 5.1, am not sure how ALSA handles other cards.
http://floam.ascorbic.com/how-to/alsa5.1
Comments / suggestions appreciated.
Note (2004/02/17): The openal-cvs noted in the artical has been updated with a VoIP patch for ALSA and UT2004.
Newest openal-cvs ebuild here: http://floam.ascorbic.com/gentoo/openal-cvs-20040314.tar.bz2
Also changed guide to include mixer settings and slightly different .openalrc for UT2004 Voice support. _________________ Think about your breathing.
http://floam.sh.nu
Last edited by floam on Sun Mar 14, 2004 9:01 pm; edited 8 times in total |
|
Back to top |
|
|
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Sun Dec 07, 2003 2:02 am Post subject: |
|
|
The guide had a bad link in there that was probably messing people up, fixed now. _________________ Think about your breathing.
http://floam.sh.nu |
|
Back to top |
|
|
ARC2300 Apprentice
Joined: 30 Mar 2003 Posts: 265
|
Posted: Mon Dec 08, 2003 1:32 am Post subject: |
|
|
Didn't work for me at all.
I'm on a CS46xx chipset with the 2.6 kernel. |
|
Back to top |
|
|
Peaceable Frood Guru
Joined: 06 Apr 2003 Posts: 338 Location: New Jersey, USA
|
Posted: Mon Dec 08, 2003 2:44 am Post subject: |
|
|
Your chipset mostlikely has to have 5.1 support on the chip and in the driver. _________________ "Our enemies are innovative and resourceful, and so are we, they never stop thinking about new ways to harm our country and our people, and neither do we." George W. Bush |
|
Back to top |
|
|
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Mon Dec 08, 2003 4:11 am Post subject: |
|
|
Yeah, I was pretty sure this would only apply to the emu10k1. _________________ Think about your breathing.
http://floam.sh.nu |
|
Back to top |
|
|
Moofed Apprentice
Joined: 22 Oct 2002 Posts: 158 Location: Bloomington, IN
|
Posted: Mon Dec 08, 2003 5:00 am Post subject: |
|
|
Works for me with my cmi8738! The mixer part is emu10k1 specific, but the Openal part should be useful for anyone that can play dvds in 4.0 or 5.1 sound. The mixer settings for other 8738 users are Exchange DAC ON, Four Channel Mode OFF.
edit: It seems alsa has cleaned up multichannel support in the cmipci driver: the Exchange DAC option has been removed. 5.1 and 4.0 sound Just Works (for me).
Last edited by Moofed on Sun Jan 04, 2004 4:43 pm; edited 1 time in total |
|
Back to top |
|
|
OverrideX n00b
Joined: 09 Jul 2002 Posts: 8
|
Posted: Sun Jan 04, 2004 4:29 pm Post subject: doh |
|
|
Of course, openal-cvs is failing to compile for me now:
Code: |
xp -Os -pipe -fforce-addr -fomit-frame-pointer -falign-functions=4 -mfpmath=sse -I/usr/include/SDL -D_REENTRANT -I/usr/include/smpeg -I/usr/include/SDL -D_REENTRANT -fPIC -Wall -W -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wimplicit-function-declaration -Waggregate-return -Winline -Wpointer-arith -fno-common -ansi -Wno-redundant-decls -c arch/esd/esd.c -o arch/esd/esd.o
arch/alsa/alsa.c: In function `set_write_alsa':
arch/alsa/alsa.c:218: error: too few arguments to function `snd_pcm_hw_params_get_channels'
arch/alsa/alsa.c:229: warning: passing arg 3 of `snd_pcm_hw_params_set_rate_near' makes pointer from integer without a cast
arch/alsa/alsa.c:257: error: too few arguments to function `snd_pcm_hw_params_get_buffer_size'
arch/alsa/alsa.c:260: warning: passing arg 2 of `snd_pcm_hw_params_get_period_size' from incompatible pointer type
arch/alsa/alsa.c:260: error: too few arguments to function `snd_pcm_hw_params_get_period_size'
gmake[1]: *** [arch/alsa/alsa.o] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory `/var/tmp/portage/openal-cvs-3/work/openal/linux/src'
make: *** [all] Error 2
|
using gcc 3.3.2-r4 - anyone else having this problem? any fixes? |
|
Back to top |
|
|
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Sun Jan 04, 2004 8:36 pm Post subject: |
|
|
Update: ALSA 1.0 support is now in openal cvs, rejoice!
What version of alsa are you using? If you are using 1.0.0rc2 you will need to edit alsa.c a bit in the openal cvs tree.
Edit: Well this is kind of weird, I should have been able to put Code: | #define ALSA_PCM_OLD_HW_PARAMS_API
#define ALSA_PCM_OLD_SW_PARAMS_API | before Code: | #include <alsa/asoundlib.h> | in alsa.c to make it work, but then it fails in alsa.c on /usr/include/alsa/pcm.h, which is weird. Maybe someone smarter than me can look into it? _________________ Think about your breathing.
http://floam.sh.nu
Last edited by floam on Tue Jan 27, 2004 11:59 pm; edited 1 time in total |
|
Back to top |
|
|
Kirschsaft n00b
Joined: 05 Jul 2003 Posts: 22
|
Posted: Tue Jan 06, 2004 1:43 pm Post subject: |
|
|
floam wrote: | What version of alsa are you using? If you are using 1.0.0rc2 you will need to edit alsa.c a bit in the openal cvs tree.
Edit: Well this is kind of weird, I should have been able to put Code: | #define ALSA_PCM_OLD_HW_PARAMS_API
#define ALSA_PCM_OLD_SW_PARAMS_API | before Code: | #include <alsa/asoundlib.h> | in alsa.c to make it work, but then it fails in alsa.c on /usr/include/alsa/pcm.h, which is weird. Maybe someone smarter than me can look into it? |
This seems to work again after the following steps.
1. Open your openal_dir/linux/src/Makefile
2. Search the CFLAGS
3. Remove "-ansi" from CFLAGS
4. Save the file and try to build OpenAL.
This seemed to work on my machine at least. |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Tue Jan 06, 2004 2:12 pm Post subject: |
|
|
hm.. i can not find this Makefile you speak of.
*update* found it
/var/tmp/portage/openal-cvs-3/work/openal/linux/src/Makefile
*update* i tried editing both the Makefile and alsa.c,
but it fails to compile for me at pcm.h as well.
"/usr/include/alsa/pcm.h:655: error: syntax error before string constant"
(and on many other lines) |
|
Back to top |
|
|
Kirschsaft n00b
Joined: 05 Jul 2003 Posts: 22
|
Posted: Tue Jan 06, 2004 2:44 pm Post subject: |
|
|
neenee wrote: |
*update* i tried editing both the Makefile and alsa.c,
but it fails to compile for me at pcm.h as well.
"/usr/include/alsa/pcm.h:655: error: syntax error before string constant"
(and on many other lines) |
What did you do after editing the Makefile? "emerge openal-cvs"? Then you have to edit /var/tmp/portage/openal-cvs-3/work/openal/linux/configure.in as well, since configure will put the "-ansi" in place again otherwise. Open the configure.in and go to line 171. It should contain "WFLAGS="$WFLAGS -ansi"". Remove the -ansi and rerun the ebuild.
I didn't had to do this step, because I built openal without portage. |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Tue Jan 06, 2004 4:43 pm Post subject: |
|
|
i tried the following:
i edited:
/usr/portage/distfiles/cvs-src/openal/linux/src/arch/alsa/alsa.c
/var/tmp/portage/openal-cvs-3/work/openal/linux/src/arch/alsa/alsa.c
and added the two defines mentioned in a post above.
then, i edited both the Makefile and the configure.in.
but the error with pcm remains.
*update* now i compiled openal-cvs manually, using
info from the ebuild, and injected the stable openal,
so that it is no longer called.
i still would like to get this 'proper' way going though |
|
Back to top |
|
|
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Tue Jan 06, 2004 10:12 pm Post subject: |
|
|
Update: ALSA 1.0 support is now in openal cvs, rejoice!
You don't need to (and probably shouldn't) edit the files in /var/tmp. You can go to /usr/portage/distfiles/cvs-src/openal and edit the files there before you start the emerge, cvs will manage them being different and stuff. Also, jvalenzu in #openal says he's looking into finding a new maintainer of the alsa backend. _________________ Think about your breathing.
http://floam.sh.nu
Last edited by floam on Tue Jan 27, 2004 11:59 pm; edited 1 time in total |
|
Back to top |
|
|
neenee Veteran
Joined: 20 Jul 2003 Posts: 1786
|
Posted: Tue Jan 06, 2004 10:52 pm Post subject: |
|
|
wow. it worked now i edited the
files in the proper location.
thanks floam |
|
Back to top |
|
|
Merlin-TC l33t
Joined: 16 May 2003 Posts: 603 Location: Germany
|
Posted: Sat Jan 24, 2004 4:02 pm Post subject: |
|
|
I have the same error but it seems like I am too dump....
I downloaded the latest CVS and the the change in the makefile removing the -ansi from the cflags.
I also tried to edit the alsa.c but it still didn't work.
Am I missing something? :O
I really don't know what I am doing wrong.
I'd really appreciate your help. |
|
Back to top |
|
|
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Sat Jan 24, 2004 8:36 pm Post subject: |
|
|
Update: ALSA 1.0 support is now in openal cvs, rejoice!
Merlin-TC: Use my openal-cvs ebuild and this patch: http://opensource.creative.com/pipermail/openal-devel/2004-January/000199.html
Emerge openal-cvs, wait for it to die, apply patch in /usr/portage/distfiles/cvs-src/openal/, and then emerge openal-cvs. _________________ Think about your breathing.
http://floam.sh.nu
Last edited by floam on Tue Jan 27, 2004 11:59 pm; edited 1 time in total |
|
Back to top |
|
|
Merlin-TC l33t
Joined: 16 May 2003 Posts: 603 Location: Germany
|
Posted: Sat Jan 24, 2004 10:22 pm Post subject: |
|
|
OK, I am editing this the third time now
I got it to compile ok I think and just symlinked the libopenal.so to the ut2003/system directory as openal.so.
But now it segfaults
Code: |
bin: pcm.c:963: snd_pcm_writei: Assertion `pcm->setup' failed.
Backtrace:
[ 1] ./Core.so [0x40a1071a]
[ 2] [0xffffd420]
[ 3] [0x6]
[ 4] /lib/libc.so.6(abort+0x1d7) [0x40bcb3a7]
[ 5] /lib/libc.so.6(__assert_fail+0x109) [0x40bc3289]
[ 6] ./libSDL-1.2.so.0(snd_pcm_writei+0x74) [0x4007ff50]
[ 7] ./openal.so(alsa_blitbuffer+0x56) [0x44c4bdb6]
[ 8] ./openal.so(_alcDeviceWrite+0x52) [0x44c4e0e2]
[ 9] ./openal.so(async_mixer_iterate+0x126) [0x44c381c6]
[10] ./openal.so [0x44c4c85e]
[11] /lib/libpthread.so.0 [0x40dd78ac]
[12] /lib/libc.so.6(__clone+0x5a) [0x40c72efa]
Signal: SIGIOT [iot trap]
Aborting.
|
Any ideas? |
|
Back to top |
|
|
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Sun Jan 25, 2004 4:32 am Post subject: |
|
|
Update: ALSA 1.0 support is now in openal cvs, rejoice!
Merlin-TC. This is the same error I am getting. You will get this if you use a kernel patched to ALSA 1.01. If you want to try getting it fixed, go complain to the openal mailing list and hopefully something will happen soon. :-/ _________________ Think about your breathing.
http://floam.sh.nu
Last edited by floam on Wed Jan 28, 2004 12:00 am; edited 2 times in total |
|
Back to top |
|
|
Merlin-TC l33t
Joined: 16 May 2003 Posts: 603 Location: Germany
|
Posted: Sun Jan 25, 2004 9:21 am Post subject: |
|
|
hey floam,
thanks for your reply.
I thought it's a mistake on my end.
Guess we will just have to wait then. |
|
Back to top |
|
|
soroh6 Apprentice
Joined: 07 Nov 2002 Posts: 232
|
Posted: Sun Jan 25, 2004 9:44 am Post subject: |
|
|
Just a couple questions in regard to your ~/.openalrc --
Code: | (define speaker-num 4)
(define devices '(alsa))
(define alsa-device "surround40:0,0") |
Now, I've never used OpenAL but I figured I'd install this anyways 'just in case' one day.
First, the define speaker-num -- I have 5.1 speakers (fronts, rears, center + sub [as I'm sure you already knew this]) .. should I set speaker-num to 5?
Second is the (define devices '(alsa)) .. is that a parse error with the apostrophe?
Thanks. _________________ :: soroh -*~ |
|
Back to top |
|
|
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Sun Jan 25, 2004 7:23 pm Post subject: |
|
|
soroh6: That's not a parse error, and while you can set it to surround51 and set speaker number to 6, you wont notice a difference, since no games make special use of the center channel. _________________ Think about your breathing.
http://floam.sh.nu |
|
Back to top |
|
|
gebner Tux's lil' helper
Joined: 01 Jan 2004 Posts: 100 Location: Wien, EU
|
Posted: Sun Jan 25, 2004 8:34 pm Post subject: |
|
|
floam wrote: | soroh6: That's not a parse error |
It's actually meant to prevent the lisp interpreter to execute the "alsa" function and to get a list containg only the element alsa instead. _________________ clue = if 0 == 0 then clue else error "The poster didn't have any clue when he posted this." |
|
Back to top |
|
|
soroh6 Apprentice
Joined: 07 Nov 2002 Posts: 232
|
Posted: Mon Jan 26, 2004 5:46 am Post subject: |
|
|
Thanks for the replies. _________________ :: soroh -*~ |
|
Back to top |
|
|
floam Veteran
Joined: 27 Oct 2002 Posts: 1067 Location: Vancouver, WA USA
|
Posted: Wed Jan 28, 2004 12:00 am Post subject: |
|
|
Looks like ALSA 1.0 support was added yesterday to cvs, yay :) Everyone is going to want to delete their alsa.c (and makefiles if one chose that route to fix it) and refetch. Maybe wipe out the entire directory if not sure what exactly's been tampered with. _________________ Think about your breathing.
http://floam.sh.nu |
|
Back to top |
|
|
Moled l33t
Joined: 09 Jul 2003 Posts: 635
|
Posted: Wed Jan 28, 2004 1:55 am Post subject: |
|
|
heh
i'm not sure if this was the lastest aa patch, or swapping the openal.so over, but in americas army, the last special forces training mission, the person that gives you your briefing in the helecopter sounds as if hes taken a bit too much helium? :p |
|
Back to top |
|
|
|