[Openal-devel] experimental surround downmix patch + need advise/assistence for
further work
Prakash K. Cheemplavam
prakashkc at gmx.de
Sun Jul 4 02:35:36 PDT 2004
*This patch is not meant for inclusion yet*
Hi,
I am currently working on getting a proper surround downmix into openal.
Here is a first experimental patch doing the above in a hackish way.
Currently I use the quad output for the downmix, which is suboptimal,
but already sounds better then stereo on my DPL amp...
I added a bit of framework into places where I think it belongs to, but
please don't bash me, as I did this within spare time in two days, and
before I had zero knowlegde about openal - and I am no professional
coder. I know that some comments are still lacking...
The surround downmix is achieved by matrixing the rears channels inside
after having them shifted by 90° in phase by a hilbert filter. (I
"stole" the code from Steve's hilbert filer from plugin.org.uk, but I
told him so. ;-)
I have updated most backends to this, but only tested alsa. To activate
surround downmix, speaker-num must be set to 4 (in future to 5 also
possible, for better downmix...) and the new option downmix to 1. The
output will be 2 channel matrixed.
This is my .openalrc:
(define speaker-num 4)
(define downmix 1)
(define devices '(alsa))
(define alsa-out-device "default")
Now the point where I need some assistance form the openal devs:
- Is the way I hacked the stuff inside OK? Or should I put routines into
other sources? If yes, where?
- If you know of a hilbert filter which can be employed onto 16 bit int,
let me know... The buffer for the hilbert filter will be ALshort in the
"real" release.
- I need 3/1 output form openal for downmixing and not 2/2 which is used
in this hack. Where should I place the center channel (and thus the
surround ch)?
I found in alc_speaker.c (I think) following setup (roughly):
for quad: (-c,0,c) (c,0,c) (-c,0,-c) (-c,0,c)
So should in the center n 3/1 be placed at (0,0,c) or rather (circle
line) (0,0,sqrt(2)*c)?
- I want also implement 3/2, 3/3 and 3/4 modes, if soundcard actually
support this. Where should the rear ch in 3/4 mode be placed? At
(-c/2,0,c) and (c/2,0,c)?
- For adding above modes, what parts of the framework should I change? I
plan to add a confing parameter rear-speaker-num, so the mode could be
precisely specified. Furthermore some inside callback functions which
give bach front and rear channels and so forth.
Hope you can help me and appreciate my work.
Cheers,
Prakash
-------------- next part --------------
A non-text attachment was scrubbed...
Name: surround.patch
Type: text/x-patch
Size: 18574 bytes
Desc: not available
Url : http://localhost.localdomain/pipermail/openal-devel/attachments/20040704/23102026/surround.bin
More information about the Openal-devel
mailing list