Set system-wide default audio output device

  • Hi!

    I'm using LibreELEC 9.2.6 (Generic.x86_64). The computer is connected to the TV using HDMI. In Kodi, I was able to set the audio output device to

    ALSA: HDA Intel PCH, GSM 42LF65 on HDMI #0

    and the audio is correctly played on my TV. But I installed the Chrome add-on, and when I play a YouTube video, the audio is played on the internal speaker of the computer instead the TV. This leads to me to the conclusion that the system-wide audio configuration remains the same, and changing the audio output in Kodi will only affect Kodi itself, not Chrome.

    In this computer I have one integrated sound card with multiple audio outputs. By issuing the command "aplay -l", I got the following output:

    So I guess I need to somehow set "card 0, device 3" as a system default. But how can I achieve that? How can I get Chrome to output audio on the TV as well?

  • Ok, I think I figured out the solution that works for me. This is what I did:

    1. I created the file "/storage/.config/asound.conf", with the following contents:

    Code
    defaults.pcm.card 0
    defaults.pcm.device 3

    2. I rebooted the system. Now in Kodi, I got sound, but in Chrome, there was no sound at all. This is because Kodi was occupying the audio output, so that Chrome is not allowed to use it.

    3. I configured Kodi to use the default ALSA audio device.

    4. I rebooted the system again.

    Now I have audio on my TV both in Chrome and in Kodi.