From unknown Wed Jun 18 00:26:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#76289 <76289@debbugs.gnu.org> To: bug#76289 <76289@debbugs.gnu.org> Subject: Status: [PATCH 0/2] Add speakersafetyd system service. Reply-To: bug#76289 <76289@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:26:10 +0000 retitle 76289 [PATCH 0/2] Add speakersafetyd system service. reassign 76289 guix-patches submitter 76289 Roman Scherer severity 76289 normal tag 76289 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 14 08:55:51 2025 Received: (at submit) by debbugs.gnu.org; 14 Feb 2025 13:55:51 +0000 Received: from localhost ([127.0.0.1]:47662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tiwAZ-0002nE-90 for submit@debbugs.gnu.org; Fri, 14 Feb 2025 08:55:51 -0500 Received: from lists.gnu.org ([2001:470:142::17]:47670) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tiwAV-0002mk-Tl for submit@debbugs.gnu.org; Fri, 14 Feb 2025 08:55:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tiwAO-0003kk-36 for guix-patches@gnu.org; Fri, 14 Feb 2025 08:55:40 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiwAJ-0001F5-TI for guix-patches@gnu.org; Fri, 14 Feb 2025 08:55:38 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-ab2b29dfc65so311433566b.1 for ; Fri, 14 Feb 2025 05:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739541332; x=1740146132; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8peuVZl3ZLILb8+dS3MUErpd2yeI1ctN8bt6++GLYjQ=; b=BXjNkxuqwr5KC6GrthPcAEGih3dQGy4VRwJBSmFXu8ax2X9dinYh7KCfX4409N51sH ke/BHJR7d9CLkAUmCt5lfn2XlC3aLw5wKI4OhOuCmmHzAIjfJcVzG4QFG5ZQpQ2LKa5q Vv0HZA+I7MuWJ66KotKliZxZcn07Rw/cqcQ5ufixyo6X1CrKWvkTIYnm0s8rtC+gvz1q JHryIsFIkng9NG4vnBJ+dB9S678p62kbz7RyEXrUUbV/B2T9JZLEltBrmIhfA06xFMCC a7L4jo2jIctiSj8Qls30MuZTIZTRSJR4T8OjVJQo6gy9xyH/k14v6KP6EHr6YAhBRYrL 3u4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739541332; x=1740146132; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8peuVZl3ZLILb8+dS3MUErpd2yeI1ctN8bt6++GLYjQ=; b=TYIQyEd8SwIh6+37hVPZP3kP9N0VnSeCcYWisArZbbMoZ/lN+EmOiOsCDYxzgkl0Yn a1Ogaqm662CxnStL5kdMcbzm4kyC5fX44lep7f1+B7me5fTjTjYroqmvOyscpS/zSmiE 5nMUIul9HNQg5K3LqXp1sRAztv0gxuY39MA9QA++1e2ef65+M+MaKDRlQxrjufTBMmJR m9r3H8Wr9osUa17y6qQXZmUW3ImvXCrGDt1/zTbL1j3bE6GYn4/G+oB4NYRokB+XAPyA AeQPpeUArNEUBoB34qOw8QjmQHPBS/5tvkKke+YJHJE1mblh9m9pkexOpPOiVJDC+s5R IHhQ== X-Gm-Message-State: AOJu0YxvCmtnNdunRSMfZd+S00HtqH2Iq430jlY61R9jyju0C1Tyg9pN smuS+IRWklHZJDgRcGHLrRJX50kb6csgAhfQYSAPQEGi4B+2xlwmW0TRpZNWaqJBGIisMDYnQUS Sk6k= X-Gm-Gg: ASbGncvBnPSKodb/eLSM3gysjqtJ9XKKHjvl/NE+eRsoRbxkgFj37ONe+I9WfrF64rT T4Mgbvv2jSvsKVi2i2xC1bCS4E5m7XQ2842rjQtS9qy6OsGjyqCZ8QhK9c5VfsRIhR/jrIaCmZr eGCjO/44suiwKvTs14GwfBNbOzUarfLqSyHEL4ufo3w1AQhhtSylrkz0cfTRqXgPC9fL6kea+t6 1jGThHhU2hgW34Lf7c7pj3v2mXGad/kyn71P1EF1UBpjDblq8+eH1fSk2I4eJG0GSij0Iuohee2 amTTgN3oALIG5erO83ocT0xHe3rl9Up8 X-Google-Smtp-Source: AGHT+IHiPke5VEmsYKD8b9VjDBqjFG8vyPB1oTnGJwbHqEp6e3gUbhMhJosVtNhlgqU710j7dMWGNQ== X-Received: by 2002:a17:907:d1a:b0:ab7:83c2:bdbf with SMTP id a640c23a62f3a-ab7f347aa61mr1263528866b.41.1739541332331; Fri, 14 Feb 2025 05:55:32 -0800 (PST) Received: from localhost.localdomain ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aba532591dcsm350552666b.58.2025.02.14.05.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2025 05:55:31 -0800 (PST) From: Roman Scherer To: guix-patches@gnu.org Subject: [PATCH 0/2] Add speakersafetyd system service. Date: Fri, 14 Feb 2025 14:55:26 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=2a00:1450:4864:20::634; envelope-from=roman@burningswell.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit Cc: Roman Scherer , efraim@flashner.co.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Guix, this patch series adds a system service for speakersafetyd [1], a userspace daemon written in Rust that implements an analogue of the Texas Instruments Smart Amp speaker protection model. It is developed and used by the Asahi Linux project to protect the speakers on Apple Silicon devices. The patch series contains 2 patches: - The first one adjusts the SHAREDIR in the speakersafetyd package I submitted earlier this year. The shared dir was wrong forcing users to specify it with the --config-path option. Now just running speakersafetyd without any options does the right thing, instead of complaining it could not find the config. - The second patch is the system service and its documentation. Could you please review the patch series? Thanks, Roman. [1] https://github.com/AsahiLinux/speakersafetyd/ Roman Scherer (2): gnu: speakersafetyd: Use correct shared directory. services: Add speakersafetyd service. doc/guix.texi | 41 +++++++++++++++++++++++++ gnu/packages/rust-apps.scm | 2 +- gnu/services/sound.scm | 61 +++++++++++++++++++++++++++++++++++++- 3 files changed, 102 insertions(+), 2 deletions(-) base-commit: 4b5f0408e66392ab745dc0f7830732217d88f17d -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 14 08:58:23 2025 Received: (at 76289) by debbugs.gnu.org; 14 Feb 2025 13:58:23 +0000 Received: from localhost ([127.0.0.1]:47669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tiwD1-0002sG-GJ for submit@debbugs.gnu.org; Fri, 14 Feb 2025 08:58:23 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:57580) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tiwCy-0002rv-Ve for 76289@debbugs.gnu.org; Fri, 14 Feb 2025 08:58:21 -0500 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5de594e2555so3305050a12.2 for <76289@debbugs.gnu.org>; Fri, 14 Feb 2025 05:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739541494; x=1740146294; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=swmFsDZOc/KCj5GVn3sMShB/3/oggRtOnpIXsB4J8x0=; b=hvpEKOeQyDsjlVLJmzM6Li7FsobEaBPVH96X4C/e6dydC4YpYgcP3mbWHtr5adRTjg Fwp4RmWDfR+KEVZYg+hQ+eNVWG/YDy/wPuHPVPPsOu+EGCqhxuCz7dkwzODsif9QE18R 4oLpEK5FDcfMmeSeISvTT2oAeedYMgb/p9I855SzM/ysvdxKZ5R+etjl8mXhe1Msd8w7 GG0/SH6PiOZYSx6uA3KaO4J/ukMsXupyT3dmPuZtf7GMR+MIhMbADEzylOZ147LWNNz9 5qcBMU8EScu6+qrdzam4Eu71xZUZIa/skCpfUvutFuSpBO/cty9//IxdnpYs5j4rGi/g qLCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739541494; x=1740146294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=swmFsDZOc/KCj5GVn3sMShB/3/oggRtOnpIXsB4J8x0=; b=tieyzHQ3dHy/H0O6EaubBK9mh2EyX4VbKJbmNLhS0ptaA2ZB8oXHUIP9rnGZLrwQql wZeFcwsCTnEEU/5kVpEBdX+CV5RfYDAXyBlg6W5dASHLhRyIu8LWVBdLbsFX14EExgQ+ bgNYjt36/ytbHQr7ARRwCsBdvmIDUSeD2L9A1kWYgoZCyvIYtn233hailNS1hTTWWyhR on2IArmbBoL8LjP5hY7p9NzogzXEdF58Af5zWgTRojsHouAeI2A5qSuRnax9CAmTOUvV qpe+w1Ok5nnC2AmQq3c6H8WWTyvKCCE61fX4Xd25RHROxv0ZiaZYrD6WOzq4hrKEz9ae PT9A== X-Gm-Message-State: AOJu0YwRXNkaHue4+O2Pi1xNhJdjfaIp69A52a0gHD1PI3WfR6sSoOXz f1/c/wfU/G3katrBseXGzIz72lRYgszA9U5c0A3WpRMqbpepvdfMYZyVPI3Q+MVzQzwThYbqlSJ 0EB4= X-Gm-Gg: ASbGncs+IRHVRUA5RrvpJCtiyMaHdXYvueVb5wbDAovg8SCXMl0oDVW9k2XutTYYYxE juKtp7arBj2kt2dzYR0q4ZLsEg6kDFLEF4PomqsPzO9oQhPxdBTQiNM4qE2U86bnTiNOb882FyP 8gWa/4Hz/huVUP2ob3Q7fMkXOIlUL5f/4Sjv16WjjcLnGr0G4HYzXzTvx5bGzmiJhvwipvRvsX5 hWOsrO2hDRm2UPwEErZyJ7bMAYrIvaNL2IVB3SGIkpLFG/6Tul4Wx5sAFdit29Sntyxi4gBLFOI pvSm+rWl+zy4qSxQmYR1GxGxy+2+zQMy X-Google-Smtp-Source: AGHT+IGBoxJJCVqewXQK9VLs5zWm2+AvXn01Al1ohi8hI41kYIk5CgQ2zjqBl5xFuQTi8g9o6cd4jA== X-Received: by 2002:a05:6402:4606:b0:5de:cbed:c955 with SMTP id 4fb4d7f45d1cf-5decbedcaf2mr6325786a12.17.1739541494133; Fri, 14 Feb 2025 05:58:14 -0800 (PST) Received: from localhost.localdomain ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dece270967sm2950587a12.55.2025.02.14.05.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2025 05:58:13 -0800 (PST) From: Roman Scherer To: 76289@debbugs.gnu.org Subject: [PATCH 1/2] gnu: speakersafetyd: Use correct shared directory. Date: Fri, 14 Feb 2025 14:58:09 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Divya Ranjan Pattanaik , Efraim Flashner Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Roman Scherer , efraim@flashner.co.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/rust-apps.scm (speakersafetyd): Adjust shared directory. Change-Id: If52576364f54394a2930d2d8750446acba389f6c --- gnu/packages/rust-apps.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index f8da401bf7..90ec1ece2e 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -3203,7 +3203,7 @@ (define-public speakersafetyd (setenv "UNITDIR" (string-append #$output "/lib/systemd/system")) (setenv "UDEVDIR" (string-append #$output "/lib/udev/rules.d")) (setenv "TMPFILESDIR" (string-append #$output "/usr/lib/tmpfiles.d")) - (setenv "SHAREDIR" (string-append #$output "/usr/share")) + (setenv "SHAREDIR" (string-append #$output "/share")) (setenv "VARDIR" (string-append #$output "/var")) (invoke "make" "install-data")))))) (inputs (list alsa-lib)) -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 14 08:58:28 2025 Received: (at 76289) by debbugs.gnu.org; 14 Feb 2025 13:58:28 +0000 Received: from localhost ([127.0.0.1]:47672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tiwD5-0002sY-Pm for submit@debbugs.gnu.org; Fri, 14 Feb 2025 08:58:28 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:48535) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tiwD1-0002s5-HS for 76289@debbugs.gnu.org; Fri, 14 Feb 2025 08:58:24 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5de6e26d4e4so3938588a12.1 for <76289@debbugs.gnu.org>; Fri, 14 Feb 2025 05:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739541497; x=1740146297; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=05yI693V+sfz1B8ed6ythrdeuZAj0zcKv3dkmkLfHMI=; b=z+b84criGt/qeMqx4+MseIk3G8M7QznojvJeCVgm2VdeKAy5y42nfJHmcbvNrPvRJh fka42hrP9vY+b299BMhDAidkzeQoRE0qkvXWFiKHnQbHY28Oa7mZI9T589EGoPqEz044 FTRM7/yAHR/3q5UGqWNcCzDaSUX2L0VEJPHQP83LyLQaCulT2aZDy0MwAMUlijFeeXvu ITcNhrHBjt5qoksqYyr+ZV51xz9AWLQaE33lz6cgu1B0yAWAsMJ7Kg1/ImGlwbqa6eIc D+YWL8Edy4ZBgENzHhMqJHZHGSV1twJZPuA5HTCqKgprEDmtIW7SAnZlr+M2KaCCBLgy 1Gwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739541497; x=1740146297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=05yI693V+sfz1B8ed6ythrdeuZAj0zcKv3dkmkLfHMI=; b=gcsLsAadmIyEREJZQnfVsyLpBTK6GOwb7W/kKD1wDSLWJZsQwZsibT0uIm+tR++q4L yxtXcHYGJ0N5TR7alB6VkHvL7I0qJjtLTi++7savovjiZYEQ7QPIQGurGRARz5HoTuLv isjz9F9T68ASG4ruZIpUAUb5QjJ/Eegc/SXcw6qYI/yORG8CSGIu0NtUx+aj/BbkyUM4 rsLfcbB0LRoSWEQFMP1iAfAT64+PeKWMK6fOdyoxLtW+4lGG685EBkomzBdQNVj3pfk8 9JLfkMesmcVSDKJ5GltQrzCk3xxI7trdKoyOOzUfkOoHt8yegJiquClhSraDtdyMxjXi aRHA== X-Gm-Message-State: AOJu0YxqIVhZeL49yvF99SwtioUVdNCL5IUXd9V357d4AxKEJvNdzPKL PkkVvB9iXwYFD4MwvmZ6bWpHwaZo6cIVHiGduDZNXyPw2VEmNJ2UGq/l1VbYiE4UmheFyUbxtyg GIKY= X-Gm-Gg: ASbGnctf2n18yQQMjv97iJJsUQWC02Fg9LE0KLojeQlLdmhzMR8mXXdJBzIMTgH9sNJ jU/6CtIzvRnQaR2Pci4t7qeiLBe+ETR+3ZR5vYMMPWEXEcrvSLgWcLcT8SvAtfi6y/c75WdH+Ru Q2xSpqsKz8QGTM9bCbNiUd6bQt46T014l+p/7qVIaqRGKiiwiqcDZIyViPPF7sT6/H4yM/Gfzf/ 64VSS9bPhV8GIXxRLpsX6uR/Ybzq/sC2SBFLs54LbdenhyX7A6J8cHKROBjtIODPwRyVoUu0+k0 9HRKAP1XrJG/Ddwz1SzCex4ePw5tUJEt X-Google-Smtp-Source: AGHT+IHFAweKRoxSarbyxmutAIMpXITarR195BRsvcUomG3HGvxhQaV/eEiE8GlVM6eBYTim25rm7A== X-Received: by 2002:a05:6402:a001:b0:5de:cc6f:43d0 with SMTP id 4fb4d7f45d1cf-5decc6f46aamr4522298a12.31.1739541496958; Fri, 14 Feb 2025 05:58:16 -0800 (PST) Received: from localhost.localdomain ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dece270967sm2950587a12.55.2025.02.14.05.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2025 05:58:16 -0800 (PST) From: Roman Scherer To: 76289@debbugs.gnu.org Subject: [PATCH 2/2] services: Add speakersafetyd service. Date: Fri, 14 Feb 2025 14:58:10 +0100 Message-ID: <6bdfd356508e8f643f2c63cb796548f36e0abb87.1739540583.git.roman@burningswell.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Roman Scherer , efraim@flashner.co.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/sound.scm (speakersafetyd-service-type) New variable. * doc/guix.texi: Document the speakersafetyd service. Change-Id: Ib8fa19b056a2036019ae7c199d81e1139664e951 --- doc/guix.texi | 41 ++++++++++++++++++++++++++++ gnu/services/sound.scm | 61 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bd66adf326..3b82df5196 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -26575,6 +26575,47 @@ Sound Services @end defvar +@subsubheading Speaker Safety Daemon System Service + +@uref{https://github.com/AsahiLinux/speakersafetyd, Speaker Safety +Daemon} is a userspace daemon that implements an analogue of the Texas +Instruments Smart Amp speaker protection model. It can be used to +protect the speakers on Apple Silicon devices. + +@defvar speakersafetyd-service-type +This is the type for the @code{speakersafetyd} system service, whose +value is a @command{speakersafetyd-configuration} record. + +@lisp +(service speakersafetyd-service-type) +@end lisp + +See below for details about @code{speakersafetyd-configuration}. +@end defvar + +@deftp {Data Type} speakersafetyd-configuration +Data type representing the configuration for @code{speakersafetyd-service}. + +@table @asis +@item @code{blackbox-path} (default: @code{"/var/lib/speakersafetyd/blackbox"}) +The path to a directory to which "blackbox" files are written when the +speakers are getting too hot. The blackbox files contain audio and +debug information which the developers of @code{speakersafetyd} might +ask for when reporting bugs. + +@item @code{config-path} (default: @code{(file-append speakersafetyd "/share/speakersafetyd")}) +Path to the base directory as a G-expression (@pxref{G-Expressions}) +that contains the configuration files of the speaker models. + +@item @code{max-reduction} (default: @code{7}) +Maximum gain reduction before panicing, useful for debugging. + +@item @code{package} (default: @var{speakersafetyd}) +The Speaker Safety Daemon package to use. + +@end table +@end deftp + @node File Search Services @subsection File Search Services diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 8ca7acd737..fb8a8d3d17 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -35,6 +35,7 @@ (define-module (gnu services sound) #:use-module (gnu packages audio) #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages rust-apps) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (alsa-configuration @@ -56,7 +57,15 @@ (define-module (gnu services sound) ladspa-configuration ladspa-configuration? ladspa-configuration-plugins - ladspa-service-type)) + ladspa-service-type + + speakersafetyd-configuration + speakersafetyd-configuration-blackbox-path + speakersafetyd-configuration-config-path + speakersafetyd-configuration-max-reduction + speakersafetyd-configuration-package + speakersafetyd-configuration? + speakersafetyd-service-type)) ;;; Commentary: ;;; @@ -263,4 +272,54 @@ (define ladspa-service-type (default-value (ladspa-configuration)) (description "Configure LADSPA plugins."))) + +;;; +;;; Speaker Safety Daemon +;;; + +(define-record-type* + speakersafetyd-configuration + make-speakersafetyd-configuration + speakersafetyd-configuration? + (blackbox-path speakersafetyd-configuration-blackbox-path + (default "/var/lib/speakersafetyd/blackbox")) + (config-path speakersafetyd-configuration-config-path + (default (file-append speakersafetyd "/share/speakersafetyd"))) + (max-reduction speakersafetyd-configuration-max-reduction + (default 7)) + (package speakersafetyd-configuration-package + (default speakersafetyd))) + +(define (speakersafetyd-shepherd-service config) + (let ((blackbox-path (speakersafetyd-configuration-blackbox-path config)) + (config-path (speakersafetyd-configuration-config-path config)) + (max-reduction (speakersafetyd-configuration-max-reduction config)) + (package (speakersafetyd-configuration-package config))) + (shepherd-service + (documentation "Speaker saftey daemon") + (provision '(speakersafetyd)) + (requirement '(udev)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/bin/speakersafetyd") + "--config-path" #$config-path + "--blackbox-path" #$blackbox-path + "--max-reduction" (number->string #$max-reduction)))) + (stop #~(make-kill-destructor))))) + +(define speakersafetyd-service-type + (service-type + (name 'speakersafetyd) + (description "Speaker Saftey Daemon") + (extensions + (list (service-extension + profile-service-type + (compose list speakersafetyd-configuration-package)) + (service-extension + shepherd-root-service-type + (compose list speakersafetyd-shepherd-service)) + (service-extension + udev-service-type + (compose list speakersafetyd-configuration-package)))) + (default-value (speakersafetyd-configuration)))) + ;;; sound.scm ends here -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 14 20:18:33 2025 Received: (at 76289) by debbugs.gnu.org; 15 Feb 2025 01:18:33 +0000 Received: from localhost ([127.0.0.1]:52460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tj6pE-0001FG-9m for submit@debbugs.gnu.org; Fri, 14 Feb 2025 20:18:33 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:55728) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tj6pB-0001Ez-VT for 76289@debbugs.gnu.org; Fri, 14 Feb 2025 20:18:30 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-220bff984a0so46712185ad.3 for <76289@debbugs.gnu.org>; Fri, 14 Feb 2025 17:18:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739582304; x=1740187104; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=i60u06VUuUT/1Dp8gubx/CNdJokGceQsJwW6kCuojno=; b=YsUf824/ZFUPceYcmzibJD2jlmM7tjKsfH6TNQxj7c6qZlAprMGG2Hx2VI6rS3OH9y KZaroxjbTaCA39CXdoFVD2+MZkV7SqQOXWCHjsJRrKMLf71n1nHkRDggIFcC7Fx7FJTg gytZVVCx4AZXSvWEur2z5dNrDAIb/TkgBdGuZJxhUUtJIftIjsEiUPfWXgsHyMevMVxM bpQw+m+Ze62EebWbh/FA114we3Stw9V2eIQkUvCZvqjjQjEjQ9QPpTNa1GzHzv1gdpn/ qOSwn1We0shsf/sOoKZjv/fJe9IlkWtrL6DOyYcFIHr+LyunPS4jkJyOweIgPpnwqAB9 cSlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739582304; x=1740187104; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=i60u06VUuUT/1Dp8gubx/CNdJokGceQsJwW6kCuojno=; b=e9cVF3u6pGPTGs29wHQgJMGnLT7o6rPMKvkYC+lqysbNdF6Mu35kplm113GWBed4Mn rzKWfesMYPSghvOkhLc+FwitORidicoat3rDIYpEpxjleBR8+nqaWrCaGjISl8kdr3u5 3JPWR6tm6FoO77SZVuOrVcANm4/ceGcGweUVPkmqIC/LSKMJONirHRNgE8x6zGDwsGc9 iLc7tsve8qcxK5sE8rfQ9AgGzCESEjb9Gk/RFINPb7cZ1Kg1oGmMvC5YgAsG/1EItcaj zJYpE1onuqI1xk70VCxJ6nT9nPrM3cbYKjnKT2+IO2UHl9M34SlZ4aL0jx+yZM0ZBu/D 2elA== X-Gm-Message-State: AOJu0YxrNQJUP/+Tdrkow53k5l6e9PwQWYELrmhfzz0VW8gppty1tNWH w+eJwqYFVfKrWx+vzP3nKpW/LCDYsLwpJlTpfBD8EplHix8H0w88 X-Gm-Gg: ASbGnctg00FaEESsjX5Qxx6Ac4mXPpbaM32BWNPPXoVLlRCRQgk6LOGkEXQFAVenSlD EoVkCoU3ji0CjyP4/TRC9pm8JT8SlZat1iD+ORIs87ji9EGesvD8eFHFKTePt0iRJboAJU0C68I mwlR5TZweU73I6bG6ruMB2Etp7C3E0/FOIUr6lpUFs6spkW9T148bIWvJsSuU+tG+507Ec5EXnx LV++K1ZN5b5RNxgT+VVNjPTrovBFZkZMpLIyPqk3Zww6n8NCyBwbrwepuNNV5cSelwHTwL8MRRc Rnh+4L2he4z6 X-Google-Smtp-Source: AGHT+IGM+/yZrgFDYzkFdgeuBHwQtLkpkNZCrA2Iv52zAZbWVYB8x4YVzwFAtegga0t96uEkxILYVA== X-Received: by 2002:a17:903:2301:b0:21e:ff3a:7593 with SMTP id d9443c01a7336-22103efec5amr22565605ad.6.1739582303599; Fri, 14 Feb 2025 17:18:23 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-220d545d021sm35024115ad.157.2025.02.14.17.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2025 17:18:23 -0800 (PST) From: Maxim Cournoyer To: Roman Scherer Subject: Re: [bug#76289] [PATCH 2/2] services: Add speakersafetyd service. In-Reply-To: <6bdfd356508e8f643f2c63cb796548f36e0abb87.1739540583.git.roman@burningswell.com> (Roman Scherer's message of "Fri, 14 Feb 2025 14:58:10 +0100") References: <6bdfd356508e8f643f2c63cb796548f36e0abb87.1739540583.git.roman@burningswell.com> Date: Sat, 15 Feb 2025 10:18:10 +0900 Message-ID: <87r0409fal.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s?= , 76289@debbugs.gnu.org, efraim@flashner.co.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Roman, Roman Scherer writes: > * gnu/services/sound.scm (speakersafetyd-service-type) New variable. > * doc/guix.texi: Document the speakersafetyd service. Interesting! > Change-Id: Ib8fa19b056a2036019ae7c199d81e1139664e951 > --- > doc/guix.texi | 41 ++++++++++++++++++++++++++++ > gnu/services/sound.scm | 61 +++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 101 insertions(+), 1 deletion(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index bd66adf326..3b82df5196 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -26575,6 +26575,47 @@ Sound Services > > @end defvar > > +@subsubheading Speaker Safety Daemon System Service > + > +@uref{https://github.com/AsahiLinux/speakersafetyd, Speaker Safety > +Daemon} is a userspace daemon that implements an analogue of the Texas > +Instruments Smart Amp speaker protection model. It can be used to > +protect the speakers on Apple Silicon devices. > + > +@defvar speakersafetyd-service-type > +This is the type for the @code{speakersafetyd} system service, whose > +value is a @command{speakersafetyd-configuration} record. > + > +@lisp > +(service speakersafetyd-service-type) > +@end lisp > + > +See below for details about @code{speakersafetyd-configuration}. > +@end defvar > + > +@deftp {Data Type} speakersafetyd-configuration > +Data type representing the configuration for @code{speakersafetyd-service}. > + > +@table @asis > +@item @code{blackbox-path} (default: @code{"/var/lib/speakersafetyd/blackbox"}) > +The path to a directory to which "blackbox" files are written when the > +speakers are getting too hot. The blackbox files contain audio and > +debug information which the developers of @code{speakersafetyd} might > +ask for when reporting bugs. > + > +@item @code{config-path} (default: @code{(file-append speakersafetyd "/share/speakersafetyd")}) > +Path to the base directory as a G-expression (@pxref{G-Expressions}) > +that contains the configuration files of the speaker models. > + > +@item @code{max-reduction} (default: @code{7}) > +Maximum gain reduction before panicing, useful for debugging. > + > +@item @code{package} (default: @var{speakersafetyd}) > +The Speaker Safety Daemon package to use. > + > +@end table > +@end deftp > + > @node File Search Services > @subsection File Search Services > > diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm > index 8ca7acd737..fb8a8d3d17 100644 > --- a/gnu/services/sound.scm > +++ b/gnu/services/sound.scm > @@ -35,6 +35,7 @@ (define-module (gnu services sound) > #:use-module (gnu packages audio) > #:use-module (gnu packages linux) > #:use-module (gnu packages pulseaudio) > + #:use-module (gnu packages rust-apps) > #:use-module (ice-9 match) > #:use-module (srfi srfi-1) > #:export (alsa-configuration > @@ -56,7 +57,15 @@ (define-module (gnu services sound) > ladspa-configuration > ladspa-configuration? > ladspa-configuration-plugins > - ladspa-service-type)) > + ladspa-service-type > + > + speakersafetyd-configuration > + speakersafetyd-configuration-blackbox-path > + speakersafetyd-configuration-config-path > + speakersafetyd-configuration-max-reduction > + speakersafetyd-configuration-package > + speakersafetyd-configuration? > + speakersafetyd-service-type)) > > ;;; Commentary: > ;;; > @@ -263,4 +272,54 @@ (define ladspa-service-type > (default-value (ladspa-configuration)) > (description "Configure LADSPA plugins."))) > > + > +;;; > +;;; Speaker Safety Daemon > +;;; > + > +(define-record-type* > + speakersafetyd-configuration > + make-speakersafetyd-configuration > + speakersafetyd-configuration? > + (blackbox-path speakersafetyd-configuration-blackbox-path > + (default "/var/lib/speakersafetyd/blackbox")) Since these values are not serialized, we are free to name them the way we like; so they should follow the GNU and Guix conventions, namely: I'd use blackbox-directory. > + (config-path speakersafetyd-configuration-config-path > + (default (file-append speakersafetyd > "/share/speakersafetyd"))) I'd use configuration-directory. > + (max-reduction speakersafetyd-configuration-max-reduction > + (default 7)) I'd use maximum-gain-reduction > + (package speakersafetyd-configuration-package > + (default speakersafetyd))) I'd use the more conventional speakersafetyd-configuration-speakersafetyd (using the name of the package as the field name). Our related conventions here are roughly: 1. Prefer full name instead of abbreviation, especially in public APIs 2. Path always used to denote a multi-entries search path like 'PATH' and friends. Use 'file name', 'file' or 'directory' instead. It's also more conventional to use the package name for the package object field, so here I'd use 'speakersafetyd-configuration-speakersafetyd'. Could you please also use 'define-configuration/no-serialization' from (gnu services configuration) ? It validates the type of each field and produces useful user error messages in case these are incorrect. > +(define (speakersafetyd-shepherd-service config) > + (let ((blackbox-path (speakersafetyd-configuration-blackbox-path config)) > + (config-path (speakersafetyd-configuration-config-path config)) > + (max-reduction (speakersafetyd-configuration-max-reduction config)) > + (package (speakersafetyd-configuration-package config))) nitpick: I'd unbox each value using match-record; which will make things a bit more concise. > + (shepherd-service > + (documentation "Speaker saftey daemon") s/saftey/safety/ > + (provision '(speakersafetyd)) > + (requirement '(udev)) > + (start #~(make-forkexec-constructor > + (list #$(file-append package "/bin/speakersafetyd") > + "--config-path" #$config-path > + "--blackbox-path" #$blackbox-path > + "--max-reduction" (number->string #$max-reduction)))) > + (stop #~(make-kill-destructor))))) > + > +(define speakersafetyd-service-type > + (service-type > + (name 'speakersafetyd) > + (description "Speaker Saftey Daemon") > s/Saftey/Safety/ The project has a better description, which can be adapted to something like "@command{speakersafetyd} is a user space daemon that implements an analogue of the Texas Instruments Smart Amp speaker protection model." > + (extensions > + (list (service-extension > + profile-service-type > + (compose list speakersafetyd-configuration-package)) > + (service-extension > + shepherd-root-service-type > + (compose list speakersafetyd-shepherd-service)) > + (service-extension > + udev-service-type > + (compose list speakersafetyd-configuration-package)))) > + (default-value (speakersafetyd-configuration)))) Nitpick, but I'd order these from most critical to less critical ordering, such that te root service type is extended first, then the udev-service-type, then the profile. The rest LGTM. Could you please send a v2? -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 04:02:21 2025 Received: (at 76289) by debbugs.gnu.org; 15 Feb 2025 09:02:21 +0000 Received: from localhost ([127.0.0.1]:53313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjE45-0007Bl-Jn for submit@debbugs.gnu.org; Sat, 15 Feb 2025 04:02:21 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:46352) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjE41-0007BO-RY for 76289@debbugs.gnu.org; Sat, 15 Feb 2025 04:02:19 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5dea50ee572so4182862a12.1 for <76289@debbugs.gnu.org>; Sat, 15 Feb 2025 01:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739610131; x=1740214931; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GnaBzmEp3pmuCEuCCVOuVrIP0en8IxXMHZcZMMiD+vo=; b=tKYzow0OOLjzVkXgrMjBR+KkE2pypMWq8iv01oPb9jhNsYX+2Dz65T/sBtzMsQ4xeV uRpbadELUuhXG+N9w8lz3t+MH268tRpvvQoLak5WqVbmN0EE+8GShLg/5iNzl3zhPu8A ACZMf0E6Jpo9arw7Acq/TiyqvxjCr2BoCmpCeT3uL38yWYAO0yZA7wN8opXkI5++57LP moT91Ub6C7Day3Fl53rZp3IsF2Aa2OshYwFuKpgngzfDKlrozSDjf1UAfEI/3D00Sx18 gM0rQGa7vvhGrWtO8ADLHdDF3UieLeyGiYN+n1NA9pNHRi72dn/nMx/AXTSSMJxkqoDD MdOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739610131; x=1740214931; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GnaBzmEp3pmuCEuCCVOuVrIP0en8IxXMHZcZMMiD+vo=; b=KhIBLz3zxNLXOvC1hCPPzu1hOt2YLpQRwnAGhXCftK/MseufUH+/I+7p6cjFKkLHGd UuU+c2OB6LjyCLJt+J+WmV037qYAe78nWfbsxRJa0woBPnl5etPt+UCN1GTEm1zJ0SKH GxKSE8o1C6rSvv1P/aQY7kREHZYh+EcyLAqndwl/9makIewdJer3n9iDriQzGNmE+EP3 fhNSMjOi20ZfwZpmBwx0uw+clWUkx8zX5yqQk0FPQe6+tEfuUvcbTwR3Djs1RrvYFIQW Ibpw16hAsOcp/QKkl+1fhECZms13mk8Ft3HxxY0QQpXw7dvyuImpge9CoTMD7uvBnM3o 0R5A== X-Gm-Message-State: AOJu0YyYEvFlfMIt/DG219b93MOAL69U3k1cktpNxxBsnvOKX0gHr079 wK0YkD6ez6dNXwZRv3kgsBy8ZCunHoSDjQMEKZUAqwwkgcXNRh1gcZ53YxlCzJVBOdgymZRbAHb Ab/4= X-Gm-Gg: ASbGncuaLTWD27D7eR3R3KBMYUNPynWnTc53PCkDBi/9vP00bpYOM0CFeKdIEOfrPIG +B7OrIHn6fceGPmWhPGy25HncA/Z1qCjp/ifHBKm2pDZYMMVnG1zIEyei3d6edO5u8I5RR2KdYX 1hGHkbP1XzV2/7wU91b+xtkoy2DKLG+Qe+Ni4yNFTSpdQPfSPO0Gll80mt1++dgBkwFDbMb6ZTl CpALkIOdRkH3NTYXnCta/OHa9+7jHend/vDV1bpkQ/dZtKFO0mHeSHkt2Ufbqfta3IN8e2YLt7w QVjVWNesxAWo6YraxripEeGFLjR6tZMo X-Google-Smtp-Source: AGHT+IGo96OAJItHEemD5tajBxK9yzp+81USFS1KY6B+zBtI2rynPRuq/1rbVFNQYaM418qzt+y10w== X-Received: by 2002:a17:907:1b1e:b0:ab7:d5e3:cbac with SMTP id a640c23a62f3a-abb70df7676mr203579366b.54.1739610130888; Sat, 15 Feb 2025 01:02:10 -0800 (PST) Received: from localhost.localdomain ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aba533bdd04sm490502966b.164.2025.02.15.01.02.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 01:02:10 -0800 (PST) From: Roman Scherer To: 76289@debbugs.gnu.org Subject: [PATCH v2 1/2] gnu: speakersafetyd: Use correct shared directory. Date: Sat, 15 Feb 2025 10:01:53 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-Debbugs-Cc: Divya Ranjan Pattanaik , Efraim Flashner Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Roman Scherer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/rust-apps.scm (speakersafetyd): Adjust shared directory. Change-Id: If52576364f54394a2930d2d8750446acba389f6c --- gnu/packages/rust-apps.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index f8da401bf7..90ec1ece2e 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -3203,7 +3203,7 @@ (define-public speakersafetyd (setenv "UNITDIR" (string-append #$output "/lib/systemd/system")) (setenv "UDEVDIR" (string-append #$output "/lib/udev/rules.d")) (setenv "TMPFILESDIR" (string-append #$output "/usr/lib/tmpfiles.d")) - (setenv "SHAREDIR" (string-append #$output "/usr/share")) + (setenv "SHAREDIR" (string-append #$output "/share")) (setenv "VARDIR" (string-append #$output "/var")) (invoke "make" "install-data")))))) (inputs (list alsa-lib)) base-commit: 4b5f0408e66392ab745dc0f7830732217d88f17d -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 04:02:26 2025 Received: (at 76289) by debbugs.gnu.org; 15 Feb 2025 09:02:26 +0000 Received: from localhost ([127.0.0.1]:53316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjE49-0007C3-Uj for submit@debbugs.gnu.org; Sat, 15 Feb 2025 04:02:26 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:55405) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjE46-0007BZ-Qs for 76289@debbugs.gnu.org; Sat, 15 Feb 2025 04:02:23 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-ab7f838b92eso500003166b.2 for <76289@debbugs.gnu.org>; Sat, 15 Feb 2025 01:02:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739610136; x=1740214936; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KskjwiWK4hsI3cNx7WSSPs9jK+tATesFhx1Oyd9sEeI=; b=qPo840zo2qCWIsLAOlsI4LnY8DqfQoBM8b7FCGIGnh5YxpFJM0GkQQifRSpJ5wa+h0 2DiNNey/HrekLxykwlCbuvo5TVanFGg0yteGknJrxbDP34WmOhzZxNqy7yjo1lfgo6x+ fH+YG69BVV8vuTfaQJiYZzXY1VEvxm5sbjfop14YwK39ixf+bQuw6Vhzyl6uFlo9CTAS Zg7T+OsQu2v24XLiaWv84x9MQLTokLGZuXvV0H5En+0+Vi2NXdrHdcrzs5vjibjN/+3Z rKT3h/nprVmgggxBepjWrivv3LXA3FbRC8HmHx7assNyD02CovdWUXl1qaMFtCJWTOlN 0IJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739610136; x=1740214936; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KskjwiWK4hsI3cNx7WSSPs9jK+tATesFhx1Oyd9sEeI=; b=wt1RDs9h5o0hiUTQ095EeNhIAtQCzSCJ5fMtiUfrTBaLdocKJ8wEyTW4U0mk5PQn77 ugRIBxl1rHF19P3BcO1vJjcpID0oUxTVvekfFLm9hLdgXeg2KVoXCd5USU6PQgHcpdDJ s1IlTfqWTU6vK+laIwO3D6i3x6+3wWekkhWWDbpyFP9tQddjx9Sb5cFQvBWvEgp9y5Cv Rr51W7XLVakXcTbrgYEeQXck2oY/E0Y9hwPslaEv1OeAN2J67FhpGV6Edv7QB94EX4IB UbY5g8/6g0IHXXM+ty0GnpFcuZqkaT6ZvJQZc7VpOuJHPxbLX5ZXpMT+NfiLBC28kOBk 3Ilg== X-Gm-Message-State: AOJu0YybVfKljSuzhI1zAgYMMblAWFmumFhSIMDQCoJU32sU421mPPj9 X8ybccZKpC0dT6xVuz73E8VkY5buMRLLQhN3uJ8iEM+bSSWEFMviEKImTcagYPMaIDmrPCpWXvm VFhQ= X-Gm-Gg: ASbGncvKhIc9I6uaN8secv5HAqcFQO31zU80B6nwQqlur/n1Q8e+n5f/IVxizsX/N39 3KQpMEDrgwPVc6iEzn58FwN7PSowDKdZ3CyfPPdMNXSVv+77ej0jzda13V23dWcDqrLgaBfnKiz 7hloetb0s5t8SeQ2cI8c2x+HoisdV0fBu7nRopLZGLUyTPRJOcOz9CAXs2MGBj11+kdTp6tWmuq iCGtCxwmo7mjkyN9Svm8xCLxzSY6whfnqUzzcxP8KSW7byMDHOTUEHyVZ5SxVtgZip43+9hvujh 1lO6c6ddKIwUAuEZnH8WkIbJKAhychss X-Google-Smtp-Source: AGHT+IFt42fSDvkqlet3yzQ1S5hFG/hbNFWQ1FwnlE3CleBs+IvB9wSW+8VmIfHWZNIBztUVZwuGdg== X-Received: by 2002:a17:907:7247:b0:ab9:76d7:16f6 with SMTP id a640c23a62f3a-abb70c2f4a5mr177802366b.32.1739610135823; Sat, 15 Feb 2025 01:02:15 -0800 (PST) Received: from localhost.localdomain ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aba533bdd04sm490502966b.164.2025.02.15.01.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 01:02:15 -0800 (PST) From: Roman Scherer To: 76289@debbugs.gnu.org Subject: [PATCH v2 2/2] services: Add speakersafetyd service. Date: Sat, 15 Feb 2025 10:01:54 +0100 Message-ID: <5c054384d00cbfbe2181f266d0d2d38843a9a411.1739609957.git.roman@burningswell.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Roman Scherer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/sound.scm (speakersafetyd-service-type) New variable. * doc/guix.texi: Document the speakersafetyd service. Change-Id: Ib8fa19b056a2036019ae7c199d81e1139664e951 --- doc/guix.texi | 42 +++++++++++++++++++++++++++ gnu/services/sound.scm | 65 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bd66adf326..ec5c7ab5cf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -26575,6 +26575,48 @@ Sound Services @end defvar +@subsubheading Speaker Safety Daemon System Service + +@uref{https://github.com/AsahiLinux/speakersafetyd, Speaker Safety +Daemon} is a user-space daemon that implements an analogue of the Texas +Instruments Smart Amp speaker protection model. It can be used to +protect the speakers on Apple Silicon devices. + +@defvar speakersafetyd-service-type +This is the type for the @code{speakersafetyd} system service, whose +value is a @command{speakersafetyd-configuration} record. + +@lisp +(service speakersafetyd-service-type) +@end lisp + +See below for details about @code{speakersafetyd-configuration}. +@end defvar + +@deftp {Data Type} speakersafetyd-configuration +Available @code{speakersafetyd-configuration} fields are: + +@table @asis +@item @code{blackbox-directory} (default: @code{"/var/lib/speakersafetyd/blackbox"}) (type: string) +The directory to which blackbox files are written when the speakers are +getting too hot. The blackbox files contain audio and debug information +which the developers of @code{speakersafetyd} might ask for when +reporting bugs. + +@item @code{configuration-directory} (type: file-like) +The base directory as a G-expression (@pxref{G-Expressions}) that +contains the configuration files of the speaker models. + +@item @code{maximum-gain-reduction} (default: @code{7}) (type: integer) +Maximum gain reduction before panicing, useful for debugging. + +@item @code{speakersafetyd} (default: @code{speakersafetyd}) (type: file-like) +The Speaker Safety Daemon package to use. + +@end table + +@end deftp + @node File Search Services @subsection File Search Services diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 8ca7acd737..9418969e9e 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -35,6 +35,7 @@ (define-module (gnu services sound) #:use-module (gnu packages audio) #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages rust-apps) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (alsa-configuration @@ -56,7 +57,15 @@ (define-module (gnu services sound) ladspa-configuration ladspa-configuration? ladspa-configuration-plugins - ladspa-service-type)) + ladspa-service-type + + speakersafetyd-configuration + speakersafetyd-configuration-blackbox-directory + speakersafetyd-configuration-directory + speakersafetyd-configuration-maximum-gain-reduction + speakersafetyd-configuration-speakersafetyd + speakersafetyd-configuration? + speakersafetyd-service-type)) ;;; Commentary: ;;; @@ -263,4 +272,58 @@ (define ladspa-service-type (default-value (ladspa-configuration)) (description "Configure LADSPA plugins."))) + +;;; +;;; Speaker Safety Daemon +;;; + +(define-configuration/no-serialization speakersafetyd-configuration + (blackbox-directory + (string "/var/lib/speakersafetyd/blackbox") + "The directory to which blackbox files are written when the speakers are +getting too hot. The blackbox files contain audio and debug information which +the developers of @code{speakersafetyd} might ask for when reporting bugs.") + (configuration-directory + (file-like (file-append speakersafetyd "/share/speakersafetyd")) + "The base directory as a G-expression (@pxref{G-Expressions}) that contains +the configuration files of the speaker models.") + (maximum-gain-reduction + (integer 7) + "Maximum gain reduction before panicing, useful for debugging.") + (speakersafetyd + (file-like speakersafetyd) + "The Speaker Safety Daemon package to use.")) + +(define speakersafetyd-shepherd-service + (match-record-lambda + (blackbox-directory configuration-directory maximum-gain-reduction speakersafetyd) + (shepherd-service + (documentation "Run the speaker safety daemon") + (provision '(speakersafetyd)) + (requirement '(udev)) + (start #~(make-forkexec-constructor + (list #$(file-append speakersafetyd "/bin/speakersafetyd") + "--config-path" #$configuration-directory + "--blackbox-path" #$blackbox-directory + "--max-reduction" (number->string #$maximum-gain-reduction)))) + (stop #~(make-kill-destructor))))) + +(define speakersafetyd-service-type + (service-type + (name 'speakersafetyd) + (description "Run @command{speakersafetyd}, a user space daemon that +implements an analogue of the Texas Instruments Smart Amp speaker protection +model. It can be used to protect the speakers on Apple Silicon devices.") + (extensions + (list (service-extension + shepherd-root-service-type + (compose list speakersafetyd-shepherd-service)) + (service-extension + udev-service-type + (compose list speakersafetyd-configuration-speakersafetyd)) + (service-extension + profile-service-type + (compose list speakersafetyd-configuration-speakersafetyd)))) + (default-value (speakersafetyd-configuration)))) + ;;; sound.scm ends here -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 04:15:35 2025 Received: (at 76289) by debbugs.gnu.org; 15 Feb 2025 09:15:35 +0000 Received: from localhost ([127.0.0.1]:53348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjEGs-0007rV-RF for submit@debbugs.gnu.org; Sat, 15 Feb 2025 04:15:35 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:59639) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjEGp-0007rB-5p for 76289@debbugs.gnu.org; Sat, 15 Feb 2025 04:15:32 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5dec996069aso5091326a12.2 for <76289@debbugs.gnu.org>; Sat, 15 Feb 2025 01:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739610925; x=1740215725; darn=debbugs.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=bUWcYjlxspzwfg1R1ppZZA83N2ST4cH2VeayxZGQXGo=; b=FC8fnWuNkNt9KT7iljst+S4kl0BhLuyzdIW+UjvACYzCz+J7Skc3CZXNOLDnpPhthr 0icKUAQP33TCr8Krr3el1iAjZd3McDGML8sY0CeSbf68rK+zw5PMNHSL3qgnSSku1+xy gcIMtLyQiPPCppnvt1VqDB+BL/9iCazmsEamO8F2lzU6ksSEbklqhIf/epj99zaOZowE fkcNPFU91HmZmfZGC9JLnG0bbzfM/CTZQqwkY2wfsoFt6ORHP9CTcytf7w92tCF0Q2eX QIN0cE83Pp9pDkKH7GEx+CQDtKppLLtKXwjxTbb1kDrP3UmAitbSsLY633ubnXPBO88U ltdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739610925; x=1740215725; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bUWcYjlxspzwfg1R1ppZZA83N2ST4cH2VeayxZGQXGo=; b=r0/DWXIBMweN+qVMq4Z1TAi6ttpzC2QkmLkiQ+NB1xKp27f1OGic2PcI0mXY0YKuXi cRwgpQ9JfAs1IyvXy/itHMNoyH0yRDL/IhgMHgRkxlsb3HFEVfO6fEDQsme5F/yYysjW E8BDkWA7oLetvvcN5bHyiA9FURhJpMLFfpaRxMEKLKpfQiVs/IsrTNSAfsh6iisWpeHX 1ixMeAnTNOz9NN1WvfkqsM+4zXE4lWIu+RazyodA7WpL9qyL4CQK0P6DT9YVYEyCfseU 7wHUEJIcMF421TNdkj8/LABa6uJkHNo9/vb6uMMgdK2dVmxOPjMdsNXxu+4FIP8vOs/1 Cpaw== X-Forwarded-Encrypted: i=1; AJvYcCXgk30qOeUrbSHedlPoeEQ21vi7rvVqK03EsKuO6XfUHnnJLSho6UufyyjLtDTpOk33yrHnTA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzXRiaEGsovp53lS++KztmU6xuuwgEW6zynltyl2Er1IreVck/X u0gAErvzBFj12FBNw97fAq8SD7LdKevVNgPK1MHuTAuylByhgYeRhePKLPZ9WW0= X-Gm-Gg: ASbGncv2hW4/c3dwrifJtVBg4WPmMHZEyyx/4fJTWaocI2hMb8impvZwIZKKAsw/vdz VXZE2JT8QFuEw0OYQ+k/vslKncWqNDQjLb93jc5fmOyigdz9en0OpxlneLOjR0pMjx8hSKW/2Cx syHIBKwxyq8P7PMsoVDyPDpsrcQLgvf7buqTvMLNiwpazvdc8ZA09F2K7buQxXOcWZfDEY/himz wuR/9FmgeKzXQCJKqXhjSsAEfsH9OxAB9S6F39hhnz8PvuLvi7/NPzUcZOHR/7QCtmfGc36zwHF yKXB+Zpg8luZBZtv X-Google-Smtp-Source: AGHT+IE4BsFbOXmygnUbdNdLiRPKRUuxnEXZzRWim7IPTy9s4xSMl2HSaUKcirq2q4Hp+5HrgG1dFA== X-Received: by 2002:a05:6402:4414:b0:5dc:91c6:8096 with SMTP id 4fb4d7f45d1cf-5e0361effd3mr2873620a12.30.1739610924736; Sat, 15 Feb 2025 01:15:24 -0800 (PST) Received: from precision ([2a01:599:10b:f79:9dcd:a0d9:c5a9:ff40]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dece1d367dsm4270604a12.44.2025.02.15.01.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 01:15:23 -0800 (PST) From: Roman Scherer To: Maxim Cournoyer Subject: Re: [bug#76289] [PATCH 2/2] services: Add speakersafetyd service. In-Reply-To: <87r0409fal.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 15 Feb 2025 10:18:10 +0900") References: <6bdfd356508e8f643f2c63cb796548f36e0abb87.1739540583.git.roman@burningswell.com> <87r0409fal.fsf@gmail.com> User-Agent: mu4e 1.12.8; emacs 29.4 Date: Sat, 15 Feb 2025 10:15:21 +0100 Message-ID: <877c5rtvpy.fsf@burningswell.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Roman Scherer , Ludovic =?utf-8?Q?Court=C3=A8s?= , 76289@debbugs.gnu.org, efraim@flashner.co.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi Maxim, thanks for your review. I hope I addressed your comments. Additionally: - I used the configuration->documentation command to generate documentation from the configuration record - I discovered match-record-lambda and use this instead of match-record Could you have another look please? Thank you, Roman. Maxim Cournoyer writes: > Hi Roman, > > Roman Scherer writes: > >> * gnu/services/sound.scm (speakersafetyd-service-type) New variable. >> * doc/guix.texi: Document the speakersafetyd service. > > Interesting! > >> Change-Id: Ib8fa19b056a2036019ae7c199d81e1139664e951 >> --- >> doc/guix.texi | 41 ++++++++++++++++++++++++++++ >> gnu/services/sound.scm | 61 +++++++++++++++++++++++++++++++++++++++++- >> 2 files changed, 101 insertions(+), 1 deletion(-) >> >> diff --git a/doc/guix.texi b/doc/guix.texi >> index bd66adf326..3b82df5196 100644 >> --- a/doc/guix.texi >> +++ b/doc/guix.texi >> @@ -26575,6 +26575,47 @@ Sound Services >> >> @end defvar >> >> +@subsubheading Speaker Safety Daemon System Service >> + >> +@uref{https://github.com/AsahiLinux/speakersafetyd, Speaker Safety >> +Daemon} is a userspace daemon that implements an analogue of the Texas >> +Instruments Smart Amp speaker protection model. It can be used to >> +protect the speakers on Apple Silicon devices. >> + >> +@defvar speakersafetyd-service-type >> +This is the type for the @code{speakersafetyd} system service, whose >> +value is a @command{speakersafetyd-configuration} record. >> + >> +@lisp >> +(service speakersafetyd-service-type) >> +@end lisp >> + >> +See below for details about @code{speakersafetyd-configuration}. >> +@end defvar >> + >> +@deftp {Data Type} speakersafetyd-configuration >> +Data type representing the configuration for @code{speakersafetyd-service}. >> + >> +@table @asis >> +@item @code{blackbox-path} (default: @code{"/var/lib/speakersafetyd/blackbox"}) >> +The path to a directory to which "blackbox" files are written when the >> +speakers are getting too hot. The blackbox files contain audio and >> +debug information which the developers of @code{speakersafetyd} might >> +ask for when reporting bugs. >> + >> +@item @code{config-path} (default: @code{(file-append speakersafetyd "/share/speakersafetyd")}) >> +Path to the base directory as a G-expression (@pxref{G-Expressions}) >> +that contains the configuration files of the speaker models. >> + >> +@item @code{max-reduction} (default: @code{7}) >> +Maximum gain reduction before panicing, useful for debugging. >> + >> +@item @code{package} (default: @var{speakersafetyd}) >> +The Speaker Safety Daemon package to use. >> + >> +@end table >> +@end deftp >> + >> @node File Search Services >> @subsection File Search Services >> >> diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm >> index 8ca7acd737..fb8a8d3d17 100644 >> --- a/gnu/services/sound.scm >> +++ b/gnu/services/sound.scm >> @@ -35,6 +35,7 @@ (define-module (gnu services sound) >> #:use-module (gnu packages audio) >> #:use-module (gnu packages linux) >> #:use-module (gnu packages pulseaudio) >> + #:use-module (gnu packages rust-apps) >> #:use-module (ice-9 match) >> #:use-module (srfi srfi-1) >> #:export (alsa-configuration >> @@ -56,7 +57,15 @@ (define-module (gnu services sound) >> ladspa-configuration >> ladspa-configuration? >> ladspa-configuration-plugins >> - ladspa-service-type)) >> + ladspa-service-type >> + >> + speakersafetyd-configuration >> + speakersafetyd-configuration-blackbox-path >> + speakersafetyd-configuration-config-path >> + speakersafetyd-configuration-max-reduction >> + speakersafetyd-configuration-package >> + speakersafetyd-configuration? >> + speakersafetyd-service-type)) >> >> ;;; Commentary: >> ;;; >> @@ -263,4 +272,54 @@ (define ladspa-service-type >> (default-value (ladspa-configuration)) >> (description "Configure LADSPA plugins."))) >> >> + >> +;;; >> +;;; Speaker Safety Daemon >> +;;; >> + >> +(define-record-type* >> + speakersafetyd-configuration >> + make-speakersafetyd-configuration >> + speakersafetyd-configuration? >> + (blackbox-path speakersafetyd-configuration-blackbox-path >> + (default "/var/lib/speakersafetyd/blackbox")) > > Since these values are not serialized, we are free to name them the way > we like; so they should follow the GNU and Guix conventions, namely: > > I'd use blackbox-directory. > >> + (config-path speakersafetyd-configuration-config-path >> + (default (file-append speakersafetyd >> "/share/speakersafetyd"))) > > I'd use configuration-directory. > >> + (max-reduction speakersafetyd-configuration-max-reduction >> + (default 7)) > > I'd use maximum-gain-reduction > >> + (package speakersafetyd-configuration-package >> + (default speakersafetyd))) > > I'd use the more conventional > speakersafetyd-configuration-speakersafetyd (using the name of the > package as the field name). > > Our related conventions here are roughly: > > 1. Prefer full name instead of abbreviation, especially in public APIs > 2. Path always used to denote a multi-entries search path like 'PATH' > and friends. Use 'file name', 'file' or 'directory' instead. > > It's also more conventional to use the package name for the package > object field, so here I'd use > 'speakersafetyd-configuration-speakersafetyd'. > > Could you please also use 'define-configuration/no-serialization' from > (gnu services configuration) ? It validates the type of each field and > produces useful user error messages in case these are incorrect. > >> +(define (speakersafetyd-shepherd-service config) >> + (let ((blackbox-path (speakersafetyd-configuration-blackbox-path config)) >> + (config-path (speakersafetyd-configuration-config-path config)) >> + (max-reduction (speakersafetyd-configuration-max-reduction config)) >> + (package (speakersafetyd-configuration-package config))) > > nitpick: I'd unbox each value using match-record; which will make things a bit > more concise. > >> + (shepherd-service >> + (documentation "Speaker saftey daemon") > > s/saftey/safety/ > >> + (provision '(speakersafetyd)) >> + (requirement '(udev)) >> + (start #~(make-forkexec-constructor >> + (list #$(file-append package "/bin/speakersafetyd") >> + "--config-path" #$config-path >> + "--blackbox-path" #$blackbox-path >> + "--max-reduction" (number->string #$max-reduction)))) >> + (stop #~(make-kill-destructor))))) >> + >> +(define speakersafetyd-service-type >> + (service-type >> + (name 'speakersafetyd) >> + (description "Speaker Saftey Daemon") >> > s/Saftey/Safety/ The project has a better description, which can be > adapted to something like "@command{speakersafetyd} is a user space > daemon that implements an analogue of the Texas Instruments Smart Amp > speaker protection model." > >> + (extensions >> + (list (service-extension >> + profile-service-type >> + (compose list speakersafetyd-configuration-package)) >> + (service-extension >> + shepherd-root-service-type >> + (compose list speakersafetyd-shepherd-service)) >> + (service-extension >> + udev-service-type >> + (compose list speakersafetyd-configuration-package)))) >> + (default-value (speakersafetyd-configuration)))) > > Nitpick, but I'd order these from most critical to less critical > ordering, such that te root service type is extended first, then the > udev-service-type, then the profile. > > The rest LGTM. Could you please send a v2? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFLBAEBCAA1FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmewWykXHHJvbWFuQGJ1 cm5pbmdzd2VsbC5jb20ACgkQPdpSUn0qwZnvhgf/SsJC8ImQDyCwx0odfvvazZZY yz/TpPIk/NGO5QQMPwkQfadfnrcanJ/zqjuG++mT1x7h0HBEEDUaDq7CgrzOF6MQ px5vwKD5toEFSUY22YVFnWXZvU3/UTmY3x/fK6k0tIXjkeBAXzEX8dyH+qnAYHUJ YA9OVJI4LJhfovlO36Zm/0iiLQ6cPMotEzMS3TYAmtFdWVoFtdIwRCROhzyCEJFw SA0H3K+sDKQdl31b/2JCxaPd2lDwQtSWIMm+fAdG7zYZ/glXJdgmhnzfBjg/LCmx eIXrA75dWXPAjALB3XogHswFHcdZoSPESIl9x6TV974w0YO070q7VAIQaNgVbg== =6HQR -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 04:24:54 2025 Received: (at 76289) by debbugs.gnu.org; 15 Feb 2025 09:24:54 +0000 Received: from localhost ([127.0.0.1]:53362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjEPt-0008EV-O0 for submit@debbugs.gnu.org; Sat, 15 Feb 2025 04:24:53 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]:59880) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjEPo-0008Dx-Om for 76289@debbugs.gnu.org; Sat, 15 Feb 2025 04:24:51 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-aaf0f1adef8so570913766b.3 for <76289@debbugs.gnu.org>; Sat, 15 Feb 2025 01:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739611482; x=1740216282; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GnaBzmEp3pmuCEuCCVOuVrIP0en8IxXMHZcZMMiD+vo=; b=eR9FE/9e/SSgO1AgnN9kD2ozc1+LLGjXn7pg+cuMBX20wjtys5gTBmvqvrN+Y6OkCb dlbKSuX9hEtT/1mTYdlGhmqGvFH/1oqPZdo5vCIOhESNc8WOiOjoaPzZEWzsnux0xYIC sILcWXSA+hk2ifMSD1UGjhf7agr0N4TcCnAG+HOi66z4mE60oBz8b8cOqi4MHlznaqif ioIdQXuIU/zg8vLsvkZHahaS8gMAtzDO7s40mRh5ocyTr7ohMXlfn2LeibMeMi+sd7Bl PT8QWX8okBdv8J+ku/GQX91R/E7OjojM7AwvsHy/Pnjk7aZkrwkjJXaS5yvbfQH/urgX CLRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739611482; x=1740216282; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GnaBzmEp3pmuCEuCCVOuVrIP0en8IxXMHZcZMMiD+vo=; b=qmZ+xKWYOIrDLam+JMy9ZInASSvFq2QRsTgaPBCrhOhUTDB4MBjjfSyDQrGaX5OD9n sgz8EW3YA/G+eUxd4L7GCL/lQsazYVRoRiR/+ksE2qUC6NsR6pB6/wPXasMBG3sYWqjm v7IwrHAMeW3fv4zLSCNKJvHMe9vGtVQRikH1ELQ+EaeUvy9FrCvIEZYh+AnjdquvIKBj 4oGEtP3GWEbEOwYBdfYgzPbNZXyMM46U58pJpJNdM2jc4L/jNUA5B1VCtWyW5AjpcP9X 6cpuYUPSXCS3v2yBsPEuwCvsQdyoF1wudMmosH8Pn3UMl/lpNpFACMlxjSnJdQIIYI4w CxOw== X-Gm-Message-State: AOJu0Yw0V4YMt/hwwEix/HApQvYsQwb/Fgh008Q6DA4GIIXqrhsV2xIO Rje9A6RmT9spSEUARU2+zOntYM9GB4Jw/mPNHaVq+HhLa2UdewYfc9hhmTTvcEFE7NVyuzSlvEh eUEc= X-Gm-Gg: ASbGncvCR5SfzWEInbMMYpMd0W/LrgKvAtWhkKtet4hzfFSo0s+XUleJOVoF96MI+le /jtzIl3ufX45D9E3sVMGekMptUhUrmt5AhqCQOMHmsN0nF9mXyRnZAEPW2rUc08zfyVaCwlFQ3T Y6P2JZ3ULadvgoeMvQ+a3q1pqTxiLyU+x+88+4IGuTFXLogarni5W9wZkT9OjiCQneNQf7JEOjV Di5v66MXcFrCNfup6qp0Wu1MNPPIysV+3GJDkqVFyd39UcKmfF+6Q3S6w2/B0hAEUWeRxgTag9O Nh3micVRQruUtwNTyZ7qFLfluztpcWZJ X-Google-Smtp-Source: AGHT+IGAqBAQ7qQGe7vcrlnHLnVvoWsQfw17Q6/pD1tNdVd3IlTq3HiEpQuFNfSusc0QEYDD9MTEGQ== X-Received: by 2002:a17:906:4794:b0:ab7:5c14:d13 with SMTP id a640c23a62f3a-abb71130b88mr217505166b.53.1739611481805; Sat, 15 Feb 2025 01:24:41 -0800 (PST) Received: from localhost.localdomain ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aba5327fc9bsm496053866b.75.2025.02.15.01.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 01:24:41 -0800 (PST) From: Roman Scherer To: 76289@debbugs.gnu.org Subject: [PATCH v3 1/2] gnu: speakersafetyd: Use correct shared directory. Date: Sat, 15 Feb 2025 10:24:34 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-Debbugs-Cc: Divya Ranjan Pattanaik , Efraim Flashner Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Roman Scherer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/rust-apps.scm (speakersafetyd): Adjust shared directory. Change-Id: If52576364f54394a2930d2d8750446acba389f6c --- gnu/packages/rust-apps.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index f8da401bf7..90ec1ece2e 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -3203,7 +3203,7 @@ (define-public speakersafetyd (setenv "UNITDIR" (string-append #$output "/lib/systemd/system")) (setenv "UDEVDIR" (string-append #$output "/lib/udev/rules.d")) (setenv "TMPFILESDIR" (string-append #$output "/usr/lib/tmpfiles.d")) - (setenv "SHAREDIR" (string-append #$output "/usr/share")) + (setenv "SHAREDIR" (string-append #$output "/share")) (setenv "VARDIR" (string-append #$output "/var")) (invoke "make" "install-data")))))) (inputs (list alsa-lib)) base-commit: 4b5f0408e66392ab745dc0f7830732217d88f17d -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 04:24:54 2025 Received: (at 76289) by debbugs.gnu.org; 15 Feb 2025 09:24:54 +0000 Received: from localhost ([127.0.0.1]:53364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjEPu-0008EX-0k for submit@debbugs.gnu.org; Sat, 15 Feb 2025 04:24:54 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:53431) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjEPr-0008E7-1E for 76289@debbugs.gnu.org; Sat, 15 Feb 2025 04:24:51 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-ab7ee6f54faso330200666b.2 for <76289@debbugs.gnu.org>; Sat, 15 Feb 2025 01:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739611484; x=1740216284; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IcjEG8FZPMpfO5cn0Tspc6YQdu+r4rugrySm4JmeJHo=; b=u7XsV5nbuu+L0RdFft8Gy/Den1rmZmbopkvq6GVGemwwQIbjaiUAulbIz4zgD2ecRU RjlquFPNWJTZFtKUoDXaJI0j54YeDeeC8LUc6k2+Pj4eHE/zDxo8QPwoqe9hHAB7C/RX zYLpNSLHdZ68lZJxnUECBdVvZchAKPavBO7buqLkxLYy557ljoKvUSw4tu7s1KVskwT2 O6PUouJ/9JsCCn23IPjEk6+0SFF5yiMKcfoDTgR1YqiLFadM8DRRXdoV1KWvWKcFW4XQ 7SnsXfWaNPbSr1OFU/t01SxpX+xIgRhdgsd1wU4WUGodg15c4K6YImFKwxp6OU/gfgQo j4fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739611484; x=1740216284; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IcjEG8FZPMpfO5cn0Tspc6YQdu+r4rugrySm4JmeJHo=; b=LtfRqMyl3969SYr+V4+AHh2xChRXQT1AoExyJS4YaeXxBLgXvQYnV3zPXwBCPUM27/ 77+RMBVnfZdTnWgPGLni0TfrVSxVY3dbNHzi0nAL72azlR6dwS6edFZrze86DhCBpcxy 3u3iHmxZYFxXFpnc/9VjcTFN44eqg8yt2yIt1P6EFXDLFg3IGT8rpd2SQwiAlBFMczF0 yKbfK+qBK81+mjRIdUHUa5ZCe9uUHfyxHQNEIScZrBtIdJWCkFM96uy1zWOFHo/wH8m1 AB9ZbcrWE9rZryp5gY+iUwV0W0XUQA0z6kJSZAlBeHO0rde0fvnJzl0G3d2vfAinsXUl wfhw== X-Gm-Message-State: AOJu0YwzxsKyUvZpnRFW8dhJmLR8Q5opRPSeFnzBRqIiaZAQUfwrurZt D8LkR0PXhZOiwxxKUjdySeLQt3MHvivAtat3jjALUUPqfOwquziQHfcXlhQU4EWdo13l4RClhIz QoNA= X-Gm-Gg: ASbGncukQlt+9Jo9hlZjzNQ45LS+Yi958E0Q04k4TnpjC9AGklohUdVqrXpBQZvUMXK 82msIcVSdDXcvBWho4pdrBn4u+H1uF0TXqw0o/Umv6hgUsvbaRTfrRzrPgKNL+873bVncLuC7Cw o7kpmlB71ZSAPy0ap952Ehkk9OmHaEpsWp+NNOD5ioCZjdwZ0EHcLEzb5gvhkvftUoBcVth/oY8 QcN4zO+sKFTn+TPmcuBY5qi6zPorn1Abcmu+ZGXaaRYC4mTzBrd31ZljZYvsvMg0hdetH2pXc1d UTJhon+ijKxbL9uYo3rBKmIt1wJ7X3Rz X-Google-Smtp-Source: AGHT+IH+PHHQKREg07tewv4yqwAA/uJukAB0sEhrE8SG/hdBgkbPWp7e7ksqxKeA2xAeo/0v65LQLQ== X-Received: by 2002:a05:6402:2745:b0:5dc:5ada:e0c7 with SMTP id 4fb4d7f45d1cf-5e036155c28mr6235605a12.26.1739611483082; Sat, 15 Feb 2025 01:24:43 -0800 (PST) Received: from localhost.localdomain ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aba5327fc9bsm496053866b.75.2025.02.15.01.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 01:24:42 -0800 (PST) From: Roman Scherer To: 76289@debbugs.gnu.org Subject: [PATCH v3 2/2] services: Add speakersafetyd service. Date: Sat, 15 Feb 2025 10:24:35 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Roman Scherer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/sound.scm (speakersafetyd-service-type) New variable. * doc/guix.texi: Document the speakersafetyd service. Change-Id: Ib8fa19b056a2036019ae7c199d81e1139664e951 --- doc/guix.texi | 42 +++++++++++++++++++++++++++ gnu/services/sound.scm | 65 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bd66adf326..ec5c7ab5cf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -26575,6 +26575,48 @@ Sound Services @end defvar +@subsubheading Speaker Safety Daemon System Service + +@uref{https://github.com/AsahiLinux/speakersafetyd, Speaker Safety +Daemon} is a user-space daemon that implements an analogue of the Texas +Instruments Smart Amp speaker protection model. It can be used to +protect the speakers on Apple Silicon devices. + +@defvar speakersafetyd-service-type +This is the type for the @code{speakersafetyd} system service, whose +value is a @command{speakersafetyd-configuration} record. + +@lisp +(service speakersafetyd-service-type) +@end lisp + +See below for details about @code{speakersafetyd-configuration}. +@end defvar + +@deftp {Data Type} speakersafetyd-configuration +Available @code{speakersafetyd-configuration} fields are: + +@table @asis +@item @code{blackbox-directory} (default: @code{"/var/lib/speakersafetyd/blackbox"}) (type: string) +The directory to which blackbox files are written when the speakers are +getting too hot. The blackbox files contain audio and debug information +which the developers of @code{speakersafetyd} might ask for when +reporting bugs. + +@item @code{configuration-directory} (type: file-like) +The base directory as a G-expression (@pxref{G-Expressions}) that +contains the configuration files of the speaker models. + +@item @code{maximum-gain-reduction} (default: @code{7}) (type: integer) +Maximum gain reduction before panicing, useful for debugging. + +@item @code{speakersafetyd} (default: @code{speakersafetyd}) (type: file-like) +The Speaker Safety Daemon package to use. + +@end table + +@end deftp + @node File Search Services @subsection File Search Services diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 8ca7acd737..bf7d3cc6b0 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -35,6 +35,7 @@ (define-module (gnu services sound) #:use-module (gnu packages audio) #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages rust-apps) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (alsa-configuration @@ -56,7 +57,15 @@ (define-module (gnu services sound) ladspa-configuration ladspa-configuration? ladspa-configuration-plugins - ladspa-service-type)) + ladspa-service-type + + speakersafetyd-configuration + speakersafetyd-configuration-blackbox-directory + speakersafetyd-configuration-configuration-directory + speakersafetyd-configuration-maximum-gain-reduction + speakersafetyd-configuration-speakersafetyd + speakersafetyd-configuration? + speakersafetyd-service-type)) ;;; Commentary: ;;; @@ -263,4 +272,58 @@ (define ladspa-service-type (default-value (ladspa-configuration)) (description "Configure LADSPA plugins."))) + +;;; +;;; Speaker Safety Daemon +;;; + +(define-configuration/no-serialization speakersafetyd-configuration + (blackbox-directory + (string "/var/lib/speakersafetyd/blackbox") + "The directory to which blackbox files are written when the speakers are +getting too hot. The blackbox files contain audio and debug information which +the developers of @code{speakersafetyd} might ask for when reporting bugs.") + (configuration-directory + (file-like (file-append speakersafetyd "/share/speakersafetyd")) + "The base directory as a G-expression (@pxref{G-Expressions}) that contains +the configuration files of the speaker models.") + (maximum-gain-reduction + (integer 7) + "Maximum gain reduction before panicing, useful for debugging.") + (speakersafetyd + (file-like speakersafetyd) + "The Speaker Safety Daemon package to use.")) + +(define speakersafetyd-shepherd-service + (match-record-lambda + (blackbox-directory configuration-directory maximum-gain-reduction speakersafetyd) + (shepherd-service + (documentation "Run the speaker safety daemon") + (provision '(speakersafetyd)) + (requirement '(udev)) + (start #~(make-forkexec-constructor + (list #$(file-append speakersafetyd "/bin/speakersafetyd") + "--config-path" #$configuration-directory + "--blackbox-path" #$blackbox-directory + "--max-reduction" (number->string #$maximum-gain-reduction)))) + (stop #~(make-kill-destructor))))) + +(define speakersafetyd-service-type + (service-type + (name 'speakersafetyd) + (description "Run @command{speakersafetyd}, a user space daemon that +implements an analogue of the Texas Instruments Smart Amp speaker protection +model. It can be used to protect the speakers on Apple Silicon devices.") + (extensions + (list (service-extension + shepherd-root-service-type + (compose list speakersafetyd-shepherd-service)) + (service-extension + udev-service-type + (compose list speakersafetyd-configuration-speakersafetyd)) + (service-extension + profile-service-type + (compose list speakersafetyd-configuration-speakersafetyd)))) + (default-value (speakersafetyd-configuration)))) + ;;; sound.scm ends here -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 04:26:08 2025 Received: (at 76289) by debbugs.gnu.org; 15 Feb 2025 09:26:08 +0000 Received: from localhost ([127.0.0.1]:53375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjER5-0008NI-QF for submit@debbugs.gnu.org; Sat, 15 Feb 2025 04:26:08 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:52384) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjER3-0008Ml-Eq for 76289@debbugs.gnu.org; Sat, 15 Feb 2025 04:26:06 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5dcdb56c9d3so4201956a12.0 for <76289@debbugs.gnu.org>; Sat, 15 Feb 2025 01:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739611559; x=1740216359; darn=debbugs.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=qQIrqK+Rfcp/mOaeFHMTvUfGZMuWi4Be+308Ln8Id7Q=; b=u0GralL88mO0gHY8lEZjW6SFR6lS2B3R5zcYlSwlr0A0hW/QSMUnK6E5tEbP+WjEpm zijdJ3QfkseHNV/H6AEV72soQnxvWt1H4UfMOuqVFpG9Psv3pxRVq4gqDZpsb0NdvbFs 1dUBeuT72IZx/Chng9ZCFVTkhT5SPz4EZ/ud3Bj5PUrR4OTFehmgxiVQAVyU7BODZMav OeIANVH9EbREY5ZRsGWDBxKXkhNnxPMbcpqXBZxmSta2JniRULalftfWnRMjwY4T1gld q3dr8qPcHJxfR43/BazSOS7XApXea3Qmt9QDV7uEY9Zu3Zfre3OLivp3ajl0xnZ9juyM QEpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739611559; x=1740216359; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qQIrqK+Rfcp/mOaeFHMTvUfGZMuWi4Be+308Ln8Id7Q=; b=Iu/lc/PqQsmjKmHcNhWv9pHzvJQ0Vtneu6/haB5L/NWycNAQY13PrzYcUaGbiZ4iYK q5lN1f8K2JC/x/PQoqfz2GbXfpN+kiG+NPWXR7murqCeeYcu76XmltZSUCcRJOLlHwFa aRVG+2fLBZ3ZSeZ9LkVLWF1dlz13IrCByxUAxDis/tz5qFPNWfYsjWHjM5yYZcvBgBA2 L8JzXLaiQNChs3XBAC6mLbYlaYkGVwiMrDF9OKevzIK1XHbsDrOoMVh90UONrRmedqp2 3zh/ehM7sLr9msUn7+MzktNqKbDq4iyk3G3BFrvgLxf86wyuitB4V206JfhBoDsw5qNz Vmlg== X-Forwarded-Encrypted: i=1; AJvYcCXsGd7+m6Vg2d9ivGL4rImNXFEySyjMERkFgvGwfWqi9NR/i8+b/8ymLNnS6/u4krmDBR2Tmg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzpO6BYm67pc9+2fmG+niCrGMalWI+Yuxna3/OW/FZt9H0bVcXJ NVWGmnhpK0NiGSaAKqwn39CY2Vr8cLI3fP68cdvv7bnBLPeLZCMJJCg5FtI+IUn0T8/CqbXIJr1 t/e0= X-Gm-Gg: ASbGncsMBBhPOvi33lH4yFJCjR7tgZaddUfdttf+t8oiHPvc59X4i77rvpmiCeRE1Ge z9So8VI2UWrMyoMOwbLkxgk206g/zrK1B/LQ8v1AiohhXbHyocjrof/5XMySmGuW439pFDtI2u+ 4BftrwFc91JrDeNqBNu2CmQVBhezvOv00Oxu/nki06qrOshuVu76evrGgSqHsx5Hm3mUp6dP4qT xyiFwqHBWiRi0Twj8B3gK63h2DRTgl/XIIr6G6Foe7BIlEurrXh9J7dV4bgXfWfhh+ZrjW4f01r 88aVD58= X-Google-Smtp-Source: AGHT+IFSBoxK2UN1L0AJOZxRTcZzbJ2Uv/PfEY3wHx4xVm3taemOyUPaZUqqRPs5J/T4RSeL31aLSw== X-Received: by 2002:a05:6402:510b:b0:5dc:a44e:7644 with SMTP id 4fb4d7f45d1cf-5e035ff9cacmr5565301a12.2.1739611559067; Sat, 15 Feb 2025 01:25:59 -0800 (PST) Received: from m1 ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abb8190d15esm23298666b.16.2025.02.15.01.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 01:25:58 -0800 (PST) From: Roman Scherer To: Roman Scherer Subject: Re: [bug#76289] [PATCH 2/2] services: Add speakersafetyd service. In-Reply-To: <877c5rtvpy.fsf@burningswell.com> (Roman Scherer's message of "Sat, 15 Feb 2025 10:15:21 +0100") References: <6bdfd356508e8f643f2c63cb796548f36e0abb87.1739540583.git.roman@burningswell.com> <87r0409fal.fsf@gmail.com> <877c5rtvpy.fsf@burningswell.com> User-Agent: mu4e 1.12.8; emacs 29.4 Date: Sat, 15 Feb 2025 10:25:55 +0100 Message-ID: <86a5an5zks.fsf@burningswell.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 76289@debbugs.gnu.org, Maxim Cournoyer , efraim@flashner.co.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain And I just send a v3, because I exported the wrong symbol. Roman Scherer writes: > Hi Maxim, > > thanks for your review. I hope I addressed your comments. Additionally: > > - I used the configuration->documentation command to generate > documentation from the configuration record > > - I discovered match-record-lambda and use this instead of match-record > > Could you have another look please? > > Thank you, Roman. > > Maxim Cournoyer writes: > >> Hi Roman, >> >> Roman Scherer writes: >> >>> * gnu/services/sound.scm (speakersafetyd-service-type) New variable. >>> * doc/guix.texi: Document the speakersafetyd service. >> >> Interesting! >> >>> Change-Id: Ib8fa19b056a2036019ae7c199d81e1139664e951 >>> --- >>> doc/guix.texi | 41 ++++++++++++++++++++++++++++ >>> gnu/services/sound.scm | 61 +++++++++++++++++++++++++++++++++++++++++- >>> 2 files changed, 101 insertions(+), 1 deletion(-) >>> >>> diff --git a/doc/guix.texi b/doc/guix.texi >>> index bd66adf326..3b82df5196 100644 >>> --- a/doc/guix.texi >>> +++ b/doc/guix.texi >>> @@ -26575,6 +26575,47 @@ Sound Services >>> >>> @end defvar >>> >>> +@subsubheading Speaker Safety Daemon System Service >>> + >>> +@uref{https://github.com/AsahiLinux/speakersafetyd, Speaker Safety >>> +Daemon} is a userspace daemon that implements an analogue of the Texas >>> +Instruments Smart Amp speaker protection model. It can be used to >>> +protect the speakers on Apple Silicon devices. >>> + >>> +@defvar speakersafetyd-service-type >>> +This is the type for the @code{speakersafetyd} system service, whose >>> +value is a @command{speakersafetyd-configuration} record. >>> + >>> +@lisp >>> +(service speakersafetyd-service-type) >>> +@end lisp >>> + >>> +See below for details about @code{speakersafetyd-configuration}. >>> +@end defvar >>> + >>> +@deftp {Data Type} speakersafetyd-configuration >>> +Data type representing the configuration for @code{speakersafetyd-service}. >>> + >>> +@table @asis >>> +@item @code{blackbox-path} (default: @code{"/var/lib/speakersafetyd/blackbox"}) >>> +The path to a directory to which "blackbox" files are written when the >>> +speakers are getting too hot. The blackbox files contain audio and >>> +debug information which the developers of @code{speakersafetyd} might >>> +ask for when reporting bugs. >>> + >>> +@item @code{config-path} (default: @code{(file-append speakersafetyd "/share/speakersafetyd")}) >>> +Path to the base directory as a G-expression (@pxref{G-Expressions}) >>> +that contains the configuration files of the speaker models. >>> + >>> +@item @code{max-reduction} (default: @code{7}) >>> +Maximum gain reduction before panicing, useful for debugging. >>> + >>> +@item @code{package} (default: @var{speakersafetyd}) >>> +The Speaker Safety Daemon package to use. >>> + >>> +@end table >>> +@end deftp >>> + >>> @node File Search Services >>> @subsection File Search Services >>> >>> diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm >>> index 8ca7acd737..fb8a8d3d17 100644 >>> --- a/gnu/services/sound.scm >>> +++ b/gnu/services/sound.scm >>> @@ -35,6 +35,7 @@ (define-module (gnu services sound) >>> #:use-module (gnu packages audio) >>> #:use-module (gnu packages linux) >>> #:use-module (gnu packages pulseaudio) >>> + #:use-module (gnu packages rust-apps) >>> #:use-module (ice-9 match) >>> #:use-module (srfi srfi-1) >>> #:export (alsa-configuration >>> @@ -56,7 +57,15 @@ (define-module (gnu services sound) >>> ladspa-configuration >>> ladspa-configuration? >>> ladspa-configuration-plugins >>> - ladspa-service-type)) >>> + ladspa-service-type >>> + >>> + speakersafetyd-configuration >>> + speakersafetyd-configuration-blackbox-path >>> + speakersafetyd-configuration-config-path >>> + speakersafetyd-configuration-max-reduction >>> + speakersafetyd-configuration-package >>> + speakersafetyd-configuration? >>> + speakersafetyd-service-type)) >>> >>> ;;; Commentary: >>> ;;; >>> @@ -263,4 +272,54 @@ (define ladspa-service-type >>> (default-value (ladspa-configuration)) >>> (description "Configure LADSPA plugins."))) >>> >>> + >>> +;;; >>> +;;; Speaker Safety Daemon >>> +;;; >>> + >>> +(define-record-type* >>> + speakersafetyd-configuration >>> + make-speakersafetyd-configuration >>> + speakersafetyd-configuration? >>> + (blackbox-path speakersafetyd-configuration-blackbox-path >>> + (default "/var/lib/speakersafetyd/blackbox")) >> >> Since these values are not serialized, we are free to name them the way >> we like; so they should follow the GNU and Guix conventions, namely: >> >> I'd use blackbox-directory. >> >>> + (config-path speakersafetyd-configuration-config-path >>> + (default (file-append speakersafetyd >>> "/share/speakersafetyd"))) >> >> I'd use configuration-directory. >> >>> + (max-reduction speakersafetyd-configuration-max-reduction >>> + (default 7)) >> >> I'd use maximum-gain-reduction >> >>> + (package speakersafetyd-configuration-package >>> + (default speakersafetyd))) >> >> I'd use the more conventional >> speakersafetyd-configuration-speakersafetyd (using the name of the >> package as the field name). >> >> Our related conventions here are roughly: >> >> 1. Prefer full name instead of abbreviation, especially in public APIs >> 2. Path always used to denote a multi-entries search path like 'PATH' >> and friends. Use 'file name', 'file' or 'directory' instead. >> >> It's also more conventional to use the package name for the package >> object field, so here I'd use >> 'speakersafetyd-configuration-speakersafetyd'. >> >> Could you please also use 'define-configuration/no-serialization' from >> (gnu services configuration) ? It validates the type of each field and >> produces useful user error messages in case these are incorrect. >> >>> +(define (speakersafetyd-shepherd-service config) >>> + (let ((blackbox-path (speakersafetyd-configuration-blackbox-path config)) >>> + (config-path (speakersafetyd-configuration-config-path config)) >>> + (max-reduction (speakersafetyd-configuration-max-reduction config)) >>> + (package (speakersafetyd-configuration-package config))) >> >> nitpick: I'd unbox each value using match-record; which will make things a bit >> more concise. >> >>> + (shepherd-service >>> + (documentation "Speaker saftey daemon") >> >> s/saftey/safety/ >> >>> + (provision '(speakersafetyd)) >>> + (requirement '(udev)) >>> + (start #~(make-forkexec-constructor >>> + (list #$(file-append package "/bin/speakersafetyd") >>> + "--config-path" #$config-path >>> + "--blackbox-path" #$blackbox-path >>> + "--max-reduction" (number->string #$max-reduction)))) >>> + (stop #~(make-kill-destructor))))) >>> + >>> +(define speakersafetyd-service-type >>> + (service-type >>> + (name 'speakersafetyd) >>> + (description "Speaker Saftey Daemon") >>> >> s/Saftey/Safety/ The project has a better description, which can be >> adapted to something like "@command{speakersafetyd} is a user space >> daemon that implements an analogue of the Texas Instruments Smart Amp >> speaker protection model." >> >>> + (extensions >>> + (list (service-extension >>> + profile-service-type >>> + (compose list speakersafetyd-configuration-package)) >>> + (service-extension >>> + shepherd-root-service-type >>> + (compose list speakersafetyd-shepherd-service)) >>> + (service-extension >>> + udev-service-type >>> + (compose list speakersafetyd-configuration-package)))) >>> + (default-value (speakersafetyd-configuration)))) >> >> Nitpick, but I'd order these from most critical to less critical >> ordering, such that te root service type is extended first, then the >> udev-service-type, then the profile. >> >> The rest LGTM. Could you please send a v2? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFLBAEBCAA1FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmewXaMXHHJvbWFuQGJ1 cm5pbmdzd2VsbC5jb20ACgkQPdpSUn0qwZnYXQgApaUmikCkRVWr8svzWbtlUvhK 1rox5wKYSIHvuZjCQ5tUg64gq2n+lHrenkjm2Cro3U587HYbnSymUxr5bjMXTUqB Rbbf0xXHjsJ8wmxKUDIYrmxWVJWj0CdCHojo5dCF9smynI8SaWfPYo1Gcl+wSDQn q6uHL9S8c9WPjnUb7jyyfasGuuoqdMaVuuFoCPo6IzrB8OP5cxUB+iiBOECV/Pm7 koEQ1TUoGyHfMb6HcP3n19qhwiRTtcN0gQChKUP1RxponN54e7nyDsznG53GpXZD eumiN65JW6Q8jC1XPtormq6Su/WsJYtYTxXEOX7h0oVYC/qCUl7Z8yWoTEwyug== =PM5K -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 09:35:47 2025 Received: (at 76289-done) by debbugs.gnu.org; 15 Feb 2025 14:35:47 +0000 Received: from localhost ([127.0.0.1]:54072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjJGk-00018C-EN for submit@debbugs.gnu.org; Sat, 15 Feb 2025 09:35:47 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:52579) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjJGh-00017t-H6 for 76289-done@debbugs.gnu.org; Sat, 15 Feb 2025 09:35:44 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-220d28c215eso42164495ad.1 for <76289-done@debbugs.gnu.org>; Sat, 15 Feb 2025 06:35:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739630137; x=1740234937; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nmU/OxEWfxGz8bcK3QPWxZ2hIh5cDHxYcGfohCccKYQ=; b=lQCOb3U+ANBSCmaJbxvaogUmViVbALHdhC6pv70EG7qf/92es+ks2fRwknhsu0qoKO YuUhy4eVt9WN0fDr+3qUhbTFPJeONwDHZZgDptw2UCB0Vg7+E5RHT2zT8GNiUpOiOCMX lS1RxqhDKf6deCqcqiwJCaX9HJb0IcyjxSyrx77RVPsfhsYF5n5hU96WPVFNQKmP47RN 0ng0FV1Cqc6qx37696V+SFEpO0NXyijzbfVI8SyD7BW85o0Y7nhcZffiLEn411TdhV5F xbGvdvhe+8bKvDVUke9kuAPFOOlZ/r7IsnIl5rJK74UTYudP1H7EIQVLpaf46lqmZIcS ERGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739630137; x=1740234937; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nmU/OxEWfxGz8bcK3QPWxZ2hIh5cDHxYcGfohCccKYQ=; b=BfRIX4w51WgM6bnxZ6ZDtw6jzcywSGWs95sQgdT8J3dlvRpTnynjDYCr32fg2HZrUe z0MCQY0y5bExQfcZ8j349a+BD1G6jfXBaM0Ng2cFSkni5wxe47erXfnP5aB94zik0Hrz /Mj015lxXajFV80wwnm75Gkq81yd1r5xQGjiYioOm7s0KUhZl2iHUwHaKVZb5Ajo110f JWy1DhIfBEuZEpOnZirvzMNLbwTrPN5vVxSY11tpbCkJ7Hu0vmTuwQrPMQdoDGs6KPrS 6QBoD88zaicDnBT4DVOl97HoIyhdBmumVBXbAq7iJAArrZ3dw/tfAwhyNORajUwr7rtP ueMQ== X-Gm-Message-State: AOJu0YzMRqITaauBvEM3rGYFCVwiy9KzAIaMsmtWbOlRtosizw6fJVCv Udnen7G6N9AJWTbdzl56vvPl9xTbQe1uMpsJQDulpFLTK/0oFP32 X-Gm-Gg: ASbGncuMOnHgTP4Ba4bMbuHTkgNJQ693u1LT24QxQnY9T0Co7MZAwpX4sq8pqEGIste 37k5ip0Q+nm1BHghgLLIhCWDCWDuNffSaErxt12Wfg0xmxZPzspy8ofdYl21ZqKHNyBWzBm+0wn xT1hgesNeBdUqCTFi208fkoEDA5Q2aHCvhA2uPLr+GpIpEDMrY6jsVAuCIlH5IhUcpeuI1RvCXu tzUqvVaGKhDq6DmeBY1SdB8SQkwWuBq105fi05CXsmmnon+ypuSIwf0cht5A0V1cZIQ0Db3Rd4G eLTOCksSvyVD X-Google-Smtp-Source: AGHT+IEK+Xk8lBUBk4wY7yVAInyk3erJ6yaqaVmQo+S8sMbfk145JMZn3Va2knnt4W6SrVoSgyLN5Q== X-Received: by 2002:a05:6a21:999f:b0:1ee:6444:1573 with SMTP id adf61e73a8af0-1ee8cbf7c49mr5141938637.42.1739630137284; Sat, 15 Feb 2025 06:35:37 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-adb5aa216f2sm4585642a12.69.2025.02.15.06.35.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 06:35:36 -0800 (PST) From: Maxim Cournoyer To: Roman Scherer Subject: Re: [bug#76289] [PATCH v3 2/2] services: Add speakersafetyd service. In-Reply-To: (Roman Scherer's message of "Sat, 15 Feb 2025 10:24:35 +0100") References: Date: Sat, 15 Feb 2025 23:35:24 +0900 Message-ID: <877c5r8edv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289-done Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 76289-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Roman Scherer writes: > * gnu/services/sound.scm (speakersafetyd-service-type) New variable. > * doc/guix.texi: Document the speakersafetyd service. > > Change-Id: Ib8fa19b056a2036019ae7c199d81e1139664e951 I've made the following small adjustments: --8<---------------cut here---------------start------------->8--- modified doc/guix.texi @@ -26593,6 +26593,7 @@ Sound Services See below for details about @code{speakersafetyd-configuration}. @end defvar =20 +@c %start of fragment @deftp {Data Type} speakersafetyd-configuration Available @code{speakersafetyd-configuration} fields are: =20 @@ -26608,14 +26609,14 @@ Sound Services contains the configuration files of the speaker models. =20 @item @code{maximum-gain-reduction} (default: @code{7}) (type: integer) -Maximum gain reduction before panicing, useful for debugging. +Maximum gain reduction before panicking, useful for debugging. =20 @item @code{speakersafetyd} (default: @code{speakersafetyd}) (type: file-l= ike) The Speaker Safety Daemon package to use. =20 @end table - @end deftp +@c %end of fragment =20 @node File Search Services @subsection File Search Services modified gnu/services/sound.scm @@ -3,6 +3,7 @@ ;;; Copyright =C2=A9 2020 Liliana Marie Prikler ;;; Copyright =C2=A9 2020 Marius Bakke ;;; Copyright =C2=A9 2022 Maxim Cournoyer +;;; Copyright =C2=A9 2025 Roman Scherer ;;; ;;; This file is part of GNU Guix. ;;; @@ -274,7 +275,7 @@ (define ladspa-service-type =20 ;;; -;;; Speaker Safety Daemon +;;; Speaker Safety Daemon. ;;; =20 (define-configuration/no-serialization speakersafetyd-configuration @@ -289,7 +290,7 @@ (define-configuration/no-serialization speakersafetyd-c= onfiguration the configuration files of the speaker models.") (maximum-gain-reduction (integer 7) - "Maximum gain reduction before panicing, useful for debugging.") + "Maximum gain reduction before panicking, useful for debugging.") (speakersafetyd (file-like speakersafetyd) "The Speaker Safety Daemon package to use.")) --8<---------------cut here---------------end--------------->8--- And expound the changelog a bit to: --8<---------------cut here---------------start------------->8--- services: Add speakersafetyd service. * gnu/services/sound.scm (speakersafetyd-shepherd-service) (speakersafetyd-configuration) (speakersafetyd-service-type): New variables. * doc/guix.texi (Sound Services): Document it. --8<---------------cut here---------------end--------------->8--- And pushed as commit af643735a5. Thank you for your contribution! Closing by replying to 76289-done@debbugs.gnu.org in CC. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 09:37:42 2025 Received: (at 76289-done) by debbugs.gnu.org; 15 Feb 2025 14:37:42 +0000 Received: from localhost ([127.0.0.1]:54083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjJIb-0001Bk-QE for submit@debbugs.gnu.org; Sat, 15 Feb 2025 09:37:42 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:56420) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjJIO-0001B1-FK for 76289-done@debbugs.gnu.org; Sat, 15 Feb 2025 09:37:29 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-220d132f16dso44771455ad.0 for <76289-done@debbugs.gnu.org>; Sat, 15 Feb 2025 06:37:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739630242; x=1740235042; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=JIs6p8SdwSI2LmgNFPGaX/1Uj5JIbiecBhigAYN59/E=; b=lDTjdGVdglhYnjm7kYiwOQVYgYmn/T/xRrG2gvSDW20/NMXfLfuRs2LqxxOCTTvhf+ Fp3NRFMGK3dXlMdRQaEoanH4jYjTHV9Vip0xQNwXBfORJ/3FFbQEOwqoguccboLvwu8f 0lCAYqCzv+oAEh0AqR6fycCv84JM2GIpruqSetM1ngaIiXIWLDEdAw+oSY369A+HP/6r AsK1L2akmRfDSrKK5pLDk3eb4RRdO1DsuUs3B7nFsuajm2lb1lSp+c/PMGyHTX2yziuL A9U02ZLquXfBKr/qdy367PGYBjVG34eEc32v8euVNRcuJF840Zr8B59foz9Pl2ZnTn5d PFQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739630242; x=1740235042; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JIs6p8SdwSI2LmgNFPGaX/1Uj5JIbiecBhigAYN59/E=; b=AiGBYYhR7OZ8GvkWTaNLiHRB+DATCWaiJV5Zb9bPdghLcaN2YMoMDjcXlycO2jGMc8 +Q0RhCVjHCQKKO3gqJvwTwHP73COVXSbewVlVBYTElmaHVlCvMINp0eAWHfFtPKAZdSA kgYhQ+u7UFed8X7GkDlbe/AiFdz00tFDB/45Mkw3PK7OyKebzJlAobFOEU209T1Sng+y d20kf57ireA8vWf0hO2zcvIymXTp7/g/z4RwZTKsswPRo5CcxtMH6g/6+Yuols4/qsJ+ tP+oS2fJQvHeIzIEi3++mgLLjGCJYPWfdE5SJhehdOrKZcEEL1vTJHzMKwfvzi78aQy7 P5eA== X-Gm-Message-State: AOJu0YyPSY62w2NZUqkJshP5zxdDUkBgiacfC84Ojrmlo36AeadI1Y/S 1wqK+nSyoLb2nrYImlOAo9OARZs4nqXmYm3mNPhv2iJzAD/JxboH/7gxRw== X-Gm-Gg: ASbGncvAOiMmIeWBAZN9oBYh9CK9gMJH8owkjXDsBIOgBVbI8vomA8yYfZfflrES+vA 3Uyjpi/EnjSk90aQZy/N3K0gwNO3Dl9f+F0W8ev45T34NIbfMJz6uhn//CL4z83lzDQzIwVW6pF R3vyS13GUe2tM4gGsWFN+Z7x8si9ztCYCnKYf6K6cL6BFKCvk5UZKiuSnq6F7ZWfTJXuxops+/d LL15g98xEdpk4ZM1s2I/9yDM0/HracQD8Nm4HmkXY47Tp1gpv5afE0DyCd6qPLrWby5GXNcREMG F2QTGF9l4v00 X-Google-Smtp-Source: AGHT+IGY7RUwIlQaia/WXmt3ogDrzVJPL9kKBkpmdqE43hHW0DZ3cbNx7ubj0aN/8JZlhkqkZJhkjg== X-Received: by 2002:a05:6a20:1590:b0:1e0:dcc5:164d with SMTP id adf61e73a8af0-1ee8caac86amr6381928637.8.1739630242399; Sat, 15 Feb 2025 06:37:22 -0800 (PST) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-adcd481d902sm2371204a12.21.2025.02.15.06.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 06:37:21 -0800 (PST) From: Maxim Cournoyer To: Roman Scherer Subject: Re: [bug#76289] [PATCH 2/2] services: Add speakersafetyd service. In-Reply-To: <86a5an5zks.fsf@burningswell.com> (Roman Scherer's message of "Sat, 15 Feb 2025 10:25:55 +0100") References: <6bdfd356508e8f643f2c63cb796548f36e0abb87.1739540583.git.roman@burningswell.com> <87r0409fal.fsf@gmail.com> <877c5rtvpy.fsf@burningswell.com> <86a5an5zks.fsf@burningswell.com> Date: Sat, 15 Feb 2025 23:37:09 +0900 Message-ID: <8734gf8eay.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289-done Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , efraim@flashner.co.il, 76289-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Roman, Roman Scherer writes: [...] >> thanks for your review. I hope I addressed your comments. Additionally: >> >> - I used the configuration->documentation command to generate >> documentation from the configuration record That's how it's currently intended to be used (more automation would be welcome :-)) >> - I discovered match-record-lambda and use this instead of match-record Neat, I ddn't know about it. >> Could you have another look please? It's now merged. -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 09:47:14 2025 Received: (at 76289-done) by debbugs.gnu.org; 15 Feb 2025 14:47:14 +0000 Received: from localhost ([127.0.0.1]:54097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjJRq-0001dN-3K for submit@debbugs.gnu.org; Sat, 15 Feb 2025 09:47:14 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:55543) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tjJRi-0001ck-4V for 76289-done@debbugs.gnu.org; Sat, 15 Feb 2025 09:47:11 -0500 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5ded1395213so4552348a12.2 for <76289-done@debbugs.gnu.org>; Sat, 15 Feb 2025 06:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20230601.gappssmtp.com; s=20230601; t=1739630820; x=1740235620; darn=debbugs.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=U71pV3YyT69qeBa3+IQXG+wleyg5GxHRfzLIDHzzCjo=; b=dtWWBiClXjfqhBJqXSf3apER/1arH6Mbsc/46tOK5pG2KylDhqdt+l282EeRW9QnC3 i2UxM94BuZy5B0e3CskUn+9X7hmrKLN/GqUrXrFJsBWqNOVLfNgFINzERdh0FsL/OQWQ ELY5fka+aEwRGE22LYjvBQvCzcrAR7oLXQHDGlxSuEhmDNkKdPviWA741vUSolTuU/lG dLgPgcQyDlOJKilo8Z0zDL/XryerDQldth3dPuygMCiO4Nd6mLsLSFWZwT+W9zw0g6vU NHOLi+2NHT9bOszMSgxQSnaisQGcj3VKuCUaA91Z1jva3SGTfr70fFTHlZAERFaY2SM4 SsLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739630820; x=1740235620; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=U71pV3YyT69qeBa3+IQXG+wleyg5GxHRfzLIDHzzCjo=; b=vyZq0H2ktpgkGqS90rElTOZLNgqcb7AlRPGIivQ1zRJIw5LRNGpBISneuXKh3ER/p7 kIMT6jh8YWQAX2aPCdPlBiaWIdZ7OgJjHPBhl/cvPs0jaSDeTkKFQY69FR3PorWdYrpB ILnginKoyRD3W1xohg6eEwvTF+6BvoWYa4mqlItJwN2Z1m7VHB5dJqUwytRaInLXYbNH ONUYIZz3AbWopgMtwOALilklTEj2SZ8NnZnNR58Q5HzjTiIX0g7J9ImBffsEraZcCkt5 4EgedZYrz1UFGW/IbruawMLxsEDrwPPBxh1ngol3Vi8MXEIxulec3gKdAZhRk3wvBoJd n8hg== X-Forwarded-Encrypted: i=1; AJvYcCW7pZdd9+YzVE5D/daxENKCOeMms5jrAxl6mcyqUaXi0IVqDNZEMXbAXYpfK02tYeHda6TzV9l34whx@debbugs.gnu.org X-Gm-Message-State: AOJu0YzYZwwaZxYol6TmKA5dWviztTIbYcrqZbeXkxnVqWp8Z11ZWrwW eRRr3ecYN66si6hvNCAQfxKUyAttuY9nR4MKw/dhXVReFZp9rCyBe3TaMrlm4FQ= X-Gm-Gg: ASbGncvxUYeI/fej61RWA/PkWLyRu+ZG/ge/gtNCNNAF47M21kztWgdVHLXp4kwRV1d KW+8C/5DXiptFzwu/KBTagF0I4h/JM3ftdl+EAy0lv1+6hgFT7YZcBy1xRgGcaLDe8vJqvoHl2u c3p1f4NvFdt3OnOlDwFLHawVWy/alcmC8pZUYQAdYmXgwyuNlAAJpWFskm6r4rV57NNQ3bFHAve K9C4umxCwKyY60fDJO7jRDnGhs/5NRtC0YQhaHvnzZ3iEGqWNYBwrKIhwJB8Gk8qveHKIahQZ7z hVUX/dE= X-Google-Smtp-Source: AGHT+IEpe3CEAmUhpvr1TABTmtroVR0yrA9vzSne12qLuwne1zf5torVAx7/bJUc2ae/ffTqsujjjw== X-Received: by 2002:a17:906:4fd0:b0:ab7:be81:8940 with SMTP id a640c23a62f3a-abb70a79a0amr248243566b.10.1739630819746; Sat, 15 Feb 2025 06:46:59 -0800 (PST) Received: from m1 ([2a01:599:10b:f79:d63b:6274:c334:5aad]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abb87d47501sm20142766b.115.2025.02.15.06.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2025 06:46:59 -0800 (PST) From: Roman Scherer To: Maxim Cournoyer Subject: Re: [bug#76289] [PATCH 2/2] services: Add speakersafetyd service. In-Reply-To: <8734gf8eay.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 15 Feb 2025 23:37:09 +0900") References: <6bdfd356508e8f643f2c63cb796548f36e0abb87.1739540583.git.roman@burningswell.com> <87r0409fal.fsf@gmail.com> <877c5rtvpy.fsf@burningswell.com> <86a5an5zks.fsf@burningswell.com> <8734gf8eay.fsf@gmail.com> User-Agent: mu4e 1.12.8; emacs 29.4 Date: Sat, 15 Feb 2025 15:46:55 +0100 Message-ID: <86wmdrb6zk.fsf@burningswell.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76289-done Cc: Roman Scherer , Ludovic =?utf-8?Q?Court=C3=A8s?= , efraim@flashner.co.il, 76289-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi Maxim, Maxim Cournoyer writes: > Hi Roman, > > Roman Scherer writes: > > [...] > >>> thanks for your review. I hope I addressed your comments. Additionally: >>> >>> - I used the configuration->documentation command to generate >>> documentation from the configuration record > > That's how it's currently intended to be used (more automation would be > welcome :-)) +1 >>> - I discovered match-record-lambda and use this instead of match-record > > Neat, I ddn't know about it. > >>> Could you have another look please? > > It's now merged. Nice, thank you! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFLBAEBCAA1FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmewqN8XHHJvbWFuQGJ1 cm5pbmdzd2VsbC5jb20ACgkQPdpSUn0qwZkkPQf9EyhXNpcT8Ht5P1ivR1S5BS7o Its9Rx/qLh32uPsiayFHz4YLpKH5j+ahfsYWnXExm6GdDEPHoD/DkOxVexncCOzp 4cl/CjWkos45FoQaLM2uJKntdKOwFfVcSwXvMccDAUSTHksYQrJ2YSL2fzQf3hrB B/jEhiDn+eoARKJs5d4wPK74MNfhVfCL4wkkyeYMOuS9ehhhzhdElb65fdjBhEC0 XdsFBkiWNybn7edlq5R4MQBrxWknfgwfc1DjbFMjYgbMNCQqzgHHf43eKup6Cun3 rRFo1m0flF0j/FSbHWIely/IZ/bsBEVKwFTRoQjgrpEJDqm79Eu6XVe6kdVGXg== =FCdT -----END PGP SIGNATURE----- --=-=-=-- From unknown Wed Jun 18 00:26:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 16 Mar 2025 11:24:30 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator