I am having this exact problem. Is there any consensus on what causes it?
I can only guess, but maybe the developers would know more. The HDMI "handshake" or "Driver Initialization" may vary from a cold boot, reboot or waking from resume.
I am having this exact problem. Is there any consensus on what causes it?
I can only guess, but maybe the developers would know more. The HDMI "handshake" or "Driver Initialization" may vary from a cold boot, reboot or waking from resume.
It worked!
Placing the sleep before xrandr was the fix. It now works perfectly. I'm sure I could have used smaller delay times, but I'm happy now.
Again, Da Flex - thanks so much for the continued support. You're a great asset to this community.
I'll mark the thread as FIXED after about a week or so.
I'll try placing the sleep before xrandr. Yes, I did make it executable.
Neither running the script manually in the SSH Terminal or letting it run when turning the NUC on will restore the audio. Only switching the refresh rate manually does.
I can't figure this one out.
I found a previous thread here from May 2021, and ghtester helped me with the old script. He instructed me how to add some delays to the script which allowed it to work again. Here's the finished script, which I edited in MS Word. Can I delete the old script and install this one instead?
cat >/storage/.config/sleep.d/99-toggle_rate.power <<'EOF'
#!/bin/sh
case "$1" in
post)
xrandr -display :0 --output DP1 --mode 1920x1080 --rate 59.94
sleep 5
xrandr -display :0 --output DP1 --mode 1920x1080 --rate 60
sleep 2
;;
esac
EOF
Link to old thread: Restart audio after waking from suspend
Post #33
Will the sleep delays work without adding anything else or do I need to add the 20-custom-sleep.sh file?
Update: After an hour, I turned on the NUC from suspend and NO AUDIO. (again)
I give up - I spent most of the day working on this problem.
Now I'm reading up on "Keep Audio Device Alive" and "Send Low Volume Noise", to see which one works best and what the difference is.
You ain't gonna believe this. It's fixed!
It was a simple setting in: Settings - System - Audio - Keep Audio Device Alive
Default: 1 minute
New Setting: Always
I went into suspend and back on a dozen times and audio is always on.
I think sleep.d is outdated, and sleep.conf.d is used by current LE versions. However, you can try both directories.
Please read post #20
Read post #4 again.
- You will need 99-toggle_rate.power. That script does the actual resolution switch.
- xrandr makes no sense, delete it (rm /storage/.config/sleep.conf.d/xrandr).
- I'm not sure whether you need 20-custom-sleep.sh. Try with and without it.
I left 99-toggle_rate.power in sleep.d and removed it from sleep.config.d. I don't remember mglae saying it must be in both directories.
I also wondered about xrandr being inside sleep.conf.d - I didn't put it there.
I never had 20-custom-sleep.sh as far as I remember.
What gets me is that running the xrandr with 2 lines works but the script containing it does not. I wonder if it's a timing issue.
I am removing xrandr from sleep.conf.d now to see if it makes a difference
I removed the 99-toggle_rate.power from the sleep.conf.d directory and here is what remains. Is this OK now?
LibreELEC:~/.config # cd sleep.conf.d
LibreELEC:~/.config/sleep.conf.d # ls
99-toggle_rate.power sleep.conf.sample
README xrandr
LibreELEC:~/.config/sleep.conf.d # rm 99-toggle_rate.power
LibreELEC:~/.config/sleep.conf.d # ls
README sleep.conf.sample xrandr
I substituted DP1 in place of HDMI1 and if I run:
xrandr -display :0 --output DP1 --mode 1920x1080 --rate 59.94
xrandr -display :0 --output DP1 --mode 1920x1080 --rate 60
it toggles the refresh rate and the sound returns. BUT not when it's part of the entire script that mglae made for me. I'll have to check the contents of the entire script again and make sure I didn't make a mistake.
Here are the contents of 99-toggle_rate.power:
LibreELEC:~/.config/sleep.d # cat 99-toggle_rate.power
#!/bin/sh
case "$1" in
post)
xrandr -display :0 --output DP1 --mode 1920x1080 --rate 59.94
xrandr -display :0 --output DP1 --mode 1920x1080 --rate 60
;;
esac
I tried running this command from the SSH Terminal and got the following error message:
login as: root
[email protected]'s password:
##############################################
# LibreELEC #
##############################################
LibreELEC (official): 11.0.1 (Generic-legacy.x86_64)
LibreELEC:~ # xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 59.94
xrandr: cannot find mode 1920x1080
LibreELEC:~ # xrandr -display :0 --output HDMI1 --mode 1920x1080 --rate 60
xrandr: cannot find mode 1920x1080
LibreELEC:~ #
Should I substitute DP1 in place of HDMI1 ?
Update: I installed LE 11.0.1 Generic Legacy and ran xrandr. Here are the results:
[email protected]'s password:
##############################################
# LibreELEC #
##############################################
LibreELEC (official): 11.0.1 (Generic-legacy.x86_64)
LibreELEC:~ # xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1600mm x 900mm
1920x1080 60.00*+ 59.94 24.00 23.98
1920x1080i 60.00 59.94
1400x1050 59.95
1280x1024 60.02
1280x720 60.00 59.94
1024x768 60.00
800x600 60.32
720x480 60.00 59.94
640x480 60.00 59.94
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
LibreELEC:~ #
Note: My NUC only has 1 HDMI output. There is no DP (display port) output on the rear panel.
In the SSH Terminal, I looked for storage/.config/sleep.d and it wasn't there. I ran this script:
mkdir -p /storage/.config/sleep.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
It installed correctly. I exited the SSH Terminal and rebooted the NUC. It came on with audio, BUT after going to suspend and back on, there was no audio again.
Note: Should I delete sleep.conf.d ? Here are it's contents:
LibreELEC:~ # cd /storage/.config/sleep.conf.d
LibreELEC:~/.config/sleep.conf.d # ls
99-toggle_rate.power sleep.conf.sample
README xrandr
If not, how do I delete 99-toggle_rate.power inside it?
The only reason I'm hesitant to switch to generic-legacy is because it still contains a bug that prevents DTS-HD MA files to play correctly when they have the .m2ts extension. SMP/SMP1 created a patched version of LE 11 but only in the generic version. I will switch back to generic legacy today to complete the testing for my no audio issue. Thanks!
I'll try that tomorrow and let you know.
No joy - Generic Legacy still did not work. I'll keep looking for a solution.
DaFlex - Thanks for all your help and patience.