unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Regarding implementing sof-firmware in GUIX.
@ 2021-12-10 20:13 Ry Pemberton via
  2021-12-10 22:38 ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 6+ messages in thread
From: Ry Pemberton via @ 2021-12-10 20:13 UTC (permalink / raw)
  To: help-guix@gnu.org

Hello,
I have an X1 Carbon (2021) that requires sof-firmware. It is libre software, and I believe is included in the linux-libre kernel since 5.2. Is there a way to get this firmware working on this laptop with GNU GUIX?

https://www.sofproject.org/
https://www.phoronix.com/scan.php?page=news_item&px=Intel-Sound-Open-Firmware-5.2

Otherwise I fear I'm unable to use this distro as this is the only computer I have (I have purchased a libre-firmware wifi usb dongle to offset iwlwifi firmware).

Thank you

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regarding implementing sof-firmware in GUIX.
  2021-12-10 20:13 Regarding implementing sof-firmware in GUIX Ry Pemberton via
@ 2021-12-10 22:38 ` Tobias Geerinckx-Rice
  2021-12-10 23:58   ` Ry Pemberton via
  2021-12-11  8:40   ` Mathieu Othacehe
  0 siblings, 2 replies; 6+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-12-10 22:38 UTC (permalink / raw)
  To: Ry Pemberton; +Cc: help-guix


[-- Attachment #1.1: Type: text/plain, Size: 1030 bytes --]

Ry,

[PSA: It's just ‘[GNU] Guix’, never ‘GUIX’ :-)  I'm not sure why 
the ‘GUIX’ meme appears to be picking up steam again as of late…]

Ry Pemberton via 写道:
> I have an X1 Carbon (2021) that requires sof-firmware. It is 
> libre
> software, and I believe is included in the linux-libre kernel 
> since
> 5.2. Is there a way to get this firmware working on this laptop 
> with
> GNU GUIX?

I tried to start a basic SOF package (attached), but quickly ran 
into ‘The GNU C library is currently unavailable for this 
platform.’  Without a cross-libc the build fails, looking for 
<stdint.h>, which AFAICT is provided (only) by libc.

I've never cross-compiled firmware before so I don't know any next 
steps.

Of course, this being ostensibly libre software, we could package 
prebuilt binaries[0] as I'm sure 99% of users actually use.  It's 
not a good option, and hardly Guixy, but not unprecedented.

Kind regards,

T G-R

[0]: https://github.com/thesofproject/sof-bin/


[-- Attachment #1.2: 0001-WIP-gnu-Add-sof.patch --]
[-- Type: text/x-patch, Size: 3713 bytes --]

From c85f4dbdaaf2081b078f02a32ede52de7162e3bf Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Fri, 10 Dec 2021 23:40:02 +0100
Subject: [PATCH] [WIP] gnu: Add sof.

* gnu/packages/firmware.scm (sof): New public variable.
---
 gnu/packages/firmware.scm | 57 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 56 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index aefc0a8b69..2f264b534e 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -29,6 +29,7 @@ (define-module (gnu packages firmware)
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
@@ -41,7 +42,8 @@ (define-module (gnu packages firmware)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages perl)
-  #:use-module (gnu packages python))
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls))
 
 (define-public ath9k-htc-firmware
   (package
@@ -552,3 +554,56 @@ (define-public arm-trusted-firmware-rk3399
        `(("cross32-gcc" ,(cross-gcc "arm-none-eabi"))
          ("cross32-binutils", (cross-binutils "arm-none-eabi"))
          ,@(package-native-inputs base))))))
+
+(define-public sof
+  (package
+    (name "sof")
+    (version "1.9.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/thesofproject/sof")
+             (commit (string-append "v" version))
+             ;; XXX Includes an ‘rimage’ submodule, whatever that is.
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0amia754j2qawpxk19yi18d3vhlj3yraqc41il4ndf5v04p5qhc4"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:parallel-build? #f
+       #:configure-flags
+       (list "-DINIT_CONFIG=skylake_defconfig" ; XXX?
+             "-DTOOLCHAIN=extensa-elf")))
+    (native-inputs
+     (let* ((target "xtensa-elf")
+            (xbinutils (cross-binutils target binutils-2.33))
+            (xgcc (cross-gcc target #:xbinutils xbinutils))
+            (xheaders (cross-kernel-headers target linux-libre-headers
+                                            xgcc xbinutils))
+            (xlibc (cross-libc target glibc xgcc xbinutils xheaders)))
+       `(("binutils-cross-xtensa-elf" ,xbinutils)
+         ("gcc-cross-sans-libc-xtensa-elf" ,xgcc)
+         ("glibc-cross-xtensa-elf" ,xlibc)
+         ("openssl" ,openssl)
+         ("python-wrapper" ,python-wrapper))))
+    (home-page "https://thesofproject.github.io")
+    (synopsis "Sound Open Firmware")
+    (description
+     "@acronym{SOF, Sound Open Firmware} is an audio @acronym{DSP, digital
+signal processing} firmware infrastructure and @acronym{SDK, software
+development kit}.  It provides a framework where developers interested in audio
+or signal processing on modern DSPs can create, test, and tune:
+
+[XXX Rewrite this for humanoids.]
+
+@enumerate
+@item audio processing pipelines and topologies
+@item audio processing components
+@item DSP infrastructure and drivers
+@item host operating system infrastructure and drivers.
+@end enumerate\n")
+    (license (list license:bsd-3
+                   license:expat
+                   license:isc))))

base-commit: 3d54f2415672aed64661bed84a043a7f0cee13dd
prerequisite-patch-id: d67a63c338648539cfa7a08c90007d2e7abbb507
-- 
2.34.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Regarding implementing sof-firmware in GUIX.
  2021-12-10 22:38 ` Tobias Geerinckx-Rice
@ 2021-12-10 23:58   ` Ry Pemberton via
  2021-12-11  8:40   ` Mathieu Othacehe
  1 sibling, 0 replies; 6+ messages in thread
From: Ry Pemberton via @ 2021-12-10 23:58 UTC (permalink / raw)
  To: me; +Cc: help-guix

Is there anything I could do to help? I have little to no experience with these kinds of things but maybe this is a fine jumping off point.

And thank you for the correction, I wasn't aware it was case sensitive (or a meme for that matter).

Thanks!

-------- Original Message --------
On Dec 10, 2021, 2:38 PM, Tobias Geerinckx-Rice wrote:

> Ry, [PSA: It's just ‘[GNU] Guix’, never ‘GUIX’ :-) I'm not sure why the ‘GUIX’ meme appears to be picking up steam again as of late…] Ry Pemberton via 写道: > I have an X1 Carbon (2021) that requires sof-firmware. It is > libre > software, and I believe is included in the linux-libre kernel > since > 5.2. Is there a way to get this firmware working on this laptop > with > GNU GUIX? I tried to start a basic SOF package (attached), but quickly ran into ‘The GNU C library is currently unavailable for this platform.’ Without a cross-libc the build fails, looking for , which AFAICT is provided (only) by libc. I've never cross-compiled firmware before so I don't know any next steps. Of course, this being ostensibly libre software, we could package prebuilt binaries[0] as I'm sure 99% of users actually use. It's not a good option, and hardly Guixy, but not unprecedented. Kind regards, T G-R [0]: https://github.com/thesofproject/sof-bin/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regarding implementing sof-firmware in GUIX.
  2021-12-10 22:38 ` Tobias Geerinckx-Rice
  2021-12-10 23:58   ` Ry Pemberton via
@ 2021-12-11  8:40   ` Mathieu Othacehe
  2021-12-11 17:37     ` Tobias Geerinckx-Rice
  1 sibling, 1 reply; 6+ messages in thread
From: Mathieu Othacehe @ 2021-12-11  8:40 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix, Ry Pemberton


Hello Tobias,

> * gnu/packages/firmware.scm (sof): New public variable.

Thanks for the package definition. Last time I checked, some devices
required signed firmware:

--8<---------------cut here---------------start------------->8---
The firmware file, /lib/firmware/intel/sof/sof-tgl.ri, contains all DSP
code and tables. On PCI devices, the firmware can only be signed by an
Intel production key which prevents community users from installing
their own firmware. Notable exceptions include Google Chromebooks and
Up2/Up-Extreme boards, where the community key is used.
--8<---------------cut here---------------end--------------->8---

I'm not sure what's the point of letting users build their firmware if
it cannot be loaded. Looks like multiple projects are in fact packaging
the signed sof firmware, which is non-free[2].

Thanks,

Mathieu

[1]: https://thesofproject.github.io/latest/getting_started/intel_debug/introduction.html
[2]: https://packages.debian.org/search?keywords=firmware-sof-signed


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regarding implementing sof-firmware in GUIX.
  2021-12-11  8:40   ` Mathieu Othacehe
@ 2021-12-11 17:37     ` Tobias Geerinckx-Rice
  2021-12-12  4:20       ` Tobias Geerinckx-Rice
  0 siblings, 1 reply; 6+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-12-11 17:37 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ry Pemberton, help-guix

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

Mathieu Othacehe 写道:
> Thanks for the package definition. Last time I checked, some 
> devices
> required signed firmware:

D'oh.  See what a sheltered life I lead!  I don't actually have 
any of this hardware.

> I'm not sure what's the point of letting users build their 
> firmware if
> it cannot be loaded. Looks like multiple projects are in fact 
> packaging
> the signed sof firmware, which is non-free[2].

I'll keep this as a great example of OpEn SoUrCe, thanks.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regarding implementing sof-firmware in GUIX.
  2021-12-11 17:37     ` Tobias Geerinckx-Rice
@ 2021-12-12  4:20       ` Tobias Geerinckx-Rice
  0 siblings, 0 replies; 6+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-12-12  4:20 UTC (permalink / raw)
  Cc: Mathieu Othacehe, Ry Pemberton, help-guix

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

Mathieu Othacehe 写道:
>> I'm not sure what's the point of letting users build their 
>> firmware
>> if it cannot be loaded.

By bizarre coincidence, I was looking at our kernel configuration 
for unrelated reasons and happened to notice:

  CONFIG_SND_SOC_SOF=y

For the record, here's what I asked on #gnu-linux-libre:

  <nckx> I ask because linux-libre provides SND_SOC_SOF_TOPLEVEL 
  et al.
  <nckx> I'd disable it in Guix but seems better to pull it out at 
  the root if it is problematic.
  <lxo> nckx, I left it in because there were reports of hardware 
  that used the unsigned images
  <lxo> I found it suspicious, but borderline acceptable
  <nckx> Ah, OK, so this is a known ‘hm’ already.
  <nckx> I guess we'll leave it enabled for the same reason as 
  long as it's part of linux-libre.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-12  5:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 20:13 Regarding implementing sof-firmware in GUIX Ry Pemberton via
2021-12-10 22:38 ` Tobias Geerinckx-Rice
2021-12-10 23:58   ` Ry Pemberton via
2021-12-11  8:40   ` Mathieu Othacehe
2021-12-11 17:37     ` Tobias Geerinckx-Rice
2021-12-12  4:20       ` Tobias Geerinckx-Rice

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).