Skip to contentSkip to conversation

Multichannels channel-mapping application API for PCM?

DISCUSSION Daniel Yek 2 participants 3 messages Oct 18, 2006 – Oct 20, 2006

lore
Share & tools
lore

Daniel Yek

author
#0 lore raw

Hi,

First of all, thanks for the previous responses that I got. All that was very helpful. More questions here...

What is the rational behind ALSA's PCM multichannel playback channel assignment? ALSA appears to be using the following channel assignment:

5.1 Channels Channel Assignment:
0: Front left
1: Front right
2: Rear Left
3: Rear Right
4. Center
5. LFE

Is this the only format ALSA supported? Why/how it was selected in the beginning? (Just curious about the history...)

I think (not sure, really) the channel assignment for Windows (if it is really one standard there) is:
0: Front left
1: Front right
2: Center
3: LFE
4. Rear Left
5. Rear Right

I haven't investigated AC3 (Dolby Digital) yet, anybody knows if there is a format for channel assignment there?

I'm looking if there is a solution (application API) provided by ALSA to do channel-mapping. If there is one, I can just ask ALSA to do the "heavy-lifting" of swapping the surround sound channels. If not, I'll iterate through the PCM data, mapping the channels to the format expected by ALSA.

I read about channel bindings in configuration files, but that isn't an application API that media application can use and it requires the end users to mess with their system. So, that isn't a real solution. Is there anything else that is available?

As always, thanks.

Signature · 8 lines
Daniel Yek


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
#1 lore raw

At Wed, 18 Oct 2006 16:53:09 -0700,

Quoted 17 lines · Daniel Yek

Hi,

First of all, thanks for the previous responses that I got. All that was very helpful. More questions here...

What is the rational behind ALSA's PCM multichannel playback channel assignment? ALSA appears to be using the following channel assignment:

5.1 Channels Channel Assignment:
0: Front left
1: Front right
2: Rear Left
3: Rear Right
4. Center
5. LFE

Quoted 1 line

Is this the only format ALSA supported?

Yes.

Quoted 2 lines

Why/how it was selected in the
beginning? (Just curious about the history...)

Hm, I also don't remember correctly why. I thought it's because of consistency between 4.0 and 5.1 setup. The rear offset is identical in both cases.

Quoted 8 lines

I think (not sure, really) the channel assignment for Windows (if it is really one standard there) is:
0: Front left
1: Front right
2: Center
3: LFE
4. Rear Left
5. Rear Right

Yes, for 5.1. Some AC97 codecs follow this order, and currently we do re-routing in alsa-lib because of that.

Quoted 2 lines

I haven't investigated AC3 (Dolby Digital) yet, anybody knows if there is a format for channel assignment there?

FL/C/FR/RL/RR/LFE, if I remember correctly.

Quoted 5 lines

I'm looking if there is a solution (application API) provided by ALSA to do channel-mapping. If there is one, I can just ask ALSA to do the "heavy-lifting" of swapping the surround sound channels. If not, I'll iterate through the PCM data, mapping the channels to the format expected by ALSA.

Currently, there is no setup API for multi-channel binding. The channels are statically defined as FL/FR/RL/RR/C/LFE.

It'd be of course nice to have an API for multi-channel binding. We can define either a read-only or a read-write API, namely,

1. The driver provides a channel mapping information for multi-channel device

2. Apps can change channel bindings dynamically as they like

In each case, we can keep the original FL/FR/RL/RR/C/LFE order as a fallback so that old apps still run without modification.

If you have any API proposal, please let us know.

Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author
#2 lore raw
Quoted 14 lines · Takashi Iwai

<snip...>

Quoted 1 line

I'm looking if there is a solution (application API) provided by ALSA

to do

Quoted 4 lines

channel-mapping. If there is one, I can just ask ALSA to do the "heavy-lifting" of swapping the surround sound channels. If not, I'll iterate through the PCM data, mapping the channels to the format expected by ALSA.

Currently, there is no setup API for multi-channel binding. The channels are statically defined as FL/FR/RL/RR/C/LFE.

It'd be of course nice to have an API for multi-channel binding. We can define either a read-only or a read-write API, namely,

Quoted 7 lines

1. The driver provides a channel mapping information for multi-channel device

2. Apps can change channel bindings dynamically as they like

In each case, we can keep the original FL/FR/RL/RR/C/LFE order as a fallback so that old apps still run without modification.

Thanks much for answering all my question. That is very helpful.

Quoted 1 line

If you have any API proposal, please let us know.

We don't currently have an API for channel mapping. I think ALSA devs. or the sound card driver devs. would be in a better position to design an API that the application can just use, but I'll keep that in mind, if I see something that is useful for the API.

Signature · 8 lines
Daniel Yek


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642