Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FL-608: alsa-pluigns/pulseaudio. allow to use custom asoundrc

  • Loading branch information...
commit 663b08f1c46fa22a797b0c5330ebbae9263a6b75 1 parent 5f13c76
@angryvincent angryvincent authored
View
2  media-plugins/alsa-plugins/Manifest
@@ -0,0 +1,2 @@
+DIST alsa-plugins-1.0.26.tar.bz2 361017 SHA256 03515134d2009db4dfb2769e0ab0e1fb517c8140ffdfd64a984be968e81c9f1f SHA512 3307e3712e2a8a418db9430889cf0b328d09d083d6b9a59b64b59515fc6d6262c3a8b7d32bcdb8f2cb21a0c52072a7264fb4a3066cdc2cf1bd7c8654c7a15919 WHIRLPOOL 1b32dd78b8ce3b0dadba8e0283d7e909bd4c8ca6f2106687315f182d1fe5a27bd627028f3e4ceb3fed42fa638a257c6ebe1846657236e95ed87e81e8566f7494
+DIST alsa-plugins-1.0.27.tar.bz2 363593 SHA256 0bbd0c37c2dd7baf16363afb2e58169ffb0f9c0a70031b3b6235594630f3ab35 SHA512 73c2010b66022429bc664bdab1c03694dfd669260dea569e32496bc6e10a11a0da2dd87db6a661ab1376f3aa59f1df8a84cb48ff1d20bb064756c655203f9993 WHIRLPOOL 4487734e0377c880a46df6f7fa53d86a7c38fa3d4bd35e06d128c0ec2b99c789ed64674b59003d8bd0abce2db53301234e467d235532ea145ddb150919cb49af
View
95 media-plugins/alsa-plugins/alsa-plugins-1.0.26-r1.ebuild
@@ -0,0 +1,95 @@
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+MY_P=${P/_/}
+
+inherit autotools eutils base flag-o-matic multilib
+
+DESCRIPTION="ALSA extra plugins"
+HOMEPAGE="http://www.alsa-project.org/"
+SRC_URI="mirror://alsaproject/plugins/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="*"
+IUSE="debug ffmpeg jack libsamplerate pulseaudio speex"
+
+RDEPEND=">=media-libs/alsa-lib-${PV}
+ ffmpeg? ( virtual/ffmpeg )
+ jack? ( >=media-sound/jack-audio-connection-kit-0.98 )
+ libsamplerate? ( media-libs/libsamplerate )
+ pulseaudio? ( media-sound/pulseaudio )
+ speex? ( media-libs/speex )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.0.19-missing-avutil.patch
+ "${FILESDIR}"/${PN}-1.0.23-automagic.patch
+ "${FILESDIR}"/${PN}-1.0.25-avcodec54.patch
+ "${FILESDIR}"/${P}-libav9.patch #443258
+)
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ base_src_prepare
+
+ # For some reasons the polyp/pulse plugin does fail with alsaplayer with a
+ # failed assert. As the code works just fine with asserts disabled, for now
+ # disable them waiting for a better solution.
+ sed -i \
+ -e '/AM_CFLAGS/s:-Wall:-DNDEBUG -Wall:' \
+ pulse/Makefile.am || die
+
+ eautoreconf
+}
+
+src_configure() {
+ use debug || append-cppflags -DNDEBUG
+
+ local myspeex=no
+ use speex && myspeex=lib
+
+ econf \
+ $(use_enable ffmpeg avcodec) \
+ $(use_enable jack) \
+ $(use_enable libsamplerate samplerate) \
+ $(use_enable pulseaudio) \
+ --with-speex=${myspeex}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ cd doc
+ dodoc upmix.txt vdownmix.txt README-pcm-oss
+ use jack && dodoc README-jack
+ use libsamplerate && dodoc samplerate.txt
+ use ffmpeg && dodoc lavcrate.txt a52.txt
+
+ if use pulseaudio; then
+ dodoc README-pulse
+ # install ALSA configuration files
+ # making PA to be used by alsa clients
+ insinto /usr/share/alsa
+ doins "${FILESDIR}"/pulse-default.conf
+ insinto /usr/share/alsa/alsa.conf.d
+ doins "${FILESDIR}"/51-pulseaudio-probe.conf
+ sed -i \
+ -e "s:/lib/:/$(get_libdir)/:" \
+ "${ED}"/usr/share/alsa/alsa.conf.d/51-pulseaudio-probe.conf || die #410261
+ fi
+
+ prune_libtool_files --all
+}
+
+pkg_postinst() {
+ if use pulseaudio; then
+ einfo "The PulseAudio device is now set as the default device if the"
+ einfo "PulseAudio server is found to be running. Any custom"
+ einfo "configuration in /etc/asound.conf or ~/.asoundrc for this"
+ einfo "purpose should now be unnecessary."
+ fi
+}
View
88 media-plugins/alsa-plugins/alsa-plugins-1.0.27-r1.ebuild
@@ -0,0 +1,88 @@
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit autotools eutils flag-o-matic multilib
+
+DESCRIPTION="ALSA extra plugins"
+HOMEPAGE="http://www.alsa-project.org/"
+SRC_URI="mirror://alsaproject/plugins/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~*"
+IUSE="debug ffmpeg jack libsamplerate pulseaudio speex"
+
+RDEPEND=">=media-libs/alsa-lib-${PV}
+ ffmpeg? ( virtual/ffmpeg )
+ jack? ( >=media-sound/jack-audio-connection-kit-0.98 )
+ libsamplerate? ( media-libs/libsamplerate )
+ pulseaudio? ( media-sound/pulseaudio )
+ speex? ( media-libs/speex )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-1.0.19-missing-avutil.patch \
+ "${FILESDIR}"/${PN}-1.0.23-automagic.patch
+
+ epatch_user
+
+ # For some reasons the polyp/pulse plugin does fail with alsaplayer with a
+ # failed assert. As the code works just fine with asserts disabled, for now
+ # disable them waiting for a better solution.
+ sed -i \
+ -e '/AM_CFLAGS/s:-Wall:-DNDEBUG -Wall:' \
+ pulse/Makefile.am || die
+
+ eautoreconf
+}
+
+src_configure() {
+ use debug || append-cppflags -DNDEBUG
+
+ local myspeex=no
+ use speex && myspeex=lib
+
+ econf \
+ $(use_enable ffmpeg avcodec) \
+ $(use_enable jack) \
+ $(use_enable libsamplerate samplerate) \
+ $(use_enable pulseaudio) \
+ --with-speex=${myspeex}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ cd doc
+ dodoc upmix.txt vdownmix.txt README-pcm-oss
+ use jack && dodoc README-jack
+ use libsamplerate && dodoc samplerate.txt
+ use ffmpeg && dodoc lavcrate.txt a52.txt
+
+ if use pulseaudio; then
+ dodoc README-pulse
+ # install ALSA configuration files
+ # making PA to be used by alsa clients
+ insinto /usr/share/alsa
+ doins "${FILESDIR}"/pulse-default.conf
+ insinto /usr/share/alsa/alsa.conf.d
+ doins "${FILESDIR}"/51-pulseaudio-probe.conf
+ sed -i \
+ -e "s:/lib/:/$(get_libdir)/:" \
+ "${ED}"/usr/share/alsa/alsa.conf.d/51-pulseaudio-probe.conf || die #410261
+ fi
+
+ prune_libtool_files --all
+}
+
+pkg_postinst() {
+ if use pulseaudio; then
+ einfo "The PulseAudio device is now set as the default device if the"
+ einfo "PulseAudio server is found to be running. Any custom"
+ einfo "configuration in /etc/asound.conf or ~/.asoundrc for this"
+ einfo "purpose should now be unnecessary."
+ fi
+}
+
View
17 media-plugins/alsa-plugins/files/51-pulseaudio-probe.conf
@@ -0,0 +1,17 @@
+# PulseAudio alsa plugin configuration file to set the pulseaudio plugin as
+# default output for applications using alsa when pulseaudio is running.
+
+hook_func.pulse_load_if_running {
+ lib "/usr/lib/alsa-lib/libasound_module_conf_pulse.so"
+ func "conf_pulse_hook_load_if_running"
+}
+
+@hooks [
+ {
+ func pulse_load_if_running
+ files [
+ "/usr/share/alsa/pulse-default.conf"
+ ]
+ errors false
+ }
+]
View
11 media-plugins/alsa-plugins/files/alsa-plugins-1.0.19-missing-avutil.patch
@@ -0,0 +1,11 @@
+--- configure.in_old 2009-01-26 21:46:07.000000000 +0100
++++ configure.in 2009-01-26 21:47:25.000000000 +0100
+@@ -67,7 +67,7 @@
+ AS_HELP_STRING([--disable-avcodec], [Don't build plugins depending on avcodec (a52)]))
+
+ if test "x$enable_avcodec" != "xno"; then
+- PKG_CHECK_MODULES(AVCODEC, [libavcodec], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no])
++ PKG_CHECK_MODULES(AVCODEC, [libavcodec libavutil], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no])
+ fi
+
+ if test "x$HAVE_AVCODEC" = "xno"; then
View
12 media-plugins/alsa-plugins/files/alsa-plugins-1.0.23-automagic.patch
@@ -0,0 +1,12 @@
+diff -uNr alsa-plugins-1.0.23.ORIg//Makefile.am alsa-plugins-1.0.23/Makefile.am
+--- alsa-plugins-1.0.23.ORIg//Makefile.am 2010-04-16 23:38:58.546243512 +0100
++++ alsa-plugins-1.0.23/Makefile.am 2010-04-16 23:39:20.049278487 +0100
+@@ -17,7 +17,7 @@
+ if HAVE_PPH
+ SUBDIRS += pph
+ endif
+-if HAVE_SPEEXDSP
++if USE_LIBSPEEX
+ SUBDIRS += speex
+ endif
+
View
31 media-plugins/alsa-plugins/files/alsa-plugins-1.0.25-avcodec54.patch
@@ -0,0 +1,31 @@
+Index: alsa-plugins-1.0.25/a52/pcm_a52.c
+===================================================================
+--- alsa-plugins-1.0.25.orig/a52/pcm_a52.c
++++ alsa-plugins-1.0.25/a52/pcm_a52.c
+@@ -444,13 +444,13 @@ static int a52_prepare(snd_pcm_ioplug_t
+ #if LIBAVCODEC_VERSION_MAJOR > 52 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 3)
+ switch (io->channels) {
+ case 2:
+- rec->avctx->channel_layout = CH_LAYOUT_STEREO;
++ rec->avctx->channel_layout = AV_CH_LAYOUT_STEREO;
+ break;
+ case 4:
+- rec->avctx->channel_layout = CH_LAYOUT_QUAD;
++ rec->avctx->channel_layout = AV_CH_LAYOUT_QUAD;
+ break;
+ case 6:
+- rec->avctx->channel_layout = CH_LAYOUT_5POINT1;
++ rec->avctx->channel_layout = AV_CH_LAYOUT_5POINT1;
+ break;
+ default:
+ break;
+@@ -702,7 +702,9 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52)
+ rec->channels = channels;
+ rec->format = format;
+
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,0,0)
+ avcodec_init();
++#endif
+ avcodec_register_all();
+
+ rec->codec = avcodec_find_encoder_by_name("ac3_fixed");
View
34 media-plugins/alsa-plugins/files/alsa-plugins-1.0.26-libav9.patch
@@ -0,0 +1,34 @@
+Author: Reinhard Tartler <siretart@ubuntu.com>
+Description: Update to newer libav API - compatible to libav 0.8 and libav 9
+
+Index: alsa-plugins-1.0.26/a52/pcm_a52.c
+===================================================================
+--- alsa-plugins-1.0.26.orig/a52/pcm_a52.c 2013-04-22 20:29:05.107102697 +0200
++++ alsa-plugins-1.0.26/a52/pcm_a52.c 2013-04-22 20:34:12.985107208 +0200
+@@ -25,6 +25,8 @@
+ #include <alsa/asoundlib.h>
+ #include <alsa/pcm_external.h>
+ #include <alsa/pcm_plugin.h>
++#include <libavutil/audioconvert.h>
++#include <libavutil/mem.h>
+ #include AVCODEC_HEADER
+
+ struct a52_ctx {
+@@ -429,7 +431,7 @@
+
+ a52_free(rec);
+
+- rec->avctx = avcodec_alloc_context();
++ rec->avctx = avcodec_alloc_context3(rec->codec);
+ if (! rec->avctx)
+ return -ENOMEM;
+
+@@ -457,7 +459,7 @@
+ }
+ #endif
+
+- if (avcodec_open(rec->avctx, rec->codec) < 0)
++ if (avcodec_open2(rec->avctx, rec->codec, NULL) < 0)
+ return -EINVAL;
+
+ rec->inbuf = malloc(rec->avctx->frame_size * 2 * io->channels);
View
10 media-plugins/alsa-plugins/files/pulse-default.conf
@@ -0,0 +1,10 @@
+# This file is referred to from files in /usr/share/alsa/alsa.conf.d/ in order
+# to set up the pulse device as the default if required.
+
+pcm.!default {
+ type pulse
+}
+
+ctl.!default {
+ type pulse
+}
View
8 media-plugins/alsa-plugins/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>alsa</herd>
+<maintainer>
+<email>alsa-bugs@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
Please sign in to comment.
Something went wrong with that request. Please try again.