How to disable power saving on my Lenovo Y50's subwoofer audio pins?

3

2

Follow-up from: How do I make my Lenovo Y50's subwoofer work on linux?

To cut things short, I have a Lenovo Y50 that has an integrated subwoofer, that only works on Linux Mint if I set some settings on two pins using HDA Analyzer. The same solution doesn't work on Fedora and other distributions. More info in the link above.

I've had some time to investigate a bit further and noticed that there are differences in what HDA Analyzer's text dump tabs tell me for each of the pin, on each of the distros (Linux Mint on left, Fedora on right):

Image 1

Image 2

I've learned that D0 means full power state and D3 means low power state. I've researched on how to disable power saving on my audio card completely, so I've tried the following on Fedora, inputting in the terminal and testing before and after reboot, but it didn't solve my problem:

echo 0 > /sys/module/snd_hda_intel/parameters/power_save

echo N > /sys/module/snd_hda_intel/parameters/power_save_controller

I've also tried enabling power saving on Linux Mint and it indeed disable the subwoofer before rebooting (and was still disabled after reboot).

I would like to know if anyone else has any ideas on how to further try and switch the power state on these two pins (0x17 and 0x1a) from D3 to D0 so to make my subwoofer output sound. Thank you!

EDIT: Here is a solution based on a python script made by me here. Don't disregard the answers below which helped (thanks again!).

Dragoș

Posted 2015-09-19T12:27:48.407

Reputation: 133

Answers

3

In addition to setting the power state to D0 for pins 0x17 and 0x1a, try increasing the output volume of node 0x3 (AUD_OUT).

Tested on the same laptop model running debian testing, the subwoofer is now working.

A simple way to test it is to plug in you earphones, the subwoofer won't be muted.

leneb

Posted 2015-09-19T12:27:48.407

Reputation: 46

It works. You're also right about the earphones and the subwoofer not being muted, but that's another chapter of linux tinkering to solve. – Dragoș – 2015-09-20T08:55:11.087

Oh cool, I added a script to my answer that does all of the steps in one, using hda-verb only, without hda analyzer. Not sure if it's a sane initial volume level, though. (But after that it appears to adjust with the regular volume controls?) Nice collaboration! – miyalys – 2015-09-20T13:32:44.483

3

With help from debianuser in the #alsa IRC channel on freenode, I think I might have gotten us a little closer. It seems the power states can be set with the hda_verb tool, which is a part of alsa-tools, however there doesn't seem to be an option to control power_save_controller specifically, only power state. You can get info on what parameters can be set by running hda-verb -L

Example getting the power state of a device:

sudo hda-verb /dev/snd/hwC1D0 0x1a GET_POWER POWER_STATE

Example setting the power state of a device:

sudo hda-verb /dev/snd/hwC1D0 0x17 SET_POWER 0x0 POWER_STATE

So specifically what you seem to need to do is run:

sudo hda-verb /dev/snd/hwC1D0 0x17 SET_POWER 0x0
sudo hda-verb /dev/snd/hwC1D0 0x1a SET_POWER 0x0

Note that this won't work while HDA Analyzer is running, but it can be launched afterwards to verify if the change worked. It did in my case change it to D0.

I wonder if that solves your problem?
As said I have the same computer, though I'm not entirely sure whether my subwoofer is actually off, as I can't hear much of a difference from an example sound file I created when played back in Windows or Archlinux. Maybe the frequency (65 hz) is too high? In case anyone else wants to test it:
http://miyalys.eu.org/files/65hzsine.wav

Maybe we can find a way to disable the regular speakers so only the subwoofer is on?

Edit: With the help from leneb's answer, I created this script that must be run as root, which does all of these things, only using hda-verb. Not sure the volume level is entirely sane, though. (feedback appreciated) And the problem with headphones being plugged in, not silencing the subwoofer, persists.

#! /usr/bin/env sh

# Run this script as root!

dev="/dev/snd/hwC1D0"

hda-verb $dev 0x17 SET_POWER 0x0
hda-verb $dev 0x1a SET_POWER 0x0
hda-verb $dev 0x03 0x300 0xa055
hda-verb $dev 0x03 0x300 0x9055
hda-verb $dev 0x17 0x300 0xb000
hda-verb $dev 0x17 0x707 0x40
hda-verb $dev 0x1a 0x707 0x25

If necessary all those steps can also be done without hda-verb, only using python, but it would make the code much less clean.

miyalys

Posted 2015-09-19T12:27:48.407

Reputation: 1 757

Unfortunately, the subwoofer clicks when I use the commands but it still doesn't work. As for disabling regular speakers, I'd use HDA Analyzer to find some option to mute them? (I'd boot Linux Mint live, enable the subwoofer, find how to disable the speakers using HDA Analyzer and reproduce the settings on Arch). – Dragoș – 2015-09-20T06:56:42.240

Ah, too bad! Does not working "only" mean the subwoofers aren't playing, or also that the power state is not changed to D0? As for disabling speakers then yeah, you're probably right it can be done that way. – miyalys – 2015-09-20T08:20:06.090

The power state does indeed change to D0. Just that the subwoofer won't play. You did answer the original question, though, – Dragoș – 2015-09-20T08:22:54.030

Okay, well still the important problem isn't solved (maybe we're closer though), so hopefully someone comes up with a better answer, if one of us don't. – miyalys – 2015-09-20T08:24:53.967