NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.39k stars 13.61k forks source link

Sound doesn't work properly: subwoofer not recognized #51037

Closed JonathanReeve closed 5 years ago

JonathanReeve commented 5 years ago

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:

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

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;
emmanuelrosa commented 5 years ago

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

JonathanReeve commented 5 years ago

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.

emmanuelrosa commented 5 years ago

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

JonathanReeve commented 5 years ago

Indeed, I now have a "bass speaker" channel show up in alsamixer. But the volume level on it can't be changed, and it's stuck on zero. Also, any sound still seems to be lacking bass.

Emmanuel Rosa notifications@github.com writes:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.*

emmanuelrosa commented 5 years ago

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!

JonathanReeve commented 5 years ago

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.

makoConstruct commented 1 year ago

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