mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 0/2] new package libsamplerate, used by alsaloop from alsa-utils
@ 2013-08-23 16:04 Andreas Pretzsch
  2013-08-23 16:04 ` [ptxdist] [PATCH 1/2] libsamplerate: add package Andreas Pretzsch
  2013-08-23 16:04 ` [ptxdist] [PATCH 2/2] package alsa-utils: alsaloop requires libsamplerate, so autoselect it Andreas Pretzsch
  0 siblings, 2 replies; 9+ messages in thread
From: Andreas Pretzsch @ 2013-08-23 16:04 UTC (permalink / raw)
  To: ptxdist

Add package libsamplerate, an audio sample rate converter library.

Without it, the optional alsaloop program from alsa-utils will bail out with
"No libsamplerate support.", as it defaults to sincfastest from libsamplerate
(equal to "-A 3"). While this can be bypassed by calling alsaloop with an
(undocumented) "-A -1", just add libsamplerate and autoselect it for alsaloop.

Andreas Pretzsch (2):
  libsamplerate: add package
  package alsa-utils: alsaloop requires libsamplerate, so autoselect it

 rules/alsa-utils.in      |    1 +
 rules/libsamplerate.in   |    7 +++++
 rules/libsamplerate.make |   71 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 79 insertions(+)
 create mode 100644 rules/libsamplerate.in
 create mode 100644 rules/libsamplerate.make

-- 
1.7.10.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ptxdist] [PATCH 1/2] libsamplerate: add package
  2013-08-23 16:04 [ptxdist] [PATCH 0/2] new package libsamplerate, used by alsaloop from alsa-utils Andreas Pretzsch
@ 2013-08-23 16:04 ` Andreas Pretzsch
  2013-09-09  8:44   ` Michael Olbrich
  2015-04-17 22:48   ` [ptxdist] [PATCH v2] libsamplerate: new package for libsamplerate 0.1.8 Andreas Pretzsch
  2013-08-23 16:04 ` [ptxdist] [PATCH 2/2] package alsa-utils: alsaloop requires libsamplerate, so autoselect it Andreas Pretzsch
  1 sibling, 2 replies; 9+ messages in thread
From: Andreas Pretzsch @ 2013-08-23 16:04 UTC (permalink / raw)
  To: ptxdist

Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for audio.
It is used e.g. by alsaloop from alsa-utils.
More information, source and docs: http://www.mega-nerd.com/SRC/

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
---
 rules/libsamplerate.in   |    7 +++++
 rules/libsamplerate.make |   71 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)
 create mode 100644 rules/libsamplerate.in
 create mode 100644 rules/libsamplerate.make

diff --git a/rules/libsamplerate.in b/rules/libsamplerate.in
new file mode 100644
index 0000000..4bdc265
--- /dev/null
+++ b/rules/libsamplerate.in
@@ -0,0 +1,7 @@
+## SECTION=multimedia_libs
+
+config LIBSAMPLERATE
+	bool
+	prompt "libsamplerate"
+	help
+	  Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for audio.
diff --git a/rules/libsamplerate.make b/rules/libsamplerate.make
new file mode 100644
index 0000000..a1ccf60
--- /dev/null
+++ b/rules/libsamplerate.make
@@ -0,0 +1,71 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2013 by Andreas Pretzsch <apr@cn-eng.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBSAMPLERATE) += libsamplerate
+
+#
+# Paths and names
+#
+LIBSAMPLERATE_VERSION	:= 0.1.8
+LIBSAMPLERATE_MD5	:= 1c7fb25191b4e6e3628d198a66a84f47
+LIBSAMPLERATE		:= libsamplerate-$(LIBSAMPLERATE_VERSION)
+LIBSAMPLERATE_SUFFIX	:= tar.gz
+LIBSAMPLERATE_URL	:= http://www.mega-nerd.com/SRC/$(LIBSAMPLERATE).$(LIBSAMPLERATE_SUFFIX)
+LIBSAMPLERATE_SOURCE	:= $(SRCDIR)/$(LIBSAMPLERATE).$(LIBSAMPLERATE_SUFFIX)
+LIBSAMPLERATE_DIR	:= $(BUILDDIR)/$(LIBSAMPLERATE)
+LIBSAMPLERATE_LICENSE	:= GPLv2+
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libsamplerate.extract:
+	@$(call targetinfo)
+	@$(call clean, $(LIBSAMPLERATE_DIR))
+	@$(call extract, LIBSAMPLERATE)
+	cd $(LIBSAMPLERATE_DIR) && [ -f configure ] || sh autogen.sh
+	@$(call patchin, LIBSAMPLERATE)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#LIBSAMPLERATE_CONF_ENV	:= $(CROSS_ENV)
+
+#
+# autoconf
+#
+LIBSAMPLERATE_CONF_TOOL	:= autoconf
+#LIBSAMPLERATE_CONF_OPT	:= $(CROSS_AUTOCONF_USR)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libsamplerate.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, libsamplerate)
+	@$(call install_fixup, libsamplerate, PRIORITY, optional)
+	@$(call install_fixup, libsamplerate, SECTION, base)
+	@$(call install_fixup, libsamplerate, AUTHOR, "Andreas Pretzsch <apr@cn-eng.de>")
+	@$(call install_fixup, libsamplerate, DESCRIPTION, "libsamplerate aka Secret Rabbit Code, a Sample Rate Converter for audio")
+
+	@$(call install_lib, libsamplerate, 0, 0, 0644, libsamplerate)
+
+	@$(call install_finish, libsamplerate)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
1.7.10.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ptxdist] [PATCH 2/2] package alsa-utils: alsaloop requires libsamplerate, so autoselect it
  2013-08-23 16:04 [ptxdist] [PATCH 0/2] new package libsamplerate, used by alsaloop from alsa-utils Andreas Pretzsch
  2013-08-23 16:04 ` [ptxdist] [PATCH 1/2] libsamplerate: add package Andreas Pretzsch
@ 2013-08-23 16:04 ` Andreas Pretzsch
  2013-09-09  8:45   ` Michael Olbrich
  2015-04-17 22:49   ` [ptxdist] [PATCH v2] alsa-utils: autoselect libsamplerate for alsaloop Andreas Pretzsch
  1 sibling, 2 replies; 9+ messages in thread
From: Andreas Pretzsch @ 2013-08-23 16:04 UTC (permalink / raw)
  To: ptxdist

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
---
 rules/alsa-utils.in |    1 +
 1 file changed, 1 insertion(+)

diff --git a/rules/alsa-utils.in b/rules/alsa-utils.in
index c24bbf6..c924ec6 100644
--- a/rules/alsa-utils.in
+++ b/rules/alsa-utils.in
@@ -50,6 +50,7 @@ config ALSA_UTILS_ALSAMIXER
 config ALSA_UTILS_ALSALOOP
 	bool
 	prompt "alsaloop"
+	select LIBSAMPLERATE
 	help
 	  alsaloop allows create a PCM loopback between a PCM capture
 	  device and a PCM playback device.
-- 
1.7.10.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH 1/2] libsamplerate: add package
  2013-08-23 16:04 ` [ptxdist] [PATCH 1/2] libsamplerate: add package Andreas Pretzsch
@ 2013-09-09  8:44   ` Michael Olbrich
  2015-04-17 22:22     ` Andreas Pretzsch
  2015-04-17 22:48   ` [ptxdist] [PATCH v2] libsamplerate: new package for libsamplerate 0.1.8 Andreas Pretzsch
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2013-09-09  8:44 UTC (permalink / raw)
  To: ptxdist

On Fri, Aug 23, 2013 at 06:04:47PM +0200, Andreas Pretzsch wrote:
> Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for audio.
> It is used e.g. by alsaloop from alsa-utils.
> More information, source and docs: http://www.mega-nerd.com/SRC/
> 
> Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
> ---
>  rules/libsamplerate.in   |    7 +++++
>  rules/libsamplerate.make |   71 ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 78 insertions(+)
>  create mode 100644 rules/libsamplerate.in
>  create mode 100644 rules/libsamplerate.make
> 
> diff --git a/rules/libsamplerate.in b/rules/libsamplerate.in
> new file mode 100644
> index 0000000..4bdc265
> --- /dev/null
> +++ b/rules/libsamplerate.in
> @@ -0,0 +1,7 @@
> +## SECTION=multimedia_libs
> +
> +config LIBSAMPLERATE
> +	bool
> +	prompt "libsamplerate"
> +	help
> +	  Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for audio.
> diff --git a/rules/libsamplerate.make b/rules/libsamplerate.make
> new file mode 100644
> index 0000000..a1ccf60
> --- /dev/null
> +++ b/rules/libsamplerate.make
> @@ -0,0 +1,71 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2013 by Andreas Pretzsch <apr@cn-eng.de>
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_LIBSAMPLERATE) += libsamplerate
> +
> +#
> +# Paths and names
> +#
> +LIBSAMPLERATE_VERSION	:= 0.1.8
> +LIBSAMPLERATE_MD5	:= 1c7fb25191b4e6e3628d198a66a84f47
> +LIBSAMPLERATE		:= libsamplerate-$(LIBSAMPLERATE_VERSION)
> +LIBSAMPLERATE_SUFFIX	:= tar.gz
> +LIBSAMPLERATE_URL	:= http://www.mega-nerd.com/SRC/$(LIBSAMPLERATE).$(LIBSAMPLERATE_SUFFIX)
> +LIBSAMPLERATE_SOURCE	:= $(SRCDIR)/$(LIBSAMPLERATE).$(LIBSAMPLERATE_SUFFIX)
> +LIBSAMPLERATE_DIR	:= $(BUILDDIR)/$(LIBSAMPLERATE)
> +LIBSAMPLERATE_LICENSE	:= GPLv2+
> +
> +# ----------------------------------------------------------------------------
> +# Extract
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libsamplerate.extract:
> +	@$(call targetinfo)
> +	@$(call clean, $(LIBSAMPLERATE_DIR))
> +	@$(call extract, LIBSAMPLERATE)
> +	cd $(LIBSAMPLERATE_DIR) && [ -f configure ] || sh autogen.sh
> +	@$(call patchin, LIBSAMPLERATE)
> +	@$(call touch)

remove this.

> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +#LIBSAMPLERATE_CONF_ENV	:= $(CROSS_ENV)

remove

> +
> +#
> +# autoconf
> +#
> +LIBSAMPLERATE_CONF_TOOL	:= autoconf
> +#LIBSAMPLERATE_CONF_OPT	:= $(CROSS_AUTOCONF_USR)

Add some defaults, for fftw and sndfile at least.

Michael

> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libsamplerate.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, libsamplerate)
> +	@$(call install_fixup, libsamplerate, PRIORITY, optional)
> +	@$(call install_fixup, libsamplerate, SECTION, base)
> +	@$(call install_fixup, libsamplerate, AUTHOR, "Andreas Pretzsch <apr@cn-eng.de>")
> +	@$(call install_fixup, libsamplerate, DESCRIPTION, "libsamplerate aka Secret Rabbit Code, a Sample Rate Converter for audio")
> +
> +	@$(call install_lib, libsamplerate, 0, 0, 0644, libsamplerate)
> +
> +	@$(call install_finish, libsamplerate)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 1.7.10.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH 2/2] package alsa-utils: alsaloop requires libsamplerate, so autoselect it
  2013-08-23 16:04 ` [ptxdist] [PATCH 2/2] package alsa-utils: alsaloop requires libsamplerate, so autoselect it Andreas Pretzsch
@ 2013-09-09  8:45   ` Michael Olbrich
  2015-04-17 22:20     ` Andreas Pretzsch
  2015-04-17 22:49   ` [ptxdist] [PATCH v2] alsa-utils: autoselect libsamplerate for alsaloop Andreas Pretzsch
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2013-09-09  8:45 UTC (permalink / raw)
  To: ptxdist

On Fri, Aug 23, 2013 at 06:04:48PM +0200, Andreas Pretzsch wrote:
> Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
> ---
>  rules/alsa-utils.in |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/rules/alsa-utils.in b/rules/alsa-utils.in
> index c24bbf6..c924ec6 100644
> --- a/rules/alsa-utils.in
> +++ b/rules/alsa-utils.in
> @@ -50,6 +50,7 @@ config ALSA_UTILS_ALSAMIXER
>  config ALSA_UTILS_ALSALOOP
>  	bool
>  	prompt "alsaloop"
> +	select LIBSAMPLERATE

This won't work. You're not getting the correct build-time dependencies
like this. Correct is this:

config ALSA_UTILS
	[...]
	select LIBSAMPLERATE if ALSA_UTILS_ALSAMIXER
	[...]

Michael

>  	help
>  	  alsaloop allows create a PCM loopback between a PCM capture
>  	  device and a PCM playback device.
> -- 
> 1.7.10.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH 2/2] package alsa-utils: alsaloop requires libsamplerate, so autoselect it
  2013-09-09  8:45   ` Michael Olbrich
@ 2015-04-17 22:20     ` Andreas Pretzsch
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Pretzsch @ 2015-04-17 22:20 UTC (permalink / raw)
  To: ptxdist

On Mo, 2013-09-09 at 10:45 +0200, Michael Olbrich wrote:
> On Fri, Aug 23, 2013 at 06:04:48PM +0200, Andreas Pretzsch wrote:
> > Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
> > ---
> >  rules/alsa-utils.in |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/rules/alsa-utils.in b/rules/alsa-utils.in
> > index c24bbf6..c924ec6 100644
> > --- a/rules/alsa-utils.in
> > +++ b/rules/alsa-utils.in
> > @@ -50,6 +50,7 @@ config ALSA_UTILS_ALSAMIXER
> >  config ALSA_UTILS_ALSALOOP
> >  	bool
> >  	prompt "alsaloop"
> > +	select LIBSAMPLERATE
> 
> This won't work. You're not getting the correct build-time dependencies
> like this. Correct is this:
> 
> config ALSA_UTILS
> 	[...]
> 	select LIBSAMPLERATE if ALSA_UTILS_ALSAMIXER
> 	[...]

Will fix in v2.

-- 

carpe noctem engineering
Ingenieurbuero fuer Hard- & Software-Entwicklung Andreas Pretzsch
Dipl.-Ing. (FH) Andreas Pretzsch          Tel. +49-(0)731-5521572
Hahnengasse 3                             Fax: +49-(0)731-5521571
89073 Ulm, Germany                        email: apr@cn-eng.de


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH 1/2] libsamplerate: add package
  2013-09-09  8:44   ` Michael Olbrich
@ 2015-04-17 22:22     ` Andreas Pretzsch
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Pretzsch @ 2015-04-17 22:22 UTC (permalink / raw)
  To: ptxdist

On Mo, 2013-09-09 at 10:44 +0200, Michael Olbrich wrote:
> On Fri, Aug 23, 2013 at 06:04:47PM +0200, Andreas Pretzsch wrote:
> > Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for audio.
> > It is used e.g. by alsaloop from alsa-utils.
> > More information, source and docs: http://www.mega-nerd.com/SRC/
> > 
> > Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
> > ---
> >  rules/libsamplerate.in   |    7 +++++
> >  rules/libsamplerate.make |   71 ++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 78 insertions(+)
> >  create mode 100644 rules/libsamplerate.in
> >  create mode 100644 rules/libsamplerate.make
> > 
> > diff --git a/rules/libsamplerate.in b/rules/libsamplerate.in
> > new file mode 100644
> > index 0000000..4bdc265
> > --- /dev/null
> > +++ b/rules/libsamplerate.in
> > @@ -0,0 +1,7 @@
> > +## SECTION=multimedia_libs
> > +
> > +config LIBSAMPLERATE
> > +	bool
> > +	prompt "libsamplerate"
> > +	help
> > +	  Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for audio.
> > diff --git a/rules/libsamplerate.make b/rules/libsamplerate.make
> > new file mode 100644
> > index 0000000..a1ccf60
> > --- /dev/null
> > +++ b/rules/libsamplerate.make
> > @@ -0,0 +1,71 @@
> > +# -*-makefile-*-
> > +#
> > +# Copyright (C) 2013 by Andreas Pretzsch <apr@cn-eng.de>
> > +#
> > +# See CREDITS for details about who has contributed to this project.
> > +#
> > +# For further information about the PTXdist project and license conditions
> > +# see the README file.
> > +#
> > +
> > +#
> > +# We provide this package
> > +#
> > +PACKAGES-$(PTXCONF_LIBSAMPLERATE) += libsamplerate
> > +
> > +#
> > +# Paths and names
> > +#
> > +LIBSAMPLERATE_VERSION	:= 0.1.8
> > +LIBSAMPLERATE_MD5	:= 1c7fb25191b4e6e3628d198a66a84f47
> > +LIBSAMPLERATE		:= libsamplerate-$(LIBSAMPLERATE_VERSION)
> > +LIBSAMPLERATE_SUFFIX	:= tar.gz
> > +LIBSAMPLERATE_URL	:= http://www.mega-nerd.com/SRC/$(LIBSAMPLERATE).$(LIBSAMPLERATE_SUFFIX)
> > +LIBSAMPLERATE_SOURCE	:= $(SRCDIR)/$(LIBSAMPLERATE).$(LIBSAMPLERATE_SUFFIX)
> > +LIBSAMPLERATE_DIR	:= $(BUILDDIR)/$(LIBSAMPLERATE)
> > +LIBSAMPLERATE_LICENSE	:= GPLv2+
> > +
> > +# ----------------------------------------------------------------------------
> > +# Extract
> > +# ----------------------------------------------------------------------------
> > +
> > +$(STATEDIR)/libsamplerate.extract:
> > +	@$(call targetinfo)
> > +	@$(call clean, $(LIBSAMPLERATE_DIR))
> > +	@$(call extract, LIBSAMPLERATE)
> > +	cd $(LIBSAMPLERATE_DIR) && [ -f configure ] || sh autogen.sh
> > +	@$(call patchin, LIBSAMPLERATE)
> > +	@$(call touch)
> 
> remove this.

Will do in v2.


> > +
> > +# ----------------------------------------------------------------------------
> > +# Prepare
> > +# ----------------------------------------------------------------------------
> > +
> > +#LIBSAMPLERATE_CONF_ENV	:= $(CROSS_ENV)
> 
> remove

Will do in v2.

> > +#
> > +# autoconf
> > +#
> > +LIBSAMPLERATE_CONF_TOOL	:= autoconf
> > +#LIBSAMPLERATE_CONF_OPT	:= $(CROSS_AUTOCONF_USR)
> 
> Add some defaults, for fftw and sndfile at least.

Finally took the time to look into this.
Compiled and tested without sndfile and fftw, with sndfile enabled, and
with sndfile and fftw enabled.
Result: The autodetect of libsamplerate configure works well here.

All we have here from configure is:
  --disable-fftw          disable usage of FFTW
  --disable-sndfile       disable support for sndfile
[...]
  SNDFILE_CFLAGS
              C compiler flags for SNDFILE, overriding pkg-config
  SNDFILE_LIBS
              linker flags for SNDFILE, overriding pkg-config
  FFTW3_CFLAGS
              C compiler flags for FFTW3, overriding pkg-config
  FFTW3_LIBS  linker flags for FFTW3, overriding pkg-config


build with both disabled:
[...]
checking for SNDFILE... no
checking for FFTW3... no
[...]
  Extra tools required for testing and examples :
    Use FFTW : .................... no
    Have libsndfile : ............. no
[...]

build with sndfile enabled:
[...]
checking for SNDFILE... yes
checking for FFTW3... no
[...]
  Extra tools required for testing and examples :
    Use FFTW : .................... no
    Have libsndfile : ............. yes
[...]

build with sndfile and fftw enabled:
[...]
checking for SNDFILE... yes
checking for FFTW3... yes
[...]
  Extra tools required for testing and examples :
    Use FFTW : .................... yes
    Have libsndfile : ............. yes
[...]

Now, libsamplerate-0.1.8/INSTALL states that sndfile are fftw are only
required for some examples and some tests. None of which are installed
here. By sure some sweet pieces of code, for everyone interessted in
using libsamplerate in an own project. But at least for my usage
(alsaloop), this is not the case.

Same applies for fixing pkg-config troubles by passing flags.

Last, forcefully disabling one or both with a configure option - despite
being enabled in ptxconfig and hence found - won't buy us much.
Just, libsamplerate won't link against them.
Not worth a ptx option, in my opinion.

Bottom line: I don't see any sensible defaults resp. options here.


One thing that _might_ be worth looking into is the clipping option
"--disable-cpu-clip". If enabled, src_float_to_short_array() omits
overflow/underflow checks. Might be a nice optimization.
Just, the autodetect of configure for this runs some test code on the
build host. Which here on my machine (x86_64 (Intel Core2)) results in
no, so it is implicitly disabled. No idea for other build hosts.
But point is, the check runs not on the target, so it might end in a
false-positive. And there is no enable-counterpart of this option (resp.
won't change anything, just tested). And I'm not in the mood to hack
this in...

Bottom line: Always disable it, to be safe, without option.


Final result: I'll send a v2 with:
LIBSAMPLERATE_CONF_OPT  := \
    $(CROSS_AUTOCONF_USR) \
    --disable-cpu-clip

Anything else can be added by those who need it.

-- 

carpe noctem engineering
Ingenieurbuero fuer Hard- & Software-Entwicklung Andreas Pretzsch
Dipl.-Ing. (FH) Andreas Pretzsch          Tel. +49-(0)731-5521572
Hahnengasse 3                             Fax: +49-(0)731-5521571
89073 Ulm, Germany                        email: apr@cn-eng.de


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ptxdist] [PATCH v2] libsamplerate: new package for libsamplerate 0.1.8
  2013-08-23 16:04 ` [ptxdist] [PATCH 1/2] libsamplerate: add package Andreas Pretzsch
  2013-09-09  8:44   ` Michael Olbrich
@ 2015-04-17 22:48   ` Andreas Pretzsch
  1 sibling, 0 replies; 9+ messages in thread
From: Andreas Pretzsch @ 2015-04-17 22:48 UTC (permalink / raw)
  To: ptxdist

Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for audio.
It is used e.g. by alsaloop from alsa-utils.
More information, source and docs: http://www.mega-nerd.com/SRC/

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
---
 rules/libsamplerate.in   |  8 +++++++
 rules/libsamplerate.make | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)
 create mode 100644 rules/libsamplerate.in
 create mode 100644 rules/libsamplerate.make

diff --git a/rules/libsamplerate.in b/rules/libsamplerate.in
new file mode 100644
index 0000000..82030e4
--- /dev/null
+++ b/rules/libsamplerate.in
@@ -0,0 +1,8 @@
+## SECTION=multimedia_libs
+
+config LIBSAMPLERATE
+	bool
+	prompt "libsamplerate"
+	help
+	  Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for audio.
+	  More information, source and docs: http://www.mega-nerd.com/SRC/
diff --git a/rules/libsamplerate.make b/rules/libsamplerate.make
new file mode 100644
index 0000000..ff23cfd
--- /dev/null
+++ b/rules/libsamplerate.make
@@ -0,0 +1,58 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2015 by Andreas Pretzsch <apr@cn-eng.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+PACKAGES-$(PTXCONF_LIBSAMPLERATE) += libsamplerate
+
+LIBSAMPLERATE_VERSION	:= 0.1.8
+LIBSAMPLERATE_MD5	:= 1c7fb25191b4e6e3628d198a66a84f47
+LIBSAMPLERATE		:= libsamplerate-$(LIBSAMPLERATE_VERSION)
+LIBSAMPLERATE_SUFFIX	:= tar.gz
+LIBSAMPLERATE_URL	:= http://www.mega-nerd.com/SRC/$(LIBSAMPLERATE).$(LIBSAMPLERATE_SUFFIX)
+LIBSAMPLERATE_SOURCE	:= $(SRCDIR)/$(LIBSAMPLERATE).$(LIBSAMPLERATE_SUFFIX)
+LIBSAMPLERATE_DIR	:= $(BUILDDIR)/$(LIBSAMPLERATE)
+LIBSAMPLERATE_LICENSE	:= GPLv2+
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+# --disable-cpu-clip      disable tricky cpu specific clipper
+# CPU clipping would allow src_float_to_short_array() to omit overflow
+# and underflow checks. But the configure check for this CPU feature runs
+# on the build host, not on the target. So it might be false-positive.
+# Not the case on my build host here (x86_64, Intel Core2), as detected
+# as no (=> disabled), but to be safe, forcefully disable it.
+# Note: There is no "force enable" counterpart.
+
+LIBSAMPLERATE_CONF_TOOL	:= autoconf
+LIBSAMPLERATE_CONF_OPT	:= \
+	$(CROSS_AUTOCONF_USR) \
+	--disable-cpu-clip
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libsamplerate.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, libsamplerate)
+	@$(call install_fixup, libsamplerate,PRIORITY,optional)
+	@$(call install_fixup, libsamplerate,SECTION,base)
+	@$(call install_fixup, libsamplerate,AUTHOR,"Andreas Pretzsch <apr@cn-eng.de>")
+	@$(call install_fixup, libsamplerate,DESCRIPTION,"libsamplerate aka Secret Rabbit Code, a Sample Rate Converter for audio")
+
+	@$(call install_lib, libsamplerate, 0, 0, 0644, libsamplerate)
+
+	@$(call install_finish, libsamplerate)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.1.3


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ptxdist] [PATCH v2] alsa-utils: autoselect libsamplerate for alsaloop
  2013-08-23 16:04 ` [ptxdist] [PATCH 2/2] package alsa-utils: alsaloop requires libsamplerate, so autoselect it Andreas Pretzsch
  2013-09-09  8:45   ` Michael Olbrich
@ 2015-04-17 22:49   ` Andreas Pretzsch
  1 sibling, 0 replies; 9+ messages in thread
From: Andreas Pretzsch @ 2015-04-17 22:49 UTC (permalink / raw)
  To: ptxdist

alsaloop will bail out with "No libsamplerate support." when not
linked against libsamplerate, as it defaults to sincfastest from
libsamplerate (equal to "-A 3").

While this can be bypassed with an (undocumented) "-A -1", just
autoselect libsamplerate for alsaloop.

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
---
 rules/alsa-utils.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rules/alsa-utils.in b/rules/alsa-utils.in
index c24bbf6..d360e00 100644
--- a/rules/alsa-utils.in
+++ b/rules/alsa-utils.in
@@ -4,6 +4,7 @@ menuconfig ALSA_UTILS
 	tristate
 	prompt "alsa utils                    "
 	select NCURSES if ALSA_UTILS_ALSAMIXER
+	select LIBSAMPLERATE if ALSA_UTILS_ALSALOOP
 	select ALSA_LIB
 # alsa-utils fails with the salsa-lib
 	select ALSA_LIB_FULL
-- 
2.1.3


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-04-17 22:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-23 16:04 [ptxdist] [PATCH 0/2] new package libsamplerate, used by alsaloop from alsa-utils Andreas Pretzsch
2013-08-23 16:04 ` [ptxdist] [PATCH 1/2] libsamplerate: add package Andreas Pretzsch
2013-09-09  8:44   ` Michael Olbrich
2015-04-17 22:22     ` Andreas Pretzsch
2015-04-17 22:48   ` [ptxdist] [PATCH v2] libsamplerate: new package for libsamplerate 0.1.8 Andreas Pretzsch
2013-08-23 16:04 ` [ptxdist] [PATCH 2/2] package alsa-utils: alsaloop requires libsamplerate, so autoselect it Andreas Pretzsch
2013-09-09  8:45   ` Michael Olbrich
2015-04-17 22:20     ` Andreas Pretzsch
2015-04-17 22:49   ` [ptxdist] [PATCH v2] alsa-utils: autoselect libsamplerate for alsaloop Andreas Pretzsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox