I am looking to do this:

-----------                                ---------------             -------------------                    --------------
| DTS/ |  --RAW bitstream-->  |  S/PDIF |   -------> |  ac3dec or  |  -----6ch--->  |  jackd  |
| AC3  |                                |  INPUT  |             |   similar      |                    -------------
-----------                                ---------------             -------------------



Is this possible? Ideally I would want the decoder to be able to automatically switch between AC3 and DTS decoding or pass through for 2 ch stereo PCM, though appreciate this may be asking a bit much.

The idea is that I pipe the decoder 6 ch audio into BruteFIR via jackd for realtime room correction, then output to amps as analog audio.

Thanks,

Chris