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