# Help Wanted: Guix Audio on Chromebooks

**URL:** <https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623>\
**Category:** Guix\
**Created:** [April 24, 2024, 9:02pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623 "2024-04-24T21:02:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 24, 2024, 9:02pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/1 "2024-04-24T21:02:01Z")

</div>

Guix System runs on Chromebooks just fine. The only problem is the usual problem with any GNU/Linux system: Audio does not work. There is a [fix for audio on Chromebooks](https://github.com/WeirdTreeThing/chromebook-linux-audio) but it is so dependent on the conventional file system that I do not know how to implement the changes for Guix System. Does anybody know if they could make a system declaration that accomplishes what the script does?

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 26, 2024, 11:26pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/2 "2024-04-26T23:26:45Z")

</div>

Created [`chromebook-guix`](https://codeberg.org/csh/chromebook-guix) to log my system changes. Got the following error:

```auto
caleb@hermes:~/Projects/chromebook-guix$ make
guix time-machine -C channels.scm -- system build system.scm
guix system: error: failed to load 'system.scm':
ice-9/boot-9.scm:3330:6: In procedure resolve-interface:
no code for module (chromebook alsa-lib)
make: *** [Makefile:9: build] Error 1

```

---

<div class="post-metadata">

**Author:** ![mrok](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrok](https://forum.systemcrafters.net/u/mrok)\
**Post date:** [April 27, 2024, 2:09am UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/3 "2024-04-27T02:09:10Z")

</div>

1. In order to use a module, you must first add it to the [load path](https://www.gnu.org/software/guile/manual/html_node/Installing-Site-Packages.html#index-load-path). [GUILE\_LOAD\_PATH](https://www.gnu.org/software/guile/manual/html_node/Environment-Variables.html#index-GUILE_005fLOAD_005fPATH) environment variable can be used for that.

2. In guile, each [module name](https://www.gnu.org/software/guile/manual/html_node/Modules-and-the-File-System.html) is derived from its file name: `(chromebook alsa-lib)` = `chromebook/alsa-lib.scm`  
In your case, the module name and the file name do not match.  
For the module to work, you need to add the directory in which your module is located to the load path. For example, if the module location is `$HOME/Projects/chromebook-guix/chromebook/alsa-lib.scm`, you need to do `export GUILE_LOAD_PATH=$HOME/Projects/chromebook-guix`

3. Instead of loading a module you can [load](https://www.gnu.org/software/guile/manual/html_node/Loading.html) a simple file: `(primitive-load "/path/to/file.scm")`

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 28, 2024, 1:54am UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/4 "2024-04-28T01:54:54Z")

</div>

Found some [instructions for non-standard distros](https://raw.githubusercontent.com/chrultrabook/docs/a281259c3016d754540500e4eeea40874098b8eb/src/docs/installing/distros.md) from the Chrultrabook people.

It seems to be building after changing `GUILE_LOAD_PATH` but I’ll have to confirm in the morning. Good night.

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 28, 2024, 9:31pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/5 "2024-04-28T21:31:30Z")

</div>

```plaintext
caleb@hermes:~/Projects/chromebook-guix$ guix repl -L .
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> (use-modules (chromebook alsa-lib))
scheme@(guix-user)> 

```

Yet, I still get the error:

```plaintext
caleb@hermes:~/Projects/chromebook-guix$ make                                                                                  
guix time-machine -C channels.scm -L . -- system build system.scm                                                              
Updating channel 'nonguix' from Git repository at 'https://gitlab.com/nonguix/nonguix'...                                      
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...                                  
Authenticating channel 'guix', commits 9edb3f6 to 9f183c3 (25 new commits)...
error: channel: unbound variable                                                                                               
hint: Did you forget `(use-modules (guix channels))'?                                                                          
                                                               
error: specifications->manifest: unbound variable                                                                              
hint: Did you forget `(use-modules (gnu packages))'?                                                                           
                                                                                                                               
no code for module (nongnu packages linux)                                                                                     
hint: File `./system.scm' should probably start with:                                                                          
                                                               
     (define-module (system))                            
[...]
guix system: error: failed to load 'system.scm':
ice-9/boot-9.scm:3330:6: In procedure resolve-interface:
no code for module (chromebook alsa-lib)
make: *** [Makefile:9: build] Error 1

```

---

<div class="post-metadata">

**Author:** ![mrok](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrok](https://forum.systemcrafters.net/u/mrok)\
**Post date:** [April 28, 2024, 11:23pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/6 "2024-04-28T23:23:49Z")

</div>

So, judging by the fact that it produces errors about `channel` and `specifications->manifest`, the directory is in the load path. But it is possible that the `-L` option is only visible to `time-machine`, but not to `system`. That happened to me with `--substitute-urls`. I think that options used in `time-machine` are not passed to the command it calls. Try this:

```Shell
guix time-machine -C channels.scm -- system -L . build system.scm

```

The module may also be broken. You need to check it separately:

```Shell
guix build -e '(@ (chromebook alsa-lib) chromebook-alsa-lib)'

```

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 29, 2024, 8:24pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/7 "2024-04-29T20:24:09Z")

</div>

> [@mrok](#):
>
> `guix time-machine -C channels.scm -- system -L . build system.scm`

```plaintext
error: channel: unbound variable
hint: Did you forget `(use-modules (guix channels))'?

error: specifications->manifest: unbound variable
hint: Did you forget `(use-modules (gnu packages))'?

error: channel: unbound variable
hint: Did you forget `(use-modules (guix channels))'?

error: specifications->manifest: unbound variable
hint: Did you forget `(use-modules (gnu packages))'?

guix system: warning: failed to load '(system)':
no code for module (system)
hint: File `./system.scm' should probably start with:

     (define-module (system))

guix system: error: chromebook-alsa-lib: unknown package
guix system: warning: failed to load '(system)':
guix system: error: failed to load 'system.scm':
guix/ui.scm:478:5: In procedure warn-about-load-error:
Wrong number of arguments to #<procedure display-error (_ _ _ _ _ _)>
make: *** [Makefile:9: build] Error 1

```

> [@mrok](#):
>
> `guix build -e '(@ (chromebook alsa-lib) chromebook-alsa-lib)'`

```plaintext
caleb@hermes:~/Projects/chromebook-guix$ guix build -e '(@ (chromebook alsa-lib) chromebook-alsa-lib)'
guix build: error: failed to evaluate expression '(@ (chromebook alsa-lib) chromebook-alsa-lib)':
In procedure module-variable: Wrong type argument in position 1 (expecting module): #f

```

---

<div class="post-metadata">

**Author:** ![mrok](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrok](https://forum.systemcrafters.net/u/mrok)\
**Post date:** [April 29, 2024, 10:30pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/9 "2024-04-29T22:30:55Z")

</div>

Alright, I tried that myself.

```Shell
guix build -L . -e '(@ (chromebook alsa-lib) chromebook-alsa-lib)'

```

is built successfully for me.

As for system.scm, `specification->package` cannot detect your package because its definition is missing `(name "chromebook-alsa-lib")`. However, I built it without `specification->package`:

```Scheme
(packages (cons* chromebook-alsa-lib
                  %base-packages))

```

The command I used:

```Shell
guix time-machine -C channels.scm -- system -L . build system.scm

```

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 30, 2024, 1:50am UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/10 "2024-04-30T01:50:04Z")

</div>

> [@mrok](#):
>
> `guix build -L . -e '(@ (chromebook alsa-lib) chromebook-alsa-lib)'`

This builds here, too!

 ![Screenshot at 2024-04-29 20-48-09](https://canada1.discourse-cdn.com/flex029/uploads/systemcrafters/original/1X/f6ea6b6ae0145b5b1a2c1aec5dbffcf51e8d9701.png)

> [@mrok](#):
>
> ```auto
> (packages (cons* chromebook-alsa-lib
> %base-packages))
> 
> ```

I [removed `specification->package`](https://codeberg.org/csh/chromebook-guix/commit/2a358c97317bd46004329b99c450668cb502a04e) and will try building it tonight, and report back.

---

<div class="post-metadata">

**Author:** ![mrok](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrok](https://forum.systemcrafters.net/u/mrok)\
**Post date:** [April 30, 2024, 6:29am UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/11 "2024-04-30T06:29:58Z")

</div>

Don’t forget to add the package name field for [chromebook-alsa-lib](https://codeberg.org/csh/chromebook-guix/src/commit/2a358c97317bd46004329b99c450668cb502a04e/chromebook/alsa-lib.scm#L82). Although the package can be built without it, it should be there anyway, even if you don’t use specification-\>package.

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 30, 2024, 5:57pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/12 "2024-04-30T17:57:12Z")

</div>

The system built! 😀 I rebooted. Sound still doesn’t work.

Add package name field. Like this?

```scheme
 29 (define-public chromebook-ucm-conf
 30 (let ((commit "1328e46bfca6db2c609df9c68d37bb418e6fe279")
 31 (revision "1"))
 32 (package
 33 (name "chromebook-ucm-conf")
 34 (version (git-version "0.0" revision commit))
 35 (source (origin

```

It was already there in [line 33](https://codeberg.org/csh/chromebook-guix/src/branch/master/chromebook/alsa-lib.scm#L33).

---

<div class="post-metadata">

**Author:** ![mrok](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrok](https://forum.systemcrafters.net/u/mrok)\
**Post date:** [April 30, 2024, 7:39pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/13 "2024-04-30T19:39:51Z")

</div>

The name is missing not from chromebook-ucm-conf, but from [chromebook-alsa-lib](https://codeberg.org/csh/chromebook-guix/src/commit/2a358c97317bd46004329b99c450668cb502a04e/chromebook/alsa-lib.scm#L82)

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 30, 2024, 9:05pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/14 "2024-04-30T21:05:11Z")

</div>

[Done](https://codeberg.org/csh/chromebook-guix/commit/e37dad350763d7b0a68c495efb29f4171866cb84). Should I return `specification->package` to `(packages)` now?

```scheme
  (packages (append (list (specification->package "chromebook-alsa-lib"))
                    %base-packages))

```

I thought `chromebook-alsa-lib` was not named, because it was supposed to totally replace `alsa-lib`. Having two `alsa-lib`s might mean that the audio settings for `chromebook-alsa-lib` are not recognized by the system.

---

<div class="post-metadata">

**Author:** ![mrok](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrok](https://forum.systemcrafters.net/u/mrok)\
**Post date:** [April 30, 2024, 11:00pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/15 "2024-04-30T23:00:27Z")

</div>

You can use `specification->package` if you want. But I think it makes no sense in this case. `specification->manifest` is usually used when the module from which the package is taken is not known. You have [explicitly specified](https://codeberg.org/csh/chromebook-guix/src/commit/e37dad350763d7b0a68c495efb29f4171866cb84/system.scm#L28) the module.

Also, my bad, I didn’t notice the package inheritance. So `(name "chromebook-alsa-lib")` can actually be removed. 🙃

And that’s why `specification->package` didn’t work last time. You had:

```Scheme
(specification->package "chromebook-alsa-lib")

```

but the name of the inherited package was :

```Scheme
(name "alsa-lib")

```

So you need to write either:

```Scheme
(packages (cons* chromebook-alsa-lib
                  %base-packages))

```

or:

```Scheme
(packages (cons* (specifiastion->package "alsa-lib")
                 %base-packages))

```

The first option is better in my opinion.

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [April 30, 2024, 11:32pm UTC](https://forum.systemcrafters.net/t/help-wanted-guix-audio-on-chromebooks/623/16 "2024-04-30T23:32:35Z")

</div>

OK, [removed the line](https://codeberg.org/csh/chromebook-guix/commit/c5f91c0471442f085d0a33c0f0c58a51e62ffeec).

Now that it builds, I wonder what is needed to get audio working.
