No hdmi audio ouput with kodi

Hello,

I’m running kodi on a Intel NUC and the audio is working fine when I use analog-stereo. But when I switch the sink with pacmd to hdmi, I get no audio output. Here is the pacmd list-sinks output

pacmd list-sinks
2 sink(s) available.

  • index: 0
    name: <alsa_output.pci-0000_00_03.0.hdmi-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
    state: RUNNING
    suspend cause:
    priority: 9950
    volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
    balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 41.28 ms
    max request: 8 KiB
    max rewind: 344 KiB
    monitor source: 0
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
    Stereo
    used by: 1
    linked by: 1
    configured latency: 50.00 ms; range is 0.50 … 1999.82 ms
    card: 0 <alsa_card.pci-0000_00_03.0>
    module: 6
    properties:
    alsa.resolution_bits = “16”
    device.api = “alsa”
    device.class = “sound”
    alsa.class = “generic”
    alsa.subclass = “generic-mix”
    alsa.name = “HDMI 0”
    alsa.id = “HDMI 0”
    alsa.subdevice = “0”
    alsa.subdevice_name = “subdevice #0
    alsa.device = “3”
    alsa.card = “0”
    alsa.card_name = “HDA Intel HDMI”
    alsa.long_card_name = “HDA Intel HDMI at 0xf7134000 irq 49”
    alsa.driver_name = “snd_hda_intel”
    device.bus_path = “pci-0000:00:03.0”
    sysfs.path = “/devices/pci0000:00/0000:00:03.0/sound/card0”
    device.bus = “pci”
    device.vendor.id = “8086”
    device.vendor.name = “Intel Corporation”
    device.product.id = “160c”
    device.product.name = “Broadwell-U Audio Controller”
    device.form_factor = “internal”
    device.string = “hdmi:0”
    device.buffering.buffer_size = “352768”
    device.buffering.fragment_size = “176384”
    device.access_mode = “mmap+timer”
    device.profile.name = “hdmi-stereo”
    device.profile.description = “Digital Stereo (HDMI)”
    device.description = “Built-in Audio Digital Stereo (HDMI)”
    alsa.mixer_name = “Intel Broadwell HDMI”
    alsa.components = “HDA:80862808,80860101,00100000”
    module-udev-detect.discovered = “1”
    device.icon_name = “audio-card-pci”
    ports:
    hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
    properties:
    device.icon_name = “video-display”
    active port: <hdmi-output-0>
    index: 1
    name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
    state: SUSPENDED
    suspend cause: IDLE
    priority: 9959
    volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
    balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 0.00 ms
    max request: 0 KiB
    max rewind: 0 KiB
    monitor source: 1
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
    Stereo
    used by: 0
    linked by: 0
    configured latency: 0.00 ms; range is 0.50 … 2000.00 ms
    card: 1 <alsa_card.pci-0000_00_1b.0>
    module: 7
    properties:
    alsa.resolution_bits = “16”
    device.api = “alsa”
    device.class = “sound”
    alsa.class = “generic”
    alsa.subclass = “generic-mix”
    alsa.name = “ALC283 Analog”
    alsa.id = “ALC283 Analog”
    alsa.subdevice = “0”
    alsa.subdevice_name = “subdevice #0
    alsa.device = “0”
    alsa.card = “1”
    alsa.card_name = “HDA Intel PCH”
    alsa.long_card_name = “HDA Intel PCH at 0xf7130000 irq 48”
    alsa.driver_name = “snd_hda_intel”
    device.bus_path = “pci-0000:00:1b.0”
    sysfs.path = “/devices/pci0000:00/0000:00:1b.0/sound/card1”
    device.bus = “pci”
    device.vendor.id = “8086”
    device.vendor.name = “Intel Corporation”
    device.product.id = “9ca0”
    device.product.name = “Wildcat Point-LP High Definition Audio Controller”
    device.form_factor = “internal”
    device.string = “front:1”
    device.buffering.buffer_size = “352800”
    device.buffering.fragment_size = “176400”
    device.access_mode = “mmap+timer”
    device.profile.name = “analog-stereo”
    device.profile.description = “Analog Stereo”
    device.description = “Built-in Audio Analog Stereo”
    alsa.mixer_name = “Realtek ALC283”
    alsa.components = “HDA:10ec0283,80862057,00100003”
    module-udev-detect.discovered = “1”
    device.icon_name = “audio-card-pci”
    ports:
    analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: yes)
    properties:
    device.icon_name = “audio-headphones”
    active port: <analog-output-headphones>

Can anybody help me getting the audio output running on hdmi? Many thanks in advance!

What have you connected on HDMI output?

I recommend using pavucontrol for this since it gives some visual output to see what is happening.

HDMI goes trough via the graphics card. If you have both an Intel analogue and GPU then things may get confused. So need more info

I have a TV connected via hdmi. The Intel NUC has analog and a GPU

Oh, btw I also tried to change it to hdmi in the kodi settings

Ok Intel confuses things using the same driver for analogue and HDMI

I don’t have instruction at the moment but basically you have to manually edit the configuration file. Oldcpu who knows this stuff better then I usually jumps in but have not seen him post for a while may be on vacation.

In any case the solution has been posted may times maybe some else has the reference

Thanks so far. Been trying a lot of stuff, but I still have the problem. But I realized that when I log in to kodi with my main user (I have an extra user starting kodi) I do have sound over hdmi.
I looked at the logs and I noticed the following two different lines that might be interesting.

NOTICE: PulseAudio: Opened device alsa_output.pci-0000_00_03.0.hdmi-stereo-extra1 in pcm mode with Buffersize 150 ms

and

NOTICE: PulseAudio: Opened device alsa_output.pci-0000_00_03.0.hdmi-surround in pcm mode with Buffersize 150 ms

I don’t know if this makes any difference.

Oh, and I cannot start gnome with the user kodi so I can’t start pavucontrol.
I hope for some new input