Patchwork [meta-fsl-ppc,dylan] alsa-utils : add 1.0.27.2 recipes

login
register
mail settings
Submitter chunrong guo
Date Nov. 21, 2013, 9:32 a.m.
Message ID <1385026350-10001-1-git-send-email-b40290@freescale.com>
Download mbox | patch
Permalink /patch/62133/
State Rejected
Headers show

Comments

chunrong guo - Nov. 21, 2013, 9:32 a.m.
From: Chunrong Guo <B40290@freescale.com>

   *There is a segmentation fault when run aplay and arecord of alsa-utils 1.0.26 in rootfs

Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
 recipes-multimedia/alsa/alsa-fpu.inc               |    6 ++
 .../Check-if-wordexp-function-is-supported.patch   |   50 ++++++++++++
 ...-iatomic.h-functions-definitions-for-mips.patch |   68 ++++++++++++++++
 .../alsa/alsa-lib/fix-tstamp-declaration.patch     |   21 +++++
 recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb       |   49 ++++++++++++
 .../alsa/alsa-utils-alsaconf_1.0.27.2.bb           |   17 ++++
 ...-t-let-systemd-unit-restore-the-volume-wh.patch |   40 ++++++++++
 recipes-multimedia/alsa/alsa-utils_1.0.27.2.bb     |   82 ++++++++++++++++++++
 8 files changed, 333 insertions(+), 0 deletions(-)
 create mode 100644 recipes-multimedia/alsa/alsa-fpu.inc
 create mode 100644 recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
 create mode 100644 recipes-multimedia/alsa/alsa-lib/Update-iatomic.h-functions-definitions-for-mips.patch
 create mode 100644 recipes-multimedia/alsa/alsa-lib/fix-tstamp-declaration.patch
 create mode 100644 recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb
 create mode 100644 recipes-multimedia/alsa/alsa-utils-alsaconf_1.0.27.2.bb
 create mode 100644 recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch
 create mode 100644 recipes-multimedia/alsa/alsa-utils_1.0.27.2.bb
Otavio Salvador - Nov. 21, 2013, 2:06 p.m.
On Thu, Nov 21, 2013 at 7:32 AM,  <b40290@freescale.com> wrote:
> From: Chunrong Guo <B40290@freescale.com>
>
>    *There is a segmentation fault when run aplay and arecord of alsa-utils 1.0.26 in rootfs
>
> Signed-off-by: Chunrong Guo <B40290@freescale.com>

This is not a BSP thing; please check the need fix for it and add the
need patches (preferable through OE-Core/Poky).

Patch

diff --git a/recipes-multimedia/alsa/alsa-fpu.inc b/recipes-multimedia/alsa/alsa-fpu.inc
new file mode 100644
index 0000000..5040230
--- /dev/null
+++ b/recipes-multimedia/alsa/alsa-fpu.inc
@@ -0,0 +1,6 @@ 
+
+def get_alsa_fpu_setting(bb, d):
+	if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+		return "--with-softfloat"
+	return ""
+
diff --git a/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch b/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
new file mode 100644
index 0000000..41b3c23
--- /dev/null
+++ b/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
@@ -0,0 +1,50 @@ 
+From 2555c5d62229cf269974f6ec6e4689ab97bbda42 Mon Sep 17 00:00:00 2001
+From: "Hong H. Pham" <hong.pham@windriver.com>
+Date: Tue, 26 Feb 2013 19:40:04 -0500
+Subject: [PATCH] Check if wordexp function is supported
+
+eglibc could be configured to build without wordexp, so it is not enough
+to check if wordexp.h exists (the header file could be installed, but it's
+possible that the wordexp() function is not supported).  An additional
+check if wordexp() is supported by the system C library is needed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
+---
+ configure.in   |    5 ++++-
+ src/userfile.c |    2 +-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 4bcb0d6..ba1c2dd 100644
+--- a/configure.in
++++ b/configure.in
+@@ -333,7 +333,10 @@ arm*)
+ esac
+ 
+ dnl Check for wordexp.h
+-AC_CHECK_HEADERS([wordexp.h])
++AC_CHECK_HEADERS([wordexp.h],
++  dnl Make sure wordexp is supported by the C library
++  AC_CHECK_FUNCS([wordexp])
++)
+ 
+ dnl Check for resmgr support...
+ AC_MSG_CHECKING(for resmgr support)
+diff --git a/src/userfile.c b/src/userfile.c
+index 3a73836..b8ce809 100644
+--- a/src/userfile.c
++++ b/src/userfile.c
+@@ -32,7 +32,7 @@
+  * stores the first matchine one.  The returned string is strdup'ed.
+  */
+ 
+-#ifdef HAVE_WORDEXP_H
++#if (defined(HAVE_WORDEXP_H) && defined(HAVE_WORDEXP))
+ #include <wordexp.h>
+ #include <assert.h>
+ int snd_user_file(const char *file, char **result)
+-- 
+1.7.10.4
+
diff --git a/recipes-multimedia/alsa/alsa-lib/Update-iatomic.h-functions-definitions-for-mips.patch b/recipes-multimedia/alsa/alsa-lib/Update-iatomic.h-functions-definitions-for-mips.patch
new file mode 100644
index 0000000..f1a7947
--- /dev/null
+++ b/recipes-multimedia/alsa/alsa-lib/Update-iatomic.h-functions-definitions-for-mips.patch
@@ -0,0 +1,68 @@ 
+Upstream-Status: Backport
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+From f21f48a70f8437a671b58fcab75e54222a9eea16 Mon Sep 17 00:00:00 2001
+From: Kai Kang <jiashuo.kang at gmail.com>
+Date: Thu, 15 Aug 2013 17:17:19 +0800
+Subject: [PATCH] Update iatomic.h functions definitions for mips
+
+Functions atomic_add(s) and atomic_sub(s) are defined with 'extern
+__inline__' that may cause compile fails when cross compile for mips.
+The error message looks like:
+
+| pcm/.libs/libpcm.a(pcm_meter.o): In function `snd_pcm_meter_update_scope':
+| .../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to `atomic_sub'
+
+Replace the 'extern __inline__' with 'static __inline__' to fix this
+issue.
+
+Signed-off-by: Kai Kang <jiashuo.kang at gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+---
+ include/iatomic.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/include/iatomic.h b/include/iatomic.h
+index 5711fe8..2393297 100644
+--- a/include/iatomic.h
++++ b/include/iatomic.h
+@@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t;
+  * Atomically adds @i to @v.  Note that the guaranteed useful range
+  * of an atomic_t is only 24 bits.
+  */
+-extern __inline__ void atomic_add(int i, atomic_t * v)
++static __inline__ void atomic_add(int i, atomic_t * v)
+ {
+ 	unsigned long temp;
+ 
+@@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
+  * Atomically subtracts @i from @v.  Note that the guaranteed
+  * useful range of an atomic_t is only 24 bits.
+  */
+-extern __inline__ void atomic_sub(int i, atomic_t * v)
++static __inline__ void atomic_sub(int i, atomic_t * v)
+ {
+ 	unsigned long temp;
+ 
+@@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)
+ /*
+  * Same as above, but return the result value
+  */
+-extern __inline__ int atomic_add_return(int i, atomic_t * v)
++static __inline__ int atomic_add_return(int i, atomic_t * v)
+ {
+ 	unsigned long temp, result;
+ 
+@@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
+ 	return result;
+ }
+ 
+-extern __inline__ int atomic_sub_return(int i, atomic_t * v)
++static __inline__ int atomic_sub_return(int i, atomic_t * v)
+ {
+ 	unsigned long temp, result;
+ 
+-- 
+1.8.1.2
+
diff --git a/recipes-multimedia/alsa/alsa-lib/fix-tstamp-declaration.patch b/recipes-multimedia/alsa/alsa-lib/fix-tstamp-declaration.patch
new file mode 100644
index 0000000..32b84b7
--- /dev/null
+++ b/recipes-multimedia/alsa/alsa-lib/fix-tstamp-declaration.patch
@@ -0,0 +1,21 @@ 
+# Author: Michael Lauer <mickey@vanille-media.de>
+# Date:   Thu Jan 18 00:27:21 2007 +0000
+# alsa-lib: fix "error: field 'tstamp' has incomplete type" when including alsa headers with strict compilation options
+#
+# Acquired from OpenEmbedded
+
+Upstream-Status: Pending
+
+Index: alsa-lib-1.0.13/include/global.h
+===================================================================
+--- alsa-lib-1.0.13.orig/include/global.h
++++ alsa-lib-1.0.13/include/global.h
+@@ -29,6 +29,8 @@
+ #define __ALSA_GLOBAL_H_
+ 
+ /* for timeval and timespec */
++#define __need_timeval
++#define __need_timespec
+ #include <time.h>
+ 
+ #ifdef __cplusplus
diff --git a/recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb b/recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb
new file mode 100644
index 0000000..0e1ea76
--- /dev/null
+++ b/recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb
@@ -0,0 +1,49 @@ 
+DESCRIPTION = "ALSA sound library"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
+SECTION = "libs/multimedia"
+LICENSE = "LGPLv2.1 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+                    file://src/socket.c;beginline=1;endline=26;md5=11ff89a8a7a4a690a5c78effe8159545"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# configure.in sets -D__arm__ on the command line for any arm system
+# (not just those with the ARM instruction set), this should be removed,
+# (or replaced by a permitted #define).
+#FIXME: remove the following
+ARM_INSTRUCTION_SET = "arm"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-${PV}.tar.bz2 \
+           file://Check-if-wordexp-function-is-supported.patch \
+           file://fix-tstamp-declaration.patch \
+           file://Update-iatomic.h-functions-definitions-for-mips.patch \
+          "
+SRC_URI[md5sum] = "69129a7c37697f81ac092335e9fa452b"
+SRC_URI[sha256sum] = "690ed393e7efd4fc7e3a2d2cda5449298ca0c895197e5914e350882012430d19"
+
+inherit autotools pkgconfig
+
+require alsa-fpu.inc
+EXTRA_OECONF += "${@get_alsa_fpu_setting(bb, d)} "
+
+EXTRA_OECONF = "--with-cards=pdaudiocf --with-oss=yes --disable-python"
+
+EXTRA_OECONF_append_libc-uclibc = " --with-versioned=no "
+
+PACKAGES =+ "alsa-server libasound alsa-conf-base alsa-conf alsa-doc alsa-dev"
+FILES_${PN} += "${libdir}/${BPN}/smixer/*.so"
+FILES_${PN}-dbg += "${libdir}/${BPN}/smixer/.debug"
+FILES_${PN}-dev += "${libdir}/${BPN}/smixer/*.la"
+FILES_libasound = "${libdir}/libasound.so.*"
+FILES_alsa-server = "${bindir}/*"
+FILES_alsa-conf = "${datadir}/alsa/"
+FILES_alsa-dev += "${libdir}/pkgconfig/ /usr/include/ ${datadir}/aclocal/*"
+FILES_alsa-conf-base = "\
+${datadir}/alsa/alsa.conf \
+${datadir}/alsa/cards/aliases.conf \
+${datadir}/alsa/pcm/default.conf \
+${datadir}/alsa/pcm/dmix.conf \
+${datadir}/alsa/pcm/dsnoop.conf"
+
+RDEPENDS_libasound = "alsa-conf-base"
diff --git a/recipes-multimedia/alsa/alsa-utils-alsaconf_1.0.27.2.bb b/recipes-multimedia/alsa/alsa-utils-alsaconf_1.0.27.2.bb
new file mode 100644
index 0000000..a3fa1d0
--- /dev/null
+++ b/recipes-multimedia/alsa/alsa-utils-alsaconf_1.0.27.2.bb
@@ -0,0 +1,17 @@ 
+require alsa-utils_${PV}.bb
+
+THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESPATH =. "${@base_set_filespath(["${THISDIR}/alsa-utils"], d)}:"
+
+PACKAGES = "${PN}"
+RDEPENDS_${PN} += "bash"
+
+DESCRIPTION_${PN}     = "a bash script that creates ALSA configuration files"
+FILES_${PN} = "${sbindir}/alsaconf"
+
+S = "${WORKDIR}/alsa-utils-${PV}"
+
+do_install() {
+	install -d ${D}${sbindir}
+	install -m 0755 ${S}/alsaconf/alsaconf ${D}${sbindir}/
+}
diff --git a/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch b/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch
new file mode 100644
index 0000000..477cd11
--- /dev/null
+++ b/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch
@@ -0,0 +1,40 @@ 
+From 37c99a3cbff36915b56a5703eeaed3c70796f80f Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sun, 9 Oct 2011 20:06:35 +0200
+Subject: [PATCH] alsactl: don't let systemd unit restore the volume when asound.state is missing
+
+This avoids an error on bootup
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+
+Filed as https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5459
+
+Upstream-Status: Pending
+
+Index: alsa-utils-1.0.27.2/alsactl/Makefile.am
+===================================================================
+--- alsa-utils-1.0.27.2.orig/alsactl/Makefile.am
++++ alsa-utils-1.0.27.2/alsactl/Makefile.am
+@@ -36,8 +36,8 @@ install-data-hook:
+ endif
+ 
+ edit = \
+-	$(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
+-		  -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
++	$(SED) -e 's,@localstatedir\@,$(localstatedir),g' -e 's,@sbindir\@,$(sbindir),g' \
++	       -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
+ 							< $< > $@ || rm $@
+ 
+ alsa-state.service: alsa-state.service.in
+Index: alsa-utils-1.0.27.2/alsactl/alsa-restore.service.in
+===================================================================
+--- alsa-utils-1.0.27.2.orig/alsactl/alsa-restore.service.in
++++ alsa-utils-1.0.27.2/alsactl/alsa-restore.service.in
+@@ -10,6 +10,7 @@ DefaultDependencies=no
+ After=alsa-state.service
+ Before=shutdown.target
+ Conflicts=shutdown.target
++ConditionPathExists=@localstatedir@/lib/alsa/asound.state
+ 
+ [Service]
+ Type=oneshot
diff --git a/recipes-multimedia/alsa/alsa-utils_1.0.27.2.bb b/recipes-multimedia/alsa/alsa-utils_1.0.27.2.bb
new file mode 100644
index 0000000..a894171
--- /dev/null
+++ b/recipes-multimedia/alsa/alsa-utils_1.0.27.2.bb
@@ -0,0 +1,82 @@ 
+DESCRIPTION = "ALSA Utilities"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://alsactl/utils.c;beginline=1;endline=20;md5=fe9526b055e246b5558809a5ae25c0b9"
+DEPENDS = "alsa-lib ncurses libsamplerate0 udev"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \
+           file://0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch \
+          "
+
+SRC_URI[md5sum] = "b65e9a04181bd7c9db7667a4566f8dc3"
+SRC_URI[sha256sum] = "02bfac39092f3b68d743c23ad3d688d6c5aa8df69f2ccd692c5b8282edb352ea"
+
+# lazy hack. needs proper fixing in gettext.m4, see
+# http://bugs.openembedded.org/show_bug.cgi?id=2348
+# please close bug and remove this comment when properly fixed
+#
+EXTRA_OECONF = "--disable-xmlto --with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d "
+EXTRA_OECONF_append_libc-uclibc = " --disable-nls"
+
+inherit autotools gettext
+
+# This are all packages that we need to make. Also, the now empty alsa-utils
+# ipk depends on them.
+
+ALSA_UTILS_PKGS = "\
+             alsa-utils-alsamixer \
+             alsa-utils-midi \
+             alsa-utils-aplay \
+             alsa-utils-amixer \
+             alsa-utils-aconnect \
+             alsa-utils-iecset \
+             alsa-utils-speakertest \
+             alsa-utils-aseqnet \
+             alsa-utils-aseqdump \
+             alsa-utils-alsactl \
+             alsa-utils-alsaloop \
+             alsa-utils-alsaucm \
+            "
+
+PACKAGES += "${ALSA_UTILS_PKGS}"
+RDEPENDS_${PN} += "${ALSA_UTILS_PKGS}"
+
+FILES_${PN} = ""
+FILES_alsa-utils-aplay       = "${bindir}/aplay ${bindir}/arecord"
+FILES_alsa-utils-amixer      = "${bindir}/amixer"
+FILES_alsa-utils-alsamixer   = "${bindir}/alsamixer"
+FILES_alsa-utils-speakertest = "${bindir}/speaker-test ${datadir}/sounds/alsa/ ${datadir}/alsa/speaker-test/"
+FILES_alsa-utils-midi        = "${bindir}/aplaymidi ${bindir}/arecordmidi ${bindir}/amidi"
+FILES_alsa-utils-aconnect    = "${bindir}/aconnect"
+FILES_alsa-utils-aseqnet     = "${bindir}/aseqnet"
+FILES_alsa-utils-iecset      = "${bindir}/iecset"
+FILES_alsa-utils-alsactl     = "${sbindir}/alsactl */udev/rules.d ${systemd_unitdir} ${localstatedir}/lib/alsa ${datadir}/alsa/init/"
+FILES_alsa-utils-aseqdump    = "${bindir}/aseqdump"
+FILES_alsa-utils-alsaloop    = "${bindir}/alsaloop"
+FILES_alsa-utils-alsaucm     = "${bindir}/alsaucm"
+
+
+DESCRIPTION_alsa-utils-aplay        = "play (and record) sound files via ALSA"
+DESCRIPTION_alsa-utils-amixer       = "command-line based control for ALSA mixer and settings"
+DESCRIPTION_alsa-utils-alsamixer    = "ncurses based control for ALSA mixer and settings"
+DESCRIPTION_alsa-utils-speakertest  = "ALSA surround speaker test utility"
+DESCRIPTION_alsa-utils-midi         = "miscalleanous MIDI utilities for ALSA"
+DESCRIPTION_alsa-utils-aconnect     = "ALSA sequencer connection manager"
+DESCRIPTION_alsa-utils-aseqnet      = "network client/server on ALSA sequencer"
+DESCRIPTION_alsa-utils-alsactl      = "saves/restores ALSA-settings in /etc/asound.state"
+DESCRIPTION_alsa-utils-alsaucm      = "ALSA Use Case Manager"
+
+RRECOMMENDS_alsa-utils-alsactl = "alsa-states"
+
+ALLOW_EMPTY_alsa-utils = "1"
+
+do_install() {
+	autotools_do_install
+
+	# We don't ship this here because it requires a dependency on bash.
+	# See alsa-utils-alsaconf_${PV}.bb
+	rm ${D}${sbindir}/alsaconf
+}