2009-05-13, 10:17
After struggling to get channel mapping correct for all outputs of an realtime ac3 encoded stream, it has become obvious that the audio system is fatally flawed.
I have started to work on fixing it, and I have already got all the DVDPlayer audio codecs working with the new renderer api, and things are working real nice.
What I have done is changed the iChannels parameter to a bitmask of channels instead. When the renderer is opened, the codec returns a bitmask for the renderer. This makes it possible to map 3.0 output with either lfe or center for the third channel.
To make the renderer work, I have modified ALSA to open as many channels as it needs to map the channels to them... ALSA's channel order is FL, FR, RL, RR, CE, LFE... but with 3.0 we need FL, FR, CE... so we have to open 5 channels, sending nothing to RL and RR so that we can send CE out on the correct channel.
The audio renderes now EXPECT the mapping to be one or more of FL, FR, RL, RR, CE, LFE, this means that we remove all the codec checks for mapping, as the codec must output it correct.
I have also updated the codecs to output the standard format, including detection of 3.0 with lfe or center for ac3.
I have started to work on fixing it, and I have already got all the DVDPlayer audio codecs working with the new renderer api, and things are working real nice.
What I have done is changed the iChannels parameter to a bitmask of channels instead. When the renderer is opened, the codec returns a bitmask for the renderer. This makes it possible to map 3.0 output with either lfe or center for the third channel.
To make the renderer work, I have modified ALSA to open as many channels as it needs to map the channels to them... ALSA's channel order is FL, FR, RL, RR, CE, LFE... but with 3.0 we need FL, FR, CE... so we have to open 5 channels, sending nothing to RL and RR so that we can send CE out on the correct channel.
The audio renderes now EXPECT the mapping to be one or more of FL, FR, RL, RR, CE, LFE, this means that we remove all the codec checks for mapping, as the codec must output it correct.
I have also updated the codecs to output the standard format, including detection of 3.0 with lfe or center for ac3.