Blame SOURCES/plugin-config.patch

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