Log in

View Full Version : madFlac - new DirectShow FLAC source filter + decoder


Pages : 1 2 3 4 [5] 6 7 8 9 10 11

cbemoore
2nd April 2008, 02:26
I think I've tracked down the source of the 0:00 track length problem in WMP11.

For some reason, WMP reports the FLAC bitrate as 0 kbps. I guess WMP11 calculates the track length by dividing the file size by the bitrate, leading to a 0 (or infinite!) track length.

The reason other programs display the track length correctly is probably because they use the track length reported by the filter, instead of calculating it on the fly.

Looking at the MadFlac filter properties in GraphEdit, the filter reports the track length correctly, but it doesn't report the bitrate. Could this be the problem?

Chris

Snowknight26
2nd April 2008, 04:32
In that case, how could some FLAC tracks be seekable whilst others can't?

madshi
2nd April 2008, 06:58
I think I've tracked down the source of the 0:00 track length problem in WMP11.

For some reason, WMP reports the FLAC bitrate as 0 kbps. I guess WMP11 calculates the track length by dividing the file size by the bitrate, leading to a 0 (or infinite!) track length.

The reason other programs display the track length correctly is probably because they use the track length reported by the filter, instead of calculating it on the fly.

Looking at the MadFlac filter properties in GraphEdit, the filter reports the track length correctly, but it doesn't report the bitrate. Could this be the problem?
Good catch! The problem with the bitrate is that with FLAC it's variable. But madFlac should be able to calculate an average bitrate and report that.

madshi
2nd April 2008, 06:58
Madshi, you must have added DTS-encoded FLAC support, or something weird's happening, because I can play it back using madflac in media player classic. which is GREAT. Or perhaps I'm using a combination of filters...quite honestly, I don't really know what I'm doing! But it's working...
Don't know why it works for you but I haven't done anything about DTS/FLAC.

cbemoore
2nd April 2008, 09:20
Good catch! The problem with the bitrate is that with FLAC it's variable. But madFlac should be able to calculate an average bitrate and report that.

Yes, the bitrate is variable between tracks. But each track should report an average bitrate calculated as size/duration.

frenchglen
2nd April 2008, 22:41
Don't know why it works for you but I haven't done anything about DTS/FLAC.
Well, obviously two filters are working at the same time, and media player classic somehow coordinates them automatically, so madflac decodes flac into wav, then whatever I have detecting dts does that and decodes the dts. Very happy, you don't have to do a thing! It also works in WMP which is amazing. Madflac must do something in the background to completely make the player think it's actually a wav file.


The other thing I wanted to ask, was that some tracks that I extract with DVD-Audio Explorer, decode and then re-encode into flac with a number of methods (DVD-Audio Explorer invoking flac.exe, or eac3to converting mlp to flac, or decoding mlp to wav then encoding into flac with dBpoweramp)...do not seem to work properly with madflac, but they do in the latest foobar which uses the latest libflac.

In MPC:

- 2.0ch 24-bit 192kHz track (tried Alan Parson's HDADs, Chicago V) - appears to play through track but silently!
- 4.0ch 24-bit 96kHz track (e.g. Janis Joplin - Pearl bootleg) - crashes MPC upon open.
- 4.1ch 24-bit 96kHz track (e.g. DSOTM bootleg) - crashes MPC upon open.
- 5.0ch 24-bit 96kHz track (e.g. Frank Zappa - Quaudiophiliac) - crashes MPC upon open.

Tracks of all other common resolution combinations I've tried work fine.
To make sure it's nothing at all to do with DVDAExplorer, I made my own 192kHz 24-bit stereo files, as well as 4.0-5.0, and the flac encoded from those had exactly the same results.

clsid
2nd April 2008, 23:52
If you reencode DTS to FLAC then it becomes FLAC and it has nothing to do with DTS anymore. If you decode FLAC you'll get uncompressed PCM audio.

frenchglen
2nd April 2008, 23:58
If you reencode DTS to FLAC then it becomes FLAC and it has nothing to do with DTS anymore. If you decode FLAC you'll get uncompressed PCM audio.
Actually, these are DTS-WAV files which I have then FLAC'd. they're already compressed with DTS, but I like FLAC because of tagging ability.
These files give noise in foobar, so they're definitely DTS-encoded files, encoded "again" in flac.

madshi
3rd April 2008, 09:59
The other thing I wanted to ask, was that some tracks that I extract with DVD-Audio Explorer, decode and then re-encode into flac with a number of methods (DVD-Audio Explorer invoking flac.exe, or eac3to converting mlp to flac, or decoding mlp to wav then encoding into flac with dBpoweramp)...do not seem to work properly with madflac, but they do in the latest foobar which uses the latest libflac.

In MPC:

- 2.0ch 24-bit 192kHz track (tried Alan Parson's HDADs, Chicago V) - appears to play through track but silently!
- 4.0ch 24-bit 96kHz track (e.g. Janis Joplin - Pearl bootleg) - crashes MPC upon open.
- 4.1ch 24-bit 96kHz track (e.g. DSOTM bootleg) - crashes MPC upon open.
- 5.0ch 24-bit 96kHz track (e.g. Frank Zappa - Quaudiophiliac) - crashes MPC upon open.

Tracks of all other common resolution combinations I've tried work fine.
To make sure it's nothing at all to do with DVDAExplorer, I made my own 192kHz 24-bit stereo file, and the flac encoded from that had exactly the same result. (not sure how to make a 4.0 or 5.0 file, would like to know, but I'm sure it would yield same results)
A sample or two would help.

Inventive Software
3rd April 2008, 11:29
I think DTS-WAV is a DTS file with a WAV header on it, same as DD WAV. Can't confirm though.

clsid
3rd April 2008, 12:39
From what I found with google, that seems about right. Compatible decoders will automatically recognize that its actually DTS instead of plain WAV. Incompatible decoders will decode it as regular WAV audio and that results in static.

tebasuna51
3rd April 2008, 15:23
I think DTS-WAV is a DTS file with a WAV header on it, same as DD WAV. Can't confirm though.

Yes, you can see some info in this post (http://forum.doom9.org/showthread.php?p=1107970#post1107970) and related

Thunderbolt8
3rd April 2008, 17:45
any news about that 2 flac tracks with different specs in 1 mkv file thing?

LIGHTNING UK!
9th April 2008, 16:06
madshi,

I've been playing around with your filter today figuring out why it didn't work with ImgBurn and I found that it's because I use WAVE_FORMAT_PCM for the wFormatTag and not WAVE_FORMAT_EXTENSIBLE. I guess that's just something missing from your implementation?

The second thing I noticed is that if I rip a cd track to a wav, encode with flac.exe and then decode it with flac.exe again, the files are identical. The same cannot be said if I use your filter to do the decoding. (I'm ignoring the wave header, don't worry!)

The bulk of the file matches perfectly but the 'silence' at the start/end isn't always faithfully reproduced - it falls a little short. The problem for me is that this then causes problems for 'INDEX 0' markers within a CUE file.

Is there any chance you could look into it?

I've attached a picture of showing the comparison (in hex workshop) between the source and encoded/decoded files.

The 2nd line in the comparison shows 1 byte difference in the files. It was a random 0x02 in the madFlac decoded file amongst a load of digital silence.

The real issue here is the missing 0x4001 bytes of digital silence shown in line 4.

madshi
9th April 2008, 16:18
any news about that 2 flac tracks with different specs in 1 mkv file thing?
Not yet.

I've been playing around with your filter today figuring out why it didn't work with ImgBurn and I found that it's because I use WAVE_FORMAT_PCM for the wFormatTag and not WAVE_FORMAT_EXTENSIBLE. I guess that's just something missing from your implementation?
Originally I used WAVE_FORMAT_PCM. But then I noticed that playing 8 channels didn't work that way. So I looked up Microsoft's documentation and they recommend to use WAVE_FORMAT_EXTENSIBLE. So I switched to that and suddenly 8 channel FLACs played fine. I guess I could probably export both WAVE_FORMAT_PCM and WAVE_FORMAT_EXTENSIBLE. Of course you could also allow both formats. Maybe we should both support both types? :)

The second thing I noticed is that if I rip a cd track to a wav, encode with flac.exe and then decode it with flac.exe again, the files are identical. The same cannot be said if I use your filter to do the decoding. (I'm ignoring the wave header, don't worry!)

The bulk of the file matches perfectly but the 'silence' at the start/end isn't always faithfully reproduced - it falls a little short. The problem for me is that this then causes problems for 'INDEX 0' markers within a CUE file.

Is there any chance you could look into it?
Sure. Does the problem occur with every FLAC file? If it only occurs with some specific files, could you make a sample available for me? If the problem occurs with every FLAC file, a sample is not needed.

I won't have time to check this out until Sunday, though.

LIGHTNING UK!
9th April 2008, 17:25
Maybe we should both support both types?

That's exactly what I've done :)

If connecting the source to the samplegrabber fails when I've set the media type using WAVE_FORMAT_PCM, I then try again having set it to WAVE_FORMAT_EXTENSIBLE.

I haven't yet decided if I should try WAVE_FORMAT_EXTENSIBLE first and then fall back to WAVE_FORMAT_PCM... hmm decisions decisions!

Sure. Does the problem occur with every FLAC file?

I've done some more tests and encoded / decoded all the tracks from a CD. The ones decoded using flac.exe came out exactly the same as the original wavs. Unfortunately not one of the madFlac decoded ones did :(

The all sound fine, they're just not bit for bit perfect copies of the original wav files. For most of them it's just a case of missing digital silence but some have some 0xFF and 0x00 sequences that don't match (I won't pretend to know what I'm talking about here! lol).

For research purposes, I also tried the illiminable filters. Out of the 14 tracks I decoded, only 2 matched the originals.
The DC-Bass Source v1.11 filters are currently the only ones I've found that output perfectly matching data.

If you want/need more info, please let me know.

73ChargerFan
10th April 2008, 18:03
Good catch! The problem with the bitrate is that with FLAC it's variable. But madFlac should be able to calculate an average bitrate and report that.
My family uses Media Center 2005, and this would be a great improvement.

madshi
13th April 2008, 19:48
Looking at the MadFlac filter properties in GraphEdit, the filter reports the track length correctly, but it doesn't report the bitrate. Could this be the problem?
Where did you check the bitrate in the madFlac filter properties? I tried to find the empty "bitrate" field. But I didn't find any "bitrate" field at all! I think madFlac does properly set all parameters. There is no "bitrate" field, but an "nAvgBytesPerSec" field - and that is set correctly by madFlac.

The other thing I wanted to ask, was that some tracks that I extract with DVD-Audio Explorer, decode and then re-encode into flac with a number of methods (DVD-Audio Explorer invoking flac.exe, or eac3to converting mlp to flac, or decoding mlp to wav then encoding into flac with dBpoweramp)...do not seem to work properly with madflac, but they do in the latest foobar which uses the latest libflac.

In MPC:

- 2.0ch 24-bit 192kHz track (tried Alan Parson's HDADs, Chicago V) - appears to play through track but silently!
- 4.0ch 24-bit 96kHz track (e.g. Janis Joplin - Pearl bootleg) - crashes MPC upon open.
- 4.1ch 24-bit 96kHz track (e.g. DSOTM bootleg) - crashes MPC upon open.
- 5.0ch 24-bit 96kHz track (e.g. Frank Zappa - Quaudiophiliac) - crashes MPC upon open.
They all work fine for me with the latest madFlac version (don't know if there was a problem with an older version). The 192kHz track is the only exception: It doesn't play, but it also doesn't crash. The reason why it doesn't play is that the audio renderers don't seem to like 192kHz. That's not the fault of madFlac, though, of course.

any news about that 2 flac tracks with different specs in 1 mkv file thing?
Should finally be fixed with the latest version now.

That's exactly what I've done :)
:) I'm now also exporting both WAVE_FORMAT_EXTENSIBLE and WAVE_FORMAT_PCM.

I haven't yet decided if I should try WAVE_FORMAT_EXTENSIBLE first and then fall back to WAVE_FORMAT_PCM... hmm decisions decisions!
Personally, I think WAVE_FORMAT_EXTENSIBLE is better because it allows to specify a channel mask. With WAVE_FORMAT_PCM you have to guess the channel order.

I've done some more tests and encoded / decoded all the tracks from a CD. The ones decoded using flac.exe came out exactly the same as the original wavs. Unfortunately not one of the madFlac decoded ones did :(
Could you please try the latest madFlac version? I've done some changes and in my (short) tests the output now seems to be bit for bit correct now.

The DC-Bass Source v1.11 filters are currently the only ones I've found that output perfectly matching data.
That is only true for 16bit tracks. For 24bit tracks DC-Bass cuts the lowest significant 8 bits. Which was the primary reason why I started developing madFlac in the first place... ;)

madshi
13th April 2008, 19:50
madFlac v1.8 released

http://madshi.net/madFlac.rar

* added support for WAVE_FORMAT_PCM
* changed standalone file decoding a bit to (hopefully) improve bit for bit correctness
* fixed handling of multiple FLAC tracks with different parameters in a container

Thunderbolt8
13th April 2008, 19:50
thanks very much!

LIGHTNING UK!
13th April 2008, 21:48
Ok, I've just tried v1.8... I'm afraid all the files are still different to the originals :(

For this test, I assume it wouldn't make a difference if I'm still using WAVE_FORMAT_PCM first would it? The files are plain old CD-DA anyway.

73ChargerFan
13th April 2008, 22:29
Below are the results of testing madFlac 1.8 on my XP MCE 2005 system,
using a stereo song, length 3:48, encoded by libFLAC 1.2.0 20070715,
& Vorbis tags.

My goal is to get full FLAC support in WMP11 and MCE 2005. I hope
these results can help in some way.


MPC Home Cinema 1.1.0.0:
"runtime" shown on filter properties page correctly

foobar2000 v0.9.5:
Song properties/Properties tab/Duration shows 3:47.600 (10037160 samples)
Sample Rate 44100 Hz, Bitrate 857 kbps
I guess duration is calculated as #samples/44100

dBpoweramp v12.4 by Spoon:
Explorer file properties /Audio Properties tab
shows "Length" as 3:47 & "Bit Rate" as 1,411 kpbs

Explorer detail columns:
"Duration" & "Bit Rate" are blank
"Length" is 3:47 (new column by dBpoweramp)
"Bit Rate" is 1,411 kpbs (CD) (second column named this, by dBpoweramp)

Windows Media Player 11.0.5721.5230, using WMPTagSupportExtender plugin
"Length" is blank
"Bit Rate" is shown as 0
"Release Year" is blank ("Year" & "Release Year" tags are both present)

madshi
14th April 2008, 07:27
Windows Media Player 11.0.5721.5230, using WMPTagSupportExtender plugin
"Length" is blank
"Bit Rate" is shown as 0
"Release Year" is blank ("Year" & "Release Year" tags are both present)
Well, I don't really know where WMP is getting the information from, unfortunately. So I don't know why some information is shown missing by WMP... :(

cbemoore
14th April 2008, 20:06
Well, I don't really know where WMP is getting the information from, unfortunately. So I don't know why some information is shown missing by WMP... :(

WMP gets the information from WMP Tag Support Extender (an open source project to add a number of different file types to WMP). So it looks like that's where the problem lies.

The source code for WMPTSE is available here (http://sourceforge.net/project/showfiles.php?group_id=151072) - does anyone fancy digging around in the code?

Chris

73ChargerFan
14th April 2008, 20:59
cbemoore, the author of WMPTSE has said that WMP gets the length from the codec, not from tags, but I really don't know. Thanks for posting a link to the code.

cbemoore
14th April 2008, 21:22
cbemoore, the author of WMPTSE has said that WMP gets the length from the codec, not from tags, but I really don't know. Thanks for posting a link to the code.

Well I've been looking around in the WMPTSE code for the last hour, and I can't see anything obvious. But the code does include the FLAC libraries (in object form, not source code) and the FLAC libraries are over 2 years old!

So I guess a first step could be to recompile WMPTSE with the latest FLAC libraries. Unfortunately I haven't got the development environment on my PC or I'd give it a go myself.

cbemoore
15th April 2008, 02:31
I've done some more reading, and the zero length FLAC file issue is a known problem. See this thread started by the WMTSE author:

http://sourceforge.net/forum/forum.php?thread_id=1660321&forum_id=504707

Evidently its a Vista MCE bug, so I wouldn't expect a solution soon!

monohouse
3rd May 2008, 16:49
-----

madshi
3rd May 2008, 19:06
how does it handle 6-channel audio ? does it have a matrix ? or does it just output the first 2 channels if the output is stereo ? there are no options in the decoder
The decoder outputs 6 channels. Downmixing to 2 channels it not supported. I think there are other filters you can connect after madFlac which can do downmixing to 2 channels, e.g. probably ffdShow can do that.

monohouse
4th May 2008, 19:21
-----

clsid
4th May 2008, 19:27
Enable "raw audio" in ffdshow and it automatically place itself between the madFLAC filter and the audio renderer.

madshi
4th May 2008, 21:23
I heard some rumors that ffdshow's flac decoder only supports 16-bit
It's not a rumour, it's a fact, I believe.

according to what I know about audio engineering, "surround" in all it's forms, is based upon the same principles of "pro logic", ac3 was made to change that a little, the question is to what extent that is being used ?
AC3 and DTS tracks are usually 5.1. That means they really contain 6 separate "discrete" channels. "pro logic" is the poor man's approach to surround.

monohouse
4th May 2008, 21:24
-----

madshi
4th May 2008, 21:45
yes, but to what extent do they use it as such ?
Not sure what you mean. You can check every AC3 and DTS track with one of the many tools available for such purpose. E.g. delaycut or eac3to. They will tell you whether the AC3/DTS track has 2.0 channels or 5.1 channels. Most (newer) DVDs have 5.1. Almost all Blu-Ray and HD DVDs have.

while I am at it, do you know if a ASIO/kernel streaming output for MPC exists ?
Reclock is the only one, AFAIK.

Inventive Software
5th May 2008, 13:58
I heard some rumors that ffdshow's flac decoder only supports 16-bit

This is due to libavcodec, which hasn't implemented true 24-bit support across all audio formats. When that happens, ffdshow will thus support 24-bit audio properly.

monohouse
5th May 2008, 18:01
-----

madshi
6th May 2008, 07:09
If you don't like multichannel audio then that's fine. I agree somewhat when talking about conventional music. But I and most other people do like surround VERY much for movies. It's a whole different atmosphere sitting in the middle of the action (surround) compared to sitting in front of the action (stereo). Of course the movie studios know that many people still have a stereo setup, only. So crucial dialog etc will always be available in the stereo channels. But that doesn't mean that the other channels are worthless. Quite in contrast. The movies are made primarily for the cinema and every good cinema has surround sound. So the movie audiotracks were made mainly with surround sound in mind. If you don't have surround sound you're missing half of "the picture". Of course that's not fully true for all movies. But many movies (especially not too old action movies) do have a lot of action going on in the surround channels.

monohouse
7th May 2008, 00:33
-----

monohouse
13th May 2008, 01:33
-----

cghebert
16th May 2008, 18:04
Hi,

Coming over from the eac3to thread as per Madshi's suggestion.

Below is my original post. Behavior seems the same whether I use MadFLAC or the CoreFLAC decoder. Later tonight I can post the filter details (like the post above) if that would help.


Quote:
Originally Posted by cghebert


First time poster but I have been following the thread on and off for a while. I recently got one of the new geforce 8200 motherboards that can send multichannel LPCM over HDMI and have been trying to get it setup properly. I am currently running it in XP SP3. I was able to create a 6 channel FLAC file no problem using eac3, and it plays fine in MPC with madflac. However, for some reason my receiver thinks it is getting a 7.1 channel file, instead of a 5.1 channel file, and the surround right and left channels come out of the surround back right and surround back left channels (I have a 7.1 system), while the surround left and right speakers are silent. All the other speakers (including sub), seem to work fine, except for stuttering, which is most certainly a driver issue, since it happens for all audio tracks.

What I'm trying to figure out is whether this is a another driver issue (quite possibly), or an issue related to how eac3 encodes the tracks. Maybe it is encoding the side surrounds as the back surrounds? This seems unlikely and I can't seem to find any reason why eac3 would, but hopefully someone can chime in and shed some light on the situation.


Madshi: Hmmmm... This may be a bug in madFlac or in the driver. Don't know for sure. It's definitely not a bug in eac3to. Can you please post a report in the madFlac thread?

madshi
16th May 2008, 21:43
Yeah, filter details (plus pin connection info) would help.

cghebert
17th May 2008, 06:11
Madshi,

I'm pretty sure the stuttering has been a heat issue. Somewhat annoying, ECS really should have put a better heatsink on this thing. Anyway, I still have the behavior that when I play the 6 channel FLAC, the sounds come out of the back surrounds, rather than just the surrounds. Also, every PCM that is sent to the receiver shows up as 7 channel PCM, regardless of type. I'm pretty sure this is a driver issue though. Let me know if you can glean anything from the code below, or if you have any other questions. I post over in avsforums as well (same username). Thanks for your input.

Here is the pin info:

[In] FLAC:

CLSID: {6B257121-CBB6-46B3-ABFA-B14DFA98C4A6}
Filter: madFlac Decoder

- Connected to:

CLSID: {149D2E01-C32E-4939-80F6-C07B81015A7A}
Filter: Matroska Splitter (low merit)
Pin: Undetermined (Audio 1)

- Connection media type:

Audio: FLAC 48000Hz 6ch 4608Kbps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: Unknown GUID Name {1541C5C0-CDDF-477D-BC0A-86F8AE7F8354}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 256000
cbFormat: 104

WAVEFORMATEX:
wFormatTag: 0xf1ac
nChannels: 6
nSamplesPerSec: 48000
nAvgBytesPerSec: 576000
nBlockAlign: 12
wBitsPerSample: 16
cbSize: 86 (extra bytes)

pbFormat:
0000: ac f1 06 00 80 bb 00 00 00 ca 08 00 0c 00 10 00 ¬ñ..€»...Ê......
0010: 56 00|66 4c 61 43 00 00 00 22 10 00 10 00 00 00 V.fLaC..."......
0020: 1a 00 84 21 0b b8 0a f0 0d b4 73 48 78 2d 05 fc ..„!.¸.ð.´sHx-.ü
0030: 62 39 42 e1 aa bb a3 b6 d0 26 50 31 84 00 00 28 b9B᪻£¶Ð&P1„..(
0040: 20 00 00 00 72 65 66 65 72 65 6e 63 65 20 6c 69 ...reference li
0050: 62 46 4c 41 43 20 31 2e 32 2e 30 20 32 30 30 37 bFLAC 1.2.0 2007
0060: 30 37 31 35 00 00 00 00 0715....


[OUT] PCM

CLSID: {6B257121-CBB6-46B3-ABFA-B14DFA98C4A6}
Filter: madFlac Decoder

- Connected to:

CLSID: {18C16B08-6497-420E-AD14-22D21C2CEAB7}
Filter: Audio Switcher
Pin: bb1.mka

- Connection media type:

Audio: WAVE_FORMAT_EXTENSIBLE 48000Hz 6ch 4608Kbps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 1
cbFormat: 40

WAVEFORMATEX:
wFormatTag: 0xfffe
nChannels: 6
nSamplesPerSec: 48000
nAvgBytesPerSec: 576000
nBlockAlign: 12
wBitsPerSample: 16
cbSize: 22 (extra bytes)

WAVEFORMATEXTENSIBLE:
wValidBitsPerSample: 16
dwChannelMask: 0x0000003f
SubFormat: {00000001-0000-0010-8000-00AA00389B71}

pbFormat:
0000: fe ff 06 00 80 bb 00 00 00 ca 08 00 0c 00 10 00 þÿ..€»...Ê......
0010: 16 00 10 00 3f 00 00 00 01 00 00 00 00 00 10 00 ....?...........
0020: 80 00 00 aa 00 38 9b 71 €..ª.8›q

madshi
17th May 2008, 08:38
The important thing is the channel mask:

dwChannelMask: 0x0000003f
This seems to be correct to me. So I'd guess that the problem is caused by a driver bug.

tebasuna51
17th May 2008, 11:54
Anyway, I still have the behavior that when I play the 6 channel FLAC, the sounds come out of the back surrounds, rather than just the surrounds.

I agree with madshi, the channel mask:
dwChannelMask: 0x0000003f
is the default for six channels and means: FL,FR,FC,LF,BL,BR
with BL,BR = Back Left/Right
and not dwChannelMask: 0x0000060f = FL,FR,FC,LF,SL,SR
with SL,SR = Side Left/Right (Side, not Surround).

I'm sure your 7.1 audio equipment must have a function to distribute the standard 5.1 format to 7.1 sending the surround sound (Back by default) to the Side and Back speakers.

cghebert
17th May 2008, 16:24
I agree with madshi, the channel mask:
dwChannelMask: 0x0000003f
is the default for six channels and means: FL,FR,FC,LF,BL,BR
with BL,BR = Back Left/Right
and not dwChannelMask: 0x0000060f = FL,FR,FC,LF,SL,SR
with SL,SR = Side Left/Right (Side, not Surround).

I'm sure your 7.1 audio equipment must have a function to distribute the standard 5.1 format to 7.1 sending the surround sound (Back by default) to the Side and Back speakers.

Thanks for the info guys. It does bring me to another question though. It seems like in the dolby and AV receiver literature I read, they refer to 5.1 as front, left, center, lfe, surround left, and surround right. when you then expand to 7.1, you add back surround left and back surround right, or just left back and left right. However, with the dwChannelMask, the default as you stated seems to be left, right, center, lfe, back left, back right.

So, when I am playing the 6 channel FLAC, and the surround channels are labeled back left and back right, maybe they are being sent to the correct channels? To me it just seems that there is an inconsistency between the channel order or at least labeling of the channels between dolby and dwChannelMask. Does this make any sense?

madshi
17th May 2008, 16:50
The situation definitely is confusing. See the following links, especially the 2nd one:

http://www.microsoft.com/whdc/device/audio/multichaud.mspx
http://msdn.microsoft.com/en-us/library/aa474707.aspx

Strictly spoken 0x3f is incorrect. It should be 0x60f. However, 0x3f has historically always been used for 5.1 channel mask. Microsoft sais:

The meaning of the channel mask 0x3F in the first table has changed in the second table to indicate the side-speaker 5.1 configuration (with SL and SR) instead of the back-speaker 5.1 configuration (with BL and BR). This is a special-case interpretation that overrides the usual meaning of the channel mask bits.
So I'm considering the behaviour of the GeForce 8200 to be incorrect. Microsoft wants us to special case 0x3f to the usual 5.1 *side* surround mapping.

But still I'm wondering: Maybe I should change madFlac to use 0x60f instead of 0x3f? But I fear that some audio drivers or audio renderers or DirectShow filters would be confused by that.

@tebasuna51, what do you think?

Maybe I should also discuss this with the ffdshow tryout guys?

73ChargerFan
17th May 2008, 16:59
madshi,

How about sending cghebert a test version recompiled with the 0x60f mask?

However, I agree with tebasuna51 that it may be a receiver configuration issue. I think my receiver has an option to remap the surround speakers from side to rear, but I haven't tried it because I only have 5.1 speakers.

cghebert
17th May 2008, 18:11
Yes, the second link certainly seems to indicate that in XP SP2 (which I have), the mapping has changed such that 0x3f is L,R,C,LFE, side left, side right

Somewhat of an update - when I play the movie through the Arcsoft TMT, I can get TrueHD 5.1, and the surrounds come out of the sides, but my receiver still thinks it is getting a 7 channel stream, due to the 8200 driver issue. It also comes out at 192khz, as opposed to 48khz, which it actually is.

If you send me a sample with the different mask, I can give it a try. I'm probably going to try another OS somewhat soon, since XP definitely has issues with these drivers, plus people seem to have things working in vista64.

tebasuna51
17th May 2008, 19:23
The situation definitely is confusing. See the following links, especially the 2nd one:

http://www.microsoft.com/whdc/device/audio/multichaud.mspx
http://msdn.microsoft.com/en-us/library/aa474707.aspx

Strictly spoken 0x3f is incorrect. It should be 0x60f. However, 0x3f has historically always been used for 5.1 channel mask. Microsoft sais:


So I'm considering the behaviour of the GeForce 8200 to be incorrect. Microsoft wants us to special case 0x3f to the usual 5.1 *side* surround mapping.

But still I'm wondering: Maybe I should change madFlac to use 0x60f instead of 0x3f? But I fear that some audio drivers or audio renderers or DirectShow filters would be confused by that.

@tebasuna51, what do you think?

Maybe I should also discuss this with the ffdshow tryout guys?
In the second link there are a clear typo:
KSAUDIO_SPEAKER_5POINT1 0x3F FL, FR, FC, LFE, SL, SR
KSAUDIO_SPEAKER_7POINT1 0xFF FL, FR, FC, LFE, BL, BR, FLC, FRC
KSAUDIO_SPEAKER_7POINT1_SURROUND 0x63F FL, FR, FC, LFE, BL, BR, SL, SR
must be BL, BR, remember the definitions in first link:
0x00010 Back Left - BL
0x00020 Back Right - BR
0x00040 Front Left of Center - FLC
0x00080 Front Right of Center - FRC
0x00100 Back Center - BC
0x00200 Side Left - SL
0x00400 Side Right - SR
To be coherent with 7.1 and 7.1_Surround the 5.1 must be:
KSAUDIO_SPEAKER_5POINT1 0x3F FL, FR, FC, LFE, BL, BR

The new in the last Ksmedia.h is the 7.1_Surround 0x63F, I propose this channel mask like default instead the less used 0xFF, here you can see the 0x600 (SL,SR).

Where you see 0x60F for 5.1 in precedent documents?
5.1 remains 0x3F always.

I see this comment:
The meaning of the channel mask 0x3F in the first table has changed in the second table to indicate the side-speaker 5.1 configuration (with SL and SR) instead of the back-speaker 5.1 configuration (with BL and BR). This is a special-case interpretation that overrides the usual meaning of the channel mask bits.
absolutely wrong.
The 0x30 in 0x3F means SL,SR but in 0xFF means BL,BR?
And the order in 0x63F FL,FR,FC,LF,BL,BR,SL,SR?

I know also flac, when decode a 6 channel, put 0x60F in channel mask, the problem is reported in this flac Feature Request (https://sourceforge.net/tracker/?func=detail&atid=363478&aid=1949155&group_id=13478)

tebasuna51
17th May 2008, 19:37
Yes, the second link certainly seems to indicate that in XP SP2 (which I have), the mapping has changed such that 0x3f is L,R,C,LFE, side left, side right.

I haven't problem how you want name the channels but 0x3F is the correct mask default for 5.1

If you want name side left to the 5th channel in a wav 5.1 and use the mask 0x10 for it, no problem for me, say you to MS.