Kodi: Adding support for Atmos, TrueHD and DTS:X, DTS-HDMA audio only files

QuadraphonicQuad

Help Support QuadraphonicQuad:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

HomerJAU

Moderator: MCH Media Players
Staff member
Moderator
Moderator
Joined
Jun 13, 2013
Messages
6,109
Location
Melbourne, Australia
If you want to add music only files containing the above codecs to the Kodi Music Library, I recently found a way to do so.

Previously I always converted to FLAC as 5.1 (or 7.1 if the original music was in 7.1 format). Kodi has no issue playing MCH flac up to 7.1. But now I have an Atmos system I want to hear the true Atmos track.

With Atmos and DTS:X you need to have those tracks in their original codec (I was using MKV which is a lossless video format containing both HD video and audio codecs) and playback via HDMI passthrough to an AVR for decoding and playback. But Matroska MKV files are not easily added to the Kodi Music Library, they're seen as music videos.

If you convert to MKA files (Matroska Audio) the original codec is stored unaltered. However, due to a tag reading bug in Kodi its difficult to get them to be added to the Library and a second bug won't allow the Kodi audio player to bitstream Atmos, TrueHD, DTS:X and DTS-HDMA to your AVR. DTS:X and DTS-HDMA: This bug is fixed in latest Kodi 18.3 for DTS:X. Atmos/TrueHD will be fixed in future 18.4. (future as of post date). The tag reading issue will be solved at some point too.

Both the issues above can be solved now for MKA files with these two hacks:

—————-
EDIT: September 2020 - This method is no longer needed as Kodi and M4A files now support Atmos/TrueHD, DTS:X, DTS-HDMA streams. The recommended method is now to remux Atmos etc into M4A files and tag them just like a FLAC file, the tracks can then be scanned into the Kodi music library like any other music file. Latest version of MMH can split an MKV into M4A song files containing an Atmos stream and can tag the M4A files.
——————

1. Getting Kodi to Playback bitstreamed Atmos, TrueHD, DTS:X and DTS-HDMA audio only:

Add a new text file to Kodi's userdata folder:

File named: playercorefactory.xml

File contents:

<playercorefactory>
<players>
<player name="VideoPlayer" audio="true" video="false">
<hidexbmc>false</hidexbmc>
</player>
</players>
<rules action="prepend">
<rule filetypes="mka" player="VideoPlayer"/>
</rules>

</playercorefactory>

This file tells kodi to use its video player to play mka Audio files, meaning the audio track is bitstreamed to the AVR. Its video player can handle bitstreaming everything.


2. Getting Kodi to Import MKA Files into its Music Library:

Create an CUE file containing the album files: Example:

REM GENRE "Rock"
REM DATE 1987
PERFORMER "INXS"
TITLE "Kick 30"
FILE "01. Guns In The Sky.mka" WAVE
TRACK 01 AUDIO
TITLE "Guns In The Sky"
PERFORMER "INXS"
INDEX 01 00:00:00
FILE "02. New Sensation.mka" WAVE
TRACK 02 AUDIO
TITLE "New Sensation"
PERFORMER "INXS"
INDEX 01 00:00:00
FILE "03. Devil Inside.mka" WAVE
TRACK 03 AUDIO
TITLE "Devil Inside"
PERFORMER "INXS"

INDEX 01 00:00:00
etc

EDIT: Currently this CUE method will only work in Kodi if the mka files have no chapters.

I've added a new tool to Music Media Helper (MMH) to Split MKV files containing chapters and convert to individual mka files per song using your selected audio track (I.e. ‘Atmos’). MKVs can be created using MakeMKV pretty easily (directly from your BDAs or BDVs, and its kind of freeware).

I've modified MMH's Tag and Rename tool to support MKA files and auto-creation of CUE files based on the MKA file names and its tags.

I'll release that tomorrow, I need to update docs and do final testing.

NOTE: MMH wont tag MKA (yet), use free MP3TAG to do that.

THX
Garry
 
Last edited:
Wow cool, sounds great! Thanks Garry!

I have my Atmos titles saved as MKV and had just played them as videos. What programme are you using to convert MKV > MKA?

Funnily enough creating a new cue file for the album 'Kick' was on my radar as the chapter times are slightly out!
 
I have my Atmos titles saved as MKV and had just played them as videos. What programme are you using to convert MKV > MKA?

I added a new tool to MMH app (Windows only). It uses MKVmerge. It also has a tool to change MKV chapter times. I used that to fix INXS Kick.
 
I have my Atmos titles saved as MKV and had just played them as videos.

That may be more portable, anyway. I finally created some MKA files a year or so back and found that the Oppo 103 and 203 would not recognize chapters or multiple soundtracks. The same material in an MKV container behaved as expected.
 
I’m creating single song mka with a single audio track, which play in Foobar and Kodi, haven’t tried JRiver.

Oppos are not long term solutions, although some may last longer than others.
 
I’m creating single song mka with a single audio track, which play in Foobar and Kodi, haven’t tried JRiver.

Oppos are not long term solutions, although some may last longer than others.

I agree that Oppo isn't forever. What I was attempting to do with multiple streams in an MKA was have both the quad and 5.1 DSotM in a single file. I thought it would be an easy and interesting way to compare.

I can't for the life of me remember if I tested it in Kodi, though the idea is a no-brainer. Maybe no brain is my issue!
 
That’s a good idea for comparing two tracks but the player would need to allow you to switch tracks. In Kodi, since almost all audio files only contain a single audio track I doubt there’s a way to select a track.

Kodi’s VideoPlayer does expect multiple audio tracks and does allow a user to select the track to hear so putting quad and 5.1 tracks into an MKV would work for comparison/testing.
 
Hey Garry,

Just having a look at this again. I got the Atmos to passthrough with the fix thanks but still having trouble with MKA Kodi tagging. I know this is an ongoing problem that hopefully can get fixed for Kodi 19...

I've split into individual files (no chapters) and created a cue file but with mixed results. I got 1 song from R.E.M. to work but it shows "quotation marks" for song/band/genre etc and I couldn't get Kick to show up at all with the same method? How are you naming your cue files? It's possible I've made a mistake in there as from prior experience it only takes one variation for it not to work!

Screen Shot 2020-04-30 at 08.16.27.pngScreen Shot2.pngKICK.jpgREM.jpg
 
At first glance the cue file doesn’t look right. Let me look at this tomorrow morning. By turn to cook tonight, so already on my second drink during prep work...
 
Just looking at your attachments, not at my PC, I’m wondering if the mka files have a chapter? Can you double check? MKVToolnix is a free download that will show you (and can remove the chapter if there is any).

MediaInfo can show chapters too.
 
Thanks I used MKVtoolnix to convert MKV >MKA. I thought I took out all the chapters but i may have missed one so will double check... It's odd that R.E.M would work and not the INXS...
 
Back
Top