Kodi Audio via Displayport & screen selection
#1
Hi,

I have rebuilt my homeserver (hp deskpro 600 g3 with Intel HD530, ubuntu 23.04 server) and installed kodi as mediacenter  besides some dockercontainers.
But now there are two problems:
1. no sound via displayport
I connected the server with a DP to HDMI cable to the LG TV, but unfortunately the DP port is not selectable as audio port.
pulse audio says:
Code:

kodi@dockerbox:~$ pacmd list-cards
1 card(s) available.
    index: 0
    name: <alsa_card.pci-0000_00_1f.3>
    driver: <module-alsa-card.c>
    owner module: 7
    properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0x1fff010000 irq 132"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1f.3"
        sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "a2f0"
        device.product.name = "200 Series PCH HD Audio"
        device.form_factor = "internal"
        device.string = "0"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        input:analog-stereo: Analog Stereo Input (priority 65, available: no)
        output:analog-stereo: Analog Stereo Output (priority 39268, available: unknown)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: unknown)
        output:analog-surround-40: Analog Surround 4.0 Output (priority 33968, available: unknown)
        output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Output + Analog Stereo Input (priority 1265, available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <output:analog-stereo>
    sinks:
        alsa_output.pci-0000_00_1f.3.analog-stereo/#0: Built-in Audio Analog Stereo
    sources:
        alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#0: Monitor of Built-in Audio Analog Stereo
    ports:
        analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
            properties:
                device.icon_name = "audio-speakers"
        analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
        analog-output-headphones-2: Headphones 2 (priority 9800, latency offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"

I would have expected that there is a corresponding DP entry under ports. Is there anything else I need to install / configure or is it simply not possible?
If it does not work, can you recommend a cable that passes the audio signal either via usb or jack to HDMI (so DP + audio to HDMI)?
Audio output via jack works.

Problem 2:
If the TV is not on and switched to the appropriate input channel when the server starts, the server will  show no picture until the Kodi service is restarted. Then everything is no problem.

kodi service:
Code:

[Unit]
Description=Kodi standalone (X11)
After=remote-fs.target systemd-user-sessions.service network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service lircd.service
Wants=network-online.target polkit.service upower.service
[email protected]

[Service]
User=kodi
Group=kodi
#EnvironmentFile=-/etc/conf.d/kodi-standalone
PAMName=login
TTYPath=/dev/tty1
ExecStart=kodi --standalone
ExecStop=/usr/bin/killall --user kodi --exact --wait kodi.bin
Restart=on-abort
StandardInput=tty
StandardOutput=journal

[Install]
Alias=display-manager.service

is there an option here to force the screen detection?
it also affects not only kodi but also simply the output of the command line.

Thanks in advance!
Reply
#2
You are missing a sound-card, "HDA Intel HDMI" with driver "snd_hda_intel".

The "HDA Intel PCH" is the analog sound of the motherboard, nothing to do with HDMI sound.

Maybe try to (re-)install the driver. You might also have a problem with the quality of your HDMI cable.
Reply
#3
(2023-09-13, 15:28)wastis Wrote: Maybe try to (re-)install the driver. You might also have a problem with the quality of your HDMI cable.

could also be docker isn't configured to access the device as it appears this setup is in a docker container

i personally would consider this type of setup 'custom' and with that outside of normal support
Reply
#4
Thanks for you help and pointing me in the right direction. the sound is working now.
I stopped all containers and disabled the service to prevent it from interfering with the problem.
But in the end it was some pulseaudio bullshit (god I hate pulseaudio...)
This is what I did to get it working:
  • /etc/modprobe.d/alsa-base.conf add "model=3stack" to the line "options snd-hda-intel model=3stack"
    After that and a reboot I had the missing DP subdevices
  • Then I selected the correct profile with pactl set-card-profile 0 output:hdmi-surround (find values with pactl list)
  • setting pulseaudio to start on login was also tricky from the terminal
  • export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1002/bus (path from netstat -an)
  • systemctl --user enable pulseaudio.service
  • systemctl --user enable pulseaudio.socket
  • systemctl --user start pulseaudio.socket
  • systemctl --user start pulseaudio.service

The problem other problem (graphics card does not scan for a display if it was not turned on when the server started) still exists. any ideas on that?
Reply
#5
Just guessing here, however it might be better to start a proper user session for kodi using sudo in your startup script. This will also solve your dbus problem, no need to point to the dbus server manually.

Code:

sudo -u $USER kodi --standalone
Reply
#6
Thanks for the input but the problem with the missing DBUS_SESSION_BUS_ADDRESS only exists if I login with ssh and switch to the user with sudo -iu kodi (kodi is also the username for this restricted user) to debug stuff.
Normally the service will login the kodi-user and everything is fine.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi Audio via Displayport & screen selection0