I'll try that tomorrow and let you know.
Intel NUC - No Sound when turning on from resume
-
blueribb -
June 2, 2023 at 3:12 PM -
Thread is Resolved
-
-
a) As you already know the script mentioned in OP can only work on Generic-legacy (X11), not on Generic (GBM). I'm not aware of a GBM tool to be capable switching resolution.
b) Even on Generic-legacy the device name ("HDMI1") may have changed . Type xrandr to check this.
c) /storage/.config/sleep.d has to be used.
-
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!
-
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
EOFIt 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?
-
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 ?
-
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 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
-
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.
The only difference to post #4 is that you have to edit 99-toggle_rate.power, and replace HDMI1 by DP1. You can use the nano editor for that.
-
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 think sleep.d is outdated, and sleep.conf.d is used by current LE versions. However, you can try both directories.
-
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
-
Please read post #20
Thanks . Then it's probably a different directory on RPi.
-
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.
-
Then it's probably a different directory on RPi.
sleep.conf.d folder is for systemd configuration
sleep.d is folder is for power scripts
-
Congrats!
With that knowledge you can go back to Generic (non-Legacy).
-
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.
-
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.
-
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?
-