No sound after wake-up

  • 1. System setup
    AMD AM1 motherboard with AMD 5150 APU integrated GPU. Libreelec 7.0.2 however the issue was seen already with Openelec 6.95.3


    HTPC <-hdmi-> CEC-adapter <-HDMI-> TV Sony [font="arial"]KDL-55W829B <-HDMI ARC-> LG Soundbar


    The HTPC is contorlled via CEC. Switching off the TV put the HTPC and soundbar into standby.


    2. Symptom
    When the TV is switched on the HTPC and soundbar wake up. Starting any video has no sound.
    Stop and start another media does not help.[/font]
    Recovery is to go to Settings/System menu. Nothing needs to be changed. When I enter to System submenu the audio comes back immediatelly.
    Frequency: not fully systematic. Sometimes comes every time, sometimes does not happen for days.


    3 Logs
    Kodi.log


    Wakeup happenes at 19:38:56
    There is no sound until I step into the Settings/System menu. Then the sound immediatelly recovers at 19:40:20


    There are many ALSA sound card related log entries I cannot evaluate.

    • Official Post


    Does anything happen with the registered bug reports here?


    They languish unloved until sometime replies


    I've no idea what the issue is but the first step is updating to the current Alpha release. If the problem still exists it can be investigated, while all development on our Jarvis/7.0 build ceased months ago.

  • They languish unloved until sometime replies


    I've no idea what the issue is but the first step is updating to the current Alpha release. If the problem still exists it can be investigated, while all development on our Jarvis/7.0 build ceased months ago.


    Now, I upgraded to v7.90.006 ALPHA and the issue is even worse.
    No sound after wake-up or restart. Sometimes it is enough to step into system settings, sometimes I have to change the display refresh rate back and forth and sound comes back.
    Shall I collect new logs?

    • Official Post

    Random guess; in LE settings use the badly named "wait for network" and put a 10 second startup delay. This setting actually has nothing to do with networking and just delays Kodi start by X seconds. I'm wondering if the audio driver needs more time to initialise before Kodi starts and auto-detects audio capabilities.

  • Hi chewitt,


    Thanks for your response. Unfortunately it does not help. I tested with your proposed settings and the problem is still there. I suspect this settings has no effect at wake-up at all.

  • The fault is still present in v7.90.007. It seems that display refresh rate switch recovers the audio.
    If the default refresh rate is 60fps then I always have sound when start watching TV (50fps). If the default refresh rate is 50fps then starting a 24p movie makes sound available.


    Is there anything I can do to speed up the investigation? It is very annoying that we have to go into the setup menu every time the system is switched on to get sound.
    Please consider that my wife and daughters are using this system...

  • As I posted in the other thread, I have the same problem. But in my case I have no CEC adapter.

  • I have CEC adapter, however it does not matter. I can reproduce the fault with removed CEC adapter as well.

  • In LibreELEC go into Settings / Player > On the 'Videos' panel scroll down find "Adjust display refresh rate" to On start / stop


    found fix here it's the last post on this thread down very bottom


  • In LibreELEC go into Settings / Player > On the 'Videos' panel scroll down find "Adjust display refresh rate" to On start / stop


    found fix here it's the last post on this thread down very bottom


    It does not work for me. Still no sound after wake-up. However I found a very dirty solution by a small script which enters then exists system settings window.


    This is the code


    It has to be put into /storage/.config/sleep.d folder


    With these copmmands the folder and executable file can be created
    mkdir -p /storage/.config/sleep.d
    cd /storage/.config/sleep.d
    touch 01-make-sound
    chmod +x 01-make-sound


    Edit the file and copy the content above with this command
    nano 01-make-sound

    Edited once, last by sakos ().

  • I also have AMD E450 with sound problem an Alpha 8!


    At boot Audio Output Device for HDMI audio to TV “ALSA HD Audio @@@” correctly detected but does not work. Have to select one of other options then immediately reselect the original option and audio works. None of the simple settings changes suggested above work.


    Chris

  • 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.

    Edited once, last by rocket321 ().

  • 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.


    Hi,


    Yes, it is a bizarre solution.


    1. No new folder is needed. Put the script into /storage/.config/sleep.d/


    2. Try to run "xrandr --listmonitors" command to list the name of active display and use that name in your script.


    example printout:

    Code
    htpc2:~ # xrandr --listmonitors
    Monitors: 1
     0: +*HDMI-0 1920/1218x1080/685+0+0  HDMI-0


    In this case the proper name is HDMI-0.


    3. The elegant way of recovering the audio below. More details here

    Bash
    #!/bin/sh
    case $1 in
       pre)
         ;;
       post)
         sleep 5
         xrandr --output HDMI-0 --set "audio" "on"
         ;;
    esac

    Edited once, last by sakos ().

  • Thank you both for this fix! Spent a few hours this morning changing the custom shutdown timer to a suspend timer then was greeted by no audio on wake. This solved it for all devices.

  • Wow, had this pain for such a long time. Searching for kernel bugs, kodi and libreelec updates, drivers...huh, that was a tuff one...and finally I am really happy that I have found this thread. Thank you guys!8)


    Successfully tested rocket321 solution. Will try the next one as well...