Skip to contentSkip to conversation

Subwoofers aren't working on ALC298 (Lenovo Yoga C930 Laptop)

DISCUSSION Jonathan Reeve 3 participants 6 messages Nov 26, 2018 – Nov 29, 2018

lore
Share & tools
lore
#0 lore raw

Hi Alsa Devs,

I've been struggling with a sound issue for a while now. I just bought a new laptop that's known for its high-quality audio. It's billed as a Dolby Atmos speaker system, and it appears to be using a ALC298 card (or so I gathered from aplay -l). From what I can tell, it has tweeters in the back, and subwoofers on the bottom of the laptop. It sounds really great in Windows, but tinny and flat in Linux. I'm guessing this is because the subwoofers aren't being engaged.

Here are some things I've tried so far:

- Tweaking what is possible to tweak in GNOME.
- Running pavucontrol. No useful options here.
- Unmuting everything in alsamixer. Unmuting only some things in alsamixer.
- Running hdajackretask, from the alsaTools package. It seems to correctly recognize that there are some unassigned pins, and even gives me the option of assigning them to "internal speaker (LFE)," which sounds like it could be a bass output. But when I click "apply now" or "apply boot options," the scripts fail by saying they can't find tools like md or tee. I can run the scripts it generates manually, but then the changes don't really seem to take effect.
- Following the instructions from the ALSA page on the wiki, and trying all kinds of different options
- All of the above, and also restarting alsa / snd_hda / pulseaudio all manually.

As far as I can tell, I'm running the latest version of ALSA, since I'm on NixOS unstable, and [[https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/alsa-firmware/default.nix][their build script]] seems to grab the latest version.

[[http://www.alsa-project.org/db/?f=8c072b3fbb139d350cd0e2c4c98cbb7736c6455a][Here's the output from my alsa-info.sh.]] I don't know enough about ALSA, or sound hardware, to know what's going on there. Is it obvious from my alsa-info which pins I should try reassigning to which channels? And does anyone know of a good way of doing this? Preferably one that doesn't use hdajackretask, which doesn't appear to work on NixOS.

[[https://unix.stackexchange.com/questions/482885/how-can-i-get-my-laptops-internal-speakers-to-work-correctly-on-nixos?noredirect=1#comment886606_482885][I also posted a few more details about this on this StackExchange question.]]

I hope that getting this to work will not only help me, but others with this same laptop or speaker configuration.

Thanks in advance for any help you'd be able to provide!

Best,

Jonathan

#1 lore raw

Hi Jonathan,

Quoted 2 lines

- Running hdajackretask, from the alsaTools package. It seems to
correctly recognize that there are some unassigned pins, and even gives me the option of assigning them to "internal speaker (LFE)," which sounds like it could be a bass output.

LFE usually stands for Low Frequency Effects, i.e. a subwoofer channel on a movie or game. There are some tips on surround sound at http://www.volkerschatz.com/noise/alsa.html

I don't know which 'md' program they are referring to, but you can install tee separately.

Cheers!

Daniel

#2 lore raw

Hi Daniel,

I'm guessing I shouldn't assign this pin to LFE, then? And maybe assign it to "internal speaker (back)"? I'm at a loss for knowing what to assign to what.

But this is all moot, since the real problem, it seems to me, is that clicking "apply now" or "install boot override" won't work on NixOS. The first issue is that hdajackretask apparently can't find my copies of tee and mv. I can run these programs just fine from a shell, and which tee shows their locations in NixOS:
/run/current-system/sw/bin/tee, but hdajackretask can't find them, for some reason, and Apply now fails. The second is that, even if I run run the /tmp script manually, nothing seems to change with my system. I have a feeling hdajackretask needs to do something beyond what is in the /tmp script, and that it can't do that, since it can't find my system utilities.

Thanks for that link, though—there's some useful stuff in there.

Are there other ways of connecting unused pins that don't use hdajackretask? Like a script I can run or a sequence of commands?

Best,

Jonathan

Quoted 12 lines · Daniel James

Hi Jonathan,

Quoted 5 lines

- Running hdajackretask, from the alsaTools package. It seems
to correctly
recognize that there are some unassigned pins, and even gives me the option of assigning them to "internal speaker (LFE)," which sounds like it could be a bass output.

LFE usually stands for Low Frequency Effects, i.e. a subwoofer channel on a movie or game. There are some tips on surround sound at
http://www.volkerschatz.com/noise/alsa.html

Quoted 6 lines

I don't know which 'md' program they are referring to, but you can install tee separately.

Cheers!

Daniel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
Quoted 1 line

As far as I can tell, I'm running the latest version of ALSA, since I'm

on NixOS unstable, and

Have you tried any other distribution, something more normal like latest Fedora or Ubuntu ? Does the subwoofers work there ?
If you run Ubuntu/Fedora you can check the sound settings and pavucontrol there is selection of speakers usually 2.1 5.1... try those ? The moment you realize your "tee" is located in /run/current-system/sw/bin/tee it should ring a bell that something is wrong with this distribution.
hdajackretask is creating a /lib/firmware/hda-jack-retask.fw (text file) which is attached to modprobe automatic and creates a file in /etc/modprobe.d/hda-jack-retask.conf
which contains a line:
options snd-hda-intel patch=hda-jack-retask.fw, hda-jack-retask.fw, hda-jack-retask.fw, hda-jack-retask.fw
And the content of the hda-jack-retask.fw is something like this:

[codec]
0x10138409 0x106b3300 0

[pincfg]
0x24 0x90100080
0x25 0x90100082
0x26 0x400000f0
0x27 0x400000f0
And you have to make sure those [pincfgs] match with your Windows10 registry of the driver's PinConfigOverride.
You happen to have Windows running on that machine and can extract the pinconfigoverride or have .ini of the driver? I can help you compare those.

Quoted 58 lines · Jonathan Reeve

Hi Daniel,

I'm guessing I shouldn't assign this pin to LFE, then? And maybe assign
it to "internal speaker (back)"? I'm at a loss for knowing what to assign to what.

But this is all moot, since the real problem, it seems to me, is that
clicking "apply now" or "install boot override" won't work on NixOS.
The first issue is that hdajackretask apparently can't find my copies
of tee and mv. I can run these programs just fine from a shell, and
which tee shows their locations in NixOS:
/run/current-system/sw/bin/tee, but hdajackretask can't find them,
for some reason, and Apply now fails. The second is that, even if I
run run the /tmp script manually, nothing seems to change with my system. I have a feeling hdajackretask needs to do something beyond
what is in the /tmp script, and that it can't do that, since it can't
find my system utilities.

Thanks for that link, though—there's some useful stuff in there.

Are there other ways of connecting unused pins that don't use hdajackretask? Like a script I can run or a sequence of commands?

Best,

Jonathan

Quoted 19 lines · Daniel James

Hi Jonathan,

Quoted 7 lines

- Running hdajackretask, from the alsaTools package. It seems to correctly
recognize that there are some unassigned pins, and even gives me the option of
assigning them to "internal speaker (LFE)," which sounds like it could be a
bass output.

LFE usually stands for Low Frequency Effects, i.e. a subwoofer channel on a
movie or game. There are some tips on surround sound at
http://www.volkerschatz.com/noise/alsa.html

I don't know which 'md' program they are referring to, but you can install tee
separately.

Quoted 8 lines
Quoted 3 lines

Cheers!

Daniel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#4 lore raw

Hi David,

Thanks very much for helping me look into this.

Quoted 2 lines

Have you tried any other distribution, something more normal like latest Fedora or Ubuntu ? Does the subwoofers work there ?

I just tried an Ubuntu live USB disk. I can't get subwoofers to work there, either.

Quoted 2 lines

If you run Ubuntu/Fedora you can check the sound settings and pavucontrol there is selection of speakers usually 2.1 5.1... try those ?

I don't see any option for that in pavucontrol on Ubuntu.

Quoted 2 lines

And you have to make sure those [pincfgs] match with your Windows10 registry of the driver's PinConfigOverride.

Awesome. How can I find these settings? I checked in regedit and searched for pinconfigoverride and pincfg, but nothing's coming up. I also grepped all the driver files for those expressions, but nothing's coming up there, either. Do you know if these settings are called something else?

Quoted 3 lines

You happen to have Windows running on that machine and can extract the pinconfigoverride or have .ini of the driver? I can help you compare those.

Yep, I have the Windows 10 driver files, but there is no .ini file, as far as I can tell. There are lots of text files that look like they could be configuration files of some sort. Which one(s) should I be looking for?

Best,

Jonathan

#5 lore raw

Ooops I have misleaded you with PinConfigOverride that's for all the Macs, dont look for it anymore.

Node 0x17 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Control: name="Bass Speaker Playback Switch", index=0, device=0

    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x0001001c: OUT HP EAPD Detect
  EAPD 0x2: EAPD
  Pin Default 0x411111f0: [N/A] Speaker at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Power states:  D0 D1 D2 D3 EPSS
  Power: setting=D3, actual=D3
  Connection: 3
     0x0c 0x0d 0x06*

Looking at your alsa-info, this is your Bass Speaker Playback Switch. It is in current Power setting=D3 and actual=D3.
It should become D0 to be turned on.

Not sure if you can do this via alsamixer -c0 ?(or whatever number is your card).
there is also a way with hda-verb (make sure you have hda-verb installed (from <ftp://ftp.alsa-project.org/pub/tools/alsa-tools-1.1.7.tar.bz2> alsa-tools <ftp://ftp.alsa-project.org/pub/tools/alsa-tools-1.1.7.tar.bz2> ?))

According to https://www.kernel.org/doc/html/v4.16/sound/hd-audio/notes.html

power_save_node (bool) advanced power management for each widget, controlling the power sate (D0/D3) of each widget node depending on the actual pin and stream states
could be a permanent more elegant solution in a hda-jack-retask.fw patch, but no idea how it should look for that widget exactly, Takashi can suggest.

You can try for now enabling that Power: setting=D0, actual=D0 if that will help you probably:

Documentation is at:
https://www.intel.com/content/dam/www/public/us/en/documents/product-specifications/high-definition-audio-specification.pdf
Page 153 is of your interest.
0x705 is the SET verb, 0x00 should be fully on D0 state

# sudo hda-verb /dev/snd/hwC0D0 0x17 0x705 0x00
you can get the value from the codec back:
# sudo hda-verb /dev/snd/hwC0D0 0x17 0xf05 0x00

Hope that helps, if that solves the solution as a dirty thing you can put that hda-verb command in your /etc/rc.local (depending on the distro rc.local maybe deadend).

Quoted 50 lines · Jonathan Reeve

Hi David,

Thanks very much for helping me look into this.

Quoted 3 lines

Have you tried any other distribution, something more normal like latest
Fedora or Ubuntu ? Does the subwoofers work there ?

I just tried an Ubuntu live USB disk. I can't get subwoofers to work
there, either.

Quoted 3 lines

If you run Ubuntu/Fedora you can check the sound settings and pavucontrol
there is selection of speakers usually 2.1 5.1... try those ?

I don't see any option for that in pavucontrol on Ubuntu.

Quoted 3 lines

And you have to make sure those [pincfgs] match with your Windows10
registry of the driver's PinConfigOverride.

Awesome. How can I find these settings? I checked in regedit and searched
for pinconfigoverride and pincfg, but nothing's coming up. I also
grepped all the driver files for those expressions, but nothing's coming
up there, either. Do you know if these settings are called something
else?

Quoted 5 lines

You happen to have Windows running on that machine and can extract the
pinconfigoverride or have .ini of the driver? I can help you compare
those.

Yep, I have the Windows 10 driver files, but there is no .ini file, as far as
I can tell. There are lots of text files that look like they could be
configuration files of some sort. Which one(s) should I be looking for?

Best,

Jonathan