Skip to content
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

update nixos ucm install #141

Closed
wants to merge 13 commits into from
Closed

update nixos ucm install #141

wants to merge 13 commits into from

Conversation

dj1ch
Copy link
Contributor

@dj1ch dj1ch commented Feb 20, 2024

pretty much the title, just updated the commit hash, and some info on nixos config locations. install script wise nothing seemed to be out of the ordinary, copied the ucm to /usr/share/alsa like normal. didn't want the nixos page to become outdated @WeirdTreeThing

@ChocolateLoverRaj
Copy link
Contributor

@dj1ch did you test the nixos instructions on a Chromebook? If you did, can you provide the full nix config? I'm trying the nixos guide and it's compiling stuff for over 10 minutes and taking up a lot of storage space. I think the nixos guide needs some fixing in addition to just updating the commit used.

@ChocolateLoverRaj
Copy link
Contributor

@dj1ch what about the issue of "50GB of rebuilds"?

@dj1ch
Copy link
Contributor Author

dj1ch commented Mar 30, 2024

@dj1ch what about the issue of "50GB of rebuilds"?

ok, pretty much did the same thing you did with audio.nix, tested it on my machine and it runs fine. nix garbage collection also freed up some of my storage which was nice.

@dj1ch dj1ch requested review from ninelore and ethanaobrien March 30, 2024 21:13
@ChocolateLoverRaj
Copy link
Contributor

ChocolateLoverRaj commented Mar 30, 2024

A few issues:

  • The ucm-conf is a few months old (Should work for most devices, but ideally it should use the latest ucm-conf which will also work for all generations. I'm planning on changing the audio config to use the latest version, but let me know if you want to do it and then I won't, and I'll just test it out once you do.
  • There appear to be instructions for AVS but does AVS work? Do some files need to be added for AVS?
  • What about max98357a (the danger)?
  • AMD audio not implemented yet (this is ok but maybe it should be mentioned in the docs)
  • Not needed, but 51-increase-headroom.lua should also be added
  • And you can use fetch from GitHub instead of fetching a zip

@ChocolateLoverRaj
Copy link
Contributor

@dj1ch
Copy link
Contributor Author

dj1ch commented Mar 30, 2024

A few issues:

  • The ucm-conf is a few months old (Should work for most devices, but ideally it should use the latest ucm-conf which will also work for all generations. I'm planning on changing the audio config to use the latest version, but let me know if you want to do it and then I won't, and I'll just test it out once you do.
  • There appear to be instructions for AVS but does AVS work? Do some files need to be added for AVS?
  • What about max98357a (the danger)?
  • AMD audio not implemented yet (this is ok but maybe it should be mentioned in the docs)
  • Not needed, but 51-increase-headroom.lua should also be added
  • And you can use fetch from GitHub instead of fetching a zip

we can probably try using the latest commit if possible. ill test it and ill let you know.

@WeirdTreeThing
Copy link
Member

bruh why are you still using that repo

@ChocolateLoverRaj
Copy link
Contributor

bruh why are you still using that repo

Should we use https://github.com/WeirdTreeThing/alsa-ucm-conf-cros/tree/standalone ? Is that "your upstream" repo for Chromebook audio, and not chromebook-ucm-conf?

@dj1ch
Copy link
Contributor Author

dj1ch commented Apr 1, 2024

bruh why are you still using that repo

Should we use https://github.com/WeirdTreeThing/alsa-ucm-conf-cros/tree/standalone ? Is that "your upstream" repo for Chromebook audio, and not chromebook-ucm-conf?

probably this issue sums it up

@ChocolateLoverRaj
Copy link
Contributor

Except that we could just use the latest commit of chromebook-ucm-conf and it will work for all SOF generations. So I'm still confused.

@dj1ch
Copy link
Contributor Author

dj1ch commented Apr 1, 2024

@ChocolateLoverRaj this is my current audio.nix, if you want to test with the last alsa-ucm-conf-cros release. im assuming this is how wtt wanted this to be packaged.

{ config, pkgs, lib, ... }:


let
  cb-ucm-conf = pkgs.alsa-ucm-conf.overrideAttrs {
    wttsrc = pkgs.fetchurl {
      url = "https://github.com/WeirdTreeThing/alsa-ucm-conf-cros/archive/refs/tags/0.4.tar.gz";
      hash = "sha256-3D+wUj8O2y+OEcdvoXzmU1IxSoc44qoV5+I5AO1tl2o=";
    };
    unpackPhase = ''
      runHook preUnpack
        tar xf "$wttsrc"
      runHook postUnpack
    '';
    installPhase = ''
      runHook preInstall
      mkdir -p $out/share/alsa
      cp -r alsa-ucm*/ucm2 $out/share/alsa
      runHook postInstall
    '';
  };
in
{
  # audio modprobes go here
  boot = {
    extraModprobeConfig = ''
      options snd-intel-dspcfg dsp_driver=3
    '';
  };  

  environment = {
    systemPackages = with pkgs; [
      maliit-keyboard # optional
      sof-firmware
    ];
    sessionVariables.ALSA_CONFIG_UCM2 = "${cb-ucm-conf}/share/alsa/ucm2";
  };

  system = {
    replaceRuntimeDependencies = [
      ({
        original = pkgs.alsa-ucm-conf;
        replacement = cb-ucm-conf;
      })
    ];
  };
}

@ChocolateLoverRaj
Copy link
Contributor

@dj1ch can u plz replace fetchurl with fetch from github?

@ChocolateLoverRaj
Copy link
Contributor

I mean https://ryantm.github.io/nixpkgs/builders/fetchers/#fetchfromgithub

@dj1ch dj1ch changed the title update nixos chromebook-ucm-conf install update nixos ucm install Apr 1, 2024
@ChocolateLoverRaj
Copy link
Contributor

Also include 51-increase-headroom.lua. That's what I did in my config. There are different instructions for 23.11 and unstable.

@ninelore
Copy link
Member

@ChocolateLoverRaj
Copy link
Contributor

I'll test this once it's completely ready

@ChocolateLoverRaj
Copy link
Contributor

what about the avs dmic config?

@WeirdTreeThing I think NixOS audio setup is SOF only atm. Idk if there are even any NixOS users who use AVS Chromebooks.

@ChocolateLoverRaj
Copy link
Contributor

@dj1ch
Copy link
Contributor Author

dj1ch commented Apr 16, 2024

what about the avs dmic config?

@WeirdTreeThing I think NixOS audio setup is SOF only atm. Idk if there are even any NixOS users who use AVS Chromebooks.

there are definitely avs users, iirc at least one having audio issues. @WeirdTreeThing may be referring to this repo, although I could be wrong on that one. for that we may just need to clone and use make to build it.

@dj1ch
Copy link
Contributor Author

dj1ch commented Apr 16, 2024

Also keyd device ids https://github.com/WeirdTreeThing/cros-keyboard-map/blob/main/cros-keyboard-map.py#L6-L20

@ninelore already done: 8892243

ill add this too

@WeirdTreeThing
Copy link
Member

there are definitely avs users, iirc at least one having audio issues. @WeirdTreeThing may be referring to this repo, although I could be wrong on that one. for that we may just need to clone and use make to build it.

Not what I was talking about. I meant this

@ChocolateLoverRaj
Copy link
Contributor

Not what I was talking about. I meant this

@WeirdTreeThing is including that one file enough to get AVS to work on Chromebooks on NixOS?

@ChocolateLoverRaj
Copy link
Contributor

there are definitely avs users, iirc at least one having audio issues

They'll have to test it out then. Are they on GitHub?

@dj1ch
Copy link
Contributor Author

dj1ch commented Apr 17, 2024

there are definitely avs users, iirc at least one having audio issues

They'll have to test it out then. Are they on GitHub?

i could try and ask them about it, it was on the chrultrabook discord server.

@dj1ch dj1ch requested a review from ninelore April 17, 2024 00:20
@WeirdTreeThing
Copy link
Member

@WeirdTreeThing is including that one file enough to get AVS to work on Chromebooks on NixOS?

No, all it does is make the mic work.

Copy link
Member

@ninelore ninelore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall weird and possibly broken nix syntax.

@ChocolateLoverRaj
Copy link
Contributor

Once the replace dependency thing works with Nix flakes I think it would be nice to have a separate repo with Chromebook config and then NixOS Chromebook users can just add that repo.

@ninelore
Copy link
Member

Once the replace dependency thing works with Nix flakes I think it would be nice to have a separate repo with Chromebook config and then NixOS Chromebook users can just add that repo.

It should be possible

@ninelore
Copy link
Member

Example config (SOF, cros-standard kb, 24.05)
https://github.com/ninelore/dots.nix/blob/master/nixos/cros-sof-std.nix

@dj1ch dj1ch requested a review from ninelore April 20, 2024 02:12
Copy link
Member

@ninelore ninelore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L177 onwards is still a confusing mess.

  • Merge modprobe part and codeblocks with the wireplumber so we have 1 codeblock for each SOF/AVS1/AVS2 and 23.11/24.05
  • Use Collapsing sections for those
Example

Foobar

function logSomething(something) {
  console.log('Something', something);
}
<details>
<summary>Example</summary>

Foobar

function logSomething(something) {
  console.log('Something', something);
}

</details>

@ninelore
Copy link
Member

Apr 21 14:22:17 9l-lillipup wireplumber[1656]: Old configuration file detected: /etc/wireplumber/main.lua.d/51-increase-headroom.lua
Apr 21 14:22:17 9l-lillipup wireplumber[1656]: Lua configuration files are NOT supported in WirePlumber 0.5. You need to port them to the new format if you w…to use them.
                                               -> See https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/migration.html

@ninelore
Copy link
Member

ninelore commented Apr 21, 2024

the alsa ucm package override is broken aswell

https://github.com/ninelore/dots.nix/blob/master/nixos/cros.nix#L4-L18

@ninelore
Copy link
Member

We have decided not to update the page. Instead it will be removed soon.

@ninelore ninelore closed this Apr 21, 2024
@ChocolateLoverRaj
Copy link
Contributor

@dj1ch it would be nice if you made your own repo with nix files and instructions for Chromebook audio

@dj1ch
Copy link
Contributor Author

dj1ch commented Apr 21, 2024

We have decided not to update the page. Instead it will be removed soon.

perfectly understandable, thank you anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants