NixOS / nixpkgs

Nix Packages collection & NixOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sound doesn't work properly: subwoofer not recognized

JonathanReeve opened this issue · comments

Issue description

I just got a Lenovo Yoga C930. (Not the Yoga Book, but the laptop.) It's known for its excellent sound system, which works very well on Windows, but seems to be broken on NixOS. I think it's that the subwoofer just isn't being recognized. Sound plays fine out of the front speaker, from what I can tell, but not the bottom speaker. There's virtually no bass response, and it sounds really flat and tinny.

Here's what 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 bass outputs. But when I click "apply now" or "apply boot options," the scripts fail by saying they can't find tools like mv 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.

Steps to reproduce

Try to play sound on a Lenovo Yoga C930 running NixOS. Notice that the sound quality is terrible.

Any direction here would be much appreciated. I'm at my wits' end trying to get this to work.

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.81, NixOS, 19.03pre159472.80738ed9dc0 (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.1.3
  • channels(jon): "nixos"
  • channels(root): "nixos-19.03pre159472.80738ed9dc0"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

More technical details

I posted about this recently on Stack Overflow, but with no solution in sight..

Also, here is a copy of the result of alsa-info.sh.

Here is my configuration.nix

and the relevant lines:

  # Enable sound.
  sound.enable = true;
  hardware.pulseaudio.enable = true;

Hmm... tee is part of the coreutils package. You should have it. Weird. Can you post the generated script?

Yep. I do have it. I'm guessing hdajackretask has something hard-coded somewhere to a path like /usr/bin/tee that doesn't exist on nix, and/or a way to spawn external commands that isn't sensitive to symlinks.

The script is just a bunch of lines that look like this:

echo "0x12 0x411111f0" | tee /sys/class/sound/hwC0D0/user_pin_configs 2>>/tmp/hda-jack-retask-KJRUSZ/errors.log
echo "0x13 0x40000000" | tee /sys/class/sound/hwC0D0/user_pin_configs 2>>/tmp/hda-jack-retask-KJRUSZ/errors.log

And of course, the script runs fine if I run it manually.

In the meantime, though, if anyone has an idea of how to reassign these pins manually, it'd be much appreciated.

After running the script to set the pins, do you see any additional volume controls in alsamixer?

In case it helps, here's the hdajackretask README: http://git.alsa-project.org/?p=alsa-tools.git;a=blob;f=hdajackretask/README;h=209e3322e555983e9bc1e9d4d776bebc93f769e6;hb=HEAD

I recommend getting on the ALSA mailing list (http://www.alsa-project.org/main/index.php/Mailing-lists) and seeking assistance there. Thus far it seems that the issue is with ALSA or it's configuration, rather than with NixOS itself. Hopefully they'll be able to help you get the sub woofer working :)

Of course, if you do find that the issue is specific to NixOS, please let us know!

Fair enough. I guess my real NixOS-specific issue is that hdajackretask doesn't work on NixOS, probably because it's looking for a tool in a place like /bin and not finding it there. But I'll open a different issue for this.

I should mention that the sound situation is even worse today, for whatever reason, you don't even get the tinny sound until you

boot.extraModprobeConfig = "options snd_intel_dspcfg dsp_driver=1";

Improvements to the hardware-configuration.nix generator could probably be made.
More discussion here https://discourse.nixos.org/t/sound-not-working/12585/4