Kodi Community Forum

Full Version: [Frodo AE] Transcode 192k (DTS / Dolby / whatever) to PCM 96k
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I'm using XBMC 12 Frodo from a fresh install of XBMCbuntu, connected with a SPDIF optical link to a DAC (Cambridge Audio upsampling DAC actually) with a high-end old fashioned 2.0 audio system
No pulseaudio or anything, direct way from XBMC to SPDIF only using ALSA Smile

So when I play a standard FLAC file, obviously I get a 44.1 kHz sampling.
When I play a 192k FLAC file, it doesn't work as my DAC only accepts 96 kHz (and it's also a S/PDIF limitation as far as I know)
When I play a DVDrip file, ok, 44.1 kHz, but when I play a HD Movie (even with DTS Master Audio), it looks like the AudioEngine resamples at 48 kHz.

Now here is my advancedsettings file
<audio>
<resample>0</resample>
<forceDirectSound>0</forceDirectSound>
<audiophile>1</audiophile>
<audiosinkbufferdurationmsec>50</audiosinkbufferdurationmsec>
<allowtranscode44100>0</allowtranscode44100>
<streamsilence>0</streamsilence>
</audio>

I have a few questions about the new AudioEngine :

I don't want to use the <resample> tag, because the DAC can handle 44.1 files, it would be a shame to make the AE upsample it to 96k as my DAC does that better imho (upsampling to 192 kHz with filters and fancy stuff huh).
But I would like to downsample anything that is higher than 96k to 96k.
Is there any tweak who could do the trick ?

In fact, the tag I would need is <allowtranscode96000> so it would downsample anything higher.

Bonus question : Would any solution apply to movies audiostream ? Like, playing a DTS Master Audio (192/24) would be transcoded and downsampled to PCM 96/24 ?

Thanks for your help, guys Smile
Here's how it works: when you play a decoded file (FLAC, mp3, wav) it looks at the sample rate of the file, and then at the closest match the device reports. In your case, playing a 192khz FLAC would downsample to 96khz as the DAC driver should report that as the closest match. A Debug Log would tell what your DAC reports.

The <allowtranscode44100> is only applicable if you are transcoding back to AC3 (Dolby). Thus the "transcode" part. Only applies to multichannel really.

Your DTS-MA question is a doozy. Basically there is no open-source decoder for DTS-MA - we either bitstream it or we don't play it - we can only play the DTS core. This DTS core can be decoded to PCM, unlike the lossless DTS-MA. DTS-MA is always at a sample rate (actually link speed) of 192khz. Your DAC *will not* pass this signal, not only because it requires 192khz but it can only be passed via HDMI as it requires a protected pathway called HDCP, which is only available on HDMI.
Hey thanks for your really quick answer.

I'll check again, but it looks like DTS movies are played correctly.
Actually to make things easier, I didn't talk about HDMI also. I use the "both" pseudo-device in XBMC 12* so the stream is output to direct-SPDIF and also HDMI, and the TV sends it to the DAC via SPDIF (but synchronized with the screenplay, the motionflow induces about 100 ms latency)

I'll give a try with DTS-MA directly to the DAC, and also try to provide a debug log with 192k FLAC to the DAC also !

*btw thanks for this feature, beloved developpers, it was a pain in the ass to create it in ALSA conf since Camelot
Here it is :
http://pastebin.com/bKPCGDKq

It gets interesting from 03:02:10, trying a standard FLAC file (44.1) then a 192k (but I noticed the issue may be that the DAC doesn't support 32 bits float ?)
About the DTS-HDMA, never mind, it looks that the file has a 48k sampling.

So with my current config, I'll use the most of my DAC, playing 44.1k files at 44.1k and 192/24 files at 96/24 ? No issue then Smile

Anyway, thanks for the work achieved in XBMC guys, it seriously kicks ass Smile