AC-3 encoding for games

Discussion in '3-D Audio' started by strider68744, Oct 20, 2005.

  1. strider68744

    strider68744 New Member

    Joined:
    Oct 20, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hey everyone,

    Okay, I've spent numerous days searching and scouring the Internet for ideas on how to get Audigy 2 ZS soundcards to output Dolby Digital audio to a Dolby Digital-capable surround system.

    I'm currently using the standard (yet latest) Creative drivers, and everything is working just fine.

    I've tried getting AC-3 encoding working through FFDShow (no success, with all honesty), and went with the latest version of AC3filter (1.01a RC5), which works perfectly.
    However, these are DirectShow filters, and only provide AC-3 encoding for anything DirectShow-enabled (media players).
    So movies and music are fine. Things get up-mixed when appropriate (mp3s), and movies get the proper surround sound treatment if they already have the encoding (or not! :)). Without the need for CMSS (a Creative upmixing feature).

    So from my limited understanding, I (and I guess everyone else who doesn't use a SoundStorm or some other hardware Dolby Digital encoder variant) need something that encodes DirectSound channels to AC-3.
    (Then enabling S/PDIF passthrough in your drivers, combined with your Dolby Digital decoding sound system, should do the rest).

    See, I admit that it all sounds fairly pointless when you've got the analog outputs from the soundcard that work just fine. However, there are some cases where people would not want the extra cables or noise, or simply want to get the most out of their hardware. Or sometimes you work a little differently and require lots of strange audio routing, and tons of analog connections is not the best course of action.

    So what's the point of this thread? I would like to request some input or correction on any of this, or if perhaps you can enlighten me on any other solutions.
    I'm hoping that I'm wrong about DirectSound AC-3 encoders not existing to this current day.

    I didn't find anything on whether the kx drivers can do it, but I'd love to be proved wrong. I'd drop the Creative drivers faster than a prom dress on prom night.



    Edit: I neglected to mention that just maybe there's a possibility of getting games or DirectX to use DirectShow filters for their audio processing on some level.
    E.g. instead of encoding a game's DirectSound channels to AC-3, just interface/bridge it all to DirectShow, to have everything done by AC3filter (or FFDShow, if that's your fetish).
    It would either be the two ways I've mentioned, or waiting for AC3filter's talented author to find a way to do it.
     
    Last edited: Oct 20, 2005
  2. strider68744

    strider68744 New Member

    Joined:
    Oct 20, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hmmm okay, I did some more searching and found more threads in these forums on the subject.

    I may be wrong about EAX support happening if anything above mentioned was successful, due to the fact that EAX features are all hardware-based. Passthrough to an external decoder would happen without EAX effects kicking in, I'm thinking.

    This isn't turning out so well.
     
  3. Tril

    Tril Triple screen racing ftw

    Joined:
    Sep 26, 2004
    Messages:
    1,665
    Likes Received:
    19
    Trophy Points:
    48
    Can you tell me what are the settings of AC3filter and what is the filters chain for mp3(drag an mp3 to GraphEdit and tell me what are the filters and how they are connected). When I tried AC3filter, the encoding for spdif only worked for ac3 files. It did not work with mp3 or wav files. It would be great if it worked.

    If I knew that it did work, I would try to code something to make it work. My idea is to make a directsound source filter with a built-in asio host. It could be called "ASIO Source". To test it, you would load "ASIO Source" in GrpahEdit, connect it to AC3filter (and activate spdif encoding) and connect AC3filter to directsound output. I'm not sure if it is possible as I've never coded any directshow filters. Using the ASIO SDK and the Windows Platform SDK I know that I could maybe get something working.

    EDIT : I'm not entirely sure but I think that AC3filter encoding only works for me for files encoded at 48 kHz. I probably have to find a direcshow resampler (to resample to 48 kHz) filter and place it before AC3filter to get it to work.
     
    Last edited: Oct 20, 2005
  4. Tril

    Tril Triple screen racing ftw

    Joined:
    Sep 26, 2004
    Messages:
    1,665
    Likes Received:
    19
    Trophy Points:
    48
    I loaded "ffdshow Audio Processor", placed it before AC3filter and configured it to resample to 48000 Hz. AC3 encoding of AC3filter worked.
     
  5. Maddogg6

    Maddogg6 Tail Razer

    Joined:
    Jun 21, 2005
    Messages:
    4,027
    Likes Received:
    26
    Trophy Points:
    0
    what if your ASIO host utilized DX/VST's also- I did see SRC VST'a - I think AC3 encoders too. The thought of this gives me chills.

    If implementing VST's is a pain to program???, a VST/DX wrapper to use VST's may be possible. Id assume using DX with DS would be easier - but thats an ignorant assumption.

    btw - Please forgive my ignorance, Im tend to learn thru humiliation. :S
     
  6. Tril

    Tril Triple screen racing ftw

    Joined:
    Sep 26, 2004
    Messages:
    1,665
    Likes Received:
    19
    Trophy Points:
    48
    I'm ignorant myself. I've never coded directshow filters and I have no idea if my idea can work. Don't worry about saying stupid stuff. I do it too.

    I just tried AC3 encoding using the latest ffdshow alpha from sourceforge (ffdshow-20041012.exe) and AC3 encoding seems to work well. You have to select AC3 in output and activate resampling to 48000 Hz.

    It's currently a better solution than AC3filter because ffdshow has a built-in resampler. When the ffdshow audio filter is loaded, the resampler is too.

    Another reason is that ffdshow is open source (AC3filter is too but the recent code is not currently available, it seems like the development is halted or done in a closed group) so you can get the source and modify it if required.

    There's something I don't understand. DX filters are classified as directshow filters(I say this because I see them when browsing the list of directshow filters in GraphEdit). But they are different from the other filters in the list of direcshow filters. DX filters can be loaded in some hosts or by using wrapper plugins but directshow filters can't be loaded.
     
  7. strider68744

    strider68744 New Member

    Joined:
    Oct 20, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hey, sorry for the delayed response.

    Yeah, I was going to mention, you could have ffdshow resample everything into 48KHz for AC3filter to encode... but it sounded more complicated than what I had set up.

    Anyways, for AC3filter, I set it to:
    Main
    3/2+SW 5.1 Channels, PCM 32-bit.
    SPDIF () checked.
    Ensure your master/gain levels are zeroed... see, once you get MP3/wav audio to play through AC3 filter, you're going to get it completely passed-through at maximum volume levels... any gain will distort it.
    Further, turn down your receiver/sound system's volume.
    Your system's control panel volume levels won't do anything, apart from muting (duhh, passthrough!).

    Mixer
    I enabled auto matrix and its three associated checkboxes to get multi-channel outputs from stereo sources. You can of course use your own matrix settings.
    Disable Bass redirect.

    Gains
    All zeroed.

    System
    Use AC3filter for all, SPDIF for all.
    Prefer AC3filter, use directsound as default audio renderer.
    (I honestly achieved NO difference between waveout and directsound... it will depend on your media player's setup).

    That was it... my sound system registers the source as a multi-channel input!

    Last but not least, use Windows Media Player classic or something that DEFINITELY uses DirectShow to play your files... I tried Foobar, and figured I was doing something wrong, when I realized it didn't even touch DirectShow. :p

    Still, as great as it is having my mp3s pass through? I need the volume adjustments without touching my sound system, so it's a little bit of an adjustment or burden, in some cases.



    And that ASIO bridge idea sounds very viable... I read about it briefly on these forums, but didn't see any further development (yet). I hope you make some progress! Do you have any idea how many people would benefit from this? heh

    I hope my post helps... but I have a feeling that it would be better resampling to 48KHz through ffdshow anyways.
    I understand that I am neglecting to mention my sound card's settings, but I am using Creative drivers. Nothing special to report, honestly... it would be nothing new to those of you using KX or Creative drivers.
     
    Last edited: Oct 21, 2005
  8. ojlehtin

    ojlehtin Kx User

    Joined:
    Sep 8, 2003
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0

Share This Page

visited