From 7a069112054fbb5dc94a857e9c020a38cb1c6fde Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Fri, 31 Oct 2014 15:35:41 +0300 Subject: [PATCH] Fix for alsaequal-0.6-r2 dmix. ALSA lib ctl_equal.c:268:(_snd_ctl_equal_open) Problem with control file .alsaequal.bin, 3. cannot open mixer: Operation not permitted https://bugs.gentoo.org/show_bug.cgi?id=499298 --- media-plugins/alsaequal/Manifest | 1 + .../alsaequal/alsaequal-0.6-r2.ebuild | 47 +++++++++++++ .../files/alsaequal-0.6-asneeded.patch | 16 +++++ .../files/alsaequal-0.6-eq-name.patch | 63 +++++++++++++++++ .../alsaequal/files/alsaequal-0.6-mixer.patch | 68 +++++++++++++++++++ profiles/desktop/package.mask | 2 - profiles/server/package.mask | 2 - 7 files changed, 195 insertions(+), 4 deletions(-) create mode 100644 media-plugins/alsaequal/Manifest create mode 100644 media-plugins/alsaequal/alsaequal-0.6-r2.ebuild create mode 100644 media-plugins/alsaequal/files/alsaequal-0.6-asneeded.patch create mode 100644 media-plugins/alsaequal/files/alsaequal-0.6-eq-name.patch create mode 100644 media-plugins/alsaequal/files/alsaequal-0.6-mixer.patch diff --git a/media-plugins/alsaequal/Manifest b/media-plugins/alsaequal/Manifest new file mode 100644 index 00000000..d61f8f1f --- /dev/null +++ b/media-plugins/alsaequal/Manifest @@ -0,0 +1 @@ +DIST alsaequal-0.6.tar.bz2 23562 SHA256 916e7d152added24617efc350142438a46099efe062bd8781d36dbf10b4e6ff0 SHA512 53a73469682eb7b641849151d4e91a3ac031daa5f11f7ad328bdd0bcf5251112814c75d27dceb8baf8582c749bf80f055414397259d24b749e7edbc03472bc6a WHIRLPOOL 991467670e6913829b402d6ba46b019317bcc49f98c45620ee2501c950d7b655c72a5dd65a76e68c59b4f2bbedc9c2c4a78d00a6b80bbfd34a37d8845eb43d85 diff --git a/media-plugins/alsaequal/alsaequal-0.6-r2.ebuild b/media-plugins/alsaequal/alsaequal-0.6-r2.ebuild new file mode 100644 index 00000000..5f6f344c --- /dev/null +++ b/media-plugins/alsaequal/alsaequal-0.6-r2.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-plugins/alsaequal/alsaequal-0.6-r2.ebuild,v 1.4 2014/08/10 12:59:02 nativemad Exp $ + +EAPI=5 +inherit eutils multilib toolchain-funcs multilib-minimal + +DESCRIPTION="a real-time adjustable equalizer plugin for ALSA" +HOMEPAGE="http://www.thedigitalmachine.net/alsaequal.html" +SRC_URI="http://www.thedigitalmachine.net/tools/${P}.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="" + +RDEPEND=">=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] + >=media-plugins/caps-plugins-0.9.15[${MULTILIB_USEDEP}] + abi_x86_32? ( !<=app-emulation/emul-linux-x86-soundlibs-20130224-r3 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)] )" +DEPEND="${RDEPEND}" + +S=${WORKDIR}/${PN} +DOCS=( README ) + +src_prepare() { + epatch "${FILESDIR}"/${P}-asneeded.patch + epatch "${FILESDIR}"/${P}-eq-name.patch + epatch "${FILESDIR}"/${P}-mixer.patch + multilib_copy_sources +} + +multilib_src_compile() { + emake \ + CC="$(tc-getCC)" \ + CFLAGS="${CFLAGS} -Wall -fPIC -DPIC" \ + LD="$(tc-getCC)" \ + LDFLAGS="${LDFLAGS} -shared" \ + Q= \ + SND_PCM_LIBS="-lasound" \ + SND_CTL_LIBS="-lasound" || die +} + +multilib_src_install() { + exeinto /usr/$(get_libdir)/alsa-lib + doexe *.so || die +} diff --git a/media-plugins/alsaequal/files/alsaequal-0.6-asneeded.patch b/media-plugins/alsaequal/files/alsaequal-0.6-asneeded.patch new file mode 100644 index 00000000..50a95e6a --- /dev/null +++ b/media-plugins/alsaequal/files/alsaequal-0.6-asneeded.patch @@ -0,0 +1,16 @@ +--- Makefile ++++ Makefile +@@ -29,11 +29,11 @@ + + $(SND_PCM_BIN): $(SND_PCM_OBJECTS) + @echo LD $@ +- $(Q)$(LD) $(LDFLAGS) $(SND_PCM_LIBS) $(SND_PCM_OBJECTS) -o $(SND_PCM_BIN) ++ $(Q)$(LD) $(LDFLAGS) $(SND_PCM_OBJECTS) -o $(SND_PCM_BIN) $(SND_PCM_LIBS) + + $(SND_CTL_BIN): $(SND_CTL_OBJECTS) + @echo LD $@ +- $(Q)$(LD) $(LDFLAGS) $(SND_CTL_LIBS) $(SND_CTL_OBJECTS) -o $(SND_CTL_BIN) ++ $(Q)$(LD) $(LDFLAGS) $(SND_CTL_OBJECTS) -o $(SND_CTL_BIN) $(SND_CTL_LIBS) + + %.o: %.c + @echo GCC $< diff --git a/media-plugins/alsaequal/files/alsaequal-0.6-eq-name.patch b/media-plugins/alsaequal/files/alsaequal-0.6-eq-name.patch new file mode 100644 index 00000000..7317214b --- /dev/null +++ b/media-plugins/alsaequal/files/alsaequal-0.6-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 +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 + . + +@@ -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/media-plugins/alsaequal/files/alsaequal-0.6-mixer.patch b/media-plugins/alsaequal/files/alsaequal-0.6-mixer.patch new file mode 100644 index 00000000..fb98c976 --- /dev/null +++ b/media-plugins/alsaequal/files/alsaequal-0.6-mixer.patch @@ -0,0 +1,68 @@ +diff -Nur b/ctl_equal.c a/ctl_equal.c +--- b/ctl_equal.c 2009-01-31 23:06:47.000000000 +0100 ++++ a/ctl_equal.c 2014-09-15 16:14:37.218286376 +0200 +@@ -263,7 +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] != ++ if((equal->klass->PortDescriptors[index] & ++ (LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) != + (LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) { + SNDERR("Problem with control file %s, %d.", controls, index); + return -1; +@@ -284,12 +285,14 @@ + } + + /* Make sure that the control file makes sense */ +- if(equal->klass->PortDescriptors[equal->control_data->input_index] != ++ if((equal->klass->PortDescriptors[equal->control_data->input_index] & ++ (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO))!= + (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) { + SNDERR("Problem with control file %s.", controls); + return -1; + } +- if(equal->klass->PortDescriptors[equal->control_data->output_index] != ++ if((equal->klass->PortDescriptors[equal->control_data->output_index] & ++ (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO))!= + (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) { + SNDERR("Problem with control file %s.", controls); + return -1; +diff -Nur b/ladspa_utils.c a/ladspa_utils.c +--- b/ladspa_utils.c 2009-01-31 22:57:41.000000000 +0100 ++++ a/ladspa_utils.c 2014-09-15 16:18:49.061293401 +0200 +@@ -354,10 +354,12 @@ + default_controls->control[index].type = LADSPA_CNTRL_OUTPUT; + } + index++; +- } else if(psDescriptor->PortDescriptors[i] == ++ } else if((psDescriptor->PortDescriptors[i] & ++ (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) == + (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) { + default_controls->input_index = i; +- } else if(psDescriptor->PortDescriptors[i] == ++ } else if((psDescriptor->PortDescriptors[i] & ++ (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) == + (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) { + default_controls->output_index = i; + } +diff -Nur b/pcm_equal.c a/pcm_equal.c +--- b/pcm_equal.c 2010-02-01 23:55:00.000000000 +0100 ++++ a/pcm_equal.c 2014-09-15 16:21:32.892297971 +0200 +@@ -231,12 +231,14 @@ + } + + /* Make sure that the control file makes sense */ +- if(equal->klass->PortDescriptors[equal->control_data->input_index] != ++ if((equal->klass->PortDescriptors[equal->control_data->input_index] & ++ (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) != + (LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) { + SNDERR("Problem with control file %s.", controls); + return -1; + } +- if(equal->klass->PortDescriptors[equal->control_data->output_index] != ++ if((equal->klass->PortDescriptors[equal->control_data->output_index] & ++ (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) != + (LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) { + SNDERR("Problem with control file %s.", controls); + return -1; diff --git a/profiles/desktop/package.mask b/profiles/desktop/package.mask index a1b455b9..2e18272d 100644 --- a/profiles/desktop/package.mask +++ b/profiles/desktop/package.mask @@ -1,7 +1,5 @@ >=media-fonts/liberation-fonts-2.00.0 >=gnome-base/gsettings-desktop-schemas-3.10.1 ->=media-plugins/caps-plugins-0.9.10 # brokes alsaequal ->=media-plugins/alsaequal-0.6-r1 =dev-lisp/gcl-2.6.11 # long compilation time # Waiting for udev to be fully populated diff --git a/profiles/server/package.mask b/profiles/server/package.mask index ea3361ae..262fdc56 100644 --- a/profiles/server/package.mask +++ b/profiles/server/package.mask @@ -1,5 +1,3 @@ ->=media-plugins/caps-plugins-0.9.10 # brokes alsaequal ->=media-plugins/alsaequal-0.6-r1 =dev-python/routes-2.0 # blocks upgrade of sys-cluster/nova # Waiting for udev to be fully populated