Archive:Intel Linux Modifications for HD Audio

From Official Kodi Wiki
Revision as of 20:16, 11 August 2013 by Fritsch (talk | contribs) (linux-firmware)
Jump to navigation Jump to search

 Audio: AudioEngine HOW-TO: Configure audio Windows Settings Intel Linux Modifications for HD Audio 


Kernel

HD Audio on Intel SandyBridge & IvyBridge systems require a patch from Intel to be included within the kernel, Linux 3.7 and higher include this patch as standard.

For more on this patch refer to Intel HDMI HBR patches for HD Audio

Kernel upgrades

To upgrade the kernel you need to obtain 3 files either x86 or x86_64 depending on your architecture.

Download 3 debs to a directory from this site http://kernel.ubuntu.com/~kernel-ppa/mainline/ (at time of writing 3.10.5 is/was the stable version) or greater. We also update the linux-firmware as we are at it.

  1. linux-headers-<version numbers>-all.deb
  2. linux-headers-<version numbers>-amd64.deb
  3. linux-image-<version number>-amd64.deb

Maybe download extras optional?

  1. linux-image-extra-<version number>-amd64.deb

Note: The examples above use a x86_64 .deb packages you need the correct architecture or else!!

Kernel Download

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.5-saucy/linux-headers-3.10.5-031005-generic_3.10.5-031005.201308040618_amd64.deb 
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.5-saucy/linux-headers-3.10.5-031005_3.10.5-031005.201308040618_all.deb 
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10.5-saucy/linux-image-3.10.5-031005-generic_3.10.5-031005.201308040618_amd64.deb 
wget http://mirrors.us.kernel.org/ubuntu//pool/main/l/linux-firmware/linux-firmware_1.113_all.deb

Kernel Install

Install the debs with these commands:

cd ~/
sudo dpkg -i *.deb

After a reboot bitstream passthrough should be working. You can check the xbmc.log if your AVR capabilities are correctly identified. If the correct codecs / speaker numbers are not found, check the following settings with your AVR. We are aware that intel is currently really picky with AVRs - on really rare cases we could not get a single sound out of the AVR.

Audio TV Out - Off
TV Control - Off
HDMI Control - Off
Audio Output - AMP

Old workarounds

Intel Systems with both SPDIF & HDMI

On old kernel version (prior to 3.9.x) systems which have a Intel GPU feeding a HDMI out but also have a motherboard SPDIF out also require a patched Linux 3.7 or higher kernel, however further system modification is also required to get sound on the HDMI out. In these circumstances both SPDIF & HDMI share certain system file settings which cause a conflict resulting in the HDMI sound being blocked, to fix this there are two options available:

1. Easy - Blacklist the SPDIF so only HDMI is available for audio, this also has the advantage of surviving system upgrades.

2. Difficult - If both SPDIF & HDMI are required to be active then editing then HDA-Intel.conf is required so there is no conflict in the device settings, however this might have to be reapplied after a system upgrade.

Easy - Blacklisting SPDIF - Fix (WIP)

aplay -L | grep -i iec958

If you find S/PDIF on the same card as your intel hdmi rmmod the module that drives your S/PDIF.

Difficult - HDA-Intel.conf - Fix

WARNING: Only carry this out if you 100% know what you are doing as a wrong step can totally break audio.


This is not needed if you run a kernel >= 3.10.x as this already increases the index internally

This fix requires modification to:

/usr/share/alsa/cards/HDA-Intel.conf

Open the HDA-Intel.conf file with a editor and look for entries containing:

"CTLINDEX="

The numerical value after the = sign need to be increased by 1 so for example "CTLINDEX=1" becomes "CTLINDEX=2"

Example of original /usr/share/alsa/cards/HDA-Intel.conf file

@@ -211,7 +211,7 @@ HDA-Intel.pcm.hdmi.0 {
"cards.HDA-Intel.pcm.hdmi.common:"
"CARD=" $CARD ","
"DEVICE=3,"
"CTLINDEX=0,"

"AES0=" $AES0 ","
"AES1=" $AES1 ","
"AES2=" $AES2 ","
@@ -234,7 +234,7 @@ HDA-Intel.pcm.hdmi.1 {
"cards.HDA-Intel.pcm.hdmi.common:"
"CARD=" $CARD ","
"DEVICE=7,"
"CTLINDEX=1,"

"AES0=" $AES0 ","
"AES1=" $AES1 ","
"AES2=" $AES2 ","
@@ -257,7 +257,7 @@ HDA-Intel.pcm.hdmi.2 {
"cards.HDA-Intel.pcm.hdmi.common:"
"CARD=" $CARD ","
"DEVICE=8,"
"CTLINDEX=2,"
"AES0=" $AES0 ","
"AES1=" $AES1 ","
"AES2=" $AES2 ","
@@ -280,7 +280,7 @@ HDA-Intel.pcm.hdmi.3 {
"cards.HDA-Intel.pcm.hdmi.common:"
"CARD=" $CARD ","
"DEVICE=9,"
"CTLINDEX=3,"
"AES0=" $AES0 ","
"AES1=" $AES1 ","
"AES2=" $AES2 ","

Becomes

@@ -211,7 +211,7 @@ HDA-Intel.pcm.hdmi.0 {
"cards.HDA-Intel.pcm.hdmi.common:"
"CARD=" $CARD ","
"DEVICE=3,"
"CTLINDEX=1,"
"AES0=" $AES0 ","
"AES1=" $AES1 ","
"AES2=" $AES2 ","
@@ -234,7 +234,7 @@ HDA-Intel.pcm.hdmi.1 {
"cards.HDA-Intel.pcm.hdmi.common:"
"CARD=" $CARD ","
"DEVICE=7,"
"CTLINDEX=2,"
"AES0=" $AES0 ","
"AES1=" $AES1 ","
"AES2=" $AES2 ","
@@ -257,7 +257,7 @@ HDA-Intel.pcm.hdmi.2 {
"cards.HDA-Intel.pcm.hdmi.common:"
"CARD=" $CARD ","
"DEVICE=8,"
"CTLINDEX=3,"
"AES0=" $AES0 ","
"AES1=" $AES1 ","
"AES2=" $AES2 ","
@@ -280,7 +280,7 @@ HDA-Intel.pcm.hdmi.3 {
"cards.HDA-Intel.pcm.hdmi.common:"
"CARD=" $CARD ","
"DEVICE=9,"
"CTLINDEX=4,"
"AES0=" $AES0 ","
"AES1=" $AES1 ","
"AES2=" $AES2 ","