Log in

View Full Version : AC3Filter, AC3 realtime encoding, SPDIF output


Phazorx
11th June 2006, 21:59
Hello
I'm trying to setup AC3Filter to encode pretty much any none-AC3 content to make it possible to take advanage of optical cable and external decoder.

However not having much luck, with or w/o spdif option checked it feeds PCM 2.0 intead of AC3 5.1

from MPC i can gather following...
AC3Filter IN:

- Connected to:

CLSID: {38BE3000-DBF4-11D0-860E-00A024CFEF6D}
Filter: MPEG Layer-3 Decoder
Pin: XForm Out

- Connection media type:

Audio: PCM 44100Hz stereo 1411Kbps

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: 4608
cbFormat: 18

WAVEFORMATEX:
wFormatTag: 0x0001
nChannels: 2
nSamplesPerSec: 44100
nAvgBytesPerSec: 176400
nBlockAlign: 4
wBitsPerSample: 16
cbSize: 0 (extra bytes)

pbFormat:
0000: 01 00 02 00 44 ac 00 00 10 b1 02 00 04 00 10 00 ....D¬...±......
0010: 00 00 ..


AC3Filter OUT:
- Connected to:

CLSID: {E30629D1-27E5-11CE-875D-00608CB78066}
Filter: Default WaveOut Device
Pin: Audio Input pin (rendered)

- Connection media type:

Audio: WAVE_FORMAT_EXTENSIBLE 44100Hz 6ch 6350Kbps

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

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

pbFormat:
0000: fe ff 06 00 44 ac 00 00 c8 1c 0c 00 12 00 18 00 юя..D¬..И.......
0010: 16 00 18 00 3f 00 00 00 01 00 00 00 00 00 10 00 ....?...........
0020: 80 00 00 aa 00 38 9b 71 Ђ..Є.8›q

- Enumerated media type 0:

Audio: 0x0092 44100Hz stereo 1411Kbps

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

WAVEFORMATEX:
wFormatTag: 0x0092
nChannels: 2
nSamplesPerSec: 44100
nAvgBytesPerSec: 176400
nBlockAlign: 4
wBitsPerSample: 16
cbSize: 0 (extra bytes)

pbFormat:
0000: 92 00 02 00 44 ac 00 00 10 b1 02 00 04 00 10 00 ’...D¬...±......
0010: 00 00 ..

- Enumerated media type 1:

Audio: WAVE_FORMAT_EXTENSIBLE 44100Hz stereo 1411Kbps

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

WAVEFORMATEX:
wFormatTag: 0xfffe
nChannels: 2
nSamplesPerSec: 44100
nAvgBytesPerSec: 176400
nBlockAlign: 4
wBitsPerSample: 16
cbSize: 22 (extra bytes)

WAVEFORMATEXTENSIBLE:
wValidBitsPerSample: 16
dwChannelMask: 0x00000003
SubFormat: {00000092-0000-0010-8000-00AA00389B71}

pbFormat:
0000: fe ff 02 00 44 ac 00 00 10 b1 02 00 04 00 10 00 юя..D¬...±......
0010: 16 00 10 00 03 00 00 00 92 00 00 00 00 00 10 00 ........’.......
0020: 80 00 00 aa 00 38 9b 71 Ђ..Є.8›q

- Enumerated media type 2:

Set as the current media type

- Enumerated media type 3:

Audio: PCM 44100Hz 6ch 6350Kbps

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: 18

WAVEFORMATEX:
wFormatTag: 0x0001
nChannels: 6
nSamplesPerSec: 44100
nAvgBytesPerSec: 793800
nBlockAlign: 18
wBitsPerSample: 24
cbSize: 0 (extra bytes)

pbFormat:
0000: 01 00 06 00 44 ac 00 00 c8 1c 0c 00 12 00 18 00 ....D¬..И.......
0010: 00 00 ..


i can see on mixer level it is trying to do 6 channels, but fails to encode it i guess


i tried several version from 1.01 and 1.02 branch
(test8 being the latest) on main page of setting for any of these whenever i check "SPDIF" i see (disabled) which most likely is the problem.

the audio card i use is Chaintech AV-710, based on Envy24 HT-S, connected to Logitech z680 via TOSLINK.


Any suggestions?

Skelsgard
12th June 2006, 00:43
it feeds PCM 2.0 intead of AC3 5.1
To your Logitech decoder?
Cause S/PDIF signals are actually 2-ch and the decoder translates them into the proper number of channels according to the info in them (wheter they´re marled as PCM audio or encoded[AC3, DTS, MPEG]).
http://en.wikipedia.org/wiki/S/PDIF
http://www.epanorama.net/documents/audio/spdif.html
BTW, WaveOut can´t handle more than 2 channels. Does your soundboard comes with a "S/PDIF output enable" kinda option?.

When using AC3 encoder form AC3filter, the file I think must already be 48kHz or it will be samplerate changed (NOT resampled) to 48kHz, and the audio will be speeded up. At least form my testings, but it may not apply to all soundboards(so I don´t know if it´s a soundboard thing or AC3filter issue).


CLSID: {E30629D1-27E5-11CE-875D-00608CB78066}
Filter: Default WaveOut Device
Pin: Audio Input pin (rendered)
Also, try to use directly your soundboard. Select the renderer to be i.e. "Chaintech AV70", and NOT "DirectShow: ChaintechAV70" or "Default WaveOut Device".

Phazorx
12th June 2006, 01:32
Thanks for the reply, 48KHz appears to be the problem, i managed to tune FFDShow audio decoder to upsample any stream to 48KHz - in this case AC3 filter engages.

Skelsgard, your answer leads me to another question, is there any other way to properly utilize S/PDIF and optical link, preferably on OS level, in a whay when all channels are passed correctly?

for example - player of my choice is foobar000, it has DSP plugin which does some magic and creates 6 channels, which then fed into the driver via DSound, WAveOut or Kernel Streaming. Either of these choice gives me PCM 2/0 at decoder within speaker however i do see all 6 channels at driver mixer.

MPC has internal, and can use external channel mixers, and is set to upmixing to 6 channels with same result.

basically unless it is native AC3 5.1 i'm failing to convinve my setup that it needs to play more than two channels.

Skelsgard
12th June 2006, 06:28
Either of these choice gives me PCM 2/0 at decoder within speaker however i do see all 6 channels at driver mixer.
That sounds more like a soundboard-related problem if u say that u have 6 channels when monitoring your PC but 2 channels when monitoring your Logitech decoder. What specs does your sb have regarding SPDIF?

Slogra
12th June 2006, 09:29
Why don't you just use the analog outs? The sound has to be converted to analog some time, it doesn't really matter if you let your soundcard or receiver do it. I don't think the DAC of your receiver will be better than your soundcard.

You can only get 5.1 sound trough your digital connection when you encode the sound to ac3 or dts... and both are lossy formats so you'll get quality loss.

3dsnar
12th June 2006, 09:50
BTW. Analog to digital
and digital to analog
conversion is also lossy...
(which you cannot avoid while sending via analog output)
Cheers, 3d

Slogra
12th June 2006, 12:28
So with a analog connection you get these losses:
1. original loss of the lossy codec the movie is encoded in
2. quality loss of digital to analog (by your soundcard)

Digital connection you get more losses:
1. original loss of the lossy codec the movie is encoded in
2. encoding to AC3 or DTS
3. quality loss of digital to analog (by your receiver)

SeeMoreDigital
12th June 2006, 12:48
I often use FFdshow to "real-time" transcode all my MP3, AAC, WAV, Vorbis etc files to AC3 at 640Kbps/48.0KHz

Once everything's been set-up correctly in FFdshow, there's no real need to have AC3 filter installed at all.......


Cheers

3dsnar
12th June 2006, 14:43
So with a analog connection you get these losses:
1. original loss of the lossy codec the movie is encoded in
2. quality loss of digital to analog (by your soundcard)

Digital connection you get more losses:
1. original loss of the lossy codec the movie is encoded in
2. encoding to AC3 or DTS
3. quality loss of digital to analog (by your receiver)

To the first part I would add also distortions caused by analog part of the receiver. Very often, the signal is digitized (if not always in modern equipment) to do some DPLII decoding and some EQ effects, etc. So in fact there is DA conversion (soundcard output),
AD conversion (home theatre amp), DA conversion of the amp.

--
Beside, it all depends on the AD/DA quality and in popular equipment the quality is pretty terrible, and in my subjective opinion significantly more distroys the sound than say AC3 448 kbps quality.

Cheers, 3d.

Kriz
15th June 2006, 04:11
I often use FFdshow to "real-time" transcode all my MP3, AAC, WAV, Vorbis etc files to AC3 at 640Kbps/48.0KHz

Once everything's been set-up correctly in FFdshow, there's no real need to have AC3 filter installed at all.......


Cheers

How would one go about doing that, specifically?

SeeMoreDigital
15th June 2006, 09:10
How would one go about doing that, specifically?This should get you started: -

http://forum.doom9.org/showthread.php?p=718812#post718812


Cheers