Intel NUC - No Sound when turning on from resume

  • I replaced a 2013 Intel NUC with a newer model from 2018. I now have everything working perfectly except for NO AUDIO when turning on the NUC from resume. My old NUCs suffered from this same issue and mglae (developer) helped me to install a script which toggled the video resolution causing the audio to return. This always worked with my older NUCs. I SSHed into my newer NUC this morning and copy/pasted the script into the new NUC. I wasn't sure how to save and exit properly, so I just typed EXIT and Putty closed.

    My newer NUC still has no audio when turning on from suspend, unless I toggle the video resolution. Was I supposed to SAVE the Putty Session's changes?

    Here's a link to my old thread. The fix starts at post # 32 No Sound when turning on from resume - Intel NUC

    Old NUC: DC53427HYE (2013)

    Newer NUC: NUC8i5BEK (2018)

  • Go to Best Answer
  • Yes - I have the /storage/.config/sleep.d directory

    The 20-custom-sleep.sh script was probably on my old NUC, not the newer one.

    I know there are quite a few different fixes (patches) for this problem but has there ever been a permanent fix?

    Edited once, last by blueribb (June 2, 2023 at 5:54 PM).

  • Instructions:

    First go to Settings -> System -> Display -> Resolution, and note down your preferred GUI resolution. You will need it later.

    On my Rpi (LE 11.0.1), the directory /storage/.config/sleep.conf.d was pre-installed. So I think that's the right one.

    Please check whether you have it:

    Code
    cd /storage/.config
    ls

    If you don't have it, create it:

    Code
    mkdir sleep.conf.d

    Then delete /storage/.config/sleep.d:

    Code
    rmdir sleep.d

    Then go into the directory, and look what's inside:

    Code
    cd sleep.conf.d
    ls

    I have a README and a sleep.conf.sample file inside. For your purpose, you have to add two more files:

    • 99-toggle_rate.power
    • 20-custom-sleep.sh

    To create 99-toggle_rate.power, copy the following code into your SSH terminal, and hit Enter to execute it. Eventually edit the resolutions first, depending on your preferred GUI resolution (see above). To do so, copy the script into an editor of your local OS, and edit both lines. Then copy the result into your SSH terminal, and hit Enter. In case you're trapped in input mode after this (> sign before cursor), type EOF, and hit Enter.

    Code
    cat >/storage/.config/sleep.conf.d/99-toggle_rate.power <<'EOF'
    #!/bin/sh
    case "$1" in
       post)
         xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 59.94
         xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 60
         ;;
    esac
    EOF

    After that you should see the new file:

    Code
    ls

    Result:

    Quote

    99-toggle_rate.power README sleep.conf.sample

    To create 20-custom-sleep.sh, copy the following code into your SSH terminal, and hit Enter to execute it:

    After that you should see the new file:

    Code
    ls

    Result:

    Quote

    20-custom-sleep.sh README

    99-toggle_rate.power sleep.conf.sample

    Reboot, and hope that it works. :)

  • 1. Resolution 1920 X 1080p

    2. sleep.conf.d is already there

    3. remdir sleep.d : Directory not empty

    4. cd sleep.conf.d : I also have Readme sleep.conf.sample

    I tried to copy the script into the SSH terminal but couldn't figure out how. I right-clicked and it seemed to copy it but when I typed ls, it wasn't there. What did I do wrong? Here's a screen shot of the results so far:


    login as: root

    [email protected]'s password:

    ##############################################

    # LibreELEC #

    # https://libreelec.tv #

    ##############################################

    LibreELEC (community): devel-20230310030330-dd3231d (Generic.x86_64)

    LibreELEC:~ # cd /storage/.config

    LibreELEC:~/.config # ls

    aacs modules-load.d sysctl.d

    boot.status pulse system.d

    firmware pulse-daemon.conf.d timesyncd.conf.d

    hosts.conf rc_keymaps tmpfiles.d

    hwdb.d rc_maps.cfg.sample udev.rules.d

    iptables samba.conf.sample wireguard

    logind.conf.d sleep.conf.d

    modprobe.d sleep.d

    LibreELEC:~/.config # rmdir sleep.d

    rmdir: 'sleep.d': Directory not empty

    LibreELEC:~/.config # cd sleep.conf.d

    LibreELEC:~/.config/sleep.conf.d # ls

    README sleep.conf.sample

    LibreELEC:~/.config/sleep.conf.d # cat >/storage/.config/sleep.d/99-toggle_rate.

    power <<'EOF'

    > #!/bin/sh

    > case "$1" in

    > post)

    > xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 59.94

    > xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 60

    > ;;

    > esac

    > EOF

    LibreELEC:~/.config/sleep.conf.d # ls

    README sleep.conf.sample

    LibreELEC:~/.config/sleep.conf.d #

    LibreELEC:~/.config/sleep.conf.d #

    LibreELEC:~/.config/sleep.conf.d #

  • Use rm -rf sleep.d to delete the directory and its content.

    The first line is obviously wrong, because we want to use sleep.conf.d, and not sleep.d as directory. Please copy & paste correctly. :rolleyes:

  • I think I deleted sleep.d and sleep.conf.d by mistake. I found 99-toggle_rate.power in config.sleep.d

    Oh boy - Now I'm really confused

    Here's another screen shot:

    login as: root

    [email protected]'s password:

    ##############################################

    # LibreELEC #

    # https://libreelec.tv #

    ##############################################

    LibreELEC (community): devel-20230310030330-dd3231d (Generic.x86_64)

    LibreELEC:~ # rm -fr sleep.d

    LibreELEC:~ # cd sleep.conf.d

    -sh: cd: can't cd to sleep.conf.d: No such file or directory

    LibreELEC:~ # cd /storage/config/sleep.d

    -sh: cd: can't cd to /storage/config/sleep.d: No such file or directory

    LibreELEC:~ # cd /storage/.config/sleep.d

    LibreELEC:~/.config/sleep.d # ls

    99-toggle_rate.power

    LibreELEC:~/.config/sleep.d # cd sleep.conf.d

    -sh: cd: can't cd to sleep.conf.d: No such file or directory

    LibreELEC:~/.config/sleep.d # cd

    LibreELEC:~ # cd /storage/.config

    LibreELEC:~/.config # ls

    aacs modules-load.d sysctl.d

    boot.status pulse system.d

    firmware pulse-daemon.conf.d timesyncd.conf.d

    hosts.conf rc_keymaps tmpfiles.d

    hwdb.d rc_maps.cfg.sample udev.rules.d

    iptables samba.conf.sample wireguard

    logind.conf.d sleep.conf.d

    modprobe.d sleep.d

    LibreELEC:~/.config # rmdir sleep.d

    rmdir: 'sleep.d': Directory not empty

    LibreELEC:~/.config # rm -rf sleep.d

    LibreELEC:~/.config # cd

    LibreELEC:~ # cd /storage/.config

    LibreELEC:~/.config # ls

    aacs modprobe.d sleep.conf.d

    boot.status modules-load.d sysctl.d

    firmware pulse system.d

    hosts.conf pulse-daemon.conf.d timesyncd.conf.d

    hwdb.d rc_keymaps tmpfiles.d

    iptables rc_maps.cfg.sample udev.rules.d

    logind.conf.d samba.conf.sample wireguard

    LibreELEC:~/.config #

  • You missed the point before config:

    Quote

    cd /storage/config/sleep.d

    Please stay focused.

    If needed, create a new directory by mkdir /storage/.config/sleep.conf.d.

  • I managed to get everything back in place and now both scripts are present in sleep.conf.d

    Bad news is I still have no sound when powering back on from resume. I can toggle video refresh rate from 60 to 59.94, respond NO to the popup and the sound returns.

    Back to square one.


    I tried running this part of the script manually but got these errors:

    login as: root

    [email protected]'s password:

    ##############################################

    # LibreELEC #

    # https://libreelec.tv #

    ##############################################

    LibreELEC (community): devel-20230310030330-dd3231d (Generic.x86_64)

    LibreELEC:~ # cd /storage/.config/sleep.conf.d

    LibreELEC:~/.config/sleep.conf.d # ls

    20-custom-sleep.sh README

    99-toggle_rate.power sleep.conf.sample

    LibreELEC:~/.config/sleep.conf.d # /usr/bin/xrandr -display :0 --output HDMI-0 -

    -mode 1920x1080 --rate 50

    -sh: /usr/bin/xrandr: not found

    LibreELEC:~/.config/sleep.conf.d # /usr/bin/xrandr -display :0 --output HDMI-0 -

    -mode 1920x1080 --rate 60

    -sh: /usr/bin/xrandr: not found

    LibreELEC:~/.config/sleep.conf.d # xrandr -display :0 --output HDMI1 --mode 1920

    x1080 --rate 59.94

    -sh: xrandr: not found

    LibreELEC:~/.config/sleep.conf.d # xrandr -display :0 --output HDMI1 --mode

    1920x1080 --rate 60

    Edited once, last by blueribb: Merged a post created by blueribb into this post. (June 2, 2023 at 8:38 PM).

  • Please check the content of the new files by nano <FILENAME>, or by cat <FILENAME>.

    99-toggle_rate.power:

    Bash
    #!/bin/sh
    case "$1" in
       post)
         xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 59.94
         xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 60
         ;;
    esac

    20-custom-sleep.sh:

    Eventually 20-custom-sleep.sh is not needed, so also try without it:

    Code
    rm /storage/.config/sleep.conf.d/20-custom-sleep.sh
    reboot
  • I tried different combinations to get a result but failed.


    login as: root

    [email protected]'s password:

    ##############################################

    # LibreELEC #

    # https://libreelec.tv #

    ##############################################

    LibreELEC (community): devel-20230310030330-dd3231d (Generic.x86_64)

    LibreELEC:~ # cat <99-toggle_rate.power>

    -sh: syntax error: unexpected newline

    LibreELEC:~ # cd /storage/.config/sleep.conf.d

    LibreELEC:~/.config/sleep.conf.d # cat <99-toggle_rate.power>

    -sh: syntax error: unexpected newline

    LibreELEC:~/.config/sleep.conf.d # nano <99-toggle_rate.power>

    -sh: syntax error: unexpected newline

    LibreELEC:~/.config/sleep.conf.d # cd

    LibreELEC:~ # nano <99-toggle_rate.power>

    -sh: syntax error: unexpected newline

    LibreELEC:~ # nano <toggle-rate.power>

    -sh: syntax error: unexpected newline

    LibreELEC:~ #

  • You have to use the full path to the files, so it's:

    Code
    cat /storage/.config/sleep.conf.d/20-custom-sleep.sh
    cat /storage/.config/sleep.conf.d/99-toggle_rate.power

    Maybe it's worth to give them explicit execution rights:

    Code
    chmod +x /storage/.config/sleep.conf.d/20-custom-sleep.sh
    chmod +x /storage/.config/sleep.conf.d/99-toggle_rate.power

    You can see the file rights by ls -l.

  • I finally got a good result by using cat 99-toggle_rate.power

    LibreELEC:~/.config/sleep.conf.d # cat 99-toggle_rate.power

    #!/bin/sh

    case "$1" in

    post)

    xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 59.94

    xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 60

    ;;

    esac

  • If I try the Generic Legacy (which still contains xrandr), will my script still be there?

    Yes. I thought you're already using it.

    Code
    cd /storage/.update
    wget https://releases.libreelec.tv/LibreELEC-Generic-legacy.x86_64-11.0.1.img.gz
    reboot
  • What happens when you start the script manually from SSH terminal?

    Code
    /storage/.config/sleep.conf.d/99-toggle_rate.power

    PS: If not already done, make it executable first:

    Code
    chmod +x /storage/.config/sleep.conf.d/99-toggle_rate.power