Patchwork [3/3] alsaequal: new package

login
register
mail settings
Submitter Martin Bark
Date April 24, 2014, 9:19 p.m.
Message ID <1398374384-8814-3-git-send-email-martin@barkynet.com>
Download mbox | patch
Permalink /patch/342481/
State Changes Requested
Headers show

Comments

Martin Bark - April 24, 2014, 9:19 p.m.
Alsaequal is a real-time adjustable equalizer plugin for ALSA. It
can be adjusted using an ALSA compatible mixer, like alsamixergui
or alsamixer.

Alsaequal uses the Eq CAPS LADSPA Plugin as it's default
equalizer.

Signed-off-by: Martin Bark <martin@barkynet.com>
---
 package/Config.in                                  |    1 +
 package/alsaequal/Config.in                        |   19 ++++++
 .../alsaequal/alsaequal-01-cross-compile-fix.patch |   17 ++++++
 package/alsaequal/alsaequal-05_fix-eq-name.patch   |   63 ++++++++++++++++++++
 .../alsaequal/alsaequal-06_fix-caps-error.patch    |   20 +++++++
 package/alsaequal/alsaequal.mk                     |   22 +++++++
 package/alsaequal/readme.txt                       |   59 ++++++++++++++++++
 7 files changed, 201 insertions(+)
 create mode 100644 package/alsaequal/Config.in
 create mode 100644 package/alsaequal/alsaequal-01-cross-compile-fix.patch
 create mode 100644 package/alsaequal/alsaequal-05_fix-eq-name.patch
 create mode 100644 package/alsaequal/alsaequal-06_fix-caps-error.patch
 create mode 100644 package/alsaequal/alsaequal.mk
 create mode 100644 package/alsaequal/readme.txt
Thomas Petazzoni - Aug. 4, 2014, 8:32 p.m.
Dear Martin Bark,

On Thu, 24 Apr 2014 22:19:44 +0100, Martin Bark wrote:

> diff --git a/package/alsaequal/alsaequal-01-cross-compile-fix.patch b/package/alsaequal/alsaequal-01-cross-compile-fix.patch
> new file mode 100644
> index 0000000..6133106
> --- /dev/null
> +++ b/package/alsaequal/alsaequal-01-cross-compile-fix.patch
> @@ -0,0 +1,17 @@

Description + Signed-off-by.

> +--- alsaequal-0.6.original/Makefile	2010-03-05 17:30:39.000000000 +0000
> ++++ alsaequal-0.6/Makefile	2014-04-24 16:25:59.468030181 +0100
> +@@ -4,10 +4,10 @@
> + #Q	?=
> + 
> + # Build Tools
> +-CC 	:= gcc
> +-CFLAGS := -I. -O2 -Wall -funroll-loops -ffast-math -fPIC -DPIC
> +-LD := gcc
> +-LDFLAGS := -O2 -Wall -shared -lasound
> ++CC 	?= gcc
> ++CFLAGS += -I. -Wall -ffast-math -fPIC -DPIC
> ++LD := $(CC)
> ++LDFLAGS := -shared -lasound
> + 
> + SND_PCM_OBJECTS = pcm_equal.o ladspa_utils.o
> + SND_PCM_LIBS =
> diff --git a/package/alsaequal/alsaequal-05_fix-eq-name.patch b/package/alsaequal/alsaequal-05_fix-eq-name.patch

Should be alsaequal-02-fix-eq-name.patch (notice the sequence number
and the difference between - and _).

Also description + Signed-off-by.


> diff --git a/package/alsaequal/alsaequal.mk b/package/alsaequal/alsaequal.mk
> new file mode 100644
> index 0000000..5669b55
> --- /dev/null
> +++ b/package/alsaequal/alsaequal.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +#
> +# alsaequal
> +#
> +################################################################################
> +
> +ALSAEQUAL_VERSION = 0.6
> +ALSAEQUAL_SOURCE = alsaequal-$(ALSAEQUAL_VERSION).tar.bz2
> +ALSAEQUAL_SITE = http://www.thedigitalmachine.net/tools/
> +ALSAEQUAL_LICENSE = LGPLv2.1
> +ALSAEQUAL_LICENSE_FILES = COPYING
> +ALSAEQUAL_DEPENDENCIES = alsa-lib
> +
> +define ALSAEQUAL_BUILD_CMDS
> +	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) all
> +endef
> +
> +define ALSAEQUAL_INSTALL_TARGET_CMDS
> +	$(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR)
> +endef

Same comments here for $(TARGET_MAKE_ENV) and $(TARGET_CONFIGURE_OPTS)
as the ones made on the 'caps' package.

So there's really no build dependency on ladspa or caps in alsaequal ?

Like the ladspa-sdk and caps patches, I've marked this one as
"Changes requested" in our patch tracking system. Could you resubmit an
updated version of those patches?

Thanks a lot!

Thomas
Martin Bark - Aug. 5, 2014, 8:52 p.m.
Thomas,

On 04/08/14 21:32, Thomas Petazzoni wrote:
> Dear Martin Bark,
>
> On Thu, 24 Apr 2014 22:19:44 +0100, Martin Bark wrote:
>
>> diff --git a/package/alsaequal/alsaequal-01-cross-compile-fix.patch b/package/alsaequal/alsaequal-01-cross-compile-fix.patch
>> new file mode 100644
>> index 0000000..6133106
>> --- /dev/null
>> +++ b/package/alsaequal/alsaequal-01-cross-compile-fix.patch
>> @@ -0,0 +1,17 @@
>
> Description + Signed-off-by.

Some of these patches are copies from debian patches hence they lack the 
description and Signed-off-by.  I'll fix this and resubmit.

>
>> +--- alsaequal-0.6.original/Makefile	2010-03-05 17:30:39.000000000 +0000
>> ++++ alsaequal-0.6/Makefile	2014-04-24 16:25:59.468030181 +0100
>> +@@ -4,10 +4,10 @@
>> + #Q	?=
>> +
>> + # Build Tools
>> +-CC 	:= gcc
>> +-CFLAGS := -I. -O2 -Wall -funroll-loops -ffast-math -fPIC -DPIC
>> +-LD := gcc
>> +-LDFLAGS := -O2 -Wall -shared -lasound
>> ++CC 	?= gcc
>> ++CFLAGS += -I. -Wall -ffast-math -fPIC -DPIC
>> ++LD := $(CC)
>> ++LDFLAGS := -shared -lasound
>> +
>> + SND_PCM_OBJECTS = pcm_equal.o ladspa_utils.o
>> + SND_PCM_LIBS =
>> diff --git a/package/alsaequal/alsaequal-05_fix-eq-name.patch b/package/alsaequal/alsaequal-05_fix-eq-name.patch
>
> Should be alsaequal-02-fix-eq-name.patch (notice the sequence number
> and the difference between - and _).
>
> Also description + Signed-off-by.

I'll fix that

>
>
>> diff --git a/package/alsaequal/alsaequal.mk b/package/alsaequal/alsaequal.mk
>> new file mode 100644
>> index 0000000..5669b55
>> --- /dev/null
>> +++ b/package/alsaequal/alsaequal.mk
>> @@ -0,0 +1,22 @@
>> +################################################################################
>> +#
>> +# alsaequal
>> +#
>> +################################################################################
>> +
>> +ALSAEQUAL_VERSION = 0.6
>> +ALSAEQUAL_SOURCE = alsaequal-$(ALSAEQUAL_VERSION).tar.bz2
>> +ALSAEQUAL_SITE = http://www.thedigitalmachine.net/tools/
>> +ALSAEQUAL_LICENSE = LGPLv2.1
>> +ALSAEQUAL_LICENSE_FILES = COPYING
>> +ALSAEQUAL_DEPENDENCIES = alsa-lib
>> +
>> +define ALSAEQUAL_BUILD_CMDS
>> +	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) all
>> +endef
>> +
>> +define ALSAEQUAL_INSTALL_TARGET_CMDS
>> +	$(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR)
>> +endef
>
> Same comments here for $(TARGET_MAKE_ENV) and $(TARGET_CONFIGURE_OPTS)
> as the ones made on the 'caps' package.
>
> So there's really no build dependency on ladspa or caps in alsaequal ?

alsaequal loads the caps 10 band equaliser at runtime hence caps is not 
a build dependency but is a dependency in Config.in.

>
> Like the ladspa-sdk and caps patches, I've marked this one as
> "Changes requested" in our patch tracking system. Could you resubmit an
> updated version of those patches?

Yes I’ll resubmit patches

>
> Thanks a lot!
>
> Thomas
>

Thanks

Martin
Thomas Petazzoni - Aug. 6, 2014, 8 a.m.
Dear Martin Bark,

On Tue, 05 Aug 2014 21:52:58 +0100, Martin Bark wrote:

> > Description + Signed-off-by.
> 
> Some of these patches are copies from debian patches hence they lack the 
> description and Signed-off-by.  I'll fix this and resubmit.

No problem with patches coming from Debian, but please indicate where
they are coming from.

> > Same comments here for $(TARGET_MAKE_ENV) and $(TARGET_CONFIGURE_OPTS)
> > as the ones made on the 'caps' package.
> >
> > So there's really no build dependency on ladspa or caps in alsaequal ?
> 
> alsaequal loads the caps 10 band equaliser at runtime hence caps is not 
> a build dependency but is a dependency in Config.in.

Ok. Maybe put a comment about this somewhere in the Config.in or .mk
file.

Thanks!

Thomas

Patch

diff --git a/package/Config.in b/package/Config.in
index 33d16ac..4f0d61c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -489,6 +489,7 @@  endmenu
 menu "Libraries"
 
 menu "Audio/Sound"
+source "package/alsaequal/Config.in"
 source "package/alsa-lib/Config.in"
 source "package/audiofile/Config.in"
 source "package/caps/Config.in"
diff --git a/package/alsaequal/Config.in b/package/alsaequal/Config.in
new file mode 100644
index 0000000..857e4d0
--- /dev/null
+++ b/package/alsaequal/Config.in
@@ -0,0 +1,19 @@ 
+config BR2_PACKAGE_ALSAEQUAL
+	bool "alsaequal"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib
+	select BR2_PACKAGE_ALSA_LIB
+	select BR2_PACKAGE_CAPS # Runtime dependency
+	help
+	  Alsaequal is a real-time adjustable equalizer plugin for ALSA. It
+	  can be adjusted using an ALSA compatible mixer, like alsamixergui
+	  or alsamixer.
+
+	  Alsaequal uses the Eq CAPS LADSPA Plugin as it's default
+	  equalizer.
+
+	  http://www.thedigitalmachine.net/alsaequal.html
+
+comment "alsaequal needs a toolchain w/ C++, threads"
+	depends on !BR2_INSTALL_LIBSTDCPP
+	depends on !BR2_TOOLCHAIN_HAS_THREADS # alsa-lib
diff --git a/package/alsaequal/alsaequal-01-cross-compile-fix.patch b/package/alsaequal/alsaequal-01-cross-compile-fix.patch
new file mode 100644
index 0000000..6133106
--- /dev/null
+++ b/package/alsaequal/alsaequal-01-cross-compile-fix.patch
@@ -0,0 +1,17 @@ 
+--- alsaequal-0.6.original/Makefile	2010-03-05 17:30:39.000000000 +0000
++++ alsaequal-0.6/Makefile	2014-04-24 16:25:59.468030181 +0100
+@@ -4,10 +4,10 @@
+ #Q	?=
+ 
+ # Build Tools
+-CC 	:= gcc
+-CFLAGS := -I. -O2 -Wall -funroll-loops -ffast-math -fPIC -DPIC
+-LD := gcc
+-LDFLAGS := -O2 -Wall -shared -lasound
++CC 	?= gcc
++CFLAGS += -I. -Wall -ffast-math -fPIC -DPIC
++LD := $(CC)
++LDFLAGS := -shared -lasound
+ 
+ SND_PCM_OBJECTS = pcm_equal.o ladspa_utils.o
+ SND_PCM_LIBS =
diff --git a/package/alsaequal/alsaequal-05_fix-eq-name.patch b/package/alsaequal/alsaequal-05_fix-eq-name.patch
new file mode 100644
index 0000000..7317214
--- /dev/null
+++ b/package/alsaequal/alsaequal-05_fix-eq-name.patch
@@ -0,0 +1,63 @@ 
+Description: Fix CAPS Eq plugin name
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/721355
+Forwarded: no
+Author: Alessandro Ghedini <ghedo@debian.org>
+Last-Update: 2013-08-30
+
+--- a/ctl_equal.c
++++ b/ctl_equal.c
+@@ -167,7 +167,7 @@
+ 	snd_ctl_equal_t *equal;
+ 	const char *controls = ".alsaequal.bin";
+ 	const char *library = "/usr/lib/ladspa/caps.so";
+-	const char *module = "Eq";
++	const char *module = "Eq10";
+ 	long channels = 2;
+ 	const char *sufix = " Playback Volume";
+ 	int err, i, index;
+--- a/pcm_equal.c
++++ b/pcm_equal.c
+@@ -151,7 +151,7 @@
+ 	snd_config_t *sconf = NULL;
+ 	const char *controls = ".alsaequal.bin";
+ 	const char *library = "/usr/lib/ladspa/caps.so";
+-	const char *module = "Eq";
++	const char *module = "Eq10";
+ 	long channels = 2;
+ 	int err;
+ 	
+--- a/README
++++ b/README
+@@ -1,11 +1,11 @@
+ Alsaequal is a real-time adjustable equalizer plugin for ALSA. It can
+ be adjusted using any ALSA compatible mixer, e.g. alsamixergui.
+ 
+-Alsaequal uses the Eq CAPS LADSPA Plugin for audio processing, actually
++Alsaequal uses the Eq10 CAPS LADSPA Plugin for audio processing, actually
+ alsaequal is a generic LADSPA plugin interface with real-time access to
+ the LADSPA controls (the LADSPA plugin included with alsa doesn't allow
+ for real-time controls) but it was developed for and only tested with
+-Eq CAPS LADSPA plugin. You are welcome to try it with other plugins, it
++Eq10 CAPS LADSPA plugin. You are welcome to try it with other plugins, it
+ may work. Let me know how it goes, you can reach me at
+ <charles@thedigitalmachine.net>.
+ 
+@@ -66,7 +66,7 @@
+ 	library -- location of the LADSPA library, the default is
+ 					"/usr/lib/ladspa/caps.so"
+ 	module -- module name within the LADSPA library, the deafault
+-					is "Eq"
++					is "Eq10"
+ 	channels -- number of channels, the default is 2
+ }
+ 
+@@ -81,7 +81,7 @@
+ 	library -- location of the LADSPA library, the default is
+ 					"/usr/lib/ladspa/caps.so"
+ 	module -- module name within the LADSPA library, the deafault
+-					is "Eq"
++					is "Eq10"
+ 	channels -- number of channels, the default is 2
+ }
+ 
diff --git a/package/alsaequal/alsaequal-06_fix-caps-error.patch b/package/alsaequal/alsaequal-06_fix-caps-error.patch
new file mode 100644
index 0000000..85e205f
--- /dev/null
+++ b/package/alsaequal/alsaequal-06_fix-caps-error.patch
@@ -0,0 +1,20 @@ 
+Description: Fix a spurious error with newer caps versions
+Origin: vendor, https://aur.archlinux.org/packages/alsaequal/?comments=all
+Forwarded: no
+Author: Alessandro Ghedini <ghedo@debian.org>
+Last-Update: 2013-08-30
+Applied-Upstream: *** FIXME ***
+
+--- a/ctl_equal.c
++++ b/ctl_equal.c
+@@ -263,8 +263,8 @@
+ 	for(i = 0; i < equal->num_input_controls; i++) {
+ 		if(equal->control_data->control[i].type == LADSPA_CNTRL_INPUT) {
+ 			index = equal->control_data->control[i].index;
+-			if(equal->klass->PortDescriptors[index] !=
+-					(LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) {
++			if((equal->klass->PortDescriptors[index] &
++					(LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) == 0) {
+ 				SNDERR("Problem with control file %s, %d.", controls, index);
+ 				return -1;
+ 			}
diff --git a/package/alsaequal/alsaequal.mk b/package/alsaequal/alsaequal.mk
new file mode 100644
index 0000000..5669b55
--- /dev/null
+++ b/package/alsaequal/alsaequal.mk
@@ -0,0 +1,22 @@ 
+################################################################################
+#
+# alsaequal
+#
+################################################################################
+
+ALSAEQUAL_VERSION = 0.6
+ALSAEQUAL_SOURCE = alsaequal-$(ALSAEQUAL_VERSION).tar.bz2
+ALSAEQUAL_SITE = http://www.thedigitalmachine.net/tools/
+ALSAEQUAL_LICENSE = LGPLv2.1
+ALSAEQUAL_LICENSE_FILES = COPYING
+ALSAEQUAL_DEPENDENCIES = alsa-lib
+
+define ALSAEQUAL_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) all
+endef
+
+define ALSAEQUAL_INSTALL_TARGET_CMDS
+	$(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR)
+endef
+
+$(eval $(generic-package))
diff --git a/package/alsaequal/readme.txt b/package/alsaequal/readme.txt
new file mode 100644
index 0000000..579706d
--- /dev/null
+++ b/package/alsaequal/readme.txt
@@ -0,0 +1,59 @@ 
+
+Alsaequal is a real-time adjustable equalizer plugin for ALSA. It
+can be adjusted using an ALSA compatible mixer, like alsamixergui
+or alsamixer.
+
+For example, add the following line to /etc/asound.conf
+
+ctl.equal {
+    type equal;
+}
+
+pcm.plugequal {
+    type equal;
+    slave.pcm "plughw:0,0";
+}
+
+pcm.equal{
+    type plug;
+    slave.pcm plugequal;
+}
+
+you can now adjust the 10 band equaliser using
+
+    alsamixer -D equal
+
+and then play using
+
+    aplay -D equal some_audio.wav
+
+By default alsaequal uses the 10 band equaliser (Eq10) from the alsa
+ladspa plugin caps.  You can bypass alsaequal and directly use caps in
+/etc/asound.conf. This can be useful if you want to fix the equaliser
+settings.
+
+Add the following lines to /etc/asound.conf to add a fixed 10 band
+equaliser setup to attenuate frequencies below 500Hz
+
+pcm.plugequal_fixed {
+    type equal;
+    slave.pcm "plughw:0,0";
+}
+
+pcm.equal_fixed {
+    type ladspa
+    slave.pcm plugequal_fixed;
+    path "/usr/lib/ladspa";
+    plugins [{
+        label Eq10
+        input {
+            # bands (Hz)   31   63   125  250  500  1000 2000 4000 8000 16000
+            controls     [ -48  -48  -48  -48  -48  0    0    0    0    0     ]
+        }
+    }]
+}
+
+
+Further reading:
+    http://alsa.opensrc.org/Ladspa_(plugin)
+    http://quitte.de/dsp/caps.html#Eq10