Raspberry Pi touchscreen video and HDMI audio

  • Is it possible to set the Raspberry Pi's touchscreen as the video output and HDMI as the audio output? My situation is that I have my Pi acting as a network music streaming device connected to my stereo with no TV which is why I use the touchscreen. My receiver has HDMI inputs which I'd like to use for audio. When I connect an HDMI cable no video shows on the touchscreen.

  • Unfortunately I can't because Pi's touchscreen is black. Video is being output via HDMI and I don't have a tv connected. Is there a way, maybe in config.txt, to force libreelec to output to the touchscreen even when there's an HDMI cable connected?

  • This is not possible in LE images as the HDMI connection is active and HDMI cannot be audio-only, so even if the DSI connector to the touchscreen is also active the output plane detection logic in Kodi finds and prefers the HDMI connection. If HDMI output is not active then Kodi finds the DSI connection and uses that instead. You cannot disable the video output part of the DRM connector without also disabling audio as they are interdependent.

    The two routes to making it work that you can explore (depending on skill levels) are hacking Kodi source to change the DRM plane detection logic, or perhaps building a custom image that runs Kodi under GBM/Wayland instead of GBM-only (or using RPiOS that does this). Running Kodi under a windowing environment should give you the option to switch the display output device. LE does not run Kodi under Wayland as it has no ability to switch/adjust refresh rates on-the-fly to match the media refresh-rate, but you won't have that option with the touchscreen anyway so it's not the dealbreaker it is with HDMI connections. We have Wayland support in our buildsystem as this is used by the Lakka retro-gaming fork to run their GUI, so you should be able to build a custom image.

  • GBM connector can be forced via advancedsettings.xml.

    First ssh in and use kmsprint to get the connected connector name of the screen.

    Create advancedsettings.xml (replace "Virtual-1" with your connector name):

    Debug logging is enabled to ease the setup.

    Perform systemctl restart kodi to test the configuration.