diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /media-plugins/alsa-plugins |
reinit the tree, so we can have metadata
Diffstat (limited to 'media-plugins/alsa-plugins')
8 files changed, 611 insertions, 0 deletions
diff --git a/media-plugins/alsa-plugins/Manifest b/media-plugins/alsa-plugins/Manifest new file mode 100644 index 000000000000..72fa0a2c8e15 --- /dev/null +++ b/media-plugins/alsa-plugins/Manifest @@ -0,0 +1,11 @@ +AUX 51-pulseaudio-probe.conf 437 SHA256 59e27621718449afbc8370af22a7185f9396eabc47894f940ad9775c04101939 SHA512 325c323ad4dcf03a4cf2528d6f5d6a0769c3e3d7bcf09c6fc11fb9cb61bef2cec1e8ad5073c07b6865ffdec4c32165cd80a7c856d13d538ff8320be1c83f9af7 WHIRLPOOL 5a964d1a130a110081d2868ffebb679721ee6b2ae078dd2d2acd832fb7b5b37b0cdd464716486f9b8a12f725efb82ed5d8ec6fb255be73a26fcd72946f355172 +AUX alsa-plugins-1.0.23-automagic.patch 346 SHA256 fe30d4011c06c37a84ff74f467f37d3c6e7a43c01b436de49addf9a36f794840 SHA512 e10f990a0138d83af93bbcb8848a588ed0a1dc643452352b75ca56e243979b69a07a1b6685dbd4c5ff6e32a3d2e98fcb3c0f5da35ff5645c0cae490ece3c710c WHIRLPOOL 89c7967ed0a20658468943424761c52cf8ce894093becdfe9e8ad637cc221bd7495b83e7d8a709774b45fd606abcdb79ccf361536405455bdcf0d6a7c6549b4f +AUX alsa-plugins-1.0.28-libav10.patch 10113 SHA256 f95e97a6001596d76c785c97d371473d9f43b8b8a5b24075fde8ed0072dbd36d SHA512 b0a169c300e3cb21ee76a6773ccc1f6d69c0e9af604d6bf24669a561e038cf670bac20c5eff5ac48b33f3f36de81d99895b6a43c8310b2609e9b2bfce42cc0bc WHIRLPOOL 9eec9b53f188315ac827b6fd61f495cfa9b9456065af7552cb3093de3e3ccc0f9975bb54c40224caa45b661e0b1a851138a291989244f3f2fd9c6906f0d409b1 +AUX pulse-default.conf 196 SHA256 331ddca02bf9324f924baa7ab14460d8878f1db917e509bfc8c314938c53c26f SHA512 c64f73a46c9f50704d4b2bef09d95ce3bc2352da1437750f49974ab8e6f60d5467d5d94ab0e1490deea5f2b1f67b20aa60a10c502e7d6e049649bca4208f7c1e WHIRLPOOL 373d276717005df7531b9a517d5392d7ff6ac765d677819ffc59799cfa6fd944428008e7e6e827bc31db0ed861044576f45eea67137158bb5a543717e17b00f1 +DIST alsa-plugins-1.1.1.tar.bz2 366193 SHA256 8ea4d1e082c36528a896a2581e5eb62d4dc2683238e353050d0d624e65f901f1 SHA512 9dd277cb5cce144ce4e5e0010cebcba0f8634c783e7bcd80ce6d04b198d6de5150a2764df3087a39a468b5fb7c4578de2e252095568e811dedaa5e7ffdbeb7c9 WHIRLPOOL 20f36afcb01dfe47172b6470fea929ffb267e0b7a78ac4ca8c2031b33faa6fe15bd0608d9963e053366ac6bf3b2f540d776537c8547418a0d2b80b5c0366a76f +DIST alsa-plugins-1.1.4.tar.bz2 366931 SHA256 530d1c3bdaeb058f2a03607a33b9e16ee5369bfd30a96bc09bd2c69b4ddd1a8a SHA512 edbc9dd762e2500ce6f820d81fcd8d2577506afcea0b33a32cece95f8d6651840f4f8a55664f274d735ab3effa13cdbfc0331690c37a64a9ad050c15dc77cac6 WHIRLPOOL 38229f5d194ee0ef47b00d1464ed5392fbdb33f8d63a9b8dbdf26e39db3d096314fbe1f9220566a30aa905ec38607ebeb042611c3defd0f93543075d23382e45 +EBUILD alsa-plugins-1.1.1-r1.ebuild 2809 SHA256 4f4ad595b30510cf1ce8e35ec9024269cf9d2635a268353ab5883ec857cbc1e5 SHA512 9a69ff136d03d28aedf1e82522653e2276f705a04e538e8ac226031c4439f3646ace3b72eb3a757841d988ba92e2ea0beaac0b97cf629d3105b838d84cc52fa4 WHIRLPOOL ee05627c7764f5da1e2d098dca2af04976b65f7cf6b662364df20d4bd819e8fd0dac194936bdcf9bc2aa599618563318e81576a8f0da9e89510663aee9871810 +EBUILD alsa-plugins-1.1.4-r1.ebuild 2783 SHA256 fea234b073e08585be8b2a88e3b443f034facfefaded3bee3df482f5dbb5dc16 SHA512 1650dbeb541884554a00f17d84bd88659944c4c32cd018a3858ce8674b3f7db6c87d22771dadf93677f528e6171463118265a2054caeef2b3a4b1ff2d6efb245 WHIRLPOOL c94fbabeb19fcc64c60e166cb72f2beca1e99006e206bca8c7204b221b8e934f791b1e24d6921efe756f3b97d5a04a41f7eb9c37f22ed9d3e1cba988b5d953b8 +MISC ChangeLog 5082 SHA256 6a71b5f21215995bb504fd9d3e6f5042b7edbc102c4d62d129203fab07b5d4d4 SHA512 82dc33c4c97e4c9a44ef9f922b997074f336cf19bebc9fbb037db4f088accd8f455b4bc5da1e8459b9bcb4f1c94551a99bfb7036c504da39ae66437c9b5ba4b1 WHIRLPOOL fc0ce1c58b51bb7ad31c23bb072a879112bae822a1093a87cd462b1680f6a8b9e1f362085ef16c754e7a269ca897b582717ca5d0ad08eaab64e87e8a7812390e +MISC ChangeLog-2015 31933 SHA256 a575adb0e1819ae57d6b291a6bf09c1a8ae04c6106f6fe3215bcba752cc2e7fc SHA512 5cefcff7cc6c154ba5179bfaa0a71fc403f3bb2e5e6da7e2c41cf385de4c3d94dc27fd8d9484215618612a967d138e46b140564a75a629b9ed2ddae016f770fd WHIRLPOOL c020d754a7ca4a07ff83f211ffa7aee46895297cff1c1f01c729d2469ce51e0b410df184ef3d3d8d2e0978f2032570682415754d263c3682ff3f1bad13c88aa2 +MISC metadata.xml 307 SHA256 cb315f1695a9cb14064679d26b259fe9afe772d726a913b82a7501d03b83abc7 SHA512 7b22a0f5e9128917a130bad101de3a7d081d41fc85735547b0409c38ac533f2b468a339b870000fad5ab68de903c1eaf72ff18f1b79bd198ac2f97e9ddc1437b WHIRLPOOL c2e12b4d59671f0d05c8640e10cd74d50ce7b6909402a8bb6b679a4947b6ce0eabea6d90d67d89ab1192446e126e0e13bba2e51df445222ccdacbcb4f1eb9021 diff --git a/media-plugins/alsa-plugins/alsa-plugins-1.1.1-r1.ebuild b/media-plugins/alsa-plugins/alsa-plugins-1.1.1-r1.ebuild new file mode 100644 index 000000000000..85833223c065 --- /dev/null +++ b/media-plugins/alsa-plugins/alsa-plugins-1.1.1-r1.ebuild @@ -0,0 +1,106 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit autotools eutils flag-o-matic multilib multilib-minimal + +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="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86 ~amd64-linux" +IUSE="debug ffmpeg jack libav libsamplerate pulseaudio speex" + +RDEPEND=" + >=media-libs/alsa-lib-${PV}:=[${MULTILIB_USEDEP}] + ffmpeg? ( + libav? ( media-video/libav:= ) + !libav? ( media-video/ffmpeg:0= ) + ) + jack? ( virtual/jack[${MULTILIB_USEDEP}] ) + libsamplerate? ( >=media-libs/libsamplerate-0.1.8-r1:=[${MULTILIB_USEDEP}] ) + pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] ) + speex? ( + || ( + ( + >=media-libs/speex-1.2.0[${MULTILIB_USEDEP}] + media-libs/speexdsp[${MULTILIB_USEDEP}] + ) + <media-libs/speex-1.2.0[${MULTILIB_USEDEP}] + ) + media-libs/speex:=[${MULTILIB_USEDEP}] + ) +" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${PN}-1.0.23-automagic.patch" + "${FILESDIR}/${PN}-1.0.28-libav10.patch" +) + +src_prepare() { + default + + # 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 +} + +multilib_src_configure() { + use debug || append-cppflags -DNDEBUG + + local myspeex=no + use speex && myspeex=lib + + ECONF_SOURCE=${S} \ + econf \ + $(use_enable ffmpeg avcodec) \ + $(use_enable jack) \ + $(use_enable libsamplerate samplerate) \ + $(use_enable pulseaudio) \ + --with-speex=${myspeex} +} + +multilib_src_install_all() { + einstalldocs + + cd doc || die + 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 + # bug #410261, comment 5+ + # seems to work fine without any path + sed -i \ + -e "s:/usr/lib/alsa-lib/::" \ + "${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 +} diff --git a/media-plugins/alsa-plugins/alsa-plugins-1.1.4-r1.ebuild b/media-plugins/alsa-plugins/alsa-plugins-1.1.4-r1.ebuild new file mode 100644 index 000000000000..28a0efe54381 --- /dev/null +++ b/media-plugins/alsa-plugins/alsa-plugins-1.1.4-r1.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit autotools eutils flag-o-matic multilib multilib-minimal + +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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux" +IUSE="debug ffmpeg jack libav libsamplerate pulseaudio speex" + +RDEPEND=" + >=media-libs/alsa-lib-${PV}:=[${MULTILIB_USEDEP}] + ffmpeg? ( + libav? ( media-video/libav:= ) + !libav? ( media-video/ffmpeg:0= ) + ) + jack? ( virtual/jack[${MULTILIB_USEDEP}] ) + libsamplerate? ( >=media-libs/libsamplerate-0.1.8-r1:=[${MULTILIB_USEDEP}] ) + pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] ) + speex? ( + || ( + ( + >=media-libs/speex-1.2.0[${MULTILIB_USEDEP}] + media-libs/speexdsp[${MULTILIB_USEDEP}] + ) + <media-libs/speex-1.2.0[${MULTILIB_USEDEP}] + ) + media-libs/speex:=[${MULTILIB_USEDEP}] + ) +" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${PN}-1.0.23-automagic.patch" +) + +src_prepare() { + default + + # 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 +} + +multilib_src_configure() { + use debug || append-cppflags -DNDEBUG + + local myspeex=no + use speex && myspeex=lib + + ECONF_SOURCE=${S} \ + econf \ + $(use_enable ffmpeg avcodec) \ + $(use_enable jack) \ + $(use_enable libsamplerate samplerate) \ + $(use_enable pulseaudio) \ + --with-speex=${myspeex} +} + +multilib_src_install_all() { + einstalldocs + + cd doc || die + 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 + # bug #410261, comment 5+ + # seems to work fine without any path + sed -i \ + -e "s:/usr/lib/alsa-lib/::" \ + "${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 +} diff --git a/media-plugins/alsa-plugins/files/51-pulseaudio-probe.conf b/media-plugins/alsa-plugins/files/51-pulseaudio-probe.conf new file mode 100644 index 000000000000..c2272c85b072 --- /dev/null +++ b/media-plugins/alsa-plugins/files/51-pulseaudio-probe.conf @@ -0,0 +1,19 @@ +# 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" + "/etc/asound.conf" + "~/.asoundrc" + ] + errors false + } +] diff --git a/media-plugins/alsa-plugins/files/alsa-plugins-1.0.23-automagic.patch b/media-plugins/alsa-plugins/files/alsa-plugins-1.0.23-automagic.patch new file mode 100644 index 000000000000..8e62f20a143d --- /dev/null +++ b/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 + diff --git a/media-plugins/alsa-plugins/files/alsa-plugins-1.0.28-libav10.patch b/media-plugins/alsa-plugins/files/alsa-plugins-1.0.28-libav10.patch new file mode 100644 index 000000000000..9718369782b3 --- /dev/null +++ b/media-plugins/alsa-plugins/files/alsa-plugins-1.0.28-libav10.patch @@ -0,0 +1,338 @@ +https://bugs.gentoo.org/539680 + +From: Luca Barbato <lu_zero@gentoo.org> +Description: lavr: Add a libavresample based rate plugin +Date: Mon, 14 Apr 2014 10:01:07 +0200 + +Provide lavcrate compatibility. + +Index: alsa-plugins-1.0.28/configure.ac +=================================================================== +--- alsa-plugins-1.0.28.orig/configure.ac ++++ alsa-plugins-1.0.28/configure.ac +@@ -66,7 +66,7 @@ if test "$use_maemo_rm" = "yes"; then + fi + + AC_ARG_ENABLE([avcodec], +- AS_HELP_STRING([--disable-avcodec], [Don't build plugins depending on avcodec (a52)])) ++ AS_HELP_STRING([--disable-avcodec], [Do not build plugins depending on avcodec (a52)])) + + if test "x$enable_avcodec" != "xno"; then + PKG_CHECK_MODULES(AVCODEC, [libavcodec libavutil], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no]) +@@ -101,6 +101,10 @@ if test $HAVE_AVCODEC = yes; then + if test -z "$AVCODEC_HEADER"; then + HAVE_AVCODEC=no + fi ++ SAVE_LIBS=$LIBS ++ LIBS="$LIBS $AVCODEC_LIBS" ++ AC_CHECK_FUNCS([av_resample_init]) ++ LIBS=$SAVE_LIBS + fi + + AM_CONDITIONAL(HAVE_AVCODEC, test x$HAVE_AVCODEC = xyes) +@@ -108,6 +112,18 @@ AC_SUBST(AVCODEC_CFLAGS) + AC_SUBST(AVCODEC_LIBS) + AC_SUBST(AVCODEC_HEADER) + ++AC_ARG_ENABLE([avresample], ++ AS_HELP_STRING([--disable-avresample], [Do not build plugins depending on avcodec (lavrate)])) ++ ++if test "x$enable_avresample" != "xno"; then ++ PKG_CHECK_MODULES(AVRESAMPLE, [libavresample libavutil], [HAVE_AVRESAMPLE=yes], [HAVE_AVRESAMPLE=no]) ++fi ++ ++AM_CONDITIONAL(HAVE_AVRESAMPLE, test x$HAVE_AVCODEC = xyes) ++AC_SUBST(AVRESAMPLE_CFLAGS) ++AC_SUBST(AVRESAMPLE_LIBS) ++AC_SUBST(AVRESAMPLE_HEADER) ++ + PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""]) + AM_CONDITIONAL(HAVE_SPEEXDSP, test "$HAVE_SPEEXDSP" = "yes") + +@@ -181,7 +197,7 @@ AC_OUTPUT([ + mix/Makefile + rate/Makefile + a52/Makefile +- rate-lavc/Makefile ++ rate-lavr/Makefile + maemo/Makefile + doc/Makefile + usb_stream/Makefile +Index: alsa-plugins-1.0.28/Makefile.am +=================================================================== +--- alsa-plugins-1.0.28.orig/Makefile.am ++++ alsa-plugins-1.0.28/Makefile.am +@@ -9,8 +9,14 @@ if HAVE_SAMPLERATE + SUBDIRS += rate + endif + if HAVE_AVCODEC ++SUBDIRS += a52 ++if !HAVE_AVRESAMPLE + SUBDIRS += a52 rate-lavc + endif ++endif ++if HAVE_AVRESAMPLE ++SUBDIRS += rate-lavr ++endif + if HAVE_MAEMO_PLUGIN + SUBDIRS += maemo + endif +Index: alsa-plugins-1.0.28/rate-lavr/Makefile.am +=================================================================== +--- /dev/null ++++ alsa-plugins-1.0.28/rate-lavr/Makefile.am +@@ -0,0 +1,22 @@ ++asound_module_rate_lavr_LTLIBRARIES = libasound_module_rate_lavr.la ++ ++asound_module_rate_lavrdir = @ALSA_PLUGIN_DIR@ ++ ++AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @AVRESAMPLE_CFLAGS@ ++AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED) ++ ++libasound_module_rate_lavr_la_SOURCES = rate_lavr.c ++libasound_module_rate_lavr_la_LIBADD = @ALSA_LIBS@ @AVRESAMPLE_LIBS@ ++ ++ ++install-exec-hook: ++ rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate*.so ++ $(LN_S) libasound_module_rate_lavr.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate.so ++ $(LN_S) libasound_module_rate_lavr.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_higher.so ++ $(LN_S) libasound_module_rate_lavr.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_high.so ++ $(LN_S) libasound_module_rate_lavr.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_fast.so ++ $(LN_S) libasound_module_rate_lavr.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_faster.so ++ ++uninstall-hook: ++ rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate*.so ++ rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavr*.so +Index: alsa-plugins-1.0.28/rate-lavr/rate_lavr.c +=================================================================== +--- /dev/null ++++ alsa-plugins-1.0.28/rate-lavr/rate_lavr.c +@@ -0,0 +1,227 @@ ++/* ++ * Rate converter plugin using libavresample ++ * Copyright (c) 2014 by Anton Khirnov ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ */ ++ ++#include <stdio.h> ++#include <alsa/asoundlib.h> ++#include <alsa/pcm_rate.h> ++ ++#include <libavresample/avresample.h> ++#include <libavutil/channel_layout.h> ++#include <libavutil/opt.h> ++#include <libavutil/mathematics.h> ++#include <libavutil/samplefmt.h> ++ ++ ++static int filter_size = 16; ++static int phase_shift = 10; /* auto-adjusts */ ++static double cutoff = 0; /* auto-adjusts */ ++ ++struct rate_src { ++ AVAudioResampleContext *avr; ++ ++ int in_rate; ++ int out_rate; ++ unsigned int channels; ++}; ++ ++static snd_pcm_uframes_t input_frames(void *obj, snd_pcm_uframes_t frames) ++{ ++ return frames; ++} ++ ++static snd_pcm_uframes_t output_frames(void *obj, snd_pcm_uframes_t frames) ++{ ++ return frames; ++} ++ ++static void pcm_src_free(void *obj) ++{ ++ struct rate_src *rate = obj; ++ avresample_free(&rate->avr); ++} ++ ++static int pcm_src_init(void *obj, snd_pcm_rate_info_t *info) ++{ ++ struct rate_src *rate = obj; ++ int i, ir, or; ++ ++ if (!rate->avr || rate->channels != info->channels) { ++ int ret; ++ ++ pcm_src_free(rate); ++ rate->channels = info->channels; ++ ir = rate->in_rate = info->in.rate; ++ or = rate->out_rate = info->out.rate; ++ i = av_gcd(or, ir); ++ if (or > ir) { ++ phase_shift = or/i; ++ } else { ++ phase_shift = ir/i; ++ } ++ if (cutoff <= 0.0) { ++ cutoff = 1.0 - 1.0/filter_size; ++ if (cutoff < 0.80) ++ cutoff = 0.80; ++ } ++ ++ rate->avr = avresample_alloc_context(); ++ if (!rate->avr) ++ return -ENOMEM; ++ ++ av_opt_set_int(rate->avr, "in_sample_rate", info->in.rate, 0); ++ av_opt_set_int(rate->avr, "out_sample_rate", info->out.rate, 0); ++ av_opt_set_int(rate->avr, "in_sample_format", AV_SAMPLE_FMT_S16, 0); ++ av_opt_set_int(rate->avr, "out_sample_format", AV_SAMPLE_FMT_S16, 0); ++ av_opt_set_int(rate->avr, "in_channel_layout", av_get_default_channel_layout(rate->channels), 0); ++ av_opt_set_int(rate->avr, "out_channel_layout", av_get_default_channel_layout(rate->channels), 0); ++ ++ av_opt_set_int(rate->avr, "filter_size", filter_size, 0); ++ av_opt_set_int(rate->avr, "phase_shift", phase_shift, 0); ++ av_opt_set_double(rate->avr, "cutoff", cutoff, 0); ++ ++ ret = avresample_open(rate->avr); ++ if (ret < 0) { ++ avresample_free(&rate->avr); ++ return -EINVAL; ++ } ++ } ++ ++ return 0; ++} ++ ++static int pcm_src_adjust_pitch(void *obj, snd_pcm_rate_info_t *info) ++{ ++ struct rate_src *rate = obj; ++ ++ if (info->out.rate != rate->out_rate || info->in.rate != rate->in_rate) ++ pcm_src_init(obj, info); ++ return 0; ++} ++ ++static void pcm_src_reset(void *obj) ++{ ++ struct rate_src *rate = obj; ++ ++ if (rate->avr) { ++ avresample_close(rate->avr); ++ avresample_open(rate->avr); ++ } ++} ++ ++static void pcm_src_convert_s16(void *obj, int16_t *dst, unsigned int ++ dst_frames, const int16_t *src, unsigned int src_frames) ++{ ++ struct rate_src *rate = obj; ++ int consumed = 0, chans=rate->channels, ret=0, i; ++ int total_in = avresample_get_delay(rate->avr) + src_frames; ++ ++ ret = avresample_convert(rate->avr, &dst, dst_frames * chans * 2, dst_frames, ++ &src, src_frames * chans * 2, src_frames); ++ ++ avresample_set_compensation(rate->avr, ++ total_in - src_frames > filter_size ? 0 : 1, src_frames); ++} ++ ++static void pcm_src_close(void *obj) ++{ ++ pcm_src_free(obj); ++} ++ ++#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002 ++static int get_supported_rates(void *obj, unsigned int *rate_min, ++ unsigned int *rate_max) ++{ ++ *rate_min = *rate_max = 0; /* both unlimited */ ++ return 0; ++} ++ ++static void dump(void *obj, snd_output_t *out) ++{ ++ snd_output_printf(out, "Converter: libavr\n"); ++} ++#endif ++ ++static snd_pcm_rate_ops_t pcm_src_ops = { ++ .close = pcm_src_close, ++ .init = pcm_src_init, ++ .free = pcm_src_free, ++ .adjust_pitch = pcm_src_adjust_pitch, ++ .convert_s16 = pcm_src_convert_s16, ++ .input_frames = input_frames, ++ .output_frames = output_frames, ++#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002 ++ .version = SND_PCM_RATE_PLUGIN_VERSION, ++ .get_supported_rates = get_supported_rates, ++ .dump = dump, ++#endif ++}; ++ ++int pcm_src_open(unsigned int version, void **objp, snd_pcm_rate_ops_t *ops) ++ ++{ ++ struct rate_src *rate; ++ ++#if SND_PCM_RATE_PLUGIN_VERSION < 0x010002 ++ if (version != SND_PCM_RATE_PLUGIN_VERSION) { ++ fprintf(stderr, "Invalid rate plugin version %x\n", version); ++ return -EINVAL; ++ } ++#endif ++ rate = calloc(1, sizeof(*rate)); ++ if (!rate) ++ return -ENOMEM; ++ ++ *objp = rate; ++ rate->avr = NULL; ++#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002 ++ if (version == 0x010001) ++ memcpy(ops, &pcm_src_ops, sizeof(snd_pcm_rate_old_ops_t)); ++ else ++#endif ++ *ops = pcm_src_ops; ++ return 0; ++} ++ ++int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate)(unsigned int version, void **objp, ++ snd_pcm_rate_ops_t *ops) ++{ ++ return pcm_src_open(version, objp, ops); ++} ++int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate_higher)(unsigned int version, ++ void **objp, snd_pcm_rate_ops_t *ops) ++{ ++ filter_size = 64; ++ return pcm_src_open(version, objp, ops); ++} ++int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate_high)(unsigned int version, ++ void **objp, snd_pcm_rate_ops_t *ops) ++{ ++ filter_size = 32; ++ return pcm_src_open(version, objp, ops); ++} ++int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate_fast)(unsigned int version, ++ void **objp, snd_pcm_rate_ops_t *ops) ++{ ++ filter_size = 8; ++ return pcm_src_open(version, objp, ops); ++} ++int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate_faster)(unsigned int version, ++ void **objp, snd_pcm_rate_ops_t *ops) ++{ ++ filter_size = 4; ++ return pcm_src_open(version, objp, ops); ++} ++ ++ diff --git a/media-plugins/alsa-plugins/files/pulse-default.conf b/media-plugins/alsa-plugins/files/pulse-default.conf new file mode 100644 index 000000000000..8f7cbf29d60c --- /dev/null +++ b/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 +} diff --git a/media-plugins/alsa-plugins/metadata.xml b/media-plugins/alsa-plugins/metadata.xml new file mode 100644 index 000000000000..36b45c593d02 --- /dev/null +++ b/media-plugins/alsa-plugins/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> +<email>alsa-bugs@gentoo.org</email> +</maintainer> +<upstream> +<remote-id type="cpe">cpe:/a:alsa-project:alsa-plugins</remote-id> +</upstream> +</pkgmetadata> |