Log in

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


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

deathlord
14th January 2009, 10:01
Well, I am pretty sure it is not possible to get the original data back from the downsampled 2 channels. So it is not lossless. Apart from that, when you play that 2 channel track, you will obviously not get the same room information as with 6 channels, there is a (huge!) loss in that sense, too.
However, I would not be too worried about that. As long as you are only interested in stereo. AC3filter's downmix should be just fine.

spectrvm
16th January 2009, 15:15
... I was already thinking about writing a "madProcessing" filter or something like that and put all processing stuff in there. Such a filter could then be used not only for madFlac, but for other decoders, too. Investing the time to implement processing into madFlac just doesn't seem right to me, because whatever funky processing algorithms I add are then limited to madFlac and can't be used with any other decoder. But then I thought: Why should I do a "madProcessing" filter, if there already exists ffdshow which does most of what is needed?

I totally agree on this one ... this is the way to go, everything minimal and clearly targeted at what it should do. To reinvent the wheel in every codec is a waste of time for you and is one more thing to check at the full Windows media mess.

Whenever you have the time and resources (if that ever be) a stand-alone upconversion/downconversion filter would be greatly appreciated by many !

thanks for your time !

Thunderbolt8
20th January 2009, 18:04
Well, I am pretty sure it is not possible to get the original data back from the downsampled 2 channels. So it is not lossless. Apart from that, when you play that 2 channel track, you will obviously not get the same room information as with 6 channels, there is a (huge!) loss in that sense, too.
However, I would not be too worried about that. As long as you are only interested in stereo. AC3filter's downmix should be just fine.
what would be when I use ac3 filter additionally then to madflac with 5.1 files, just because of the additional +db output function? isnt all the 5.1 sound decoded to pcm via madflac and then sent to ac3 filter and from there outputed as 5.1 again? so would it be still completely lossless in that case, aside from the increased volume applied by ac3filter?

Rectal Prolapse
20th January 2009, 18:24
Thunderbolt8, maybe if you turn off Dynamic Range in AC3Filter it will prevent processing of the PCM data?

Thunderbolt8
23rd January 2009, 04:38
DRC is not enabled. but at mixer options, there are fields like auto gain control, auto matrix with normalize matrix, voice control and expand stereo checkmarked by default. is this adviseable?

btw. the displayed chains for 2.0 and 5.1 tracks are (copy & pasted the displayed info, whatever it means :S):

(PCM24 3/2.1 (5.1) 48000) -> Processor -> (PCM24 2/0 (stereo) 48000) -> Dejitter -> (PCM24 2/0 (stereo) 48000)


(PCM24 3/2.1 (5.1) 48000) -> PCM->Linear converter -> (Linear PCM 3/2.1 (5.1) 48000) -> Input levels -> (Linear PCM 3/2.1 (5.1) 48000) -> Mixer -> (Linear PCM 2/0 (stereo) 48000) -> Equalizer -> (Linear PCM 2/0 (stereo) 48000) -> SRC -> (Linear PCM 2/0 (stereo) 48000) -> Bass redirection -> (Linear PCM 2/0 (stereo) 48000) -> Dither -> (Linear PCM 2/0 (stereo) 48000) -> AGC -> (Linear PCM 2/0 (stereo) 48000) -> Delay -> (Linear PCM 2/0 (stereo) 48000) -> Spectrum -> (Linear PCM 2/0 (stereo) 48000) -> Output levels -> (Linear PCM 2/0 (stereo) 48000) -> Linear->PCM converter -> (PCM24 2/0 (stereo) 48000)

Rectal Prolapse
26th January 2009, 18:38
I'd definitely leave auto gain control unchecked - but I don't know about the others - guess you'll have to experiment.

deathlord
26th January 2009, 18:55
I agree. But just forget the idea of a lossless downmix, that's a contradiction in itself. Maybe there are better and worse downmixes, maybe even one of them is best. But none of them is lossless.
You should let your personal taste decide which you like most. Just my opinion...

mikelebron
27th January 2009, 20:09
Actually, (Im not in front of my home PC) you can just turn off PCM for ac3Filter but leave it on for DTS and AC3.. I find ac3filter to be a much better audio renderer then ffdshow.. BUT I can admit I have limited experience with ffdshow outside of video... soo.. I am biased at this point..

ac3filter I would say is a direct competitor of ffdshow in the ac3/dts/pcm world.. it does not support any of the HD content.. It also does not support 7 or 8 channels..

Take a look... this actually spawned some interest.. Im going to try ffdshow next time im at my PC and playing with some downmixing.. http://ac3filter.net/projects/ac3filter

Thunderbolt8, maybe if you turn off Dynamic Range in AC3Filter it will prevent processing of the PCM data?

clsid
6th February 2009, 21:03
Small bug:
When unregistering the filter, it leaves a registry key behind.
HKEY_CLASSES_ROOT\CLSID\{D26B55F2-8137-4916-9761-B5D415D25768}

Thunderbolt8
10th February 2009, 01:18
madshi, are 192kHz (5.1 channel) files not supported by madflac? tried to play the 5.1 192kHz flac track from the akira blu-ray (truehd), but got a mkx message: "a decoder for the new track could not be found. track type: flac, 192000Hz, 6ch"

do you need a sample (which size; flac or TrueHD source?)

honai
15th February 2009, 20:23
Perhaps a bug: When decoding a 5.1 24bit FLAC with madFlac, AC3Filter will not accept the stream as input (I use AC3Filter to downmix to stereo, don't have 5.1 speaker set at the moment). With 16bit tracks it works.

Thunderbolt8
15th February 2009, 21:43
hm I always use madflac & ac3filter for the same purpose, but for me it works fine so far when choosing 2/0 as output (if thats the same you are hinting at).

deathlord
16th February 2009, 08:52
I don't think this is a bug, as madflac works fine with 24bit input.I could be your soundcard not supporting 24 bit, e.g. rme cards in kernel streaming mode behave like this. In this case you can use ffdshow audio processor to upscale the audio data to 32 bit, this should work.

madshi
16th February 2009, 09:41
Small bug:
When unregistering the filter, it leaves a registry key behind.
HKEY_CLASSES_ROOT\CLSID\{D26B55F2-8137-4916-9761-B5D415D25768}
Oooops. Thanks for reporting.

madshi, are 192kHz (5.1 channel) files not supported by madflac? tried to play the 5.1 192kHz flac track from the akira blu-ray (truehd), but got a mkx message: "a decoder for the new track could not be found. track type: flac, 192000Hz, 6ch"

do you need a sample (which size; flac or TrueHD source?)
madFlac supports 192khz just fine. But the audio renderers usually don't. So you may have to downsample in order to play it. Or try to find an audio renderer which supports 192khz playback.

honai
16th February 2009, 10:53
I could be your soundcard not supporting 24 bit, e.g. rme cards in kernel streaming mode behave like this.

No, the soundcard supports 24bit just fine, and when madFlac decodes the 24bit track I do get sound. The problem is that I want AC3Filter to intercept the 24bit output, and while it works for 16bit output from madFlac it does not work for 24bit output from madFlac.

clsid
16th February 2009, 13:21
Then AC3Filter probably does not accept 24bit input.

madshi
16th February 2009, 13:24
It might have to do with the mediatype used by eac3to. E.g. WAVE_FORMAT_PCM <-> WAVE_FORMAT_EXTENSIBLE. But if AC3filter accepts madFlac input for 16bit, then I don't understand why it shouldn't accept 24bit input, since madFlac does not use different mediatype infos for different bitdepths...

honai
16th February 2009, 15:34
Then AC3Filter probably does not accept 24bit input.

That may be the case.

What other options are there to downmix 24bit 5.1 to 2.0? If I recall correctly, ffdshow Audio does only 16bit internally.

Or madshi might include it in the filter ... :rolleyes:

clsid
16th February 2009, 16:19
It can do audio processing in 16 and 32 bit afaik. I don't know what it choses for 24-bit input. You would need to ask Albain about that.

Thunderbolt8
16th February 2009, 17:29
theres that 'format' field in output in the first tab where you can enter PCM 24-bit. isnt that whats needed?

honai
16th February 2009, 18:13
theres that 'format' field in output in the first tab where you can enter PCM 24-bit. isnt that whats needed?

No, that's for the *output* of AC3Filter (hence the name). I want AC3Filter to support 24bit as *input*, i.e. the output of MadFlac is 24bit, and I want to use AC3Filter to downsample that to 24bit 2.0 channels.

Thunderbolt8
17th February 2009, 00:35
Oooops. Thanks for reporting.


madFlac supports 192khz just fine. But the audio renderers usually don't. So you may have to downsample in order to play it. Or try to find an audio renderer which supports 192khz playback.I dont know what or where the audio renderer here is in this case. I tried to play it with madflac + ac3filter and then with madflac alone, but it didnt work in both cases. I only have madflac checkmarked in mpc as my only audio filter, so actually it should then work, since it is said to support it?

No, that's for the *output* of AC3Filter (hence the name). I want AC3Filter to support 24bit as *input*, i.e. the output of MadFlac is 24bit, and I want to use AC3Filter to downsample that to 24bit 2.0 channels.
where can you see that ac3filter doesnt accept 24-bit input?

Snowknight26
17th February 2009, 01:31
Nope, that's not possible because madFlac was written in Delphi and Delphi doesn't support native 64bit compiling yet.

Has that changed in the last year? :p

73ChargerFan
17th February 2009, 02:16
The article "The Future of the Delphi Compiler" (http://dn.codegear.com/article/39174) says to expect a preview release of their 64-bit compiler mid 2009.

Free Pascal (http://en.wikipedia.org/wiki/Free_Pascal) is Delphi compatible and can target Win64.

honai
17th February 2009, 11:23
where can you see that ac3filter doesnt accept 24-bit input?

Well, the 24bit FLAC I'm playing (as an audio track inside an MKV) is correctly decoded by madFlac, but even though AC3Filter is set to connect to PCM streams in this case it's not connecting and thus doesn't show up in the filter chain of MPC-HC. For 16bit FLAC it works, i.e. madFlac decodes and AC3Filter connects and downmixes to 2.0 just as intended.

shambles
17th February 2009, 12:22
madflac -> ac3filter works fine for me with 24bit tracks :confused: the only thing it doesn't accept is tracks with more than 6 channels

honai
17th February 2009, 13:42
I have a number of 24bit 5.1 FLAC tracks from eac3to muxed into MKV with mkvmerge, none of them connect to AC3Filter after decoding with madFlac (but 16bit 5.1 FLAC tracks do connect).

Perhaps there is a bug after all.

Thunderbolt8
17th February 2009, 14:21
Well, the 24bit FLAC I'm playing (as an audio track inside an MKV) is correctly decoded by madFlac, but even though AC3Filter is set to connect to PCM streams in this case it's not connecting and thus doesn't show up in the filter chain of MPC-HC. For 16bit FLAC it works, i.e. madFlac decodes and AC3Filter connects and downmixes to 2.0 just as intended.
did you set ac3filter on prefer as well? sometimes, if not, its overwritten by other filters then, even though they are not added to the use list at all. in such a case add them then and set those to block, while setting ac3filter to prefer as well

honai
17th February 2009, 14:26
That's irrelevant. As I wrote several times, the chain [source] -> [madFlac] -> [AC3Filter] works for 16bit FLAC tracks, just not for 24bit FLAC tracks. Why would filter merit make a difference for different bit-depths?

Thunderbolt8
17th February 2009, 22:40
so what does exactly happen when it doesnt work the way you described? does the file not play at all?

honai
18th February 2009, 10:33
Perhaps you missed the initial point.

Of course it does play, but I want AC3Filter to be in the filter chain after madFlac because currently I only have a 2.0 setup and therefore need to downmix 5.1 to 2.0, and since madFlac can't do any downmixing ... :)

hubblec4
18th February 2009, 18:01
some questions...

in your dsfilter madflac.ax: i can enable 5.1 channels only. it will downmix the 2 surround-channels into 5.1? or i lose the 2channels?

when i lose the 2subchannels is it possible to create an option to downmix the 2 subchannels??

hubble

Mark_A_W
20th February 2009, 13:04
That may be the case.

What other options are there to downmix 24bit 5.1 to 2.0? If I recall correctly, ffdshow Audio does only 16bit internally.

Or madshi might include it in the filter ... :rolleyes:

I believe the 16 bit limitation of ffdshow only affects ffdshow FLAC decoding.

My filter path is Madflac->ffdshow audio, upconvert to 32bit->Reclock using Kernel Streaming (needs 32bit for soundcard drivers, 24bit doesn't work).

From my testing ffdshow does pass/process 24bit uncompressed without loss.

Wag
22nd February 2009, 03:28
Getting a false positive on the Madflac 1.8 posted here on Vista64, AVG AntiVirus- "Win32.Trojan-Dropper.Delf"

nautilus7
22nd February 2009, 03:32
Report that to AVG if you want it to get fixed.

madshi
22nd February 2009, 07:14
Yeah, please report it to AVG, thanks!

Mike5
25th March 2009, 15:10
I came across MadFlac surfing the web and finally managed to play multichannel FLAC (5.1) with a DirectShow player.

Previously, with other Flac source/decoders I couldn't (MPC-HC, ZP e WMP11 crashed) and was forced to use Foobar, loosing the DirectShow flexibility (for example I couldn't reencode in AC3 for S/PDIF passthrough).

Now I can play multichannel 96/24 FLAC with MPC-HC, ZP6 and even with the awful WMP11.

So, many thanks and congratulations for your valuable work.:thanks:

leeperry
1st April 2009, 03:07
here's a 24/96 sample that works fine in winamp and give garbage in madflac 1.8 :
http://www.megaupload.com/?d=LYMN7DI4

I extracted it from an original DVD-A w/ DVDA-Explorer, the WAV file is fine, I've also tried to encode it in "level 8" w/ the official FLAC GUI(flac 1.21)...it also gave garbled audio in madflac.

OTOH I've got some other 24/96 FLAC files that work fine in madflac...WavPack it is then :o

I could have tried ffdshow's FLAC decoder if it had been possible to use madflac's source filter w/ an external decoder..

Mike5
1st April 2009, 10:17
Tried the sample:

- ZP6 with MadFlac: it stop after 11 seconds with the timebar blinking; no error reported.

- MPC-HC with MadFlac: it stops after 11 seconds; no error reported.

- ZP6 with Illiminable Flac: ZP crashes.

- MPC-HC with Illiminable Flac: it stops after 11 seconds; no error reported.

- FooBar: it stops after 11 seconds giving this error:
Decoding failure at 0:11.861 (Unsupported format or corrupted file).

Don't have Winamp.

So i guess there must be something wrong in the sample at the 11th second.

leeperry
1st April 2009, 10:58
well it's been cut you know, I wasn't gonna upload a 300mb sample :)

when I play it in MPC using madflac I get garbled audio...you get perfect audio :confused:

some other 24/96 FLAC work perfectly fine..

EDIT: apparently it's ffdshow audio that's at fault :confused:

keep ffdshow audio forced by checking "all supported" and you get garbage, at least I do.

some big/small endian story maybe? but all my other 24/96 FLAC work fine, and WavPack 24/96 on that wav file works fine too :o

Mike5
1st April 2009, 11:28
Sorry, I didn't realize the ratio between size and duration in a FLAC 24/96.

Anyway the 11 seconds available play fine on any combination.

I tried to add ffdshow audio to the graph in MPC-HC, setting uncompressed = all supported. It plays fine. I checked ffdshow is used in Filters and, to be utterly sure I checked Resample to 48000 Hz in ffshow audio. Now, in Filters / ffdshow Audio / Pin Info, I get:
IN: nSamplesPerSec: 96000
OUT: nSamplesPerSec: 48000

that should mean ffdshow works.

tebasuna51
1st April 2009, 11:42
Using flac.exe there are also a error:
flac.exe -d 96000.flac

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.

96000.flac: 5% complete

96000.flac: ERROR while decoding data
state = FLAC__STREAM_DECODER_END_OF_STREAM

Or your file is corrupt or is a encoder problem (is not a decoder problem)

EDIT: Sorry, I don't read in this page 18

"well it's been cut you know, I wasn't gonna upload a 300mb sample "

Then we can't test a cut flac.

leeperry
1st April 2009, 11:53
my file is not corrupt, I didn't bother cutting a 3" from the WAV file and prefered to cut it afterwards...oh well, my other 24/96 FLAC work fine in madflac and compressing this file to WavPack works fine too, I guess I didn't even need to mention it here..

clearly ffdshow is the problem, as sound is fine if I disable it and only use madflac :confused:

@Mike5 : MPC HC has its own FLAC decoder I think, is it really using madflac? no matter what I do(16/24/32 float output) ffdshow(latest ICL10 build from xvidvideo.ru) still outputs garbage :o

Mike5
1st April 2009, 12:43
I'm sure I use madflac because:

- I use Beliyaal MPC-HC 22 and have disabled both Source Filter and Flac Transform Filter in Internal Filters

- I set Codecs / Flac to disabled in ffdshow audio

- If I go in Filters / madFlac / Pin Info I get:

Filter : madFlac Source - CLSID : {C52908F0-1C06-4C0D-A4CD-3D10EA51C757}

- Connected to:
CLSID: {0F40E1E5-4F79-4988-B1A9-CC98794E6B55}
Filter: ffdshow Audio Decoder
Pin: In

- Connection media type:
Audio: WAVE_FORMAT_EXTENSIBLE 96000Hz 6ch 13824Kbps

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: 96000
nAvgBytesPerSec: 1728000
nBlockAlign: 18
wBitsPerSample: 24
cbSize: 22 (extra bytes)

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

So the stream is already decodec when outputs madFlac.

Mike5
1st April 2009, 12:58
Wait, reading again the output I posted above I realized this is a 6 channels audio and managed to get what you call garbled audio (new word form me in english).

If I tick Mixer in ffdshow audio and set Output speaker configuration to 2/0/0 - stereo, I get a confused superposition of the six channels that sounds like a static plus some scattered gongs.

If this is your problem, set Mixer to 3/0/2 - 5 channels or simply untick Mixer and it should play fine.

leeperry
1st April 2009, 13:18
whatever I pick in the mixer, I still get saturated static....even if I uncheck all the filters in ffdshow audio.

doesn't occur w/ other 24/96 FLAC files or the same exact wave file encoded to WavPack, oh well that will remain a mistery I guess :D

leoliver
3rd April 2009, 04:55
Hi Everyone,

I recently installed Madflac on my Win XP Pro Sp3 computer , and it worked flawlessly when playing flac files on WMP 11.
Now I have a friend who wants to convert his WMA files to flac and play them back on his Windows XP Media Center Edition computer , with WMP 11. He successfully encoded some files to flac , and then installed Madflac, but then he phoned and told me that his flac files won't play with Madflac on his Windows XP Media Center Edition .
I'm going to his home tomorrow to look at his computer, but first I wanted to ask if Madflac will work on a Windows XP Media Center Edition system ? And if so , what other issues could cause flac play back problems on a Windows XP Media Center Edition computer ?
Thanks.

leeperry
3rd April 2009, 21:03
If this is your problem, set Mixer to 3/0/2 - 5 channels or simply untick Mixer and it should play fine.
ok thanks for your help! but can you try my sample in WaveOut please?

I've run more tests. If I completely reset ffdshow and force it for uncompressed audio and use MPC Classic, I get garbage in WaveOut w/ some 24/96 FLAC in madflac...but not in DS :o

for the record, I've got an M-Audio Audiophile USB on XP SP3...what's weird is that it works perfectly fine w/ MPC HC's FLAC decoder in WaveOut..

too bad ffdshow's "number of channels" detection works fine w/ madflac/wavpack DS decoders but not w/ MPC HC's decoder...and my MME drivers being bit-perfect there's no chance I'm gonna go WDM :D

gotta love HTPC's, it takes a lot of trial & error :devil:

Mike5
4th April 2009, 17:20
Ok, these are my tests:

MPC-HC / madFlac / ffdshow / WaveOut
The sound is severely disturbed, like in your setting. I have the full Beatles Love in multichannel FLAC and tried
other songs for a longer period: they are all disturbed, even though "While my Guitar..." is perhaps the worst.
It doesn't happen with DirectSound
It doesn't happen if ffdshow is not in the graph.

Other 6 channels 48KHz 24 bit or two channels FLAC that I tried play fine with these settings.

MPC-HC / MPC-HC FLAC source/filter / ffdshow / WaveOut
The sound is fine, but I noticed that in the FLAC filter properties Output sample format is set to 16 bit. If I set it
to 24 bit the sound becomes much softer and a sort of echo appears.

MPC-HC / MPC-HC FLAC source/filter / WaveOut
If I remove ffdshow setting Uncompressed to disabled, on the contrary the sound is fine only if the FLAC filter is set
to 24 or 32 bit. If I set it to 16 bit there is no sound at all.

MPC-HC / madFlac / ffdshow or not ffdshow / Reclock set to WaveOut
If I choose Reclock as audio renderer and set "Audio interface to use for PCM sound to" WaveOut ... surprise surprise ...
the sound is perfect, ffdshow present or not. Reclock says: Audio stream: 96000 Hz, 6 channels, 24 bits PCM and Audio:
WaveOut (bit exact).

What conclusions ? Perhaps ffdshow doesn't cope well with WaveOut when the input is 96KHz 24bit. Even with the MPC-HC
decoder if ffdshow receives 96/24 there is a strange sound. It depends on the input of ffdshow, not the output, because
if I limit the output to 48/24 96/16 or 48/16 using resampler and output options nothing changes.

Perhaps when Reclock put itself in the middle between fffshow and WaveOut, it fixs the problem. See if Reclock solves
your problem. If it does, then we'll notify James that it is not only for video problems...:D

leeperry
4th April 2009, 18:28
ok thanks for the tests :)

well, the same exact file in WavPack 24/96 5.1 works fine w/ ffdshow, same for the plain multichannel WAV file :o

OK I'll try w/ Reclock, but then you need to add +500 ms delay in ffdshow to counterbalance Reclock's cache :rolleyes:

anyway I've never understood why FLAC got so big.....APE does higher compression for stereo, and WavPack for multichannel....FLAC is not the best in any field, and WavPack is also open source(APE is not)