Handling DTS / AC3 Music Files (1 Viewer)

orencha

Portal Pro
February 2, 2005
66
14
Netanya
Home Country
Israel Israel
Yes.
I know it sounds weird, but DTS can also be used as an audio-only format for music.
There are actually many music titles now, available in DTS (either on DVD or DTS-CD). I personally bought all Depeche Mode's albums that were re-mastered in 5.1 channels, and are available as CD/SACD+DVD sets.

I now have many DTS streams (files ripped from my DVDs), which are plain "bit-perfect copy" DTS streams with ".DTS" file extension.

I currently use them in MediaPortal (one advantage over playing from DVDs directly, is that I can build playlists and shuffle among different albums). I'm able to hear those streams just right (SPDIF passthrough to my Amplifier), using a directshow filter (either MPA or FFDSHOW) and adding the ".DTS" extension to MediaPortal's "music extensions" configuration.

However...
Current support in MediaPortal for DTS music files is very poor. Here are the reasons, along with suggestions for improvements:

  1. BASS Engine cannot play those files. Therefore, I find myself going to the MP configuration too many times, switching between "BASS" (which is cool for other file formats) and "Internal DSHOW" (which is the only way to play DTS). Suggestion: have an additional checkbox option "fallback to Internal DSHOW for formats not supported by BASS". This way I can choose BASS as my music engine, an use it for common formats (MP3, FLAC) and still be able to play "DTS" files directly through DSHOW --> SPDIF.
  2. Music Tags are not supported for DTS files. I know this is not a MP problem, since there's currently no standard way for doing this. However, I can suggest two solutions for MP.
    • Solution 1: padding a ".DTS" file with additional 128 bytes containing a standard ID3v1 tag. I did some tests, and so far those 128 bytes are ignored by the amplifier anyway (since they're not a valid DTS frame). The TagReader will then need to be modified, so it looks for ID3v1 tags at the end of DTS files also. Sounds pretty easy to implement - only the "duration" calculation can be complicated.
    • Solution 2: using an external "filename.tag" file with manual tags entered by the user. Again, the TagReader will have to be modified, so it looks for "xxx.tag" file for "xxx.dts" file, and read tags from it. The ".tag" file can be either XML or INI-style file. An additional "folder.tag" file can also be looked for. It can contain the Tags for all files inside a folder. Very useful for albums! It is also a more generic solution that can be used for other weird formats in the future.

You may consider me of a "pioneer" since I found myself the only person (in this forum) that currently enjoys 5.1 multi-channel music (not video!) in MediaPortal. However, I beleive it will become more common soon, as additional DTS titles are published/re-mastered.

General remark: I used "DTS" format to describe the problem, but the same solution(s) may be applied to "AC3" music files, which also become common. Implementation should be the same for both formats.

Here's an example for a "folder.tag" file, used in my "solution 2" above:

Code:
<?xml version="1.0" encoding="utf-8"?>
<tags>
  <section name="folder">
    <entry name="Album">Violator [DTS]</entry>
    <entry name="Artist">Depeche Mode</entry>
    <entry name="Year">1990</entry>
    <entry name="Genre">Synthpop</entry>
  </section>
  <section name="01-World In My Eyes.DTS">
    <entry name="Title">World In My Eyes</entry>
    <entry name="Duration">266</entry>
    <entry name="Track">1</entry>
  </section>
  <section name="02-Sweetest Perfection.DTS">
    <entry name="Title">Sweetest Perfection</entry>
    <entry name="Duration">243</entry>
    <entry name="Track">2</entry>
  </section>
    :
    :
  <section name="09-Clean.DTS">
    <entry name="Title">Clean</entry>
    <entry name="Duration">214</entry>
    <entry name="Track">9</entry>
  </section>
</tags>

I would like to hear other users' opinions!
Are you listening to DTS music?
Are you listening to DTS music files?
Are you listening to DTS music files through MediaPortal?
 

hwahrmann

Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    Orencha,

    looks like i may be able to help you.

    1. BASS is supporting AC3 playback.
    i just need to implement it.

    2. As for the tags, i would go for ID3v1 + APE Tags at the end of the file.
    you could then even have Coverart included.
    the AC3 would be treated by the Tag reader, same as an MP3 file.
    i just need to find out how to get other infor from the stream, like bitrate, etc.,
    which is not Tag related.

    i'll put it on my list, to be targeted sometimes in the next weeks.

    regards,

    Helmut
     

    orencha

    Portal Pro
    February 2, 2005
    66
    14
    Netanya
    Home Country
    Israel Israel
    Thanks for your quick response, Helmut.

    Can you implement the same ID3 trick for DTS files?

    How difficult to implement is the "fallback to DirectShow" option ? Can I contribute my own code? (I have no experience with team development or SVN).

    I beleive BASS knows to decode AC3 files, however I'm interested in bit-perfect SPDIF pass-through (that's the main idea with those streams... If I just wanted stereo, I have PCM versions of all those tracks as well). I still think a "fallback" option (or even: different extensions list for each player - BASS/DSHOW) is better... Think about crossfading for example... BASS will not be able to crossfade from "regular" (stereo) tracks to SPDIF pass through... It will be easier to just fade the song out and hand the control to the DSHOW (when playing mixed content).

    As for AC3/DTS information, such as duration, maybe you can use the MPA (MPEG Audio by Gabest) DLL that is already part of MediaPortal. It knows to parse both AC3 and DTS files. Actually, now that I think of it... Maybe MPA can be used for DTS/AC3 files, instead of the DSHOW alternative (which use external MPA codec in my configuration anyway).

    Anyway, I think that the ability to use both BASS and DSHOW (for unsupported or future formats) is a more generic and preferred solution than the current "black or white" (DSHOW or BASS) approach. What do you think?
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    sure ID3 stuff can be implemented for AC3/DTS or any other file we like.

    i think BASS will play your ac3/dts stuff very well, but we can also do something with the fallback option.
    I need to think about that a bit.

    if you want to supply me with your own code, that's no problem for me.
    I'll pm you my mail address.
     

    stanik

    Portal Pro
    October 10, 2006
    146
    4
    Home Country
    Czech Republic Czech Republic
    Similar problem but whit dts Audio CD

    I have a similar problem with DTS Audio CD.

    Now its imposible for me find way how can play this type of CD. Everything looks ok but I hear only noise instead of multichannel music. I am using external AV receiver with SPDIF input. Everything working OK, DVD with Dolby Digital or DTS also Divx with AC3 but this ....

    Help Pls.
     

    orencha

    Portal Pro
    February 2, 2005
    66
    14
    Netanya
    Home Country
    Israel Israel
    To play a DTS-CD, the player (BASS or DSHOW) must play the PCM data "bit-perfectly", meaning: no gain change, no re-sampling (must be 44.1kHz), no DSP at all! Additionally, from my experience (with two different SPDIF soundcards), the soundcard volume must be set to 100%, for both "Master" and "Wave Out".

    The reason for that is that a DTS-CD is kind of "tricky": it looks to every player as a "regular" CD (16bit PCM 2-channel 44.1Khz sampling rate). However, a DTS stream is encoded into the PCM frames; so an SPDIF-enabled CD player simply sends the PCM bits to the amplifier through SPDIF, and the amplifier recognize the stream as "DTS". If you hear a DTS-CD without DTS-enabled amplifier you will hear noise. If you modify bits of the stream (such as changing gain), it will not be a valid DTS stream, and again - you'll hear noise.

    Unfortunately, I'm not aware of a simple way of identifying a specific CD as a DTS-CD, so even if we have a "fallback" option from BASS to DSHOW, it will probably not solve the problem.

    However, if we DO find a way to know a CD is a DTS-CD (such as, reading the first 1 second and looking for a DTS frame, which is, again, not simple), even BASS can go into "bit-perfect mode", meaning: all DSPs are disabled for this CD, and the volume is set to 100% (to prevent changing bits in the stream). Note the player will also need to set the soundcard's WAVE and MASTER volumes to 100%.

    PS: the same problem exists with WAV files ripped from a DTS-CD. I have a few of those files, and I can only play them through MediaPortal if I:
    * Choose DSHOW as a player
    * Set soundcard MASTER volume to 100%
    * Set soundcard WAVE volume to 100%

    identifying those files as DTS may be easier to implement; we can simply give them a different file extension, such as ".dts.wav" or ".dtswav". The player (BASS) can then go into "bit-perfect" mode, according to file extension.
     

    stanik

    Portal Pro
    October 10, 2006
    146
    4
    Home Country
    Czech Republic Czech Republic
    Thx for answer.
    I am also finding general solution not only in MP - How Play DTS CD on PC trough SPDIF. Nothing work.
    Win DVD play but not trough SPDIF (silent), KMPlayer is with same result.

    Have someone some workarround or best practice How?
     

    donkenjo

    New Member
    December 30, 2006
    4
    0
    Home Country
    Germany Germany
    I also have a collection of AC3 music from DVD's and just started using Media Portal. Ac3/DTS works perfect using DirectSound.
    The BASS engine of MP 0.2.2 plays AC3 but converts it to stereo, even if gap-less and transitions are disabled. Are there any settings on what codec BASS uses for playback?

    ID3 Tags on AC3 music would be cool, but if you hack a fast solution with which editor would you edit the metadata?
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    AC3 support needs to be enabled in BASS.
    Needs a bit of coding, which i will do within the next 2 weeks, if i find some time.
    I'm currently working on ASIO implementation and still have some problems with that.
    Before this is solved, i can't implement the AC3 stuff, since it is touching the same area of code.

    re: the AC3 Tag editing, i think, an editor like TGF should be able to do it.
    probably te file need to be renamed to *.mp3 or *.ape before being able to edit it.
    haven't tried it yet.
     

    stanik

    Portal Pro
    October 10, 2006
    146
    4
    Home Country
    Czech Republic Czech Republic
    hwahrmann,

    can you look also on dts wav files playback and on DTS CD playback both trough SPDIF in MP?

    Thx and Happy New Year.
     

    Users who are viewing this thread

    Top Bottom