# [SOLVED] Intel HDA HDMI sound?

## dmac0o1

I can't seem to get my HDMI sound to work system-wide. I managed to get my PCH working by adding:

```
GRUB_CMDLINE_LINUX_DEFAULT="snd-hda-intel.index=1,0"
```

to /etc/default/grub (because my PCH card was originally not being sensed as the "default").

HDMI sound output works on specific applications (VLC: Audio > Audio Device > HDA Intel HDMI, HDMI 1 Audio Output), but I'd like to get it working system-wide (specifically for Firefox). I've read that I may be able to get it working by manipulating the ~/.asoundrc file, but I'm not sure how I should go about doing so.

Here are some of my laptop's specs:

OUTPUT OF aplay -L

```
~ $ aplay -L

null

    Discard all samples (playback) or generate zero samples (capture)

default:CARD=PCH

    HDA Intel PCH, CX20751/2 Analog

    Default Audio Device

sysdefault:CARD=PCH

    HDA Intel PCH, CX20751/2 Analog

    Default Audio Device

front:CARD=PCH,DEV=0

    HDA Intel PCH, CX20751/2 Analog

    Front speakers

surround21:CARD=PCH,DEV=0

    HDA Intel PCH, CX20751/2 Analog

    2.1 Surround output to Front and Subwoofer speakers

surround40:CARD=PCH,DEV=0

    HDA Intel PCH, CX20751/2 Analog

    4.0 Surround output to Front and Rear speakers

surround41:CARD=PCH,DEV=0

    HDA Intel PCH, CX20751/2 Analog

    4.1 Surround output to Front, Rear and Subwoofer speakers

surround50:CARD=PCH,DEV=0

    HDA Intel PCH, CX20751/2 Analog

    5.0 Surround output to Front, Center and Rear speakers

surround51:CARD=PCH,DEV=0

    HDA Intel PCH, CX20751/2 Analog

    5.1 Surround output to Front, Center, Rear and Subwoofer speakers

surround71:CARD=PCH,DEV=0

    HDA Intel PCH, CX20751/2 Analog

    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

hdmi:CARD=HDMI,DEV=0

    HDA Intel HDMI, HDMI 0

    HDMI Audio Output

```

OUTPUT OF cat /sys/class/sound/card*/id

```
~ $ cat /sys/class/sound/card*/id

PCH

HDMI

```

OUTPUT OF cat /proc/asound/devices

```
~ $ cat /proc/asound/devices

  0: [ 0]   : control

  1:        : sequencer

  4: [ 0- 0]: hardware dependent

 16: [ 0- 0]: digital audio playback

 24: [ 0- 0]: digital audio capture

 32: [ 1]   : control

 33:        : timer

 36: [ 1- 0]: hardware dependent

 51: [ 1- 3]: digital audio playback

```

How should I go about making HDMI output work system-wide? If I need to configure ~/.asoundrc, what should the file look like?Last edited by dmac0o1 on Wed May 11, 2016 2:40 am; edited 1 time in total

----------

## dmac0o1

I should add that in alsamixer:

-- "HDA Intel PCH" shows up with all the required volume controls, including microphone, no problems.

-- "HDA Intel HDMI" shows up with only a single "S/PDIF" option that can be muted or unmuted with no volume controls.

----------

## dmac0o1

I get sound through HDMI when I run this test, as well:

aplay -vvv -D plughw:1,3 /usr/share/sounds/alsa/Front_Right.wav 

```
~ $ aplay -vvv -D plughw:1,3 /usr/share/sounds/alsa/Front_Right.wav 

Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

Plug PCM: Route conversion PCM (sformat=S16_LE)

  Transformation table:

    0 <- 0

    1 <- 0

Its setup is:

  stream       : PLAYBACK

  access       : RW_INTERLEAVED

  format       : S16_LE

  subformat    : STD

  channels     : 1

  rate         : 48000

  exact rate   : 48000 (48000/1)

  msbits       : 16

  buffer_size  : 16384

  period_size  : 4096

  period_time  : 85333

  tstamp_mode  : NONE

  tstamp_type  : MONOTONIC

  period_step  : 1

  avail_min    : 4096

  period_event : 0

  start_threshold  : 16384

  stop_threshold   : 16384

  silence_threshold: 0

  silence_size : 0

  boundary     : 4611686018427387904

Slave: Hardware PCM card 1 'HDA Intel HDMI' device 3 subdevice 0

Its setup is:

  stream       : PLAYBACK

  access       : MMAP_INTERLEAVED

  format       : S16_LE

  subformat    : STD

  channels     : 2

  rate         : 48000

  exact rate   : 48000 (48000/1)

  msbits       : 16

  buffer_size  : 16384

  period_size  : 4096

  period_time  : 85333

  tstamp_mode  : NONE

  tstamp_type  : MONOTONIC

  period_step  : 1

  avail_min    : 4096

  period_event : 0

  start_threshold  : 16384

  stop_threshold   : 16384

  silence_threshold: 0

  silence_size : 0

  boundary     : 4611686018427387904

  appl_ptr     : 0

  hw_ptr       : 0

Max peak (4096 samples): 0x0000004e #                    0%

Max peak (4096 samples): 0x0000018a #                    1%

Max peak (4096 samples): 0x0000402a ###########          50%

Max peak (4096 samples): 0x000020e0 ######               25%

Max peak (4096 samples): 0x00001457 ####                 15%

Max peak (4096 samples): 0x000001fb #                    1%

Max peak (4096 samples): 0x000003b8 #                    2%

Max peak (4096 samples): 0x0000006d #                    0%

Max peak (4096 samples): 0x00000031 #                    0%

Max peak (4096 samples): 0x00000030 #                    0%

Max peak (4096 samples): 0x00000439 #                    3%

Max peak (4096 samples): 0x00003c14 ##########           46%

Max peak (4096 samples): 0x00002390 ######               27%

Max peak (4096 samples): 0x0000111b ###                  13%

Max peak (4096 samples): 0x000000da #                    0%

Max peak (4096 samples): 0x0000001f #                    0%

Max peak (4096 samples): 0x000000d9 #                    0%

Max peak (4096 samples): 0x00000052 #                    0%

```

Also, here are my relevant kernel settings (most/all are modules):

```
linux # cat .config | grep SND 

CONFIG_SND=y

CONFIG_SND_TIMER=y

CONFIG_SND_PCM=y

CONFIG_SND_HWDEP=m

CONFIG_SND_JACK=y

CONFIG_SND_SEQUENCER=y

CONFIG_SND_SEQ_DUMMY=y

CONFIG_SND_OSSEMUL=y

CONFIG_SND_MIXER_OSS=y

CONFIG_SND_PCM_OSS=y

CONFIG_SND_PCM_OSS_PLUGINS=y

CONFIG_SND_PCM_TIMER=y

CONFIG_SND_SEQUENCER_OSS=y

CONFIG_SND_HRTIMER=y

CONFIG_SND_SEQ_HRTIMER_DEFAULT=y

# CONFIG_SND_DYNAMIC_MINORS is not set

CONFIG_SND_SUPPORT_OLD_API=y

CONFIG_SND_PROC_FS=y

CONFIG_SND_VERBOSE_PROCFS=y

# CONFIG_SND_VERBOSE_PRINTK is not set

# CONFIG_SND_DEBUG is not set

CONFIG_SND_VMASTER=y

CONFIG_SND_DMA_SGBUF=y

# CONFIG_SND_RAWMIDI_SEQ is not set

# CONFIG_SND_OPL3_LIB_SEQ is not set

# CONFIG_SND_OPL4_LIB_SEQ is not set

# CONFIG_SND_SBAWE_SEQ is not set

# CONFIG_SND_EMU10K1_SEQ is not set

CONFIG_SND_AC97_CODEC=y

CONFIG_SND_DRIVERS=y

# CONFIG_SND_PCSP is not set

# CONFIG_SND_DUMMY is not set

# CONFIG_SND_ALOOP is not set

# CONFIG_SND_VIRMIDI is not set

# CONFIG_SND_MTPAV is not set

# CONFIG_SND_SERIAL_U16550 is not set

# CONFIG_SND_MPU401 is not set

# CONFIG_SND_AC97_POWER_SAVE is not set

CONFIG_SND_PCI=y

# CONFIG_SND_AD1889 is not set

# CONFIG_SND_ALS300 is not set

# CONFIG_SND_ALS4000 is not set

# CONFIG_SND_ALI5451 is not set

# CONFIG_SND_ASIHPI is not set

# CONFIG_SND_ATIIXP is not set

# CONFIG_SND_ATIIXP_MODEM is not set

# CONFIG_SND_AU8810 is not set

# CONFIG_SND_AU8820 is not set

# CONFIG_SND_AU8830 is not set

# CONFIG_SND_AW2 is not set

# CONFIG_SND_AZT3328 is not set

# CONFIG_SND_BT87X is not set

# CONFIG_SND_CA0106 is not set

# CONFIG_SND_CMIPCI is not set

# CONFIG_SND_OXYGEN is not set

# CONFIG_SND_CS4281 is not set

# CONFIG_SND_CS46XX is not set

# CONFIG_SND_CTXFI is not set

# CONFIG_SND_DARLA20 is not set

# CONFIG_SND_GINA20 is not set

# CONFIG_SND_LAYLA20 is not set

# CONFIG_SND_DARLA24 is not set

# CONFIG_SND_GINA24 is not set

# CONFIG_SND_LAYLA24 is not set

# CONFIG_SND_MONA is not set

# CONFIG_SND_MIA is not set

# CONFIG_SND_ECHO3G is not set

# CONFIG_SND_INDIGO is not set

# CONFIG_SND_INDIGOIO is not set

# CONFIG_SND_INDIGODJ is not set

# CONFIG_SND_INDIGOIOX is not set

# CONFIG_SND_INDIGODJX is not set

# CONFIG_SND_EMU10K1 is not set

# CONFIG_SND_EMU10K1X is not set

# CONFIG_SND_ENS1370 is not set

# CONFIG_SND_ENS1371 is not set

# CONFIG_SND_ES1938 is not set

# CONFIG_SND_ES1968 is not set

# CONFIG_SND_FM801 is not set

# CONFIG_SND_HDSP is not set

# CONFIG_SND_HDSPM is not set

# CONFIG_SND_ICE1712 is not set

# CONFIG_SND_ICE1724 is not set

CONFIG_SND_INTEL8X0=y

CONFIG_SND_INTEL8X0M=y

# CONFIG_SND_KORG1212 is not set

# CONFIG_SND_LOLA is not set

# CONFIG_SND_LX6464ES is not set

# CONFIG_SND_MAESTRO3 is not set

# CONFIG_SND_MIXART is not set

# CONFIG_SND_NM256 is not set

# CONFIG_SND_PCXHR is not set

# CONFIG_SND_RIPTIDE is not set

# CONFIG_SND_RME32 is not set

# CONFIG_SND_RME96 is not set

# CONFIG_SND_RME9652 is not set

# CONFIG_SND_SE6X is not set

# CONFIG_SND_SONICVIBES is not set

# CONFIG_SND_TRIDENT is not set

# CONFIG_SND_VIA82XX is not set

# CONFIG_SND_VIA82XX_MODEM is not set

# CONFIG_SND_VIRTUOSO is not set

# CONFIG_SND_VX222 is not set

# CONFIG_SND_YMFPCI is not set

CONFIG_SND_HDA=m

CONFIG_SND_HDA_INTEL=m

CONFIG_SND_HDA_HWDEP=y

CONFIG_SND_HDA_RECONFIG=y

CONFIG_SND_HDA_INPUT_BEEP=y

CONFIG_SND_HDA_INPUT_BEEP_MODE=1

CONFIG_SND_HDA_PATCH_LOADER=y

CONFIG_SND_HDA_CODEC_REALTEK=m

CONFIG_SND_HDA_CODEC_ANALOG=m

CONFIG_SND_HDA_CODEC_SIGMATEL=m

CONFIG_SND_HDA_CODEC_VIA=m

CONFIG_SND_HDA_CODEC_HDMI=m

CONFIG_SND_HDA_CODEC_CIRRUS=m

CONFIG_SND_HDA_CODEC_CONEXANT=m

CONFIG_SND_HDA_CODEC_CA0110=m

CONFIG_SND_HDA_CODEC_CA0132=m

CONFIG_SND_HDA_CODEC_CA0132_DSP=y

CONFIG_SND_HDA_CODEC_CMEDIA=m

CONFIG_SND_HDA_CODEC_SI3054=m

CONFIG_SND_HDA_GENERIC=m

CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0

CONFIG_SND_HDA_CORE=m

CONFIG_SND_HDA_DSP_LOADER=y

CONFIG_SND_HDA_I915=y

CONFIG_SND_HDA_PREALLOC_SIZE=64

CONFIG_SND_USB=y

# CONFIG_SND_USB_AUDIO is not set

# CONFIG_SND_USB_UA101 is not set

# CONFIG_SND_USB_USX2Y is not set

# CONFIG_SND_USB_CAIAQ is not set

# CONFIG_SND_USB_US122L is not set

# CONFIG_SND_USB_6FIRE is not set

# CONFIG_SND_USB_HIFACE is not set

# CONFIG_SND_BCD2000 is not set

# CONFIG_SND_USB_POD is not set

# CONFIG_SND_USB_PODHD is not set

# CONFIG_SND_USB_TONEPORT is not set

# CONFIG_SND_USB_VARIAX is not set

CONFIG_SND_PCMCIA=y

# CONFIG_SND_VXPOCKET is not set

# CONFIG_SND_PDAUDIOCF is not set

# CONFIG_SND_SOC is not set

```

----------

## dmac0o1

Also, here's my /etc/modprobe.d/alsa.conf :

```

# Alsa kernel modules' configuration file.

# ALSA portion

alias char-major-116 snd

# OSS/Free portion

alias char-major-14 soundcore

##

## IMPORTANT:

## You need to customise this section for your specific sound card(s)

## and then run `update-modules' command.

## Read alsa-driver's INSTALL file in /usr/share/doc for more info.

##

##  ALSA portion

## alias snd-card-0 snd-interwave

## alias snd-card-1 snd-ens1371

##  OSS/Free portion

## alias sound-slot-0 snd-card-0

## alias sound-slot-1 snd-card-1

##

# OSS/Free portion - card #1

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

##  OSS/Free portion - card #2

## alias sound-service-1-0 snd-mixer-oss

## alias sound-service-1-3 snd-pcm-oss

## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

# Set this to the correct number of cards.

options snd cards_limit=2

# NEW LINE

options snd-hda-intel id=PCH index=0

options snd-hda-intel id=HDMI index=1

```

----------

## v_andal

This page https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture describes various ways to configure Alsa. Try to read through and pick up the most convenient for you. In the simplest case you would write something like

 *Quote:*   

> 
> 
> pcm.!default {
> 
>     type hw
> ...

 

in your /etc/asound.conf. But this has a drawback that you have to fix the numbering of cards during boot. You may prefer to use names of cards visible to alsa and reported by aplay -l.

So try reading and configuring  :Smile: 

----------

## dmac0o1

I emerged pulseaudio according to the instructions on the Gentoo wiki, and now everything works as it should. I can easily toggle between HDMI, speakers and headphones now. My mic works without any problems either.

I suspect the problem was that some applications, like Firefox, only recognise the "default" sound card for the system. It seems (to my untrained eye) that pulseaudio sinks all the sound cards into a single system "default" mixer whose content can be toggled from PCH to HDMI, etc..., thereby making all cards accessible via a single "default" card setting (which is particularly useful for Firefox, which seems to only recognise the default sound mixer/card).

At any rate it's all working now!   :Very Happy: 

----------

