On 12/31/2014 01:34 PM, Mark Harmstone wrote:
Needed for surround sound.
ALSA uses a different channel mapping for 5.1 than Windows. Windows wants: front-left, front-right, front-center, lfe, back-left*, back-right* while ALSA wants: front-left, front-right, back-left*, back-right*, front-center, lfe
So you can't just pass the samples through without swapping them.
* This is complicated by the fact that some 5.1 setups use the side channels instead of the back channels, and with the side channels the mappings are the same for both: front-left, front-right, front-center, lfe, side-left, side-right Technically 5.1 is supposed to use the side channels according to Dolby, but until recently Windows has used back and many speakers are color-coded to match the surround speakers to the back speaker jacks. The newer enumerant DSSPEAKER_5POINT1_SURROUND indicates it's using side channels, while the older DSSPEAKER_5POINT1 (aka DSSPEAKER_5POINT1_BACK) indicates the back channels.
On Wed, Dec 31, 2014 at 02:01:36PM -0800, Chris Robinson wrote:
On 12/31/2014 01:34 PM, Mark Harmstone wrote:
Needed for surround sound.
ALSA uses a different channel mapping for 5.1 than Windows. Windows wants: front-left, front-right, front-center, lfe, back-left*, back-right* while ALSA wants: front-left, front-right, back-left*, back-right*, front-center, lfe
So you can't just pass the samples through without swapping them.
I believe winealsa already handles this, though I'd welcome a review. See map_channels() in <dlls/winealsa.drv/mmdevdrv.c>:
http://source.winehq.org/git/wine.git/blob/6bab17313918ec21b196c7e465500f4c2...
I'd like to use the new ALSA channel mapping API at some point, but in the meantime I think it's handled well enough.
Andrew