From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fX2X1-00022r-T7 for guix-patches@gnu.org; Sun, 24 Jun 2018 06:46:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fX2Wx-00058w-0s for guix-patches@gnu.org; Sun, 24 Jun 2018 06:46:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:54015) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fX2Ww-00058m-Pc for guix-patches@gnu.org; Sun, 24 Jun 2018 06:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fX2Ww-0008Cy-F5 for guix-patches@gnu.org; Sun, 24 Jun 2018 06:46:02 -0400 Subject: [bug#31934] [PATCH] services: sound: Properly handle alsa-plugins. Resent-Message-ID: From: Oleg Pykhalov References: <87a7rkhdg2.fsf@member.fsf.org> Date: Sun, 24 Jun 2018 13:44:54 +0300 In-Reply-To: <87a7rkhdg2.fsf@member.fsf.org> ("=?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?="'s message of "Sun, 24 Jun 2018 15:05:17 +0800") Message-ID: <87h8lso449.fsf_-_@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Cc: 31934@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, iyzsong@member.fsf.org (=E5=AE=8B=E6=96=87=E6=AD=A6) writes: > Julien Lepiller writes: [=E2=80=A6] > Hello, after some hours of searching... I found that we can use the > 'lib' option in 'pcm_type' and 'ctl_type' to specify the library path > for alsa plugins, e.g: Thats a nice hack :-) Thank you for working on this. [=E2=80=A6] > So I think we can make our 'alsa-service' do this, instead of patching > alsa-lib for 'ALSA_PLUGIN_DIR'. Done. Here is a patch which I tested on my machine by =E2=80=98system reco= nfigure=E2=80=99: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-services-sound-Properly-handle-alsa-plugins.patch Content-Transfer-Encoding: quoted-printable Content-Description: services: sound: Properly handle alsa-plugins. From=2022186e76d991a47e7057d1abe23af02b52f8153b Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Sun, 24 Jun 2018 13:18:53 +0300 Subject: [PATCH] services: sound: Properly handle alsa-plugins. * gnu/services/sound.scm ()[alsa-plugins]: New field. (alsa-config-file): Add this. * doc/guix.texi (Sound Services): Document this. =2D-- doc/guix.texi | 3 +++ gnu/services/sound.scm | 31 +++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 74c10e4bb..e5366ac6b 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -13152,6 +13152,9 @@ See below for details about @code{alsa-configuratio= n}. Data type representing the configuration for @code{alsa-service}. =20 @table @asis +@item @code{alsa-plugins} (default: @var{alsa-plugins}) +@code{alsa-plugins} package to use. + @item @code{pulseaudio?} (default: @var{#t}) Whether ALSA applications should transparently be made to use the @uref{http://www.pulseaudio.org/, PulseAudio} sound server. diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 5fe555e8b..2b2cabd7b 100644 =2D-- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -26,6 +26,7 @@ #:use-module (guix packages) #:use-module (guix records) #:use-module (guix store) + #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) #:use-module (ice-9 match) #:export (alsa-configuration @@ -44,17 +45,31 @@ =20 (define-record-type* alsa-configuration make-alsa-configuration alsa-configuration? + (alsa-plugins alsa-configuration-alsa-plugins ; + (default alsa-plugins)) (pulseaudio? alsa-configuration-pulseaudio? ;boolean (default #t)) (extra-options alsa-configuration-extra-options ;string (default ""))) =20 =2D(define (alsa-config-file config) =2D "Return the ALSA configuration file corresponding to CONFIG." =2D (plain-file "asound.conf" =2D (string-append "# Generated by 'alsa-service'.\n\n" =2D (if (alsa-configuration-pulseaudio? config) =2D "# Use PulseAudio by default +(define alsa-config-file + ;; Return the ALSA configuration file. + (match-lambda + (($ alsa-plugins pulseaudio? extra-options) + (mixed-text-file "asound.conf" + "# Generated by 'alsa-service'.\n\n" + ;; if pulseaudio? + "# Use PulseAudio by default +pcm_type.pulse { + lib " #~(string-append #$alsa-plugins:pulseaudio + "/lib/alsa-lib/libasound_module_pcm_pulse.so") " +} + +ctl_type.pulse { + lib " #~(string-append #$alsa-plugins:pulseaudio + "/lib/alsa-lib/libasound_module_ctl_pulse.so") " +} + pcm.!default { type pulse fallback \"sysdefault\" @@ -69,8 +84,8 @@ ctl.!default { fallback \"sysdefault\" } " =2D "") =2D (alsa-configuration-extra-options config)))) + "" + extra-options)))) =20 (define (alsa-etc-service config) (list `("asound.conf" ,(alsa-config-file config)))) =2D-=20 2.17.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E2=80=A6] Thanks, Oleg. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlsvdiYACgkQckbhHGm3 lWkXRBAAtMY8dLzFehiyGG7b17MavQyrMQu7Jn/jIbCvVJ4gJwv7inPb9OptrsIH TCTSG9+1XkJpOoMNmnHXiMue3aJjcxNt8yKU1tZmkkvrooGrPyueKAw0ZnVcGVl+ Bfeni9wr37L+knLRpG+ooM6xxqvd0TAM/58UjEOHLLmdfHiGEsey1fwb1CrJ9Z5n 1HkApb4ZQMlR52N0oZOvic/jH0sUKxTuoI4IEhqy0JrI3HKBtZHti4tmI/0bQtdJ dc77+ps5eVQnFuRxXxGshdOtTXNQudKdfvCxl5DYs4M18n9kWL4l4CCz0nBrWbgO lgm8pcHF9r/O2iQNd6nKqr1vkhwJ9gfsc9F+Uh9XymZUVPDXmYoCh9rSy0kJrNt2 4yDftWyhDWrv3tulurWbcMBPJj4juwQWkr8QOFins5y7Wv3DrxvtcPXvVtVRIu31 Qb9F6wSK/roQJMje99X0N99mptBN6A2ydicfWW3JYcWc2OJ+O0oewf2IPH+vsurr 3+1LM6qUIE2HhuToIunYZ+r350zdgXvucLmU1V8vsnM5RqjjgPLc9C//T/8UtTb4 nQiQto0qs8WpjDG2+2RqEe/Um0YQwsFrFYC82XtRh2fun2oz7LYzs1nPaUZGUjmD 06QDc+bUlGWqeop6Hafum6TlKSSZt4gFku/upYfuiK8HkfZBK3Q= =Jupb -----END PGP SIGNATURE----- --==-=-=--