Blame SOURCES/alsa-plugins-1.1.6-post.patch

703989
From e8fabec7adc70220f52588dc170d90d146b92ba7 Mon Sep 17 00:00:00 2001
703989
From: Jaroslav Kysela <perex@perex.cz>
703989
Date: Thu, 5 Apr 2018 09:23:09 +0200
703989
Subject: [PATCH 1/8] samplerate: fix unused variable warning
703989
703989
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
703989
---
703989
 rate/rate_samplerate.c | 4 ++--
703989
 1 file changed, 2 insertions(+), 2 deletions(-)
703989
703989
diff --git a/rate/rate_samplerate.c b/rate/rate_samplerate.c
703989
index 0b14a59..100d6f2 100644
703989
--- a/rate/rate_samplerate.c
703989
+++ b/rate/rate_samplerate.c
703989
@@ -154,14 +154,14 @@ static void pcm_src_close(void *obj)
703989
 }
703989
 
703989
 #if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
703989
-static int get_supported_rates(void *obj, unsigned int *rate_min,
703989
+static int get_supported_rates(void *obj ATTRIBUTE_UNUSED, unsigned int *rate_min,
703989
 			       unsigned int *rate_max)
703989
 {
703989
 	*rate_min = *rate_max = 0; /* both unlimited */
703989
 	return 0;
703989
 }
703989
 
703989
-static void dump(void *obj, snd_output_t *out)
703989
+static void dump(void *obj ATTRIBUTE_UNUSED, snd_output_t *out)
703989
 {
703989
 	snd_output_printf(out, "Converter: libsamplerate\n");
703989
 }
703989
-- 
703989
2.13.6
703989
703989
703989
From 6e40eb5fd346207021a95d06bc30205a537926ea Mon Sep 17 00:00:00 2001
703989
From: Jaroslav Kysela <perex@perex.cz>
703989
Date: Wed, 4 Apr 2018 19:57:56 +0200
703989
Subject: [PATCH 2/8] configure: add --with-alsaaddondir, add default config
703989
 files for plugins
703989
703989
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
703989
---
703989
 a52/60-a52-encoder.conf       | 38 ++++++++++++++++++++++++++
703989
 a52/Makefile.am               |  4 +++
703989
 a52/pcm_a52.c                 |  2 +-
703989
 arcam-av/50-arcam-av-ctl.conf | 16 +++++++++++
703989
 arcam-av/Makefile.am          |  4 +++
703989
 configure.ac                  | 12 +++++++++
703989
 jack/50-jack.conf             | 18 +++++++++++++
703989
 jack/Makefile.am              |  4 +++
703989
 maemo/98-maemo.conf           | 11 ++++++++
703989
 maemo/Makefile.am             |  4 +++
703989
 mix/60-upmix.conf             | 26 ++++++++++++++++++
703989
 mix/60-vdownmix.conf          | 24 +++++++++++++++++
703989
 mix/Makefile.am               |  5 +++-
703989
 oss/50-oss.conf               | 26 ++++++++++++++++++
703989
 oss/Makefile.am               |  4 +++
703989
 pph/10-speexrate.conf         | 28 +++++++++++++++++++
703989
 pph/Makefile.am               |  4 +++
703989
 pulse/50-pulseaudio.conf      | 15 ++++++-----
703989
 pulse/Makefile.am             |  4 +--
703989
 rate-lavc/10-rate-lavc.conf   | 28 +++++++++++++++++++
703989
 rate-lavc/Makefile.am         |  4 +++
703989
 rate/10-samplerate.conf       | 28 +++++++++++++++++++
703989
 rate/Makefile.am              |  4 +++
703989
 speex/60-speex.conf           | 63 +++++++++++++++++++++++++++++++++++++++++++
703989
 speex/Makefile.am             |  4 +++
703989
 usb_stream/98-usb-stream.conf | 27 +++++++++++++++++++
703989
 usb_stream/Makefile.am        |  4 +++
703989
 27 files changed, 401 insertions(+), 10 deletions(-)
703989
 create mode 100644 a52/60-a52-encoder.conf
703989
 create mode 100644 arcam-av/50-arcam-av-ctl.conf
703989
 create mode 100644 jack/50-jack.conf
703989
 create mode 100644 maemo/98-maemo.conf
703989
 create mode 100644 mix/60-upmix.conf
703989
 create mode 100644 mix/60-vdownmix.conf
703989
 create mode 100644 oss/50-oss.conf
703989
 create mode 100644 pph/10-speexrate.conf
703989
 create mode 100644 rate-lavc/10-rate-lavc.conf
703989
 create mode 100644 rate/10-samplerate.conf
703989
 create mode 100644 speex/60-speex.conf
703989
 create mode 100644 usb_stream/98-usb-stream.conf
703989
703989
diff --git a/a52/60-a52-encoder.conf b/a52/60-a52-encoder.conf
703989
new file mode 100644
703989
index 0000000..346c94f
703989
--- /dev/null
703989
+++ b/a52/60-a52-encoder.conf
703989
@@ -0,0 +1,38 @@
703989
+pcm.a52 {
703989
+	@args [ CARD SLAVE RATE BITRATE CHANNELS ]
703989
+	@args.CARD {
703989
+		type integer
703989
+		default {
703989
+			@func refer
703989
+			name defaults.pcm.card
703989
+		}
703989
+	}
703989
+	@args.SLAVE {
703989
+		type string
703989
+	}
703989
+	@args.RATE {
703989
+		type integer
703989
+		default 48000
703989
+	}
703989
+	@args.BITRATE {
703989
+		type integer
703989
+		default 448
703989
+	}
703989
+	@args.CHANNELS {
703989
+		type string
703989
+		default 6
703989
+	}
703989
+	type a52
703989
+	card $CARD
703989
+	slavepcm $SLAVE
703989
+	rate $RATE
703989
+	bitrate $BITRATE
703989
+	channels $CHANNELS
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+                description "Plugin to convert multichannel stream to A52 (AC3) bitstream"
703989
+	}
703989
+}
703989
diff --git a/a52/Makefile.am b/a52/Makefile.am
703989
index 48567b4..cbc1497 100644
703989
--- a/a52/Makefile.am
703989
+++ b/a52/Makefile.am
703989
@@ -1,6 +1,10 @@
703989
+EXTRA_DIST = 60-a52-encoder.conf
703989
+
703989
 asound_module_pcm_a52_LTLIBRARIES = libasound_module_pcm_a52.la
703989
+asound_module_addon_DATA = 60-a52-encoder.conf
703989
 
703989
 asound_module_pcm_a52dir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @AVCODEC_CFLAGS@ \
703989
 	-DAVCODEC_HEADER="@AVCODEC_HEADER@"
703989
diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c
703989
index 348d58f..155da36 100644
703989
--- a/a52/pcm_a52.c
703989
+++ b/a52/pcm_a52.c
703989
@@ -937,7 +937,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52)
703989
 		goto error;
703989
 	}
703989
 
703989
-	if (! pcm_string) {
703989
+	if (! pcm_string || pcm_string[0] == '\0') {
703989
 		snprintf(devstr, sizeof(devstr),
703989
 			 "iec958:{AES0 0x%x AES1 0x%x AES2 0x%x AES3 0x%x %s%s}",
703989
 			 IEC958_AES0_CON_EMPHASIS_NONE | IEC958_AES0_NONAUDIO |
703989
diff --git a/arcam-av/50-arcam-av-ctl.conf b/arcam-av/50-arcam-av-ctl.conf
703989
new file mode 100644
703989
index 0000000..b76caa9
703989
--- /dev/null
703989
+++ b/arcam-av/50-arcam-av-ctl.conf
703989
@@ -0,0 +1,16 @@
703989
+ctl.arcam_av {
703989
+	@args [ PORT ]
703989
+	@args.PORT {
703989
+		type string
703989
+		default "/dev/ttyUSB0"
703989
+	}
703989
+	type arcam_av
703989
+	port $PORT
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+		description "Arcam-AV Amplifier"
703989
+	}
703989
+}
703989
diff --git a/arcam-av/Makefile.am b/arcam-av/Makefile.am
703989
index 5c7855f..4a54ccd 100644
703989
--- a/arcam-av/Makefile.am
703989
+++ b/arcam-av/Makefile.am
703989
@@ -1,6 +1,10 @@
703989
+EXTRA_DIST = 50-arcam-av-ctl.conf
703989
+
703989
 asound_module_ctl_arcam_av_LTLIBRARIES = libasound_module_ctl_arcam_av.la
703989
+asound_module_addon_DATA = 50-arcam-av-ctl.conf
703989
 
703989
 asound_module_ctl_arcam_avdir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined
703989
diff --git a/configure.ac b/configure.ac
703989
index ecc265b..ae98caa 100644
703989
--- a/configure.ac
703989
+++ b/configure.ac
703989
@@ -206,6 +206,18 @@ AC_DEFINE_UNQUOTED(ALSA_DATA_DIR, "$alsadatadir", [directory containing ALSA dat
703989
 ALSA_DATA_DIR="$alsadatadir"
703989
 AC_SUBST(ALSA_DATA_DIR)
703989
 
703989
+dnl ALSA add-on config directory
703989
+AC_ARG_WITH(alsaaddondir,
703989
+    AS_HELP_STRING([--with-alsaaddondir=dir],
703989
+	[path where ALSA add-on config files are stored]),
703989
+    alsaaddondir="$withval", alsaaddondir="")
703989
+if test -z "$alsaaddondir"; then
703989
+    alsaaddondir="/etc/alsa/conf.d"
703989
+fi
703989
+AC_DEFINE_UNQUOTED(ALSA_ADDON_DIR, "$alsaaddondir", [directory containing ALSA add-on config files])
703989
+ALSA_ADDON_DIR="$alsaaddondir"
703989
+AC_SUBST(ALSA_ADDON_DIR)
703989
+
703989
 SAVE_PLUGINS_VERSION
703989
 
703989
 AC_OUTPUT([
703989
diff --git a/jack/50-jack.conf b/jack/50-jack.conf
703989
new file mode 100644
703989
index 0000000..d780dfc
703989
--- /dev/null
703989
+++ b/jack/50-jack.conf
703989
@@ -0,0 +1,18 @@
703989
+pcm.jack {
703989
+	type jack
703989
+	playback_ports {
703989
+		0 alsa_pcm:playback_1
703989
+		1 alsa_pcm:playback_2
703989
+	}
703989
+	capture_ports {
703989
+		0 alsa_pcm:capture_1
703989
+		1 alsa_pcm:capture_2
703989
+	}
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+		description "JACK Audio Connection Kit"
703989
+	}
703989
+}
703989
diff --git a/jack/Makefile.am b/jack/Makefile.am
703989
index f913cb6..0a3d6ae 100644
703989
--- a/jack/Makefile.am
703989
+++ b/jack/Makefile.am
703989
@@ -1,6 +1,10 @@
703989
+EXTRA_DIST = 50-jack.conf
703989
+
703989
 asound_module_pcm_jack_LTLIBRARIES = libasound_module_pcm_jack.la
703989
+asound_module_addon_DATA = 50-jack.conf
703989
 
703989
 asound_module_pcm_jackdir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @JACK_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
diff --git a/maemo/98-maemo.conf b/maemo/98-maemo.conf
703989
new file mode 100644
703989
index 0000000..a9ad6a0
703989
--- /dev/null
703989
+++ b/maemo/98-maemo.conf
703989
@@ -0,0 +1,11 @@
703989
+pcm.!default {
703989
+	type alsa_dsp
703989
+	playback_device_file [ "/dev/dsptask/pcm2" ]
703989
+	recording_device_file [ "/dev/dsptask/pcm_rec" ]
703989
+}
703989
+
703989
+ctl.!default {
703989
+	type dsp_ctl
703989
+	playback_devices [ "/dev/dsptask/pcm2" ]
703989
+	recording_devices [ "/dev/dsptask/pcm_rec" ]
703989
+}
703989
diff --git a/maemo/Makefile.am b/maemo/Makefile.am
703989
index 2684781..aca481d 100644
703989
--- a/maemo/Makefile.am
703989
+++ b/maemo/Makefile.am
703989
@@ -1,8 +1,12 @@
703989
+EXTRA_DIST = 98-maemo.conf
703989
+
703989
 asound_module_pcm_alsa_dsp_LTLIBRARIES = libasound_module_pcm_alsa_dsp.la
703989
 asound_module_ctl_dsp_ctl_LTLIBRARIES = libasound_module_ctl_dsp_ctl.la
703989
+asound_module_addon_DATA = 98-maemo.conf
703989
 
703989
 asound_module_pcm_alsa_dspdir = @ALSA_PLUGIN_DIR@
703989
 asound_module_ctl_dsp_ctldir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -O2 @ALSA_CFLAGS@ $(DBUS_CFLAGS)
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
diff --git a/mix/60-upmix.conf b/mix/60-upmix.conf
703989
new file mode 100644
703989
index 0000000..028cfe1
703989
--- /dev/null
703989
+++ b/mix/60-upmix.conf
703989
@@ -0,0 +1,26 @@
703989
+pcm.upmix {
703989
+	@args [ SLAVE CHANNELS DELAY ]
703989
+	@args.SLAVE {
703989
+		type string
703989
+		default "plug:hw"
703989
+	}
703989
+	@args.CHANNELS {
703989
+		type integer
703989
+		default 6
703989
+	}
703989
+	@args.DELAY {
703989
+		type integer
703989
+		default 0
703989
+	}
703989
+	type upmix
703989
+	channels $CHANNELS
703989
+	delay $DELAY
703989
+	slave.pcm $SLAVE
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+                description "Plugin for channel upmix (4,6,8)"
703989
+	}
703989
+}
703989
diff --git a/mix/60-vdownmix.conf b/mix/60-vdownmix.conf
703989
new file mode 100644
703989
index 0000000..32e9c56
703989
--- /dev/null
703989
+++ b/mix/60-vdownmix.conf
703989
@@ -0,0 +1,24 @@
703989
+pcm.vdownmix {
703989
+	@args [ SLAVE CHANNELS DELAY ]
703989
+	@args.SLAVE {
703989
+		type string
703989
+		default "plug:hw"
703989
+	}
703989
+	@args.CHANNELS {
703989
+		type integer
703989
+		default 6
703989
+	}
703989
+	@args.DELAY {
703989
+		type integer
703989
+		default 0
703989
+	}
703989
+	type vdownmix
703989
+	slave.pcm $SLAVE
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+                description "Plugin for channel downmix (stereo) with a simple spacialization"
703989
+	}
703989
+}
703989
diff --git a/mix/Makefile.am b/mix/Makefile.am
703989
index e31839a..710606c 100644
703989
--- a/mix/Makefile.am
703989
+++ b/mix/Makefile.am
703989
@@ -1,8 +1,12 @@
703989
+EXTRA_DIST = 60-upmix.conf 60-vdownmix.conf
703989
+
703989
 asound_module_pcm_upmix_LTLIBRARIES = libasound_module_pcm_upmix.la
703989
 asound_module_pcm_vdownmix_LTLIBRARIES = libasound_module_pcm_vdownmix.la
703989
+asound_module_addon_DATA = 60-upmix.conf 60-vdownmix.conf
703989
 
703989
 asound_module_pcm_upmixdir = @ALSA_PLUGIN_DIR@
703989
 asound_module_pcm_vdownmixdir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
@@ -11,4 +15,3 @@ libasound_module_pcm_upmix_la_SOURCES = pcm_upmix.c
703989
 libasound_module_pcm_upmix_la_LIBADD = @ALSA_LIBS@
703989
 libasound_module_pcm_vdownmix_la_SOURCES = pcm_vdownmix.c
703989
 libasound_module_pcm_vdownmix_la_LIBADD = @ALSA_LIBS@
703989
-
703989
diff --git a/oss/50-oss.conf b/oss/50-oss.conf
703989
new file mode 100644
703989
index 0000000..5b2817b
703989
--- /dev/null
703989
+++ b/oss/50-oss.conf
703989
@@ -0,0 +1,26 @@
703989
+pcm.oss {
703989
+	@args [ DEVICE ]
703989
+	@args.DEVICE {
703989
+		type string
703989
+		default "/dev/dsp"
703989
+	}
703989
+	type oss
703989
+	port $DEVICE
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+		description "Open Sound System"
703989
+	}
703989
+}
703989
+
703989
+ctl.oss {
703989
+	@args [ DEVICE ]
703989
+	@args.DEVICE {
703989
+		type string
703989
+		default "/dev/mixer"
703989
+	}
703989
+	type oss
703989
+	device $DEVICE
703989
+}
703989
diff --git a/oss/Makefile.am b/oss/Makefile.am
703989
index 302538b..df83d20 100644
703989
--- a/oss/Makefile.am
703989
+++ b/oss/Makefile.am
703989
@@ -1,8 +1,12 @@
703989
+EXTRA_DIST = 50-oss.conf
703989
+
703989
 asound_module_pcm_oss_LTLIBRARIES = libasound_module_pcm_oss.la
703989
 asound_module_ctl_oss_LTLIBRARIES = libasound_module_ctl_oss.la
703989
+asound_module_addon_DATA = 50-oss.conf
703989
 
703989
 asound_module_pcm_ossdir = @ALSA_PLUGIN_DIR@
703989
 asound_module_ctl_ossdir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
diff --git a/pph/10-speexrate.conf b/pph/10-speexrate.conf
703989
new file mode 100644
703989
index 0000000..1d9eae9
703989
--- /dev/null
703989
+++ b/pph/10-speexrate.conf
703989
@@ -0,0 +1,28 @@
703989
+pcm.speexrate {
703989
+	@args [ SLAVE RATE CONVERTER ]
703989
+	@args.SLAVE {
703989
+		type string
703989
+		default "plug:hw"
703989
+	}
703989
+	@args.RATE {
703989
+		type integer
703989
+		default 48000
703989
+	}
703989
+	@args.CONVERTER {
703989
+		type string
703989
+		default "speexrate"
703989
+	}
703989
+	type rate
703989
+	converter $CONVERTER
703989
+	slave {
703989
+		pcm $SLAVE
703989
+		rate $RATE
703989
+	}
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+                description "Rate Converter Plugin Using Speex Resampler"
703989
+	}
703989
+}
703989
diff --git a/pph/Makefile.am b/pph/Makefile.am
703989
index 551e5bd..abb950b 100644
703989
--- a/pph/Makefile.am
703989
+++ b/pph/Makefile.am
703989
@@ -1,6 +1,10 @@
703989
+EXTRA_DIST = 10-speexrate.conf
703989
+
703989
 asound_module_rate_speexrate_LTLIBRARIES = libasound_module_rate_speexrate.la
703989
+asound_module_addon_DATA = 10-speexrate.conf
703989
 
703989
 asound_module_rate_speexratedir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -DVAR_ARRAYS -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
diff --git a/pulse/50-pulseaudio.conf b/pulse/50-pulseaudio.conf
703989
index dd85dab..62da207 100644
703989
--- a/pulse/50-pulseaudio.conf
703989
+++ b/pulse/50-pulseaudio.conf
703989
@@ -1,13 +1,16 @@
703989
 # Add a specific named PulseAudio pcm and ctl (typically useful for testing)
703989
 
703989
 pcm.pulse {
703989
-    type pulse
703989
-    hint {
703989
-        show on
703989
-        description "PulseAudio Sound Server"
703989
-    }
703989
+	type pulse
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+		description "PulseAudio Sound Server"
703989
+	}
703989
 }
703989
 
703989
 ctl.pulse {
703989
-    type pulse
703989
+	type pulse
703989
 }
703989
diff --git a/pulse/Makefile.am b/pulse/Makefile.am
703989
index a5550b9..835808c 100644
703989
--- a/pulse/Makefile.am
703989
+++ b/pulse/Makefile.am
703989
@@ -3,12 +3,12 @@ EXTRA_DIST = 50-pulseaudio.conf 99-pulseaudio-default.conf.example
703989
 asound_module_pcm_LTLIBRARIES = libasound_module_pcm_pulse.la
703989
 asound_module_ctl_LTLIBRARIES = libasound_module_ctl_pulse.la
703989
 asound_module_conf_LTLIBRARIES = libasound_module_conf_pulse.la
703989
-asound_module_data_DATA = 50-pulseaudio.conf 99-pulseaudio-default.conf.example
703989
+asound_module_addon_DATA = 50-pulseaudio.conf 99-pulseaudio-default.conf.example
703989
 
703989
 asound_module_pcmdir = @ALSA_PLUGIN_DIR@
703989
 asound_module_ctldir = @ALSA_PLUGIN_DIR@
703989
 asound_module_confdir = @ALSA_PLUGIN_DIR@
703989
-asound_module_datadir = @ALSA_DATA_DIR@/alsa.conf.d
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ $(PTHREAD_CFLAGS) $(pulseaudio_CFLAGS) -D_GNU_SOURCE
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
diff --git a/rate-lavc/10-rate-lavc.conf b/rate-lavc/10-rate-lavc.conf
703989
new file mode 100644
703989
index 0000000..bab1694
703989
--- /dev/null
703989
+++ b/rate-lavc/10-rate-lavc.conf
703989
@@ -0,0 +1,28 @@
703989
+pcm.lavcrate {
703989
+	@args [ SLAVE RATE CONVERTER ]
703989
+	@args.SLAVE {
703989
+		type string
703989
+		default "plug:hw"
703989
+	}
703989
+	@args.RATE {
703989
+		type integer
703989
+		default 48000
703989
+	}
703989
+	@args.CONVERTER {
703989
+		type string
703989
+		default "lavcrate"
703989
+	}
703989
+	type rate
703989
+	converter $CONVERTER
703989
+	slave {
703989
+		pcm $SLAVE
703989
+		rate $RATE
703989
+	}
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+                description "Rate Converter Plugin Using AVC Library"
703989
+	}
703989
+}
703989
diff --git a/rate-lavc/Makefile.am b/rate-lavc/Makefile.am
703989
index 5cffd44..5f66472 100644
703989
--- a/rate-lavc/Makefile.am
703989
+++ b/rate-lavc/Makefile.am
703989
@@ -1,6 +1,10 @@
703989
+EXTRA_DIST = 10-rate-lavc.conf
703989
+
703989
 asound_module_rate_lavcrate_LTLIBRARIES = libasound_module_rate_lavcrate.la
703989
+asound_module_addon_DATA = 10-rate-lavc.conf
703989
 
703989
 asound_module_rate_lavcratedir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @AVCODEC_CFLAGS@ \
703989
 	-DAVCODEC_HEADER="@AVCODEC_HEADER@"
703989
diff --git a/rate/10-samplerate.conf b/rate/10-samplerate.conf
703989
new file mode 100644
703989
index 0000000..0d2e604
703989
--- /dev/null
703989
+++ b/rate/10-samplerate.conf
703989
@@ -0,0 +1,28 @@
703989
+pcm.samplerate {
703989
+	@args [ SLAVE RATE CONVERTER ]
703989
+	@args.SLAVE {
703989
+		type string
703989
+		default "plug:hw"
703989
+	}
703989
+	@args.RATE {
703989
+		type integer
703989
+		default 48000
703989
+	}
703989
+	@args.CONVERTER {
703989
+		type string
703989
+		default "samplerate"
703989
+	}
703989
+	type rate
703989
+	converter $CONVERTER
703989
+	slave {
703989
+		pcm $SLAVE
703989
+		rate $RATE
703989
+	}
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+                description "Rate Converter Plugin Using Samplerate Library"
703989
+	}
703989
+}
703989
diff --git a/rate/Makefile.am b/rate/Makefile.am
703989
index 0605bfd..25014d8 100644
703989
--- a/rate/Makefile.am
703989
+++ b/rate/Makefile.am
703989
@@ -1,6 +1,10 @@
703989
+EXTRA_DIST = 10-samplerate.conf
703989
+
703989
 asound_module_rate_samplerate_LTLIBRARIES = libasound_module_rate_samplerate.la
703989
+asound_module_addon_DATA = 10-samplerate.conf
703989
 
703989
 asound_module_rate_sampleratedir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ $(samplerate_CFLAGS)
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
diff --git a/speex/60-speex.conf b/speex/60-speex.conf
703989
new file mode 100644
703989
index 0000000..bf2ce95
703989
--- /dev/null
703989
+++ b/speex/60-speex.conf
703989
@@ -0,0 +1,63 @@
703989
+pcm.speex {
703989
+	@args [ SLAVE AGC AGC_LEVEL DENOISE ECHO
703989
+                DEREVERB DEREVERB_DECAY DEREVERB_LEVEL
703989
+                FRAMES FILTER_LENGTH ]
703989
+	@args.SLAVE {
703989
+		type string
703989
+		default "plug:hw"
703989
+	}
703989
+	@args.AGC {
703989
+		type string
703989
+		default off
703989
+	}
703989
+	@args.AGC_LEVEL {
703989
+		type integer
703989
+		default 8000
703989
+	}
703989
+	@args.DENOISE {
703989
+		type string
703989
+		default on
703989
+	}
703989
+	@args.ECHO {
703989
+		type string
703989
+		default off
703989
+	}
703989
+	@args.DEREVERB {
703989
+		type string
703989
+		default off
703989
+	}
703989
+	@args.DEREVERB_DECAY {
703989
+		type real
703989
+		default 0
703989
+	}
703989
+	@args.DEREVERB_LEVEL {
703989
+		type real
703989
+		default 0
703989
+	}
703989
+	@args.FRAMES {
703989
+		type integer
703989
+		default 64
703989
+	}
703989
+	@args.FILTER_LENGTH {
703989
+		type integer
703989
+		default 256
703989
+	}
703989
+	type speex
703989
+	agc $AGC
703989
+	agc_level $AGC_LEVEL
703989
+	denoise $DENOISE
703989
+	echo $ECHO
703989
+	dereverb $DEREVERB
703989
+	dereverb_decay $DEREVERB_DECAY
703989
+	dereverb_level $DEREVERB_LEVEL
703989
+	frames $FRAMES
703989
+	filter_length $FILTER_LENGTH
703989
+	slave.pcm $SLAVE
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+                description "Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)"
703989
+	}
703989
+}
703989
diff --git a/speex/Makefile.am b/speex/Makefile.am
703989
index 7d84190..7891954 100644
703989
--- a/speex/Makefile.am
703989
+++ b/speex/Makefile.am
703989
@@ -1,6 +1,10 @@
703989
+EXTRA_DIST = 60-speex.conf
703989
+
703989
 asound_module_pcm_speex_LTLIBRARIES = libasound_module_pcm_speex.la
703989
+asound_module_addon_DATA = 60-speex.conf
703989
 
703989
 asound_module_pcm_speexdir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @speexdsp_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
diff --git a/usb_stream/98-usb-stream.conf b/usb_stream/98-usb-stream.conf
703989
new file mode 100644
703989
index 0000000..2efc95f
703989
--- /dev/null
703989
+++ b/usb_stream/98-usb-stream.conf
703989
@@ -0,0 +1,27 @@
703989
+pcm.usbstream {
703989
+	@args [ CARD RATE PERIOD_SIZE ]
703989
+	@args.CARD {
703989
+		type string
703989
+		default {
703989
+			func refer
703989
+			name defaults.pcm.card
703989
+		}
703989
+	}
703989
+	@args.RATE {
703989
+		type integer
703989
+	}
703989
+	@args.PERIOD_SIZE {
703989
+		type integer
703989
+	}
703989
+	type usb_stream
703989
+	card $CARD
703989
+	rate $RATE
703989
+	period_size $PERIOD_SIZE
703989
+	hint {
703989
+		show {
703989
+			@func refer
703989
+			name defaults.namehint.basic
703989
+		}
703989
+                description "USB Stream Output"
703989
+	}
703989
+}
703989
diff --git a/usb_stream/Makefile.am b/usb_stream/Makefile.am
703989
index 50a98a0..b606d3d 100644
703989
--- a/usb_stream/Makefile.am
703989
+++ b/usb_stream/Makefile.am
703989
@@ -1,6 +1,10 @@
703989
+EXTRA_DIST = 98-usb-stream.conf
703989
+
703989
 asound_module_pcm_usb_stream_LTLIBRARIES = libasound_module_pcm_usb_stream.la
703989
+asound_module_addon_DATA = 98-usb-stream.conf
703989
 
703989
 asound_module_pcm_usb_streamdir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic $(LDFLAGS_NOUNDEFINED)
703989
-- 
703989
2.13.6
703989
703989
703989
From cc6bed233a3167d806834460befca2c6d655f0fb Mon Sep 17 00:00:00 2001
703989
From: Jaroslav Kysela <perex@perex.cz>
703989
Date: Fri, 13 Apr 2018 13:37:36 +0200
703989
Subject: [PATCH 3/8] config/Makefile: make everything modular
703989
703989
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
703989
---
703989
 Makefile.am     | 21 ++++++++++++++++++---
703989
 configure.ac    | 20 +++++++++++++++++++-
703989
 doc/Makefile.am | 37 ++++++++++++++++++++++++++++++++++---
703989
 3 files changed, 71 insertions(+), 7 deletions(-)
703989
703989
diff --git a/Makefile.am b/Makefile.am
703989
index 69cfe0d..303bc83 100644
703989
--- a/Makefile.am
703989
+++ b/Makefile.am
703989
@@ -1,4 +1,10 @@
703989
-SUBDIRS = oss mix usb_stream arcam-av doc
703989
+SUBDIRS = doc
703989
+if HAVE_OSS
703989
+SUBDIRS += oss
703989
+endif
703989
+if HAVE_MIX
703989
+SUBDIRS += mix
703989
+endif
703989
 if HAVE_JACK
703989
 SUBDIRS += jack
703989
 endif
703989
@@ -8,8 +14,17 @@ endif
703989
 if HAVE_SAMPLERATE
703989
 SUBDIRS += rate
703989
 endif
703989
-if HAVE_AVCODEC
703989
-SUBDIRS += a52 rate-lavc
703989
+if HAVE_A52
703989
+SUBDIRS += a52
703989
+endif
703989
+if HAVE_AVCRATE
703989
+SUBDIRS += rate-lavc
703989
+endif
703989
+if HAVE_USBSTREAM
703989
+SUBDIRS += usb_stream
703989
+endif
703989
+if HAVE_ARCAMAV
703989
+SUBDIRS += arcam-av
703989
 endif
703989
 if HAVE_MAEMO_PLUGIN
703989
 SUBDIRS += maemo
703989
diff --git a/configure.ac b/configure.ac
703989
index ae98caa..2d7e6aa 100644
703989
--- a/configure.ac
703989
+++ b/configure.ac
703989
@@ -135,6 +135,22 @@ AC_SUBST(AVCODEC_CFLAGS)
703989
 AC_SUBST(AVCODEC_LIBS)
703989
 AC_SUBST(AVCODEC_HEADER)
703989
 
703989
+AC_ARG_ENABLE([a52],
703989
+      AS_HELP_STRING([--disable-a52], [Disable building of A52 encoder plugin]))
703989
+
703989
+if test "x$enable_a52" != "xno" -a "$HAVE_AVCODEC" = "yes"; then
703989
+  HAVE_A52=yes
703989
+fi
703989
+AM_CONDITIONAL(HAVE_A52, test x$HAVE_A52 = xyes)
703989
+
703989
+AC_ARG_ENABLE([avcrate],
703989
+      AS_HELP_STRING([--disable-avcrate], [Disable building of AVC rate plugin]))
703989
+
703989
+if test "x$enable_avcrate" != "xno" -a "$HAVE_AVCODEC" = "yes"; then
703989
+  HAVE_AVCRATE=yes
703989
+fi
703989
+AM_CONDITIONAL(HAVE_AVCRATE, test x$HAVE_AVCRATE = xyes)
703989
+
703989
 AC_ARG_ENABLE([speexdsp],
703989
       AS_HELP_STRING([--disable-speexdsp], [Disable building of speexdsp plugin]))
703989
 
703989
@@ -260,12 +276,14 @@ if test "$HAVE_SAMPLERATE" = "yes"; then
703989
 fi
703989
 echo "Maemo plugin:       $HAVE_MAEMO_PLUGIN"
703989
 echo "  Using Osso resource manager: $use_maemo_rm"
703989
-echo "A52, lavc plugins:  $HAVE_AVCODEC"
703989
 if test "$HAVE_AVCODEC" = "yes"; then
703989
+  echo "AVCodec config:"
703989
   echo "  AVCODEC_CFLAGS: $AVCODEC_CFLAGS"
703989
   echo "  AVCODEC_LIBS: $AVCODEC_LIBS"
703989
   echo "  AVCODEC_HEADER: $AVCODEC_HEADER"
703989
 fi
703989
+echo "A52 plugin:         $HAVE_A52"
703989
+echo "AVC rate plugin:    $HAVE_AVCRATE"
703989
 echo "Speex rate plugin:  $PPH"
703989
 echo "Speex preprocess plugin:  $HAVE_SPEEXDSP"
703989
 if test "$HAVE_SPEEX" = "yes"; then
703989
diff --git a/doc/Makefile.am b/doc/Makefile.am
703989
index 19fa0d2..0d6f6e5 100644
703989
--- a/doc/Makefile.am
703989
+++ b/doc/Makefile.am
703989
@@ -1,4 +1,35 @@
703989
-EXTRA_DIST = README-pcm-oss README-jack README-pulse README-maemo \
703989
-	upmix.txt vdownmix.txt samplerate.txt a52.txt lavcrate.txt \
703989
-	speexrate.txt speexdsp.txt README-arcam-av
703989
+EXTRA_DIST =
703989
 
703989
+if HAVE_OSS
703989
+EXTRA_DIST += README-pcm-oss
703989
+endif
703989
+if HAVE_MIX
703989
+EXTRA_DIST += upmix.txt vdownmix.txt
703989
+endif
703989
+if HAVE_JACK
703989
+EXTRA_DIST += README-jack
703989
+endif
703989
+if HAVE_PULSE
703989
+EXTRA_DIST += README-pulse
703989
+endif
703989
+if HAVE_MAEMO_PLUGIN
703989
+EXTRA_DIST += README-maemo
703989
+endif
703989
+if HAVE_SAMPLERATE
703989
+EXTRA_DIST += samplerate.txt
703989
+endif
703989
+if HAVE_A52
703989
+EXTRA_DIST += a52.txt
703989
+endif
703989
+if HAVE_AVCRATE
703989
+EXTRA_DIST += lavcrate.txt
703989
+endif
703989
+if HAVE_PPH
703989
+EXTRA_DIST += speexrate.txt
703989
+endif
703989
+if HAVE_SPEEXDSP
703989
+EXTRA_DIST += speexdsp.txt
703989
+endif
703989
+if HAVE_ARCAMAV
703989
+EXTRA_DIST += README-arcam-av
703989
+endif
703989
-- 
703989
2.13.6
703989
703989
703989
From 24db7f59d76984e2901f2834a297735853cab776 Mon Sep 17 00:00:00 2001
703989
From: Jaroslav Kysela <perex@perex.cz>
703989
Date: Mon, 16 Apr 2018 16:24:29 +0200
703989
Subject: [PATCH 4/8] Move rate-lavc to rate-lav subdirectory and update to use
703989
 libavresample
703989
703989
- --disable-avcodec renamed to --disable-libav
703989
- --avcodec-includedir renamed to --libav-includedir
703989
- --avcodec-libdir renamed to --libav-libdir
703989
- --disable-lavcrate renamed to --disable-lavrate
703989
703989
The .c changes are from Anton Khirnov. The rest is from Jaroslav Kysela.
703989
703989
From: Anton Khirnov
703989
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
703989
---
703989
 Makefile.am                                        |   4 +-
703989
 a52/Makefile.am                                    |   5 +-
703989
 a52/pcm_a52.c                                      |   2 +-
703989
 configure.ac                                       |  85 +++---
703989
 doc/Makefile.am                                    |   4 +-
703989
 doc/{lavcrate.txt => lavrate.txt}                  |  10 +-
703989
 .../10-rate-lavc.conf => rate-lav/10-rate-lav.conf |   6 +-
703989
 rate-lav/Makefile.am                               |  25 ++
703989
 {rate-lavc => rate-lav}/gcd.h                      |   0
703989
 rate-lav/rate_lavrate.c                            | 235 +++++++++++++++++
703989
 rate-lavc/Makefile.am                              |  26 --
703989
 rate-lavc/rate_lavcrate.c                          | 291 ---------------------
703989
 12 files changed, 311 insertions(+), 382 deletions(-)
703989
 rename doc/{lavcrate.txt => lavrate.txt} (76%)
703989
 rename rate-lavc/10-rate-lavc.conf => rate-lav/10-rate-lav.conf (73%)
703989
 create mode 100644 rate-lav/Makefile.am
703989
 rename {rate-lavc => rate-lav}/gcd.h (100%)
703989
 create mode 100644 rate-lav/rate_lavrate.c
703989
 delete mode 100644 rate-lavc/Makefile.am
703989
 delete mode 100644 rate-lavc/rate_lavcrate.c
703989
703989
diff --git a/Makefile.am b/Makefile.am
703989
index 303bc83..27f61a4 100644
703989
--- a/Makefile.am
703989
+++ b/Makefile.am
703989
@@ -17,8 +17,8 @@ endif
703989
 if HAVE_A52
703989
 SUBDIRS += a52
703989
 endif
703989
-if HAVE_AVCRATE
703989
-SUBDIRS += rate-lavc
703989
+if HAVE_LAVRATE
703989
+SUBDIRS += rate-lav
703989
 endif
703989
 if HAVE_USBSTREAM
703989
 SUBDIRS += usb_stream
703989
diff --git a/a52/Makefile.am b/a52/Makefile.am
703989
index cbc1497..4ac8edd 100644
703989
--- a/a52/Makefile.am
703989
+++ b/a52/Makefile.am
703989
@@ -6,9 +6,8 @@ asound_module_addon_DATA = 60-a52-encoder.conf
703989
 asound_module_pcm_a52dir = @ALSA_PLUGIN_DIR@
703989
 asound_module_addondir = @ALSA_ADDON_DIR@
703989
 
703989
-AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @AVCODEC_CFLAGS@ \
703989
-	-DAVCODEC_HEADER="@AVCODEC_HEADER@"
703989
+AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @LIBAV_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
 
703989
 libasound_module_pcm_a52_la_SOURCES = pcm_a52.c
703989
-libasound_module_pcm_a52_la_LIBADD = @ALSA_LIBS@ @AVCODEC_LIBS@
703989
+libasound_module_pcm_a52_la_LIBADD = @ALSA_LIBS@ @LIBAV_LIBS@ @LIBAV_CODEC_LIBS@
703989
diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c
703989
index 155da36..29ce45f 100644
703989
--- a/a52/pcm_a52.c
703989
+++ b/a52/pcm_a52.c
703989
@@ -25,7 +25,7 @@
703989
 #include <alsa/asoundlib.h>
703989
 #include <alsa/pcm_external.h>
703989
 #include <alsa/pcm_plugin.h>
703989
-#include AVCODEC_HEADER
703989
+#include <libavcodec/avcodec.h>
703989
 #include <libavutil/avutil.h>
703989
 
703989
 /* some compatibility wrappers */
703989
diff --git a/configure.ac b/configure.ac
703989
index 2d7e6aa..cb1ae2d 100644
703989
--- a/configure.ac
703989
+++ b/configure.ac
703989
@@ -89,67 +89,55 @@ if test "$use_maemo_rm" = "yes"; then
703989
         fi
703989
 fi
703989
 
703989
-AC_ARG_ENABLE([avcodec],
703989
-      AS_HELP_STRING([--disable-avcodec], [Don't build plugins depending on avcodec (a52)]))
703989
+AC_ARG_ENABLE([libav],
703989
+      AS_HELP_STRING([--disable-avlib], [Do not build plugins depending on libav/ffmpeg (a52,lavrate...)]))
703989
 
703989
-if test "x$enable_avcodec" != "xno"; then
703989
-  PKG_CHECK_MODULES(AVCODEC, [libavcodec libavutil], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no])
703989
+if test "x$enable_libav" != "xno"; then
703989
+  PKG_CHECK_MODULES(LIBAV, [libavcodec libavutil libavresample], [HAVE_LIBAV=yes], [HAVE_LIBAV=no])
703989
 fi
703989
 
703989
-if test "x$HAVE_AVCODEC" = "xno"; then
703989
-  AC_ARG_WITH([avcodec-includedir],
703989
-	AS_HELP_STRING([--with-avcodec-includedir=dir],
703989
-		[AVcodec include directory]),
703989
-	[AVCODEC_CFLAGS="-I$withval"], [AVCODEC_CFLAGS=""])
703989
-  AC_ARG_WITH([avcodec-libdir],
703989
-	AS_HELP_STRING([--with-avcodec-libdir=dir],
703989
-		[AVcodec library directory]),
703989
-	[AVCODEC_LIBS="-L$withval"], [AVCODEC_LIBS=""])
703989
+if test "x$HAVE_LIBAV" = "xno"; then
703989
+  AC_ARG_WITH([libav-includedir],
703989
+	AS_HELP_STRING([--with-libav-includedir=dir],
703989
+		[Libav/ffmpeg include directory]),
703989
+		[LIBAV_CFLAGS="-I$(withval)"], [LIBAV_CFLAGS=""])
703989
+  AC_ARG_WITH([libav-libdir],
703989
+	AS_HELP_STRING([--with-libav-libdir=dir],
703989
+		[Libav/ffmpeg library directory]),
703989
+		[LIBAV_LIBS="-L$withval"], [LIBAV_LIBS=""])
703989
 
703989
   CFLAGS_saved="$CFLAGS"
703989
   LDFLAGS_saved="$LDFLAGS"
703989
-  CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
703989
-  LDFLAGS="$LDFLAGS $AVCODEC_LIBS"
703989
-  AVCODEC_LIBS="$AVCODEC_LIBS -lavcodec"
703989
-  AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no])
703989
+  CFLAGS="$CFLAGS $LIBAV_CFLAGS"
703989
+  LDFLAGS="$LDFLAGS $LIBAV_LIBS"
703989
+  AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_LIBAV=yes], [HAVE_LIBAV=no])
703989
   CFLAGS="$CFLAGS_saved"
703989
   LDFLAGS="$LDFLAGS_saved"
703989
+  LIBAV_CODEC_LIBS="-lavcodec"
703989
+  LIBAV_RESAMPLE_LIBS="-lavresample -lavutil"
703989
 fi
703989
 
703989
-if test $HAVE_AVCODEC = yes; then
703989
-  AVCODEC_HEADER=""
703989
-  CFLAGS_saved="$CFLAGS"
703989
-  CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
703989
-  AC_CHECK_HEADER([ffmpeg/avcodec.h], [AVCODEC_HEADER='<ffmpeg/avcodec.h>'])
703989
-  if test -z "$AVCODEC_HEADER"; then
703989
-    AC_CHECK_HEADER([libavcodec/avcodec.h], [AVCODEC_HEADER='<libavcodec/avcodec.h>'])
703989
-  fi
703989
-  if test -z "$AVCODEC_HEADER"; then
703989
-    HAVE_AVCODEC=no
703989
-  fi
703989
-  CFLAGS="$CFLAGS_saved"
703989
-fi
703989
-
703989
-AM_CONDITIONAL(HAVE_AVCODEC, test x$HAVE_AVCODEC = xyes)
703989
-AC_SUBST(AVCODEC_CFLAGS)
703989
-AC_SUBST(AVCODEC_LIBS)
703989
-AC_SUBST(AVCODEC_HEADER)
703989
+AM_CONDITIONAL(HAVE_LIBAV, test x$HAVE_LIBAV = xyes)
703989
+AC_SUBST(LIBAV_CFLAGS)
703989
+AC_SUBST(LIBAV_LIBS)
703989
+AC_SUBST(LIBAV_CODEC_LIBS)
703989
+AC_SUBST(LIBAV_RESAMPLE_LIBS)
703989
 
703989
 AC_ARG_ENABLE([a52],
703989
       AS_HELP_STRING([--disable-a52], [Disable building of A52 encoder plugin]))
703989
 
703989
-if test "x$enable_a52" != "xno" -a "$HAVE_AVCODEC" = "yes"; then
703989
+if test "x$enable_a52" != "xno" -a "$HAVE_LIBAV" = "yes"; then
703989
   HAVE_A52=yes
703989
 fi
703989
 AM_CONDITIONAL(HAVE_A52, test x$HAVE_A52 = xyes)
703989
 
703989
-AC_ARG_ENABLE([avcrate],
703989
-      AS_HELP_STRING([--disable-avcrate], [Disable building of AVC rate plugin]))
703989
+AC_ARG_ENABLE([lavrate],
703989
+      AS_HELP_STRING([--disable-lavrate], [Disable building of libav/ffmpeg rate plugin]))
703989
 
703989
-if test "x$enable_avcrate" != "xno" -a "$HAVE_AVCODEC" = "yes"; then
703989
-  HAVE_AVCRATE=yes
703989
+if test "x$enable_lavrate" != "xno" -a "$HAVE_LIBAV" = "yes"; then
703989
+  HAVE_LAVRATE=yes
703989
 fi
703989
-AM_CONDITIONAL(HAVE_AVCRATE, test x$HAVE_AVCRATE = xyes)
703989
+AM_CONDITIONAL(HAVE_LAVRATE, test x$HAVE_LAVRATE = xyes)
703989
 
703989
 AC_ARG_ENABLE([speexdsp],
703989
       AS_HELP_STRING([--disable-speexdsp], [Disable building of speexdsp plugin]))
703989
@@ -245,7 +233,7 @@ AC_OUTPUT([
703989
 	mix/Makefile
703989
 	rate/Makefile
703989
 	a52/Makefile
703989
-	rate-lavc/Makefile
703989
+	rate-lav/Makefile
703989
 	maemo/Makefile
703989
 	doc/Makefile
703989
 	usb_stream/Makefile
703989
@@ -276,14 +264,13 @@ if test "$HAVE_SAMPLERATE" = "yes"; then
703989
 fi
703989
 echo "Maemo plugin:       $HAVE_MAEMO_PLUGIN"
703989
 echo "  Using Osso resource manager: $use_maemo_rm"
703989
-if test "$HAVE_AVCODEC" = "yes"; then
703989
-  echo "AVCodec config:"
703989
-  echo "  AVCODEC_CFLAGS: $AVCODEC_CFLAGS"
703989
-  echo "  AVCODEC_LIBS: $AVCODEC_LIBS"
703989
-  echo "  AVCODEC_HEADER: $AVCODEC_HEADER"
703989
+if test "$HAVE_LIBAV" = "yes"; then
703989
+  echo "Libav/ffmpeg config:"
703989
+  echo "  LIBAV_CFLAGS:   $LIBAV_CFLAGS"
703989
+  echo "  LIBAV_LIBS:     $LIBAV_LIBS / $LIBAV_CODEC_LIBS / $LIBAV_RESAMPLE_LIBS"
703989
 fi
703989
-echo "A52 plugin:         $HAVE_A52"
703989
-echo "AVC rate plugin:    $HAVE_AVCRATE"
703989
+echo "Libav A52 plugin:   $HAVE_A52"
703989
+echo "Libav rate plugin:  $HAVE_LAVRATE"
703989
 echo "Speex rate plugin:  $PPH"
703989
 echo "Speex preprocess plugin:  $HAVE_SPEEXDSP"
703989
 if test "$HAVE_SPEEX" = "yes"; then
703989
diff --git a/doc/Makefile.am b/doc/Makefile.am
703989
index 0d6f6e5..7c004e5 100644
703989
--- a/doc/Makefile.am
703989
+++ b/doc/Makefile.am
703989
@@ -21,8 +21,8 @@ endif
703989
 if HAVE_A52
703989
 EXTRA_DIST += a52.txt
703989
 endif
703989
-if HAVE_AVCRATE
703989
-EXTRA_DIST += lavcrate.txt
703989
+if HAVE_LAVRATE
703989
+EXTRA_DIST += lavrate.txt
703989
 endif
703989
 if HAVE_PPH
703989
 EXTRA_DIST += speexrate.txt
703989
diff --git a/doc/lavcrate.txt b/doc/lavrate.txt
703989
similarity index 76%
703989
rename from doc/lavcrate.txt
703989
rename to doc/lavrate.txt
703989
index faf3e25..6575183 100644
703989
--- a/doc/lavcrate.txt
703989
+++ b/doc/lavrate.txt
703989
@@ -1,14 +1,14 @@
703989
-Rate Converter Plugin Using libavcodec
703989
-======================================
703989
+Rate Converter Plugin Using libavresample
703989
+=========================================0
703989
 
703989
-The plugin in rate-lavc subdirectory is an external rate converter using
703989
-libavcodec's resampler.  You can use this rate converter plugin by defining a
703989
+The plugin in rate-lavr subdirectory is an external rate converter using
703989
+libavresample library. You can use this rate converter plugin by defining a
703989
 rate PCM with "converter" parameter, such as:
703989
 
703989
 	pcm.my_rate {
703989
 		type rate
703989
 		slave.pcm "hw"
703989
-		converter "lavcrate"
703989
+		converter "lavrate"
703989
 	}
703989
 
703989
 The plug plugin has also a similar field, "rate_converter".
703989
diff --git a/rate-lavc/10-rate-lavc.conf b/rate-lav/10-rate-lav.conf
703989
similarity index 73%
703989
rename from rate-lavc/10-rate-lavc.conf
703989
rename to rate-lav/10-rate-lav.conf
703989
index bab1694..48ede62 100644
703989
--- a/rate-lavc/10-rate-lavc.conf
703989
+++ b/rate-lav/10-rate-lav.conf
703989
@@ -1,4 +1,4 @@
703989
-pcm.lavcrate {
703989
+pcm.lavrate {
703989
 	@args [ SLAVE RATE CONVERTER ]
703989
 	@args.SLAVE {
703989
 		type string
703989
@@ -10,7 +10,7 @@ pcm.lavcrate {
703989
 	}
703989
 	@args.CONVERTER {
703989
 		type string
703989
-		default "lavcrate"
703989
+		default "lavrate"
703989
 	}
703989
 	type rate
703989
 	converter $CONVERTER
703989
@@ -23,6 +23,6 @@ pcm.lavcrate {
703989
 			@func refer
703989
 			name defaults.namehint.basic
703989
 		}
703989
-                description "Rate Converter Plugin Using AVC Library"
703989
+                description "Rate Converter Plugin Using Libav/FFmpeg Library"
703989
 	}
703989
 }
703989
diff --git a/rate-lav/Makefile.am b/rate-lav/Makefile.am
703989
new file mode 100644
703989
index 0000000..0f6ecb6
703989
--- /dev/null
703989
+++ b/rate-lav/Makefile.am
703989
@@ -0,0 +1,25 @@
703989
+EXTRA_DIST = 10-rate-lav.conf
703989
+
703989
+asound_module_rate_lavrate_LTLIBRARIES = libasound_module_rate_lavrate.la
703989
+asound_module_addon_DATA = 10-rate-lav.conf
703989
+
703989
+asound_module_rate_lavratedir = @ALSA_PLUGIN_DIR@
703989
+asound_module_addondir = @ALSA_ADDON_DIR@
703989
+
703989
+AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @LIBAV_CFLAGS@
703989
+AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
+
703989
+libasound_module_rate_lavrate_la_SOURCES = rate_lavrate.c
703989
+libasound_module_rate_lavrate_la_LIBADD = @ALSA_LIBS@ @LIBAV_LIBS@ @LIBAV_RESAMPLE_LIBS@
703989
+
703989
+noinst_HEADERS = gcd.h
703989
+
703989
+install-exec-hook:
703989
+	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_*.so
703989
+	$(LN_S) libasound_module_rate_lavrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_higher.so
703989
+	$(LN_S) libasound_module_rate_lavrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_high.so
703989
+	$(LN_S) libasound_module_rate_lavrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_fast.so
703989
+	$(LN_S) libasound_module_rate_lavrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_faster.so
703989
+
703989
+uninstall-hook:
703989
+	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_*.so
703989
diff --git a/rate-lavc/gcd.h b/rate-lav/gcd.h
703989
similarity index 100%
703989
rename from rate-lavc/gcd.h
703989
rename to rate-lav/gcd.h
703989
diff --git a/rate-lav/rate_lavrate.c b/rate-lav/rate_lavrate.c
703989
new file mode 100644
703989
index 0000000..2b992c5
703989
--- /dev/null
703989
+++ b/rate-lav/rate_lavrate.c
703989
@@ -0,0 +1,235 @@
703989
+/*
703989
+ * Rate converter plugin using libavresample
703989
+ * Copyright (c) 2014 by Anton Khirnov
703989
+ *
703989
+ * This library is free software; you can redistribute it and/or
703989
+ * modify it under the terms of the GNU Lesser General Public
703989
+ * License as published by the Free Software Foundation; either
703989
+ * version 2.1 of the License, or (at your option) any later version.
703989
+ *
703989
+ * This library is distributed in the hope that it will be useful,
703989
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
703989
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
703989
+ * Lesser General Public License for more details.
703989
+ */
703989
+
703989
+#include <stdio.h>
703989
+#include <alsa/asoundlib.h>
703989
+#include <alsa/pcm_rate.h>
703989
+
703989
+#include <libavresample/avresample.h>
703989
+#include <libavutil/channel_layout.h>
703989
+#include <libavutil/opt.h>
703989
+#include <libavutil/mathematics.h>
703989
+#include <libavutil/samplefmt.h>
703989
+
703989
+
703989
+static unsigned int filter_size = 16;
703989
+static unsigned int phase_shift = 10; /* auto-adjusts */
703989
+static double cutoff = 0; /* auto-adjusts */
703989
+
703989
+struct rate_src {
703989
+	AVAudioResampleContext *avr;
703989
+
703989
+	unsigned int in_rate;
703989
+	unsigned int out_rate;
703989
+	unsigned int channels;
703989
+};
703989
+
703989
+static snd_pcm_uframes_t input_frames(void *obj ATTRIBUTE_UNUSED,
703989
+				      snd_pcm_uframes_t frames)
703989
+{
703989
+	return frames;
703989
+}
703989
+
703989
+static snd_pcm_uframes_t output_frames(void *obj ATTRIBUTE_UNUSED,
703989
+				       snd_pcm_uframes_t frames)
703989
+{
703989
+	return frames;
703989
+}
703989
+
703989
+static void pcm_src_free(void *obj)
703989
+{
703989
+	struct rate_src *rate = obj;
703989
+	avresample_free(&rate->avr);
703989
+}
703989
+
703989
+static int pcm_src_init(void *obj, snd_pcm_rate_info_t *info)
703989
+{
703989
+	struct rate_src *rate = obj;
703989
+	int i, ir, or;
703989
+
703989
+	if (!rate->avr || rate->channels != info->channels) {
703989
+		int ret;
703989
+
703989
+		pcm_src_free(rate);
703989
+		rate->channels = info->channels;
703989
+		ir = rate->in_rate = info->in.rate;
703989
+		or = rate->out_rate = info->out.rate;
703989
+		i = av_gcd(or, ir);
703989
+		if (or > ir) {
703989
+			phase_shift = or/i;
703989
+		} else {
703989
+			phase_shift = ir/i;
703989
+		}
703989
+		if (cutoff <= 0.0) {
703989
+			cutoff = 1.0 - 1.0/filter_size;
703989
+			if (cutoff < 0.80)
703989
+				cutoff = 0.80;
703989
+		}
703989
+
703989
+		rate->avr = avresample_alloc_context();
703989
+		if (!rate->avr)
703989
+			return -ENOMEM;
703989
+
703989
+		av_opt_set_int(rate->avr, "in_sample_rate",     info->in.rate,  0);
703989
+		av_opt_set_int(rate->avr, "out_sample_rate",    info->out.rate, 0);
703989
+		av_opt_set_int(rate->avr, "in_sample_format",   AV_SAMPLE_FMT_S16, 0);
703989
+		av_opt_set_int(rate->avr, "out_sample_format",  AV_SAMPLE_FMT_S16, 0);
703989
+		av_opt_set_int(rate->avr, "in_channel_layout",  av_get_default_channel_layout(rate->channels), 0);
703989
+		av_opt_set_int(rate->avr, "out_channel_layout", av_get_default_channel_layout(rate->channels), 0);
703989
+
703989
+		av_opt_set_int(rate->avr, "filter_size",        filter_size, 0);
703989
+		av_opt_set_int(rate->avr, "phase_shift",        phase_shift, 0);
703989
+		av_opt_set_double(rate->avr, "cutoff",          cutoff,      0);
703989
+
703989
+		ret = avresample_open(rate->avr);
703989
+		if (ret < 0) {
703989
+			avresample_free(&rate->avr);
703989
+			return -EINVAL;
703989
+		}
703989
+	}
703989
+
703989
+	return 0;
703989
+}
703989
+
703989
+static int pcm_src_adjust_pitch(void *obj, snd_pcm_rate_info_t *info)
703989
+{
703989
+	struct rate_src *rate = obj;
703989
+
703989
+	if (info->out.rate != rate->out_rate || info->in.rate != rate->in_rate)
703989
+		pcm_src_init(obj, info);
703989
+	return 0;
703989
+}
703989
+
703989
+static void pcm_src_reset(void *obj)
703989
+{
703989
+	struct rate_src *rate = obj;
703989
+
703989
+	if (rate->avr) {
703989
+#if 0
703989
+		avresample_close(rate->avr);
703989
+		avresample_open(rate->avr);
703989
+#endif
703989
+	}
703989
+}
703989
+
703989
+static void pcm_src_convert_s16(void *obj, int16_t *dst,
703989
+				unsigned int dst_frames,
703989
+				const int16_t *src,
703989
+				unsigned int src_frames)
703989
+{
703989
+	struct rate_src *rate = obj;
703989
+	int chans = rate->channels;
703989
+	unsigned int total_in = avresample_get_delay(rate->avr) + src_frames;
703989
+
703989
+	avresample_convert(rate->avr, (uint8_t **)&dst, dst_frames * chans * 2, dst_frames,
703989
+	                   (uint8_t **)&src, src_frames * chans * 2, src_frames);
703989
+
703989
+	avresample_set_compensation(rate->avr,
703989
+                                    total_in - src_frames > filter_size ? 0 : 1, src_frames);
703989
+}
703989
+
703989
+static void pcm_src_close(void *obj)
703989
+{
703989
+	pcm_src_free(obj);
703989
+}
703989
+
703989
+#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
703989
+static int get_supported_rates(void *obj ATTRIBUTE_UNUSED,
703989
+			       unsigned int *rate_min,
703989
+			       unsigned int *rate_max)
703989
+{
703989
+	*rate_min = *rate_max = 0; /* both unlimited */
703989
+	return 0;
703989
+}
703989
+
703989
+static void dump(void *obj ATTRIBUTE_UNUSED, snd_output_t *out)
703989
+{
703989
+	snd_output_printf(out, "Converter: libavr\n");
703989
+}
703989
+#endif
703989
+
703989
+static snd_pcm_rate_ops_t pcm_src_ops = {
703989
+	.close = pcm_src_close,
703989
+	.init = pcm_src_init,
703989
+	.free = pcm_src_free,
703989
+	.reset = pcm_src_reset,
703989
+	.adjust_pitch = pcm_src_adjust_pitch,
703989
+	.convert_s16 = pcm_src_convert_s16,
703989
+	.input_frames = input_frames,
703989
+	.output_frames = output_frames,
703989
+#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
703989
+	.version = SND_PCM_RATE_PLUGIN_VERSION,
703989
+	.get_supported_rates = get_supported_rates,
703989
+	.dump = dump,
703989
+#endif
703989
+};
703989
+
703989
+int pcm_src_open(unsigned int version, void **objp, snd_pcm_rate_ops_t *ops)
703989
+
703989
+{
703989
+	struct rate_src *rate;
703989
+
703989
+#if SND_PCM_RATE_PLUGIN_VERSION < 0x010002
703989
+	if (version != SND_PCM_RATE_PLUGIN_VERSION) {
703989
+		fprintf(stderr, "Invalid rate plugin version %x\n", version);
703989
+		return -EINVAL;
703989
+	}
703989
+#endif
703989
+	rate = calloc(1, sizeof(*rate));
703989
+	if (!rate)
703989
+		return -ENOMEM;
703989
+
703989
+	*objp = rate;
703989
+	rate->avr = NULL;
703989
+#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
703989
+	if (version == 0x010001)
703989
+		memcpy(ops, &pcm_src_ops, sizeof(snd_pcm_rate_old_ops_t));
703989
+	else
703989
+#endif
703989
+		*ops = pcm_src_ops;
703989
+	return 0;
703989
+}
703989
+
703989
+int SND_PCM_RATE_PLUGIN_ENTRY(lavrate)(unsigned int version, void **objp,
703989
+			snd_pcm_rate_ops_t *ops)
703989
+{
703989
+	return pcm_src_open(version, objp, ops);
703989
+}
703989
+int SND_PCM_RATE_PLUGIN_ENTRY(lavrate_higher)(unsigned int version,
703989
+			void **objp, snd_pcm_rate_ops_t *ops)
703989
+{
703989
+	filter_size = 64;
703989
+	return pcm_src_open(version, objp, ops);
703989
+}
703989
+int SND_PCM_RATE_PLUGIN_ENTRY(lavrate_high)(unsigned int version,
703989
+			void **objp, snd_pcm_rate_ops_t *ops)
703989
+{
703989
+	filter_size = 32;
703989
+	return pcm_src_open(version, objp, ops);
703989
+}
703989
+int SND_PCM_RATE_PLUGIN_ENTRY(lavrate_fast)(unsigned int version,
703989
+			void **objp, snd_pcm_rate_ops_t *ops)
703989
+{
703989
+	filter_size = 8;
703989
+	return pcm_src_open(version, objp, ops);
703989
+}
703989
+int SND_PCM_RATE_PLUGIN_ENTRY(lavrate_faster)(unsigned int version,
703989
+			void **objp, snd_pcm_rate_ops_t *ops)
703989
+{
703989
+	filter_size = 4;
703989
+	return pcm_src_open(version, objp, ops);
703989
+}
703989
+
703989
+
703989
diff --git a/rate-lavc/Makefile.am b/rate-lavc/Makefile.am
703989
deleted file mode 100644
703989
index 5f66472..0000000
703989
--- a/rate-lavc/Makefile.am
703989
+++ /dev/null
703989
@@ -1,26 +0,0 @@
703989
-EXTRA_DIST = 10-rate-lavc.conf
703989
-
703989
-asound_module_rate_lavcrate_LTLIBRARIES = libasound_module_rate_lavcrate.la
703989
-asound_module_addon_DATA = 10-rate-lavc.conf
703989
-
703989
-asound_module_rate_lavcratedir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
-
703989
-AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @AVCODEC_CFLAGS@ \
703989
-	-DAVCODEC_HEADER="@AVCODEC_HEADER@"
703989
-AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
-
703989
-libasound_module_rate_lavcrate_la_SOURCES = rate_lavcrate.c
703989
-libasound_module_rate_lavcrate_la_LIBADD = @ALSA_LIBS@ @AVCODEC_LIBS@
703989
-
703989
-noinst_HEADERS = gcd.h
703989
-
703989
-install-exec-hook:
703989
-	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_*.so
703989
-	$(LN_S) libasound_module_rate_lavcrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_higher.so
703989
-	$(LN_S) libasound_module_rate_lavcrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_high.so
703989
-	$(LN_S) libasound_module_rate_lavcrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_fast.so
703989
-	$(LN_S) libasound_module_rate_lavcrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_faster.so
703989
-
703989
-uninstall-hook:
703989
-	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavcrate_*.so
703989
diff --git a/rate-lavc/rate_lavcrate.c b/rate-lavc/rate_lavcrate.c
703989
deleted file mode 100644
703989
index 14a2198..0000000
703989
--- a/rate-lavc/rate_lavcrate.c
703989
+++ /dev/null
703989
@@ -1,291 +0,0 @@
703989
-/*
703989
- * Rate converter plugin using libavcodec's resampler
703989
- * Copyright (c) 2007 by Nicholas Kain <njkain@gmail.com>
703989
- *
703989
- * based on rate converter that uses libsamplerate
703989
- * Copyright (c) 2006 by Takashi Iwai <tiwai@suse.de>
703989
- *
703989
- * This library is free software; you can redistribute it and/or
703989
- * modify it under the terms of the GNU Lesser General Public
703989
- * License as published by the Free Software Foundation; either
703989
- * version 2.1 of the License, or (at your option) any later version.
703989
- *
703989
- * This library is distributed in the hope that it will be useful,
703989
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
703989
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
703989
- * Lesser General Public License for more details.
703989
- */
703989
-
703989
-#include <stdio.h>
703989
-#include <alsa/asoundlib.h>
703989
-#include <alsa/pcm_rate.h>
703989
-#include AVCODEC_HEADER
703989
-#include "gcd.h"
703989
-
703989
-static int filter_size = 16;
703989
-static int phase_shift = 10; /* auto-adjusts */
703989
-static double cutoff = 0; /* auto-adjusts */
703989
-
703989
-struct rate_src {
703989
-	struct AVResampleContext *context;
703989
-	int in_rate;
703989
-	int out_rate;
703989
-	int stored;
703989
-	int point;
703989
-	int16_t **out;
703989
-	int16_t **in;
703989
-	unsigned int channels;
703989
-};
703989
-
703989
-static snd_pcm_uframes_t input_frames(void *obj, snd_pcm_uframes_t frames)
703989
-{
703989
-	return frames;
703989
-}
703989
-
703989
-static snd_pcm_uframes_t output_frames(void *obj, snd_pcm_uframes_t frames)
703989
-{
703989
-	return frames;
703989
-}
703989
-
703989
-static void pcm_src_free(void *obj)
703989
-{
703989
-	struct rate_src *rate = obj;
703989
-	int i;
703989
-
703989
-	if (rate->out) {
703989
-		for (i=0; i<rate->channels; i++) {
703989
-			free(rate->out[i]);
703989
-		}
703989
-		free(rate->out);
703989
-	}
703989
-	if (rate->in) {
703989
-		for (i=0; i<rate->channels; i++) {
703989
-			free(rate->in[i]);
703989
-		}
703989
-		free(rate->in);
703989
-	}
703989
-	rate->out = rate->in = NULL;
703989
-
703989
-	if (rate->context) {
703989
-		av_resample_close(rate->context);
703989
-		rate->context = NULL;
703989
-	}
703989
-}
703989
-
703989
-static int pcm_src_init(void *obj, snd_pcm_rate_info_t *info)
703989
-{
703989
-	struct rate_src *rate = obj;
703989
-	int i, ir, or;
703989
-
703989
-	if (! rate->context || rate->channels != info->channels) {
703989
-		pcm_src_free(rate);
703989
-		rate->channels = info->channels;
703989
-		ir = rate->in_rate = info->in.rate;
703989
-		or = rate->out_rate = info->out.rate;
703989
-		i = gcd(or, ir);
703989
-		if (or > ir) {
703989
-			phase_shift = or/i;
703989
-		} else {
703989
-			phase_shift = ir/i;
703989
-		}
703989
-		if (cutoff <= 0.0) {
703989
-			cutoff = 1.0 - 1.0/filter_size;
703989
-			if (cutoff < 0.80)
703989
-				cutoff = 0.80;
703989
-		}
703989
-		rate->context = av_resample_init(info->out.rate, info->in.rate,
703989
-			filter_size, phase_shift,
703989
-			(info->out.rate >= info->in.rate ? 0 : 1), cutoff);
703989
-		if (!rate->context)
703989
-			return -EINVAL;
703989
-	}
703989
-
703989
-	rate->out = malloc(rate->channels * sizeof(int16_t *));
703989
-	rate->in = malloc(rate->channels * sizeof(int16_t *));
703989
-	for (i=0; i<rate->channels; i++) {
703989
-		rate->out[i] = calloc(info->out.period_size * 2, 
703989
-			sizeof(int16_t));
703989
-		rate->in[i] = calloc(info->in.period_size * 2,
703989
-			sizeof(int16_t));
703989
-	}
703989
-	rate->point = info->in.period_size / 2;
703989
-	if (!rate->out || !rate->in) {
703989
-		pcm_src_free(rate);
703989
-		return -ENOMEM;
703989
-	}
703989
-
703989
-	return 0;
703989
-}
703989
-
703989
-static int pcm_src_adjust_pitch(void *obj, snd_pcm_rate_info_t *info)
703989
-{
703989
-	struct rate_src *rate = obj;
703989
-
703989
-	if (info->out.rate != rate->out_rate || info->in.rate != rate->in_rate)
703989
-		pcm_src_init(obj, info);
703989
-	return 0;
703989
-}
703989
-
703989
-static void pcm_src_reset(void *obj)
703989
-{
703989
-	struct rate_src *rate = obj;
703989
-	rate->stored = 0;
703989
-}
703989
-
703989
-static void deinterleave(const int16_t *src, int16_t **dst, unsigned int frames,
703989
-	unsigned int chans, int overflow)
703989
-{
703989
-	int i, j;
703989
-
703989
-	if (chans == 1) {
703989
-		memcpy(dst + overflow, src, frames*sizeof(int16_t));
703989
-	} else if (chans == 2) {
703989
-		for (j=overflow; j<(frames + overflow); j++) {
703989
-			dst[0][j] = *(src++);
703989
-			dst[1][j] = *(src++);
703989
-		}
703989
-	} else {
703989
-		for (j=overflow; j<(frames + overflow); j++) {
703989
-			for (i=0; i
703989
-				dst[i][j] = *(src++);
703989
-			}
703989
-		}
703989
-	}
703989
-}
703989
-
703989
-static void reinterleave(int16_t **src, int16_t *dst, unsigned int frames,
703989
-	unsigned int chans)
703989
-{
703989
-	int i, j;
703989
-
703989
-	if (chans == 1) {
703989
-		memcpy(dst, src, frames*sizeof(int16_t));
703989
-	} else if (chans == 2) {
703989
-		for (j=0; j
703989
-			*(dst++) = src[0][j];
703989
-			*(dst++) = src[1][j];
703989
-		}
703989
-	} else {
703989
-		for (j=0; j
703989
-			for (i=0; i
703989
-				*(dst++) = src[i][j];
703989
-			}
703989
-		}
703989
-	}
703989
-}
703989
-
703989
-static void pcm_src_convert_s16(void *obj, int16_t *dst, unsigned int
703989
-	dst_frames, const int16_t *src, unsigned int src_frames)
703989
-{
703989
-	struct rate_src *rate = obj;
703989
-	int consumed = 0, chans=rate->channels, ret=0, i;
703989
-	int total_in = rate->stored + src_frames, new_stored;
703989
-
703989
-	deinterleave(src, rate->in, src_frames, chans, rate->point);
703989
-	for (i=0; i
703989
-		ret = av_resample(rate->context, rate->out[i],
703989
-				rate->in[i]+rate->point-rate->stored, &consumed,
703989
-				total_in, dst_frames, i == (chans - 1));
703989
-		new_stored = total_in-consumed;
703989
-		memmove(rate->in[i]+rate->point-new_stored,
703989
-				rate->in[i]+rate->point-rate->stored+consumed,
703989
-				new_stored*sizeof(int16_t));
703989
-	}
703989
-	av_resample_compensate(rate->context,
703989
-			total_in-src_frames>filter_size?0:1, src_frames);
703989
-	reinterleave(rate->out, dst, ret, chans);
703989
-	rate->stored = total_in-consumed;
703989
-}
703989
-
703989
-static void pcm_src_close(void *obj)
703989
-{
703989
-	pcm_src_free(obj);
703989
-}
703989
-
703989
-#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
703989
-static int get_supported_rates(void *obj, unsigned int *rate_min,
703989
-			       unsigned int *rate_max)
703989
-{
703989
-	*rate_min = *rate_max = 0; /* both unlimited */
703989
-	return 0;
703989
-}
703989
-
703989
-static void dump(void *obj, snd_output_t *out)
703989
-{
703989
-	snd_output_printf(out, "Converter: liblavc\n");
703989
-}
703989
-#endif
703989
-
703989
-static snd_pcm_rate_ops_t pcm_src_ops = {
703989
-	.close = pcm_src_close,
703989
-	.init = pcm_src_init,
703989
-	.free = pcm_src_free,
703989
-	.reset = pcm_src_reset,
703989
-	.adjust_pitch = pcm_src_adjust_pitch,
703989
-	.convert_s16 = pcm_src_convert_s16,
703989
-	.input_frames = input_frames,
703989
-	.output_frames = output_frames,
703989
-#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
703989
-	.version = SND_PCM_RATE_PLUGIN_VERSION,
703989
-	.get_supported_rates = get_supported_rates,
703989
-	.dump = dump,
703989
-#endif
703989
-};
703989
-
703989
-int pcm_src_open(unsigned int version, void **objp, snd_pcm_rate_ops_t *ops)
703989
-
703989
-{
703989
-	struct rate_src *rate;
703989
-
703989
-#if SND_PCM_RATE_PLUGIN_VERSION < 0x010002
703989
-	if (version != SND_PCM_RATE_PLUGIN_VERSION) {
703989
-		fprintf(stderr, "Invalid rate plugin version %x\n", version);
703989
-		return -EINVAL;
703989
-	}
703989
-#endif
703989
-	rate = calloc(1, sizeof(*rate));
703989
-	if (!rate)
703989
-		return -ENOMEM;
703989
-
703989
-	*objp = rate;
703989
-	rate->context = NULL;
703989
-#if SND_PCM_RATE_PLUGIN_VERSION >= 0x010002
703989
-	if (version == 0x010001)
703989
-		memcpy(ops, &pcm_src_ops, sizeof(snd_pcm_rate_old_ops_t));
703989
-	else
703989
-#endif
703989
-		*ops = pcm_src_ops;
703989
-	return 0;
703989
-}
703989
-
703989
-int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate)(unsigned int version, void **objp,
703989
-			snd_pcm_rate_ops_t *ops)
703989
-{
703989
-	return pcm_src_open(version, objp, ops);
703989
-}
703989
-int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate_higher)(unsigned int version,
703989
-			void **objp, snd_pcm_rate_ops_t *ops)
703989
-{
703989
-	filter_size = 64;
703989
-	return pcm_src_open(version, objp, ops);
703989
-}
703989
-int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate_high)(unsigned int version,
703989
-			void **objp, snd_pcm_rate_ops_t *ops)
703989
-{
703989
-	filter_size = 32;
703989
-	return pcm_src_open(version, objp, ops);
703989
-}
703989
-int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate_fast)(unsigned int version,
703989
-			void **objp, snd_pcm_rate_ops_t *ops)
703989
-{
703989
-	filter_size = 8;
703989
-	return pcm_src_open(version, objp, ops);
703989
-}
703989
-int SND_PCM_RATE_PLUGIN_ENTRY(lavcrate_faster)(unsigned int version,
703989
-			void **objp, snd_pcm_rate_ops_t *ops)
703989
-{
703989
-	filter_size = 4;
703989
-	return pcm_src_open(version, objp, ops);
703989
-}
703989
-
703989
-
703989
-- 
703989
2.13.6
703989
703989
703989
From 4afd4ab0b276b26b965bae3aadaa31cdb52b1df0 Mon Sep 17 00:00:00 2001
703989
From: Jaroslav Kysela <perex@perex.cz>
703989
Date: Mon, 16 Apr 2018 17:49:36 +0200
703989
Subject: [PATCH 5/8] configure: change --with-alsaaddondir to
703989
 --with-alsagconfdir and --with-alsalconfdir
703989
703989
The local add-on configuration directory (/etc/alsa/conf.d) contains
703989
links to the global configuration directory (/usr/share/alsa/alsa.conf.d) now.
703989
703989
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
703989
---
703989
 a52/Makefile.am        | 14 +++++++++++---
703989
 arcam-av/Makefile.am   | 14 +++++++++++---
703989
 configure.ac           | 32 ++++++++++++++++++++++----------
703989
 install-hooks.am       | 16 ++++++++++++++++
703989
 jack/Makefile.am       | 14 +++++++++++---
703989
 maemo/Makefile.am      | 14 +++++++++++---
703989
 mix/Makefile.am        | 14 +++++++++++---
703989
 oss/Makefile.am        | 14 +++++++++++---
703989
 pph/Makefile.am        | 16 ++++++++++++----
703989
 pulse/Makefile.am      | 17 ++++++++++++++---
703989
 rate-lav/Makefile.am   | 13 ++++++++++---
703989
 rate/Makefile.am       | 14 +++++++++++---
703989
 speex/Makefile.am      | 14 +++++++++++---
703989
 usb_stream/Makefile.am | 14 +++++++++++---
703989
 14 files changed, 173 insertions(+), 47 deletions(-)
703989
 create mode 100644 install-hooks.am
703989
703989
diff --git a/a52/Makefile.am b/a52/Makefile.am
703989
index 4ac8edd..cd5ce45 100644
703989
--- a/a52/Makefile.am
703989
+++ b/a52/Makefile.am
703989
@@ -1,13 +1,21 @@
703989
-EXTRA_DIST = 60-a52-encoder.conf
703989
+GCONF_FILES = 60-a52-encoder.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_a52_LTLIBRARIES = libasound_module_pcm_a52.la
703989
-asound_module_addon_DATA = 60-a52-encoder.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_a52dir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @LIBAV_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
 
703989
 libasound_module_pcm_a52_la_SOURCES = pcm_a52.c
703989
 libasound_module_pcm_a52_la_LIBADD = @ALSA_LIBS@ @LIBAV_LIBS@ @LIBAV_CODEC_LIBS@
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/arcam-av/Makefile.am b/arcam-av/Makefile.am
703989
index 4a54ccd..c16aec0 100644
703989
--- a/arcam-av/Makefile.am
703989
+++ b/arcam-av/Makefile.am
703989
@@ -1,13 +1,21 @@
703989
-EXTRA_DIST = 50-arcam-av-ctl.conf
703989
+GCONF_FILES = 50-arcam-av-ctl.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_ctl_arcam_av_LTLIBRARIES = libasound_module_ctl_arcam_av.la
703989
-asound_module_addon_DATA = 50-arcam-av-ctl.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_ctl_arcam_avdir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined
703989
 
703989
 libasound_module_ctl_arcam_av_la_SOURCES = ctl_arcam_av.c arcam_av.c arcam_av.h
703989
 libasound_module_ctl_arcam_av_la_LIBADD = @ALSA_LIBS@
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/configure.ac b/configure.ac
703989
index cb1ae2d..f49bb6b 100644
703989
--- a/configure.ac
703989
+++ b/configure.ac
703989
@@ -210,17 +210,29 @@ AC_DEFINE_UNQUOTED(ALSA_DATA_DIR, "$alsadatadir", [directory containing ALSA dat
703989
 ALSA_DATA_DIR="$alsadatadir"
703989
 AC_SUBST(ALSA_DATA_DIR)
703989
 
703989
-dnl ALSA add-on config directory
703989
-AC_ARG_WITH(alsaaddondir,
703989
-    AS_HELP_STRING([--with-alsaaddondir=dir],
703989
-	[path where ALSA add-on config files are stored]),
703989
-    alsaaddondir="$withval", alsaaddondir="")
703989
-if test -z "$alsaaddondir"; then
703989
-    alsaaddondir="/etc/alsa/conf.d"
703989
+dnl ALSA add-on global config directory
703989
+AC_ARG_WITH(alsagconfdir,
703989
+    AS_HELP_STRING([--with-alsagconfdir=dir],
703989
+	[path where ALSA global add-on config files are stored]),
703989
+    alsagconfdir="$withval", alsagconfdir="")
703989
+if test -z "$alsagconfdir"; then
703989
+    alsagconfdir="$ALSA_DATA_DIR/alsa.conf.d"
703989
 fi
703989
-AC_DEFINE_UNQUOTED(ALSA_ADDON_DIR, "$alsaaddondir", [directory containing ALSA add-on config files])
703989
-ALSA_ADDON_DIR="$alsaaddondir"
703989
-AC_SUBST(ALSA_ADDON_DIR)
703989
+AC_DEFINE_UNQUOTED(ALSA_GCONF_DIR, "$alsagconfdir", [directory containing global ALSA add-on config files])
703989
+ALSA_GCONF_DIR="$alsagconfdir"
703989
+AC_SUBST(ALSA_GCONF_DIR)
703989
+
703989
+dnl ALSA add-on local config directory
703989
+AC_ARG_WITH(alsalconfdir,
703989
+    AS_HELP_STRING([--with-alsalconfdir=dir],
703989
+	[path where ALSA local add-on config files are stored]),
703989
+    alsalconfdir="$withval", alsalconfdir="")
703989
+if test -z "$alsalconfdir"; then
703989
+    alsalconfdir="/etc/alsa/conf.d"
703989
+fi
703989
+AC_DEFINE_UNQUOTED(ALSA_LCONF_DIR, "$alsalconfdir", [directory containing local ALSA add-on config files])
703989
+ALSA_LCONF_DIR="$alsalconfdir"
703989
+AC_SUBST(ALSA_LCONF_DIR)
703989
 
703989
 SAVE_PLUGINS_VERSION
703989
 
703989
diff --git a/install-hooks.am b/install-hooks.am
703989
new file mode 100644
703989
index 0000000..2d6d383
703989
--- /dev/null
703989
+++ b/install-hooks.am
703989
@@ -0,0 +1,16 @@
703989
+install-conf-hook:
703989
+	mkdir -p $(DESTDIR)$(ALSA_LCONF_DIR)
703989
+	@(echo cd $(DESTDIR)$(ALSA_LCONF_DIR);			\
703989
+	  cd $(DESTDIR)$(ALSA_LCONF_DIR);			\
703989
+	  for i in $(GCONF_FILES); do				\
703989
+	    echo $(RM) $$i";" ln -s $(ALSA_GCONF_DIR)/$$i .;	\
703989
+	    $(RM) $$i;						\
703989
+	    ln -s $(ALSA_GCONF_DIR)/$$i .;			\
703989
+	  done)
703989
+uninstall-conf-hook:
703989
+	@(echo cd $(DESTDIR)$(ALSA_LCONF_DIR);			\
703989
+	  cd $(DESTDIR)$(ALSA_LCONF_DIR);			\
703989
+	  for i in $(GCONF_FILES); do				\
703989
+	    echo $(RM) $$i;					\
703989
+	    $(RM) $$i;						\
703989
+	  done)
703989
diff --git a/jack/Makefile.am b/jack/Makefile.am
703989
index 0a3d6ae..7801194 100644
703989
--- a/jack/Makefile.am
703989
+++ b/jack/Makefile.am
703989
@@ -1,13 +1,21 @@
703989
-EXTRA_DIST = 50-jack.conf
703989
+GCONF_FILES = 50-jack.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_jack_LTLIBRARIES = libasound_module_pcm_jack.la
703989
-asound_module_addon_DATA = 50-jack.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_jackdir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @JACK_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
 
703989
 libasound_module_pcm_jack_la_SOURCES = pcm_jack.c
703989
 libasound_module_pcm_jack_la_LIBADD = @ALSA_LIBS@ @JACK_LIBS@
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/maemo/Makefile.am b/maemo/Makefile.am
703989
index aca481d..7749926 100644
703989
--- a/maemo/Makefile.am
703989
+++ b/maemo/Makefile.am
703989
@@ -1,12 +1,14 @@
703989
-EXTRA_DIST = 98-maemo.conf
703989
+GCONF_FILES = 98-maemo.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_alsa_dsp_LTLIBRARIES = libasound_module_pcm_alsa_dsp.la
703989
 asound_module_ctl_dsp_ctl_LTLIBRARIES = libasound_module_ctl_dsp_ctl.la
703989
-asound_module_addon_DATA = 98-maemo.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_alsa_dspdir = @ALSA_PLUGIN_DIR@
703989
 asound_module_ctl_dsp_ctldir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -O2 @ALSA_CFLAGS@ $(DBUS_CFLAGS)
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
@@ -19,3 +21,9 @@ libasound_module_ctl_dsp_ctl_la_LIBADD = @ALSA_LIBS@ $(DBUS_LIBS) -lpthread
703989
 
703989
 noinst_HEADERS = constants.h debug.h dsp-protocol.h list.h reporting.h \
703989
 	         types.h
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/mix/Makefile.am b/mix/Makefile.am
703989
index 710606c..a74c200 100644
703989
--- a/mix/Makefile.am
703989
+++ b/mix/Makefile.am
703989
@@ -1,12 +1,14 @@
703989
-EXTRA_DIST = 60-upmix.conf 60-vdownmix.conf
703989
+GCONF_FILES = 60-upmix.conf 60-vdownmix.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_upmix_LTLIBRARIES = libasound_module_pcm_upmix.la
703989
 asound_module_pcm_vdownmix_LTLIBRARIES = libasound_module_pcm_vdownmix.la
703989
-asound_module_addon_DATA = 60-upmix.conf 60-vdownmix.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_upmixdir = @ALSA_PLUGIN_DIR@
703989
 asound_module_pcm_vdownmixdir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
@@ -15,3 +17,9 @@ libasound_module_pcm_upmix_la_SOURCES = pcm_upmix.c
703989
 libasound_module_pcm_upmix_la_LIBADD = @ALSA_LIBS@
703989
 libasound_module_pcm_vdownmix_la_SOURCES = pcm_vdownmix.c
703989
 libasound_module_pcm_vdownmix_la_LIBADD = @ALSA_LIBS@
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/oss/Makefile.am b/oss/Makefile.am
703989
index df83d20..46dfcac 100644
703989
--- a/oss/Makefile.am
703989
+++ b/oss/Makefile.am
703989
@@ -1,12 +1,14 @@
703989
-EXTRA_DIST = 50-oss.conf
703989
+GCONF_FILEs = 50-oss.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_oss_LTLIBRARIES = libasound_module_pcm_oss.la
703989
 asound_module_ctl_oss_LTLIBRARIES = libasound_module_ctl_oss.la
703989
-asound_module_addon_DATA = 50-oss.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_ossdir = @ALSA_PLUGIN_DIR@
703989
 asound_module_ctl_ossdir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
@@ -16,3 +18,9 @@ libasound_module_pcm_oss_la_LIBADD = @ALSA_LIBS@
703989
 
703989
 libasound_module_ctl_oss_la_SOURCES = ctl_oss.c
703989
 libasound_module_ctl_oss_la_LIBADD = @ALSA_LIBS@
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/pph/Makefile.am b/pph/Makefile.am
703989
index abb950b..6938b74 100644
703989
--- a/pph/Makefile.am
703989
+++ b/pph/Makefile.am
703989
@@ -1,10 +1,12 @@
703989
-EXTRA_DIST = 10-speexrate.conf
703989
+GCONF_FILES = 10-speexrate.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_rate_speexrate_LTLIBRARIES = libasound_module_rate_speexrate.la
703989
-asound_module_addon_DATA = 10-speexrate.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_rate_speexratedir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -DVAR_ARRAYS -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
@@ -20,6 +22,10 @@ libasound_module_rate_speexrate_la_SOURCES += resample.c
703989
 libasound_module_rate_speexrate_la_LIBADD += -lm
703989
 endif
703989
 
703989
+noinst_HEADERS = speex_resampler.h arch.h fixed_generic.h
703989
+
703989
+include ../install-hooks.am
703989
+
703989
 install-exec-hook:
703989
 	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_speexrate_*.so
703989
 	$(LN_S) libasound_module_rate_speexrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_speexrate_best.so
703989
@@ -28,4 +34,6 @@ install-exec-hook:
703989
 uninstall-hook:
703989
 	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_speexrate_*.so
703989
 
703989
-noinst_HEADERS = speex_resampler.h arch.h fixed_generic.h
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/pulse/Makefile.am b/pulse/Makefile.am
703989
index 835808c..c33e702 100644
703989
--- a/pulse/Makefile.am
703989
+++ b/pulse/Makefile.am
703989
@@ -1,14 +1,19 @@
703989
-EXTRA_DIST = 50-pulseaudio.conf 99-pulseaudio-default.conf.example
703989
+GCONF_FILES = 50-pulseaudio.conf
703989
+LCONF_FILES = 99-pulseaudio-default.conf.example
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES) $(LCONF_FILES)
703989
 
703989
 asound_module_pcm_LTLIBRARIES = libasound_module_pcm_pulse.la
703989
 asound_module_ctl_LTLIBRARIES = libasound_module_ctl_pulse.la
703989
 asound_module_conf_LTLIBRARIES = libasound_module_conf_pulse.la
703989
-asound_module_addon_DATA = 50-pulseaudio.conf 99-pulseaudio-default.conf.example
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
+asound_module_lconf_DATA = $(LCONF_FILES)
703989
 
703989
 asound_module_pcmdir = @ALSA_PLUGIN_DIR@
703989
 asound_module_ctldir = @ALSA_PLUGIN_DIR@
703989
 asound_module_confdir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
+asound_module_lconfdir = @ALSA_LCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ $(PTHREAD_CFLAGS) $(pulseaudio_CFLAGS) -D_GNU_SOURCE
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
@@ -21,3 +26,9 @@ libasound_module_ctl_pulse_la_LIBADD = @ALSA_LIBS@ $(PTHREAD_LIBS) $(pulseaudio_
703989
 
703989
 libasound_module_conf_pulse_la_SOURCES = conf_pulse.c
703989
 libasound_module_conf_pulse_la_LIBADD = @ALSA_LIBS@ $(PTHREAD_LIBS) $(pulseaudio_LIBS)
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/rate-lav/Makefile.am b/rate-lav/Makefile.am
703989
index 0f6ecb6..eb672b5 100644
703989
--- a/rate-lav/Makefile.am
703989
+++ b/rate-lav/Makefile.am
703989
@@ -1,10 +1,12 @@
703989
-EXTRA_DIST = 10-rate-lav.conf
703989
+GCONF_FILES = 10-rate-lav.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_rate_lavrate_LTLIBRARIES = libasound_module_rate_lavrate.la
703989
-asound_module_addon_DATA = 10-rate-lav.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_rate_lavratedir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @LIBAV_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
@@ -14,6 +16,8 @@ libasound_module_rate_lavrate_la_LIBADD = @ALSA_LIBS@ @LIBAV_LIBS@ @LIBAV_RESAMP
703989
 
703989
 noinst_HEADERS = gcd.h
703989
 
703989
+include ../install-hooks.am
703989
+
703989
 install-exec-hook:
703989
 	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_*.so
703989
 	$(LN_S) libasound_module_rate_lavrate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_higher.so
703989
@@ -23,3 +27,6 @@ install-exec-hook:
703989
 
703989
 uninstall-hook:
703989
 	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_lavrate_*.so
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/rate/Makefile.am b/rate/Makefile.am
703989
index 25014d8..488c12a 100644
703989
--- a/rate/Makefile.am
703989
+++ b/rate/Makefile.am
703989
@@ -1,10 +1,12 @@
703989
-EXTRA_DIST = 10-samplerate.conf
703989
+GCONF_FILES = 10-samplerate.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_rate_samplerate_LTLIBRARIES = libasound_module_rate_samplerate.la
703989
-asound_module_addon_DATA = 10-samplerate.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_rate_sampleratedir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ $(samplerate_CFLAGS)
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
@@ -12,6 +14,8 @@ AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUN
703989
 libasound_module_rate_samplerate_la_SOURCES = rate_samplerate.c
703989
 libasound_module_rate_samplerate_la_LIBADD = @ALSA_LIBS@ @samplerate_LIBS@
703989
 
703989
+include ../install-hooks.am
703989
+
703989
 install-exec-hook:
703989
 	rm -f $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_samplerate_*.so
703989
 	$(LN_S) libasound_module_rate_samplerate.so $(DESTDIR)@ALSA_PLUGIN_DIR@/libasound_module_rate_samplerate_best.so
703989
@@ -21,3 +25,7 @@ install-exec-hook:
703989
 
703989
 uninstall-hook:
703989
 	rm -f $(DESTDIR)$(libdir)/alsa-lib/libasound_module_rate_samplerate_*.so
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/speex/Makefile.am b/speex/Makefile.am
703989
index 7891954..27c4ea5 100644
703989
--- a/speex/Makefile.am
703989
+++ b/speex/Makefile.am
703989
@@ -1,13 +1,21 @@
703989
-EXTRA_DIST = 60-speex.conf
703989
+GCONF_FILES = 60-speex.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_speex_LTLIBRARIES = libasound_module_pcm_speex.la
703989
-asound_module_addon_DATA = 60-speex.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_speexdir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@ @speexdsp_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
703989
 
703989
 libasound_module_pcm_speex_la_SOURCES = pcm_speex.c
703989
 libasound_module_pcm_speex_la_LIBADD = @ALSA_LIBS@ @speexdsp_LIBS@
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
diff --git a/usb_stream/Makefile.am b/usb_stream/Makefile.am
703989
index b606d3d..203618b 100644
703989
--- a/usb_stream/Makefile.am
703989
+++ b/usb_stream/Makefile.am
703989
@@ -1,10 +1,12 @@
703989
-EXTRA_DIST = 98-usb-stream.conf
703989
+GCONF_FILES = 98-usb-stream.conf
703989
+
703989
+EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_usb_stream_LTLIBRARIES = libasound_module_pcm_usb_stream.la
703989
-asound_module_addon_DATA = 98-usb-stream.conf
703989
+asound_module_gconf_DATA = $(GCONF_FILES)
703989
 
703989
 asound_module_pcm_usb_streamdir = @ALSA_PLUGIN_DIR@
703989
-asound_module_addondir = @ALSA_ADDON_DIR@
703989
+asound_module_gconfdir = @ALSA_GCONF_DIR@
703989
 
703989
 AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic $(LDFLAGS_NOUNDEFINED)
703989
@@ -13,3 +15,9 @@ libasound_module_pcm_usb_stream_la_SOURCES = pcm_usb_stream.c
703989
 libasound_module_pcm_usb_stream_la_LIBADD = @ALSA_LIBS@
703989
 
703989
 noinst_HEADERS = usb_stream.h
703989
+
703989
+include ../install-hooks.am
703989
+
703989
+install-data-hook: install-conf-hook
703989
+
703989
+uninstall-local: uninstall-conf-hook
703989
-- 
703989
2.13.6
703989
703989
703989
From beb24e58763e3b1d831fcd7ef87a478e6ac74fcc Mon Sep 17 00:00:00 2001
703989
From: Jaroslav Kysela <perex@perex.cz>
703989
Date: Mon, 16 Apr 2018 18:14:18 +0200
703989
Subject: [PATCH 6/8] oss/Makefile.am: fix typo
703989
703989
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
703989
---
703989
 oss/Makefile.am | 2 +-
703989
 1 file changed, 1 insertion(+), 1 deletion(-)
703989
703989
diff --git a/oss/Makefile.am b/oss/Makefile.am
703989
index 46dfcac..bff4443 100644
703989
--- a/oss/Makefile.am
703989
+++ b/oss/Makefile.am
703989
@@ -1,4 +1,4 @@
703989
-GCONF_FILEs = 50-oss.conf
703989
+GCONF_FILES = 50-oss.conf
703989
 
703989
 EXTRA_DIST = $(GCONF_FILES)
703989
 
703989
-- 
703989
2.13.6
703989
703989
703989
From 992b7eb1f1fe95fe7b8b622042aa32c33fffd18d Mon Sep 17 00:00:00 2001
703989
From: Takashi Iwai <tiwai@suse.de>
703989
Date: Tue, 22 May 2018 14:13:53 +0200
703989
Subject: [PATCH 7/8] arcam-av: Add explicit -lpthread to *_LIBADD
703989
703989
The pthread library has to be linked for this module.  In some tool
703989
chains, it results in a build error.
703989
703989
Signed-off-by: Takashi Iwai <tiwai@suse.de>
703989
---
703989
 arcam-av/Makefile.am | 2 +-
703989
 1 file changed, 1 insertion(+), 1 deletion(-)
703989
703989
diff --git a/arcam-av/Makefile.am b/arcam-av/Makefile.am
703989
index c16aec0..57d5542 100644
703989
--- a/arcam-av/Makefile.am
703989
+++ b/arcam-av/Makefile.am
703989
@@ -12,7 +12,7 @@ AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined
703989
 
703989
 libasound_module_ctl_arcam_av_la_SOURCES = ctl_arcam_av.c arcam_av.c arcam_av.h
703989
-libasound_module_ctl_arcam_av_la_LIBADD = @ALSA_LIBS@
703989
+libasound_module_ctl_arcam_av_la_LIBADD = @ALSA_LIBS@ -lpthread
703989
 
703989
 include ../install-hooks.am
703989
 
703989
-- 
703989
2.13.6
703989
703989
703989
From 2d310f84e7af4c5b4bc68a6e45500e874df482f9 Mon Sep 17 00:00:00 2001
703989
From: Takashi Iwai <tiwai@suse.de>
703989
Date: Tue, 22 May 2018 14:15:21 +0200
703989
Subject: [PATCH 8/8] usb_stream: Add explicit -lpthread to *_LIBADD
703989
703989
The pthread library has to be linked for this module.  In some tool
703989
chains, it results in a build error.
703989
703989
Signed-off-by: Takashi Iwai <tiwai@suse.de>
703989
---
703989
 usb_stream/Makefile.am | 2 +-
703989
 1 file changed, 1 insertion(+), 1 deletion(-)
703989
703989
diff --git a/usb_stream/Makefile.am b/usb_stream/Makefile.am
703989
index 203618b..fde2455 100644
703989
--- a/usb_stream/Makefile.am
703989
+++ b/usb_stream/Makefile.am
703989
@@ -12,7 +12,7 @@ AM_CFLAGS = -Wall -g @ALSA_CFLAGS@
703989
 AM_LDFLAGS = -module -avoid-version -export-dynamic $(LDFLAGS_NOUNDEFINED)
703989
 
703989
 libasound_module_pcm_usb_stream_la_SOURCES = pcm_usb_stream.c
703989
-libasound_module_pcm_usb_stream_la_LIBADD = @ALSA_LIBS@
703989
+libasound_module_pcm_usb_stream_la_LIBADD = @ALSA_LIBS@ -lpthread
703989
 
703989
 noinst_HEADERS = usb_stream.h
703989
 
703989
-- 
703989
2.13.6
703989