GNU bug report logs - #38941
[PATCH 0/5] Support fluidsynth and opus in sdl(2)-mixer, and other tweaks

Previous Next

Package: guix-patches;

Reported by: Timotej Lazar <timotej.lazar <at> araneo.si>

Date: Sun, 5 Jan 2020 10:37:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38941 in the body.
You can then email your comments to 38941 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Sun, 05 Jan 2020 10:37:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timotej Lazar <timotej.lazar <at> araneo.si>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 05 Jan 2020 10:37:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/5] Support fluidsynth and opus in sdl(2)-mixer,
 and other tweaks
Date: Sun, 05 Jan 2020 11:36:34 +0100
Hi,

these patches improve sdl- and sdl2-mixer: fix dependencies and
configure flags that changed between the two versions, and enable
support for fluidsynth and opus libraries. I tested several dependent
packages, and everything seems to work OK.

The MIDI backends need additional runtime configuration. Fluidsynth
requires a soundfont to be installed and specified when running a
program that uses sdl-mixer, e.g.:

    SDL_SOUNDFONTS=/gnu/store/…-fluid-3-2.1/share/soundfonts/FluidR3Mono_GM.sf3

If this is not set, the bundled timidity backend is used, which can use
the freepats samples. Configuration must be specified since only files
under /etc are checked by default, e.g.:

    TIMIDITY_CFG=/gnu/store/…-freepats-20060219/share/freepats/freepats.cfg

I’m not sure if and how default values for these vars can be specified
for all programs using sdl-mixer, and I would prefer to leave the choice
of backend to the user anyway. However, we should probably document them
somewhere. Would a comment be enough? Dependent packages can then wrap
binaries to set required paths if needed.

Alternatively we can add freepats and/or fluid as inputs to sdl(2)-mixer
and patch the source to look for them in the store.

Thanks!
Timotej

Timotej Lazar (5):
  gnu: sdl-mixer: Use correct inputs for MOD file support.
  gnu: sdl-mixer: Remove unused configure flag.
  gnu: sdl2-mixer: Fix configure flags.
  gnu: sdl-mixer: Enable fluidsynth MIDI backend.
  gnu: sdl2-mixer: Enable opus support.

 gnu/packages/sdl.scm | 49 +++++++++++++++++++++++++++++---------------
 1 file changed, 33 insertions(+), 16 deletions(-)

-- 
2.24.1




Information forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Sun, 05 Jan 2020 10:47:01 GMT) Full text and rfc822 format available.

Message #8 received at 38941 <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: 38941 <at> debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar <at> araneo.si>
Subject: [PATCH 1/5] gnu: sdl-mixer: Use correct inputs for MOD file support.
Date: Sun,  5 Jan 2020 11:45:47 +0100
Only one MOD backend is compiled, so specify (only) the correct inputs:
libmikmod for sdl-mixer and libmodplug for sdl2-mixer.

* gnu/packages/sdl.scm (sdl-mixer)[inputs]: Remove libmodplug.
* gnu/packages/sdl.scm (sdl2-mixer)[inputs]: Add libmodplug.
---
 gnu/packages/sdl.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index f7a34003d1..beeec1b8ca 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2019 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
 ;;; Copyright © 2019 Marius Bakke <mbakke <at> fastmail.com>
 ;;; Copyright © 2019 Pierre Neidhardt <mail <at> ambrevar.xyz>
+;;; Copyright © 2020 Timotej Lazar <timotej.lazar <at> araneo.si>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -274,8 +275,7 @@ WEBP, XCF, XPM, and XV.")
     (inputs `(("libvorbis" ,libvorbis)
               ("libflac" ,flac)
               ("libmad" ,libmad)
-              ("libmikmod" ,libmikmod)
-              ("libmodplug" ,libmodplug)))
+              ("libmikmod" ,libmikmod)))
     ;; FIXME: Add libfluidsynth
     (propagated-inputs `(("sdl" ,sdl)))
     (synopsis "SDL multi-channel audio mixer library")
@@ -416,6 +416,10 @@ directory.")
                    #t))
        (sha256
         (base32 "0694vsz5bjkcdgfdra6x9fq8vpzrl8m6q96gh58df7065hw5mkxl"))))
+    (inputs
+     ;; The default MOD library changed in SDL2 mixer.
+     `(("libmodplug" ,libmodplug)
+       ,@(alist-delete "libmikmod" (package-inputs sdl-mixer))))
     (propagated-inputs
      (propagated-inputs-with-sdl2 sdl-mixer))))
 
-- 
2.24.1





Information forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Sun, 05 Jan 2020 10:47:02 GMT) Full text and rfc822 format available.

Message #11 received at 38941 <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: 38941 <at> debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar <at> araneo.si>
Subject: [PATCH 2/5] gnu: sdl-mixer: Remove unused configure flag.
Date: Sun,  5 Jan 2020 11:45:48 +0100
The flag --disable-music-mp3-shared is only used when building with smpeg
instead of libmad, which is linked at build time by default.

* gnu/packages/sdl.scm (sdl-mixer)[arguments]: Remove unused configure flag.
---
 gnu/packages/sdl.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index beeec1b8ca..92d8f9a922 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -270,8 +270,7 @@ WEBP, XCF, XPM, and XV.")
                                      "--disable-music-mod-shared"
                                      "--disable-music-fluidsynth-shared"
                                      "--disable-music-ogg-shared"
-                                     "--disable-music-flac-shared"
-                                     "--disable-music-mp3-shared")))
+                                     "--disable-music-flac-shared")))
     (inputs `(("libvorbis" ,libvorbis)
               ("libflac" ,flac)
               ("libmad" ,libmad)
-- 
2.24.1





Information forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Sun, 05 Jan 2020 10:47:02 GMT) Full text and rfc822 format available.

Message #14 received at 38941 <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: 38941 <at> debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar <at> araneo.si>
Subject: [PATCH 3/5] gnu: sdl2-mixer: Fix configure flags.
Date: Sun,  5 Jan 2020 11:45:49 +0100
Some configure options were renamed between SDL / SDL2 mixer; add new variants
to the derived package.

* gnu/packages/sdl.scm (sdl2-mixer)[arguments]: Fix flags to disable dynamic
  library loading.
---
 gnu/packages/sdl.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index 92d8f9a922..d441040cd6 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -415,6 +415,15 @@ directory.")
                    #t))
        (sha256
         (base32 "0694vsz5bjkcdgfdra6x9fq8vpzrl8m6q96gh58df7065hw5mkxl"))))
+    (arguments
+      (substitute-keyword-arguments (package-arguments sdl-mixer)
+         ((#:configure-flags flags)
+          `(cons*
+            ;; These options were renamed in SDL2 mixer. Keeping the inherited
+            ;; variants produces a harmless warning.
+            "--disable-music-mod-modplug-shared"
+            "--disable-music-midi-fluidsynth-shared"
+            ,flags))))
     (inputs
      ;; The default MOD library changed in SDL2 mixer.
      `(("libmodplug" ,libmodplug)
-- 
2.24.1





Information forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Sun, 05 Jan 2020 10:47:03 GMT) Full text and rfc822 format available.

Message #17 received at 38941 <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: 38941 <at> debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar <at> araneo.si>
Subject: [PATCH 4/5] gnu: sdl-mixer: Enable fluidsynth MIDI backend.
Date: Sun,  5 Jan 2020 11:45:50 +0100
* gnu/packages/sdl.scm (sdl-mixer)[inputs]: Add fluidsynth and alphabetize.
[arguments]: Reformat.
---
 gnu/packages/sdl.scm | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index d441040cd6..80f3da9327 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -262,20 +262,21 @@ WEBP, XCF, XPM, and XV.")
                 "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n"))))
     (build-system gnu-build-system)
     (outputs '("out" "debug"))
-    ;; no check target
-    ;; use libmad instead of smpeg
-    ;; explicitly link against shared libraries instead of dlopening them
-    (arguments `(#:tests? #f
-                 #:configure-flags '("--enable-music-mp3-mad-gpl"
-                                     "--disable-music-mod-shared"
-                                     "--disable-music-fluidsynth-shared"
-                                     "--disable-music-ogg-shared"
-                                     "--disable-music-flac-shared")))
-    (inputs `(("libvorbis" ,libvorbis)
-              ("libflac" ,flac)
-              ("libmad" ,libmad)
-              ("libmikmod" ,libmikmod)))
-    ;; FIXME: Add libfluidsynth
+    (arguments
+     `(#:tests? #f ; No check target.
+       #:configure-flags
+       '("--enable-music-mp3-mad-gpl" ; Use libmad instead of smpeg.
+         ;; Explicitly link against shared libraries instead of dlopening them.
+         "--disable-music-flac-shared"
+         "--disable-music-fluidsynth-shared"
+         "--disable-music-mod-shared"
+         "--disable-music-ogg-shared")))
+    (inputs
+     `(("fluidsynth" ,fluidsynth)
+       ("libflac" ,flac)
+       ("libmad" ,libmad)
+       ("libmikmod" ,libmikmod)
+       ("libvorbis" ,libvorbis)))
     (propagated-inputs `(("sdl" ,sdl)))
     (synopsis "SDL multi-channel audio mixer library")
     (description "SDL_mixer is a multi-channel audio mixer library for SDL.
-- 
2.24.1





Information forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Sun, 05 Jan 2020 10:47:03 GMT) Full text and rfc822 format available.

Message #20 received at 38941 <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: 38941 <at> debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar <at> araneo.si>
Subject: [PATCH 5/5] gnu: sdl2-mixer: Enable opus support.
Date: Sun,  5 Jan 2020 11:45:51 +0100
* gnu/packages/sdl.scm (sdl2-mixer)[inputs]: Add opusfile.
  [native-inputs]: Add pkg-config.
  [arguments]: Link opusfile at build time.
---
 gnu/packages/sdl.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index 80f3da9327..80725561fb 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -420,15 +420,19 @@ directory.")
       (substitute-keyword-arguments (package-arguments sdl-mixer)
          ((#:configure-flags flags)
           `(cons*
+            "--disable-music-opus-shared"
             ;; These options were renamed in SDL2 mixer. Keeping the inherited
             ;; variants produces a harmless warning.
             "--disable-music-mod-modplug-shared"
             "--disable-music-midi-fluidsynth-shared"
             ,flags))))
     (inputs
-     ;; The default MOD library changed in SDL2 mixer.
-     `(("libmodplug" ,libmodplug)
+     `(("opusfile" ,opusfile)
+       ;; The default MOD library changed in SDL2 mixer.
+       ("libmodplug" ,libmodplug)
        ,@(alist-delete "libmikmod" (package-inputs sdl-mixer))))
+    (native-inputs
+     `(("pkgconfig" ,pkg-config))) ; Needed to find the opus library.
     (propagated-inputs
      (propagated-inputs-with-sdl2 sdl-mixer))))
 
-- 
2.24.1





Information forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Sun, 05 Jan 2020 12:24:02 GMT) Full text and rfc822 format available.

Message #23 received at 38941 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Timotej Lazar <timotej.lazar <at> araneo.si>
Cc: 38941 <at> debbugs.gnu.org, Ricardo Wurmus <rekado <at> elephly.net>
Subject: Re: [bug#38941] [PATCH 0/5] Support fluidsynth and opus in
 sdl(2)-mixer, and other tweaks
Date: Sun, 5 Jan 2020 13:23:44 +0100
[Message part 1 (text/plain, inline)]
Hi,

thanks for the patches!

On Sun, 05 Jan 2020 11:36:34 +0100
Timotej Lazar <timotej.lazar <at> araneo.si> wrote:

> The MIDI backends need additional runtime configuration. Fluidsynth
> requires a soundfont to be installed and specified when running a
> program that uses sdl-mixer, e.g.:
> 
>     SDL_SOUNDFONTS=/gnu/store/…-fluid-3-2.1/share/soundfonts/FluidR3Mono_GM.sf3
> 
> If this is not set, the bundled timidity backend is used, which can use
> the freepats samples. Configuration must be specified since only files
> under /etc are checked by default, e.g.:
> 
>     TIMIDITY_CFG=/gnu/store/…-freepats-20060219/share/freepats/freepats.cfg

> I’m not sure if and how default values for these vars can be specified
> for all programs using sdl-mixer, and I would prefer to leave the choice
> of backend to the user anyway.

> However, we should probably document them somewhere. Would a comment be enough?

Let's put it in the description of the sdl-mixer package.
After all, it would document the usage of an interface that sdl-mixer provides.

> Dependent packages can then wrap
> binaries to set required paths if needed.
> 
> Alternatively we can add freepats and/or fluid as inputs to sdl(2)-mixer
> and patch the source to look for them in the store.

How often is it that a user switches MIDI soundfonts?

Does a user expect a default soundfont?

That would tell us whether we should provide such a default (and increase
the closure size of sdl2-mixer considerably, maybe?).

There's also a procedure "sdl-union" which already does sdl magic.  We could
also add some stuff for MIDI there, maybe.

In the mean time, I've applied your patchset to master since it only adds
functionality and only has few dependents.

Could you provide an update to the description or similar as a patch?
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Mon, 06 Jan 2020 11:13:01 GMT) Full text and rfc822 format available.

Message #26 received at 38941 <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 38941 <at> debbugs.gnu.org, Ricardo Wurmus <rekado <at> elephly.net>
Subject: Re: [bug#38941] [PATCH 0/5] Support fluidsynth and opus in
 sdl(2)-mixer, and other tweaks
Date: Mon, 06 Jan 2020 12:12:36 +0100
Danny Milosavljevic <dannym <at> scratchpost.org> [2020-01-05 13:23:44+0100]:
> Let's put it in the description of the sdl-mixer package.
> After all, it would document the usage of an interface that sdl-mixer provides.

OK, I sent a patch describing runtime setup for MIDI playback.

> How often is it that a user switches MIDI soundfonts?
>
> Does a user expect a default soundfont?
>
> That would tell us whether we should provide such a default (and increase
> the closure size of sdl2-mixer considerably, maybe?).

The packages `freepats` and `fluid-3` are 31.9 and 13.9 MiB
respectively. I think that the best solution would be to include them as
inputs to packages that use sdl-mixer to actually play MIDI files. I did
so for CorsixTH (patch submitted), which was also the reason for the
sdl-mixer patches. :)

Thank you for the feedback!




Information forwarded to guix-patches <at> gnu.org:
bug#38941; Package guix-patches. (Sun, 13 Dec 2020 12:58:02 GMT) Full text and rfc822 format available.

Message #29 received at 38941 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Timotej Lazar <timotej.lazar <at> araneo.si>
Cc: 38941 <at> debbugs.gnu.org
Subject: Re: [bug#38941] [PATCH 0/5] Support fluidsynth and opus in
 sdl(2)-mixer, and other tweaks
Date: Sun, 13 Dec 2020 12:57:43 +0000
[Message part 1 (text/plain, inline)]
Timotej Lazar <timotej.lazar <at> araneo.si> writes:

> Hi,
>
> these patches improve sdl- and sdl2-mixer: fix dependencies and
> configure flags that changed between the two versions, and enable
> support for fluidsynth and opus libraries. I tested several dependent
> packages, and everything seems to work OK.
>
> The MIDI backends need additional runtime configuration. Fluidsynth
> requires a soundfont to be installed and specified when running a
> program that uses sdl-mixer, e.g.:
>
>     SDL_SOUNDFONTS=/gnu/store/…-fluid-3-2.1/share/soundfonts/FluidR3Mono_GM.sf3
>
> If this is not set, the bundled timidity backend is used, which can use
> the freepats samples. Configuration must be specified since only files
> under /etc are checked by default, e.g.:
>
>     TIMIDITY_CFG=/gnu/store/…-freepats-20060219/share/freepats/freepats.cfg
>
> I’m not sure if and how default values for these vars can be specified
> for all programs using sdl-mixer, and I would prefer to leave the choice
> of backend to the user anyway. However, we should probably document them
> somewhere. Would a comment be enough? Dependent packages can then wrap
> binaries to set required paths if needed.
>
> Alternatively we can add freepats and/or fluid as inputs to sdl(2)-mixer
> and patch the source to look for them in the store.
>
> Thanks!
> Timotej
>
> Timotej Lazar (5):
>   gnu: sdl-mixer: Use correct inputs for MOD file support.
>   gnu: sdl-mixer: Remove unused configure flag.
>   gnu: sdl2-mixer: Fix configure flags.
>   gnu: sdl-mixer: Enable fluidsynth MIDI backend.
>   gnu: sdl2-mixer: Enable opus support.
>
>  gnu/packages/sdl.scm | 49 +++++++++++++++++++++++++++++---------------
>  1 file changed, 33 insertions(+), 16 deletions(-)

Hi,

I think these patches might have been merged, so I'm going to close this
issue. If this is incorrect, just let me know!

Thanks,

Chris
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Sun, 13 Dec 2020 13:02:01 GMT) Full text and rfc822 format available.

Notification sent to Timotej Lazar <timotej.lazar <at> araneo.si>:
bug acknowledged by developer. (Sun, 13 Dec 2020 13:02:02 GMT) Full text and rfc822 format available.

Message #34 received at 38941-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 38941-done <at> debbugs.gnu.org
Subject: Re: [bug#38941] [PATCH 0/5] Support fluidsynth and opus in
 sdl(2)-mixer, and other tweaks
Date: Sun, 13 Dec 2020 13:01:21 +0000



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 11 Jan 2021 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.