-
Notifications
You must be signed in to change notification settings - Fork 41
udev: Do not disable powersaving for NVIDIA audio devices #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Somehow, disabling power saving for NVIDIA audio device also prevents the dGPU from going into sleep mode. Signed-off-by: Vasiliy Stelmachenok <[email protected]>
Happy to confirm that this fixes the issue :) |
Nice, thanks for the quick report and testing!
Yeah, it's a bit upsetting, but as it is... |
FWIW I independently found #147 broke D3 for my GPU too - except I have an AMD 7900XT, not an NVIDIA GPU. So it affected AMD GPUs as well... Mentioning this for the changelog, but that's not super important :) |
Oh wait -- I didn't actually try this PR, only removed the original file (as I don't use intel audio anyway). The workaround seems to exclude only NVIDIA GPUs, this is wrong for the reason above... I don't have any such hardware to test, but maybe it might cause issues for intel dGPU HDMI audio? |
Can you please share output of |
(EDIT: Ah, sorry, the PR's udev rules do indeed check the vendor - I've probably misunderstood why you wanted to check the See:
It seems like that on my system the 80:1f.3 device is indeed the onboard audio seeing as my only "audio device"s in lspci are this one and the AMD dGPU:
|
I see, thank you. Could you also check if the problem is present if change values as in this diff: diff --git a/usr/lib/modprobe.d/20-audio-pm.conf b/usr/lib/modprobe.d/20-audio-pm.conf
index 761a2fa..1a0d1b9 100644
--- a/usr/lib/modprobe.d/20-audio-pm.conf
+++ b/usr/lib/modprobe.d/20-audio-pm.conf
@@ -2,4 +2,4 @@
# running on battery power. This is needed because it prevents audio cracks on
# some hardware. If device starts working on battery power, same named udev rule
# re-enables power saving.
-options snd_hda_intel power_save_controller=N
+options snd_hda_intel power_save=0
diff --git a/usr/lib/udev/rules.d/20-audio-pm.rules b/usr/lib/udev/rules.d/20-audio-pm.rules
index fa4f11c..b0f88a0 100644
--- a/usr/lib/udev/rules.d/20-audio-pm.rules
+++ b/usr/lib/udev/rules.d/20-audio-pm.rules
@@ -2,7 +2,7 @@
# running on battery power. This is needed because it prevents audio cracks on
# some hardware.
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", TEST=="/sys/module/snd_hda_intel", \
- RUN+="/bin/sh -c 'echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller'"
+ RUN+="/bin/sh -c 'echo 0 > /sys/module/snd_hda_intel/parameters/power_save'"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", TEST=="/sys/module/snd_hda_intel", \
- RUN+="/bin/sh -c 'echo $(grep -w -q 0x10de /sys/module/snd_hda_intel/drivers/*/*/vendor && echo Y || echo N) > /sys/module/snd_hda_intel/parameters/power_save_controller'"
+ RUN+="/bin/sh -c 'echo 10 > /sys/module/snd_hda_intel/parameters/power_save'" |
Applied this and rebooted, the problem seems to be solved. (also double-checked my |
My mistake was that I blindly trusted information on the Arch Wiki, which mentions the power_save_controller parameter without noting that power_save=0 is sufficient to solve the issues, and power_save_controller=N breaks power management completely. Fixes: #149 (comment) Fixes: #147 (comment) Signed-off-by: Vasiliy Stelmachenok <[email protected]>
Thanks, looks like this should be finally fixed. |
I'm a bit confused - as far as I understand, this udev rule is supposed to set power_save to 0 when the laptop is charging, and to 10 when running on battery. However, on my system, when the laptop is charging, the output of cat /sys/module/snd_hda_intel/parameters/power_save is 10, and when it's not charging, the output is 0. Isn't this reversed? |
Sorry, I was a bit tired last night, so I didn't notice. But anyway it's already fixed in 81a5ef2. |
Somehow, disabling power saving for NVIDIA audio device also prevents the dGPU from going into sleep mode.
See: #147 (comment)