Posts by rocket321

    Background:
    I had a similar setup and issue. AMD 6450 GPU -> HDMI Audio -> LG TV. Running 7.0.3 LibreELEC.

    As this seems to be a common issue for AMD graphics using HDMI audio, I would assume this fix will work for others as well. I used a combination of some other forum posts along with some of my own prodding to get this working and want to share this solution so that others may benefit.

    Thanks to jamesw4 on another board and sakos from this thread. I used a combination of these approaches to make a working result for my use.

    The key difference for my solution is the location of the wake-up script. I built my script and placed it in the recommended location and it seemed that the system was not executing the script upon resume. I ran this command to examine what the system was doing upon sleep/wake:

    Code
    journalctl -u systemd-suspend.service

    This showed that the script I had built following other examples was not being executed. Instead, the system was looking for scripts in the following place:

    Code
    /storage/.kodi/addons/*/sleep.d/*.power


    I moved my script to this new location and renamed it with a ".power" extension, and it began showing in the log listed above as being executed at wake up.

    Will it work for you?
    If you have an AMD GPU/iGPU and upon sleep/resume you have no audio, then you navigate to Settings -> System and suddenly audio is back on, then yes I expect this will work for you. If you have another situation then I cannot say for sure.

    Guide:
    Fix for no HDMI audio on resume with AMD graphics.

    SSH into host
    Login as root

    Create the path to store your script: /storage/.kodi/addons/hdmi.sound/sleep.d

    Code
    cd /storage/.kodi/addons
    mkdir -p hdmi.sound
    cd hdmi.sound
    mkdir -p sleep.d
    cd sleep.d

    Create a file ending with ".power" and make executable and open it:

    Code
    touch 01-hdmi.power
    chmod +x 01-hdmi.power
    nano 01-hdmi.power

    Add the following:

    Bash
    #!/bin/sh
    case "$1" in
            *)
            sleep 1
            DISPLAY=:0 /usr/lib/kodi/kodi-xrandr --output HDMI1 --auto
            ;;
    esac

    Save and exit:
    ctrl+O
    ctrl+X

    Now give it a test. Verify sound is working to begin with. Put system to sleep (suspend). Wake back up. You should have audio. Success!

    Closing Notes:
    Running the command in the script technically does not do anything, it actually just generates an error:

    Code
    # DISPLAY=:0 /usr/lib/kodi/kodi-xrandr --output HDMI1 --auto
    warning: output HDMI1 not found; ignoring

    And yet, apparently this is enough for the system to quarry the audio device to see if it exists. As a result, the audio begins working again. I guess it is a little bizarre, but not really more so than opening System -> Settings as a fix.