Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding
Register FAQ Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 26th April 2011, 19:18   #1  |  Link
deathlord
Registered User
 
Join Date: Mar 2008
Posts: 101
Avoid kmixer and still get correct 5.1 playback in a 7.1 setup

Hi

In order to get maximum audio quality in Windows, it is probably a good idea to avoid kmixer (whatever its name in the different Windows versions, more details how to avoid it below). It appears that in this case, 5.1 and 7.1 material plays inconsistently, i.e. the side channels of the 5.1 signal are played through the back rather than through the side speakers.*

This thread is intended to discuss the causes of this problem and how to best overcome it. In my opinion it should be possible to play multichannel audio of any common format without having to worry about number of channels or file type every time. Of course one may argue given the number of 7.1 recordings/soundtracks in movies this is not very important. I believe since these sources (BD, BD-audio) exist and are likely to grow in number, the issue should be addressed.
Even though this is a “playback” issue, I think it fits in this section, because it is closely related to how the audio is encoded.

The situation is complicated and confusing. Encoding, OS version, playback software, soundcard driver, audio renderer or audio file format may have an influence. I will do my best trying to explain what is happening. However, I may not have understood everything correctly, so corrections to my explanations are welcome.
I encounter the problem as follows
Audio file format: Wave Format Extensible, 5.1 and 7.1 or flac created from it using eac3to
OS: Win7x64
Playback software: Foobar2000 with WASAPI plugin
Soundcard: RME HDSP 9632 /Soundblaster X-fi Gamer, most recent drivers
However, I expect the problem to appear “somehow” in any Windows with any soundcard and any playback software, as long as a means to bypass kmixer is used I will try to summarize what I have found:
Code:
	RME, WASAPI	Creative, WASAPI	Creative, direct sound
wav             i                    c                   c
flac            i                    i                   i



Here, “i” means incorrect, i.e. surround goes to back, “c” means correct, surround goes to side (while in all cases the routing of 7.1 signals is identical). I can’t test the RME card in direct sound, since the people at RME have not yet managed to write a driver that can correctly play multichannel formats in direct sound.
What strikes me is, that with the Creative card there is a difference between wav and flac, while with the RME card there isn’t.


How did I test this?

I used the official 8 channel test file from Microsoft (http://www.microsoft.com/windows/win...ng71audio.aspx) and created 48/16 versions for 7.1 and 5.1 from it using eac3to and wavewizard:

6 channels wav:
http://www.megaupload.com/?d=T0D09T1A

8 channels wav:
http://www.megaupload.com/?d=GM455Z5I

6 channels flac:
http://www.megaupload.com/?d=EBOBEE16

8 channels flac:
http://www.megaupload.com/?d=Z5DGMDS5


Why does it happen?

Let me try to explain:
In an audio file, the channels are arranged in a certain order. For wave format extensible, Microsoft defines the following order for wave format extensible (http://msdn.microsoft.com/en-us/library/ms713496.aspx , left out irrelevant channels):
FRONT_LEFT 0x1
FRONT_RIGHT 0x2
FRONT_CENTER 0x4
LOW_FREQUENCY 0x8
BACK_LEFT 0x10
BACK_RIGHT 0x20
SIDE_LEFT 0x200
SIDE_RIGHT 0x400

The flac files encoded by eac3to follow the same convention.
When playing back an audio file, some entity has to make sure, each channel is routed to the right speaker. Now as far as I understand, kmixer is this entity. When using direct sound, i.e. kmixer is active (I am not quite sure the two are equivalent), the routing should be correct.
If kmixer is not used, I would assume the routing will be 1:1, which would explain exactly why the surround channels come through the back.
However, two entries in the above table cannot be explained like this:
1) The creative card plays back wav correctly even in WASAPI
2) The creative card plays back flac incorrectly in direct sound

Why?
1): All I can think of is WASAPI is not used/not working here or the Creative driver is doing something creative on its own
2): Maybe kmixer is not used here? But why?


How can it be solved?

First of all, I believe, before solving anything, we have to understand what is going on. To me, the above explanations are not yet satisfactory.
My explanation seems plausible at least for what’s happening with the RME card. There, I can see to ways of solving the problem (not involving Microsoft or the sound card manufacturers):
1) Encode differently
2) Change the playback
For 1) one could simply swap side and back of all 7.1 material in eac3to.
Pro: problem solved for a given setup
Con: bad for playback in a setup that actually works correctly

For 2) it gets difficult. Something in the playback chain will automatically have to check if it is a 5.1 or 7.1 file and swap channels accordingly. Maybe it is possible to write a directshow filter that will do this, though I don't know this would be done.


Now, everyone who has arrived down here is invited to comment explain, propose...:-) It would be helpful if some people could confirm this, using other sound cards, too.
Maybe it's a good idea to discuss wav first and save flac for later?

Cheers
deathlord


* I am assuming here that the “correct” way of playing back a 5.1 signal through a 7.1 setup is to play the “surround” channels through the side, the back channels get no signal. Dolby recommends 90-110° for the surround/side speakers in 5.1/7.1 setups, so this seems to be a very reasonable assumption.
edit: See more also my more detailed explanation below: (http://forum.doom9.org/showthread.ph...89#post1496289)

Last edited by deathlord; 28th April 2011 at 11:48.
deathlord is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.