Audio troubleshooting

This page describes some of the steps you can take to troubleshoot audio problem and gives background information on audio concepts as a foundation for understand why some things work as they do.

= Background = To understand how Kodi processes audio you must first have a basic understanding of how audio in the digital domain works. This page will help guide you to understanding some basics in audio and how to troubleshoot basic audio issues.

Pulse Code Modulation (PCM)
When analog audio is converted into the digital domain the near universal format used is Pulse Code Modulation (PCM). All manipulation of audio in the digital domain is always done on audio in the PCM format, therefore functions in Kodi such as volume control can only be done on PCM data, therefore if audio is in one of the Encoded Formats Kodi must decode the audio to PCM in order to manipulate it for volume control.

Number of Channels
When number of channels is referred to, it will nearly always be the number of PCM channels that is meant. Since PCM is uncompressed audio this is a frequently used way of expressing the raw bandwidth for a particular audio path, thus when you see the "Number of channels" setting in Kodi this is the number of PCM channels.

Encoded Formats
There are two types of encoded formats, these are lossy and lossless.

Lossy
These formats take the PCM audio data and use encoding algorithms to throw away (hence term lossy) audio information that the human ear cannot hear in order to save space. Examples of lossy formats:
 * Dolby Digital AC3
 * DTS

Why 5.1 is possible when number of channels is 2.0?
When audio is in a lossy format it is so much smaller than the original uncompressed PCM data that it's still possible to send 5.1 channels even when "Number of channels" is 2.0.

Take SPDIF as an example, this type of audio path can only handle a maximum of 2 PCM channels, however a format such as DTS can still be passed as 5.1 channels because once encoded into DTS the data is so much smaller than what is required for 2 PCM channels.

Lossless
These formats differ from the Lossy formats in that they don't chuck data away but instead compressed the PCM data with highly sophisticated algorithms that allow the original audio to be reconstructed (hence lossless), this is very similar in principle to the way zip & rar works on documents in that the original source can always be reconstructed. Examples of Lossless formats:
 * DTS-HD MA
 * Dolby TrueHD
 * Flac

For the lossless formats such as DTS=HD MA, although the audio data is compressed the they still require the same number of PCM channels to be available as they are trying to pass unlike the lossy formats so 7.1 channel DTS-HD MA still requires 7.1 PCM channels.

DTS-HD MA
DTS High Definition Master Audio (DTS-HD MA) is the commonly used on Blu-ray and uses a Core plus Extension encoding scheme where:


 * Core - is a lossy DTS stream encoded as 5.1.
 * Extension - is the additional data required for the audio to be lossless including a possible further 2 channels for a 7.1 audio stream.

The advantage of this type of encoding scheme is that equipment that can't decode the full DTS-HD MA will still be able to recognise the lossy Core DTS 5.1 stream. Thus in Kodi if you deselect the DTS-HD option if using HDMI, or you are using SPDIF so that option is not available, then you will get DTS 5.1 out.


 * Pro - compatible with all equipment which supports DTS
 * Con - can be larger than other formats

Dolby TrueHD
TrueHD is another commonly used Blu-ray audio format, however in this case it's a single lossless audio stream so tends to be slightly smaller than DTS-HD MA, however if you have a single TrueHD audio track for your video then all equipment must be capable of decoding it. It you have a mixture of equipment where some can decode Dolby TrueHD and some can only decode Dolby Digital, then 2 audio tracks are required, one containing the Dolby TrueHD audio upto 7.1 channels and one containing Dolby Digital upto 5.1 channels, however having 2 audio tracks will likely negate any space saving over DTS-HD MA.


 * Pro - can be smaller data size than other lossless formats
 * Con - equipment must be compatible with the format

What this means for XBMC?
XBMC has three modes of operation:


 * Passthrough - This is where encoded audio types such as DTS are sent by Kodi for decoding elsewhere, typically a AVR, however the device the encoded audio is being sent to MUST be able to decode the audio format e.g. DTS.
 * Decode - This is where the audio is decoded into PCM, this can be used where a format such as DTS can't be sent in it's encoded format so instead the audio is decoded into PCM.
 * Transcode - This is used where multichannel audio needs to sent over a connection that only has 2 PCM channels, Kodi does this by encoding the 5.1 audio into AC3 5.1.

= Troubleshooting (WIP) = This is currently a Work In Progress

No Audio or Video Stutters
This generally indicates you are trying to pass a format that is not compatible with your hardware.

Check volume
If audio type is PCM then volume needs to be checked. Check that mute is not on with the mute toggle and also make sure volume is at maximum with.

Check passthrough formats
If you have the passthrough option available and it is enabled, then try disabling all the passthrough encoded audio formats such as Dolby Digital. If this fixes the problem then your system is not working with one of the passthrough types, there are then two things you can do:


 * Check files with MediaInfo to see what type of audio they contain.
 * Enable each format one at a time and test a file with that type of audio to see if a problem is encountered.
 * Look the the xbmc.log file, refer to log file for how to find this and enable debug loging, and towards the start you should see all the audio devices listed with it's properties.

Interpret Log
In the log file all valid audio devices installed will be listed, when looking at the log the two important bits of information are lines  m_channels  and  m_dataFormats .


 *  m_channels - this is the number of PCM channels, if HD audio such as DTS-HD is required then 8 channels must be shown here. For example:


 *  m_dataFormats - this is the formats the audio device supports, for example:
 * where
 * = DTS-HD
 * = TrueHD
 * = Dolby Digital Plus
 * = DTS
 * = Dolby Digital
 * = PCM where * is different for each PCM data type e.g.
 * = PCM where * is different for each PCM data type e.g.

No HD Audio
DTS-HD and TrueHD are not shown in the Kodi settings.

In order to pass HD audio there are several things required:


 * The HDMI device that supports HD audio e.g. PC graphic card with HDMI port.
 * If a PC the software on the device including any drivers must also support HD audio.
 * The HDMI receiving device must support HD audio e.g. AVR.
 * The two connected devices must be able to successfully communicate their capabilities with one another via EDID/ELD.