Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57483 - [patch] OpenAL multichannel >4 and surround downmix
Summary: [patch] OpenAL multichannel >4 and surround downmix
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Chris Gianelloni (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-18 07:20 UTC by Prakash Punnoor
Modified: 2005-04-28 15:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Final version of the patch (final.patch.bz2,11.55 KB, application/x-bzip)
2004-07-18 07:21 UTC, Prakash Punnoor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Prakash Punnoor 2004-07-18 07:20:31 UTC
I made a patch against OpenAL CVS giving more output formats. The OpenAL devs seem to ignore my patch, so I ask whether gentoo is interested in incorporating my patch (perhaps via use flag). Depending on how much time I will be having, I'm thinking of making a fork. 

Link to the gentoo forum post (containing a preliminary patch): 
http://forums.gentoo.org/viewtopic.php?p=1309850

Here is a descrition I sent to OpenAL mailing list:

* What can you do with this patch?

- You can take advantage of you multi-channel system, if you have more
than 4 speakers.
- If you just have a 2 channel soundcard, but a Dolby Pro-Logic alike
(or better)  decoder, you can still experience surround sound, by
enabling the surround downmix mode.


I did following things to OpenAL
- Put in a lot of tags which define all kinds of channel combinations
for up to 7.0 and modified functions in al_main and al_source for it
- Beginning of Speaker mapping framework in alc_speaker
- Added more options to openal (see down)
- Implemented the surround downmix thingie in al_mixer. A side note:
I changed the coefficients a bit in comparison to traditional downmix.
Testing with my setup the rear and center channels were too load
otherwise. Feel free to tune the coeffs.
- Changed buffer size to take # of channels into account which makes
more sense in my eyes

I couldn't test the multichannel modes due to lack of hardware, but alsa
gives sound out. Furthermore downmixed 4->2 and 5->2 sound fine.

I only tested alsa backend. I don't know whether the other ones like the
downmixed sound. Anyway, using traditional OpenAL settings shouldn't
break anything.

So I hope this patch doesn't get ignored...


* How does it work?

For multi-channel mode:
I added the "rear-speaker-num" option. So if you have a 5.1 System,
specify this in your .openalrc:

(define speaker-num 3)
(define rear-speaker-num 2)

A LFE is not generated, but a center channel(, whereas cvs openal
doesn't create this center channel).

(In fact using speaker-num would be enough, as the most common modes are
implemented for 4 to 7, but specifying rear-speaker-num is more precise)

If you have a 6.1 or 7.1 system, you could try

(define speaker-num 3)
(define rear-speaker-num 3)

This will give you a back surround center.

resp.

(define speaker-num 3)
(define rear-speaker-num 4)

This will give you two back surround centers beside the normal surrounds.

I haven't tested these modes due to lack of hardware, so I would eb
happy if I got some feedback.

For external decoder/surround downmix mode:

If you have a "simple" Dolby Prologic decoder (or alike: DTS Neo, Circle
Surround, etc.), use this configuration:

(define speaker-num 3)
(define rear-speaker-num 1)
(define downmix 1)


If you have a new amp having Dolby Pro-Logic II or Logic 7, try this
one, which should give rear channel seperation:

(define speaker-num 3)
(define rear-speaker-num 2)
(define downmix 1)

This mode should be downward compatible to Dolby Prologic (old not II),
but makes now sense, of course...

In case you have problem with alsa getting sound, try to force the
internal sampling rate (I added an option for this, as well, as this is
a easy work-around) to your external one:

eg.:
(define sampling-rate 48000)
(define canon-sampling-rate 48000)

Cheers,

Prakash


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Prakash Punnoor 2004-07-18 07:21:19 UTC
Created attachment 35697 [details]
Final version of the patch
Comment 2 Frank van de Pol (RETIRED) gentoo-dev 2005-04-28 11:42:35 UTC
9 months without activity... is this bug stil valid? 
Comment 3 Prakash Punnoor 2005-04-28 13:06:29 UTC
The patch should still work, but it wasn't merged upstream.
Comment 4 Frank van de Pol (RETIRED) gentoo-dev 2005-04-28 15:03:07 UTC
ok. marking bug upstream
Comment 5 Prakash Punnoor 2005-04-28 15:47:37 UTC
Well, I don't wuite see the logics of marking this upstream. Purpose of this bug was to offer gentoo my patch. But if you don't want it...