Skip to contentSkip to conversation

Pull request for branch fixes

GIT PULL New Thomas Petazzoni 2 participants 12 messages Feb 24, 2010

lore
Share & tools
lore
#0 lore raw

The following changes since commit 4f05a61b33e5d87f23837109fb0dd538a5bd5d62:
Peter Korsgaard (1):
Merge branch 'misc-fixes5' of git://git.busybox.net/~tpetazzoni/git/buildroot

are available in the git repository at:

git://git.busybox.net/~tpetazzoni/git/buildroot fixes

Thomas Petazzoni (10):
netsnmp: use the autoconf built by Buildroot
ipsec-tools: add host-flex dependency
openmotif: remove package
xpdf: remove package
libgtk2: host version needs host-libpng
pango: remove gtk-doc patch
pango: re-enable thai module
pango: remove dependency on host-pango
sylpheed: add dependency on libgtk2
madplay: add patch to switch to the new ALSA API

 package/Config.in                                  |    2 -
 package/ipsec-tools/ipsec-tools.mk                 |    2 +-
 package/libgtk2/libgtk2.mk                         |    2 +-
 .../madplay-0.15.2b-switch-to-new-alsa-api.patch   |  173 ++++
 package/netsnmp/netsnmp.mk                         |    4 +-
 package/openmotif/Config.in                        |    7 -
 package/openmotif/README                           |    2 -
 .../openmotif/openmotif-2.3.0-cross-compile.patch  |  106 ---
 .../openmotif-2.3.0-legacy-bzero-must-die.patch    |  758 ------------------
 package/openmotif/openmotif.mk                     |   94 ---
 package/pango/pango-gtk-doc.patch                  |   59 --
 package/pango/pango-no-libthai.patch               |   10 -
 package/pango/pango.mk                             |   13 +-
 package/sylpheed/Config.in                         |    1 +
 package/sylpheed/sylpheed.mk                       |    2 +-
 package/xpdf/Config.in                             |    9 -
 package/xpdf/xpdf-3.02pl1.patch                    |   33 -
 package/xpdf/xpdf-3.02pl2.patch                    |  823 --------------------
 package/xpdf/xpdf.mk                               |   31 -
 19 files changed, 182 insertions(+), 1949 deletions(-)
 create mode 100644 package/multimedia/madplay/madplay-0.15.2b-switch-to-new-alsa-api.patch
 delete mode 100644 package/openmotif/Config.in
 delete mode 100644 package/openmotif/README
 delete mode 100644 package/openmotif/openmotif-2.3.0-cross-compile.patch
 delete mode 100644 package/openmotif/openmotif-2.3.0-legacy-bzero-must-die.patch
 delete mode 100644 package/openmotif/openmotif.mk
 delete mode 100644 package/pango/pango-gtk-doc.patch
 delete mode 100644 package/pango/pango-no-libthai.patch
 delete mode 100644 package/xpdf/Config.in
 delete mode 100644 package/xpdf/xpdf-3.02pl1.patch
 delete mode 100644 package/xpdf/xpdf-3.02pl2.patch
 delete mode 100644 package/xpdf/xpdf.mk

Thanks,

Signature · 1 line
Thomas Petazzoni
#1 lore raw

PATCH 1/10 netsnmp: use the autoconf built by Buildroot

---
 package/netsnmp/netsnmp.mk |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
package/netsnmp/netsnmp.mk +2 -2
index cfe9905..c589e25 100644
@@ -58,7 +58,7 @@ endif
 
 $(NETSNMP_DIR)/.configured: $(NETSNMP_DIR)/.unpacked
 	(cd $(NETSNMP_DIR); rm -f config.cache; \
-		autoconf && \
+		$(AUTOCONF) && \
 		ac_cv_NETSNMP_CAN_USE_SYSCTL=yes \
 		$(NETSNMP_CONFIGURE_PERL_ENV) \
 		$(TARGET_CONFIGURE_OPTS) \
@@ -130,7 +130,7 @@ endif
 	$(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/header_complex.h $(STAGING_DIR)/usr/include/net-snmp/agent/header_complex.h
 	$(INSTALL) -D -m 0755 package/netsnmp/S59snmpd $(TARGET_DIR)/etc/init.d/S59snmpd
 
-netsnmp: $(if $(BR2_PACKAGE_OPENSSL),openssl) $(TARGET_DIR)/usr/sbin/snmpd
+netsnmp: host-autoconf $(if $(BR2_PACKAGE_OPENSSL),openssl) $(TARGET_DIR)/usr/sbin/snmpd
 
 netsnmp-headers: $(TARGET_DIR)/usr/include/net-snmp/net-snmp-config.h
 	$(INSTALL) -d $(TARGET_DIR)/usr/include/net-snmp
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH 2/10 ipsec-tools: add host-flex dependency

In reply to Thomas Petazzoni

This fixes the following build failure:

checking lex output file root...
configure: error: cannot find output from flex; giving up

Caused by the fact that a host version of flex is missing in $(HOST_DIR).

---
 package/ipsec-tools/ipsec-tools.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
package/ipsec-tools/ipsec-tools.mk +1 -1
index a8b87a6..38cd57b 100644
@@ -145,7 +145,7 @@ ifeq ($(BR2_PACKAGE_IPSEC_TOOLS_ADMINPORT), y)
 IPSEC_TOOLS_PROGS+= $(TARGET_DIR)/$(IPSEC_TOOLS_TARGET_BINARY_RACOONCTL)
 endif
 
-ipsec-tools: openssl flex $(IPSEC_TOOLS_PROGS)
+ipsec-tools: openssl flex host-flex $(IPSEC_TOOLS_PROGS)
 
 ipsec-tools-source: $(DL_DIR)/$(IPSEC_TOOLS_SOURCE)
 
Signature · 1 line
1.6.3.3
#3 lore raw

PATCH 3/10 openmotif: remove package

In reply to Thomas Petazzoni

This is an old package. It is currently broken, and probably nobody uses it. So let's get rid of it.

---
 package/Config.in                                  |    1 -
 package/openmotif/Config.in                        |    7 -
 package/openmotif/README                           |    2 -
 .../openmotif/openmotif-2.3.0-cross-compile.patch  |  106 ---
 .../openmotif-2.3.0-legacy-bzero-must-die.patch    |  758 --------------------
 package/openmotif/openmotif.mk                     |   94 ---
 6 files changed, 0 insertions(+), 968 deletions(-)
 delete mode 100644 package/openmotif/Config.in
 delete mode 100644 package/openmotif/README
 delete mode 100644 package/openmotif/openmotif-2.3.0-cross-compile.patch
 delete mode 100644 package/openmotif/openmotif-2.3.0-legacy-bzero-must-die.patch
 delete mode 100644 package/openmotif/openmotif.mk
package/Config.in +0 -1
index 37cae2e..e3b1743 100644
@@ -342,7 +342,6 @@ source "package/gtk2-engines/Config.in"
 source "package/gtk2-themes/Config.in"
 source "package/libsexy/Config.in"
 source "package/fltk/Config.in"
-source "package/openmotif/Config.in"
 source "package/fontconfig/Config.in"
 source "package/freetype/Config.in"
 source "package/tslib/Config.in"
package/openmotif/Config.in deleted +0 -7
deleted file mode 100644
index 56cb651..0000000
@@ -1,7 +0,0 @@
-config BR2_PACKAGE_OPENMOTIF
-	bool "openmotif"
-	help
-	  OpenMotif is the publicly licensed version of Motif, the
-	  industry standard user interface toolkit for UNIX systems.
-
-	  ftp://ftp.ics.com/openmotif/2.3/2.3.0
package/openmotif/README deleted +0 -2
deleted file mode 100644
index e93bc65..0000000
@@ -1,2 +0,0 @@
-Compiling OpenMotif may require byacc (or just yacc) 
-to be installed on the host build system 
package/openmotif/openmotif-2.3.0-cross-compile.patch deleted +0 -106

106 lines not on this page · raw message

package/openmotif/openmotif-2.3.0-legacy-bzero-must-die.patch deleted +0 -758

758 lines not on this page · raw message

package/openmotif/openmotif.mk deleted +0 -94

94 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#4 lore raw

PATCH 4/10 xpdf: remove package

In reply to Thomas Petazzoni

This package depends on openmotif, which has been removed.

---
 package/Config.in               |    1 -
 package/xpdf/Config.in          |    9 -
 package/xpdf/xpdf-3.02pl1.patch |   33 --
 package/xpdf/xpdf-3.02pl2.patch |  823 ---------------------------------------
 package/xpdf/xpdf.mk            |   31 --
 5 files changed, 0 insertions(+), 897 deletions(-)
 delete mode 100644 package/xpdf/Config.in
 delete mode 100644 package/xpdf/xpdf-3.02pl1.patch
 delete mode 100644 package/xpdf/xpdf-3.02pl2.patch
 delete mode 100644 package/xpdf/xpdf.mk
package/Config.in +0 -1
index e3b1743..b21604d 100644
@@ -369,7 +369,6 @@ source "package/sylpheed/Config.in"
 source "package/synergy/Config.in"
 source "package/torsmo/Config.in"
 source "package/x11vnc/Config.in"
-source "package/xpdf/Config.in"
 source "package/xstroke/Config.in"
 source "package/xvkbd/Config.in"
 endmenu
package/xpdf/Config.in deleted +0 -9
deleted file mode 100644
index 4846383..0000000
@@ -1,9 +0,0 @@
-config BR2_PACKAGE_XPDF
-	bool "xpdf"
-	select BR2_PACKAGE_OPENMOTIF
-	select BR2_PACKAGE_FREETYPE
-	help
-	  Xpdf is an open source viewer for Portable Document Format
-	  (PDF) files.
-
-	  ftp://ftp.foolabs.com/pub/xpdf
package/xpdf/xpdf-3.02pl1.patch deleted +0 -33
deleted file mode 100644
index cd42fb9..0000000
@@ -1,33 +0,0 @@
-*** xpdf-3.02.orig/xpdf/Stream.cc	Tue Feb 27 14:05:52 2007
---- xpdf-3.02/xpdf/Stream.cc	Thu Jul 26 14:44:43 2007
-***************
-*** 410,424 ****
-    ok = gFalse;
-  
-    nVals = width * nComps;
--   if (width <= 0 || nComps <= 0 || nBits <= 0 ||
--       nComps >= INT_MAX / nBits ||
--       width >= INT_MAX / nComps / nBits ||
--       nVals * nBits + 7 < 0) {
--     return;
--   }
-    pixBytes = (nComps * nBits + 7) >> 3;
-    rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
-!   if (rowBytes <= 0) {
-      return;
-    }
-    predLine = (Guchar *)gmalloc(rowBytes);
---- 410,422 ----
-    ok = gFalse;
-  
-    nVals = width * nComps;
-    pixBytes = (nComps * nBits + 7) >> 3;
-    rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
-!   if (width <= 0 || nComps <= 0 || nBits <= 0 ||
-!       nComps > gfxColorMaxComps ||
-!       nBits > 16 ||
-!       width >= INT_MAX / nComps ||      // check for overflow in nVals 
-!       nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
-      return;
-    }
-    predLine = (Guchar *)gmalloc(rowBytes);
package/xpdf/xpdf-3.02pl2.patch deleted +0 -823

823 lines not on this page · raw message

package/xpdf/xpdf.mk deleted +0 -31
deleted file mode 100644
index 6bbfed6..0000000
@@ -1,31 +0,0 @@
-#############################################################
-#
-# xpdf
-#
-#############################################################
-XPDF_VERSION = 3.02
-XPDF_SOURCE = xpdf-$(XPDF_VERSION).tar.gz
-XPDF_SITE = ftp://ftp.foolabs.com/pub/xpdf
-XPDF_AUTORECONF = NO
-XPDF_INSTALL_STAGING = NO
-XPDF_INSTALL_TARGET = YES
-XPDF_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
-
-XPDF_CONF_OPT = --enable-multithreaded
-
-ifeq ($(BR2_SOFT_FLOAT),y)
-	XPDF_CONF_OPT += --enable-fixedpoint
-endif
-
-ifeq ($(BR2_PACKAGE_XORG7),y)
-	XPDF_DEPENDENCIES += xserver_xorg-server openmotif
-	XPDF_CONF_OPT += --with-Xm-library=$(STAGING_DIR)/usr/lib --with-Xm-includes=$(STAGING_DIR)/usr/include/Xm \
-					--with-x --with-freetype2-includes=$(STAGING_DIR)/usr/include \
-					--with-freetype2-library=$(STAGING_DIR)/usr/lib CFLAGS="-I$(STAGING_DIR)/usr/include/freetype2" \
-					CXXFLAGS="-I$(STAGING_DIR)/usr/include/freetype2"
-endif
-
-XPDF_DEPENDENCIES = freetype
-
-$(eval $(call AUTOTARGETS,package,xpdf))
-
Signature · 1 line
1.6.3.3
#5 lore raw

PATCH 5/10 libgtk2: host version needs host-libpng

In reply to Thomas Petazzoni
---
 package/libgtk2/libgtk2.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
package/libgtk2/libgtk2.mk +1 -1
index cc62c73..1e732d0 100644
@@ -126,7 +126,7 @@ endif
 # gtk-update-icon-cache, which are the host tools needed to build Gtk
 # for the target.
 
-HOST_LIBGTK2_DEPENDENCIES = host-libglib2
+HOST_LIBGTK2_DEPENDENCIES = host-libglib2 host-libpng
 HOST_LIBGTK2_AUTORECONF = YES
 HOST_LIBGTK2_CONF_OPT = \
 		--disable-static \
Signature · 1 line
1.6.3.3
#6 lore raw

PATCH 6/10 pango: remove gtk-doc patch

In reply to Thomas Petazzoni

The gtk-doc.m4 file is now installed globally (see the automake package), so there's no point in including a pango-specific patch.

---
 package/pango/pango-gtk-doc.patch |   59 -------------------------------------
 1 files changed, 0 insertions(+), 59 deletions(-)
 delete mode 100644 package/pango/pango-gtk-doc.patch
package/pango/pango-gtk-doc.patch deleted +0 -59
deleted file mode 100644
index bee5fe6..0000000
@@ -1,59 +0,0 @@
---- pango/acinclude.m4.old	2004-05-08 11:31:48.000000000 +0100
-+++ pango/acinclude.m4	2004-05-08 11:31:58.000000000 +0100
-@@ -55,3 +55,56 @@
- ])
- 
- 
-+dnl -*- mode: autoconf -*-
-+
-+# serial 1
-+
-+dnl Usage:
-+dnl   GTK_DOC_CHECK([minimum-gtk-doc-version])
-+AC_DEFUN([GTK_DOC_CHECK],
-+[
-+  AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
-+  AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
-+  dnl for overriding the documentation installation directory
-+  AC_ARG_WITH(html-dir,
-+    AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
-+    [with_html_dir='${datadir}/gtk-doc/html'])
-+  HTML_DIR="$with_html_dir"
-+  AC_SUBST(HTML_DIR)
-+
-+  dnl enable/disable documentation building
-+  AC_ARG_ENABLE(gtk-doc,
-+    AC_HELP_STRING([--enable-gtk-doc],
-+                   [use gtk-doc to build documentation [default=no]]),,
-+    enable_gtk_doc=no)
-+
-+  have_gtk_doc=no
-+  if test -z "$PKG_CONFIG"; then
-+    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-+  fi
-+  if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
-+    have_gtk_doc=yes
-+  fi
-+
-+  dnl do we want to do a version check?
-+ifelse([$1],[],,
-+  [gtk_doc_min_version=$1
-+  if test "$have_gtk_doc" = yes; then
-+    AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
-+    if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
-+      AC_MSG_RESULT(yes)
-+    else
-+      AC_MSG_RESULT(no)
-+      have_gtk_doc=no
-+    fi
-+  fi
-+])
-+  if test x$enable_gtk_doc = xyes; then
-+    if test "$have_gtk_doc" != yes; then
-+      enable_gtk_doc=no
-+    fi
-+  fi
-+
-+  AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
-+  AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
-+])
Signature · 1 line
1.6.3.3
#7 lore raw

PATCH 7/10 pango: re-enable thai module

In reply to Thomas Petazzoni

This module got disabled when pango was upgraded to 1.19.3. But now, the module builds fine. And even more: disabling it breaks the build when modules are compiled statically into pango.

---
 package/pango/pango-no-libthai.patch |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
 delete mode 100644 package/pango/pango-no-libthai.patch
package/pango/pango-no-libthai.patch deleted +0 -10
deleted file mode 100644
index 78a3baf..0000000
@@ -1,10 +0,0 @@
---- a/modules/Makefile.am	2007-07-05 17:30:28.000000000 -0400
-+++ b/modules/Makefile.am	2008-02-09 19:37:13.000000000 -0500
-@@ -8,7 +8,6 @@ SUBDIRS = 		\
- 	indic           \
- 	khmer		\
- 	syriac		\
--	thai		\
- 	tibetan
- 
- EXTRA_DIST =		\
Signature · 1 line
1.6.3.3
#8 lore raw

PATCH 8/10 pango: remove dependency on host-pango

In reply to Thomas Petazzoni

Pango was depending on host-pango because of the pango-querymodules utility. Compiling pango for the host is a mess because it depends on Cairo, which itself depends on X.org.

Therefore, we remove the dependency of pango on pango-querymodules by using statically compiled rendering libraries instead of modules. For the moment, all rendering libraries are included, but we could imagine adding more configuration options in the future.

---
 package/pango/pango.mk |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
package/pango/pango.mk +3 -10
index 38e163e..08f6610 100644
@@ -38,14 +38,15 @@ PANGO_CONF_ENV = ac_cv_func_posix_getpwuid_r=yes glib_cv_stack_grows=no \
 		ac_cv_path_FREETYPE_CONFIG=$(STAGING_DIR)/usr/bin/freetype-config
 
 PANGO_CONF_OPT = --enable-shared --enable-static \
-		--enable-explicit-deps=no --disable-debug
+		--enable-explicit-deps=no --disable-debug \
+		--without-dynamic-modules --with-included-modules=yes
 
 HOST_PANGO_CONF_OPT = \
 		--disable-static \
 		$(if $(BR2_PACKAGE_XORG7),--with-x,--without-x) \
 		--disable-debug \
 
-PANGO_DEPENDENCIES = gettext libintl host-pkg-config host-pango libglib2 cairo
+PANGO_DEPENDENCIES = gettext libintl host-pkg-config libglib2 cairo
 
 HOST_PANGO_DEPENDENCIES = host-pkg-config host-cairo host-libglib2 host-autoconf host-automake
 
@@ -62,11 +63,3 @@ endif
 
 $(eval $(call AUTOTARGETS,package,pango))
 $(eval $(call AUTOTARGETS,package,pango,host))
-
-$(PANGO_HOOK_POST_INSTALL):
-	mkdir -p $(TARGET_DIR)/etc/pango
-	$(PANGO_HOST_BINARY) > $(TARGET_DIR)/etc/pango/pango.modules
-	$(SED) 's~$(HOST_DIR)~~g' $(TARGET_DIR)/etc/pango/pango.modules
-	touch $@
-
-PANGO_HOST_BINARY:=$(HOST_DIR)/usr/bin/pango-querymodules
Signature · 1 line
1.6.3.3
#9 lore raw

PATCH 9/10 sylpheed: add dependency on libgtk2

In reply to Thomas Petazzoni
---
 package/sylpheed/Config.in   |    1 +
 package/sylpheed/sylpheed.mk |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
package/sylpheed/Config.in +1 -0
index 2c4aa3a..fe5aee6 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_SYLPHEED
 	bool "sylpheed"
+	select BR2_PACKAGE_LIBGTK2
 	help
 	  lightweight and user-friendly e-mail client.
 
package/sylpheed/sylpheed.mk +1 -1
index 96eca9c..bc2872d 100644
@@ -13,7 +13,7 @@ SYLPHEED_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
 
 SYLPHEED_CONF_OPT = --disable-gtkspell --program-prefix=""
 
-SYLPHEED_DEPENDENCIES = host-pkg-config
+SYLPHEED_DEPENDENCIES = host-pkg-config libgtk2
 
 $(eval $(call AUTOTARGETS,package,sylpheed))
 
Signature · 1 line
1.6.3.3
#10 lore raw

PATCH 10/10 madplay: add patch to switch to the new ALSA API

In reply to Thomas Petazzoni

madplay was failing to build with errors such as :

audio_alsa.o: In function `config':
audio_alsa.c:(.text+0x200): undefined reference to snd_pcm_hw_params_set_rate_near at ALSA_0.9' audio_alsa.c:(.text+0x25c): undefined reference to snd_pcm_hw_params_set_buffer_time_near at ALSA_0.9' audio_alsa.c:(.text+0x284): undefined reference to snd_pcm_hw_params_get_buffer_size at ALSA_0.9' audio_alsa.c:(.text+0x2a4): undefined reference to snd_pcm_hw_params_set_period_time_near at ALSA_0.9' audio_alsa.c:(.text+0x2d4): undefined reference to `snd_pcm_hw_params_get_period_size at ALSA_0.9'

The ALSA library uses symbol versioning by default, to handle ABI changes. However, since uClibc doesn't seem to support symbol versioning, we disable this when building the ALSA library by passing --without-versioned.

However, madplay relies on the old ALSA ABI, so even without symbol versioning, references to versioned symbols are generated (functions with the same name, but different API, exist in the old and new API).

The easiest solution is to switch madplay to the new API. This is done thanks to a patch written by Micha Nelissen <[email protected]> and available at http://article.gmane.org/gmane.comp.audio.mad.devel/729.

---
 .../madplay-0.15.2b-switch-to-new-alsa-api.patch   |  173 ++++++++++++++++++++
 1 files changed, 173 insertions(+), 0 deletions(-)
 create mode 100644 package/multimedia/madplay/madplay-0.15.2b-switch-to-new-alsa-api.patch
package/multimedia/madplay/madplay-0.15.2b-switch-to-new-alsa-api.patch new file +173 -0
new file mode 100644
index 0000000..60d7bd3
@@ -0,0 +1,173 @@
+Switch madplay to the new API. This is done thanks to a patch written
+by Micha Nelissen <[email protected]> and available at
+http://article.gmane.org/gmane.comp.audio.mad.devel/729.
+
+--- madplay-0.15.2b/audio_alsa.c	2008-10-18 15:10:16.000000000 +0200
++++ madplay-0.15.2b/audio_alsa.c.new	2008-10-18 15:03:27.000000000 +0200
+@@ -28,31 +28,30 @@
+
+ #include <errno.h>
+
+-#define ALSA_PCM_OLD_HW_PARAMS_API
+-#define ALSA_PCM_OLD_SW_PARAMS_API
+ #include <alsa/asoundlib.h>
+
+ #include <mad.h>
+
+ #include "audio.h"
+
+-char *buf	= NULL;
+-int paused	= 0;
++#define BUFFER_TIME_MAX     500000
+
+-int rate	= -1;
+-int channels	= -1;
+-int bitdepth	= -1;
+-int sample_size	= -1;
+-
+-int buffer_time		= 500000;
+-int period_time		= 100000;
+-char *defaultdev	= "plughw:0,0";
++unsigned char *buf  = NULL;
++int paused	    = 0;
++
++unsigned int rate           = 0;
++unsigned int channels	    = -1;
++unsigned int bitdepth	    = -1;
++unsigned int sample_size    = -1;
++
++unsigned int buffer_time;
++unsigned int period_time;
++char *defaultdev	    = "plughw:0,0";
+
+ snd_pcm_hw_params_t *alsa_hwparams;
+ snd_pcm_sw_params_t *alsa_swparams;
+
+-snd_pcm_sframes_t buffer_size;
+-snd_pcm_sframes_t period_size;
++snd_pcm_uframes_t buffer_size;
+
+ snd_pcm_format_t  alsa_format = -1;
+ snd_pcm_access_t  alsa_access = SND_PCM_ACCESS_MMAP_INTERLEAVED;
+@@ -66,14 +65,20 @@
+ 		 snd_pcm_hw_params_t *params,
+ 		 snd_pcm_access_t access)
+ {
+-	int err, dir;
+-	
++	int err;
++
+ 	/* choose all parameters */
+ 	err = snd_pcm_hw_params_any(handle,params);
+ 	if (err < 0) {
+ 		printf("Access type not available for playback: %s\n", snd_strerror(err));
+ 		return err;
+ 	}
++	/* set the access type */
++	err = snd_pcm_hw_params_set_access(handle, params, alsa_access);
++	if (err < 0) {
++		printf("Sample format not available for playback: %s\n", snd_strerror(err));
++		return err;
++	}
+ 	/* set the sample format */
+ 	err = snd_pcm_hw_params_set_format(handle, params, alsa_format);
+ 	if (err < 0) {
+@@ -87,29 +92,38 @@
+ 		return err;
+ 	}
+ 	/* set the stream rate */
+-	err = snd_pcm_hw_params_set_rate_near(handle, params, rate, 0);
++	err = snd_pcm_hw_params_set_rate(handle, params, rate, 0);
+ 	if (err < 0) {
+ 		printf("Rate %iHz not available for playback: %s\n", rate, snd_strerror(err));
+ 		return err;
+ 	}
+-	if (err != rate) {
+-		printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err);
+-		return -EINVAL;
+-	}
++	err = snd_pcm_hw_params_get_buffer_time_max(params, &buffer_time, NULL);
++        if (err < 0) {
++                printf("Unable to retrieve buffer time: %s\n", snd_strerror(err));
++                return err;
++        }
++        if (buffer_time > BUFFER_TIME_MAX)
++                buffer_time = BUFFER_TIME_MAX;
+ 	/* set buffer time */
+-	err = snd_pcm_hw_params_set_buffer_time_near(handle, params, buffer_time, &dir);
++	err = snd_pcm_hw_params_set_buffer_time_near(handle, params, &buffer_time, 0);
+ 	if (err < 0) {
+ 		printf("Unable to set buffer time %i for playback: %s\n", buffer_time, snd_strerror(err));
+ 		return err;
+ 	}
+-	buffer_size = snd_pcm_hw_params_get_buffer_size(params);
++        if (period_time * 4 > buffer_time)
++                period_time = buffer_time / 4;
+ 	/* set period time */
+-	err = snd_pcm_hw_params_set_period_time_near(handle, params, period_time, &dir);
++	err = snd_pcm_hw_params_set_period_time_near(handle, params, &period_time, NULL);
+ 	if (err < 0) {
+ 		printf("Unable to set period time %i for playback: %s\n", period_time, snd_strerror(err));
+ 		return err;
+ 	}
+-	period_size = snd_pcm_hw_params_get_period_size(params, &dir);
++        /* retrieve buffer size */
++	err = snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
++        if (err < 0) {
++                printf("Unable to retrieve buffer size: %s\n", snd_strerror(err));
++                return err;
++        }
+ 	/* write the parameters to device */
+ 	err = snd_pcm_hw_params(handle, params);
+ 	if (err < 0) {
+@@ -123,6 +137,7 @@
+ int set_swparams(snd_pcm_t *handle,
+ 		 snd_pcm_sw_params_t *params)
+ {
++        unsigned int start_threshold;
+ 	int err;
+
+         /* get current swparams */
+@@ -136,13 +151,7 @@
+         if (err < 0) {
+                 printf("Unable to set start threshold mode for playback: %s\n", snd_strerror(err));
+                 return err;
+-										        }
+-        /* allow transfer when@least period_size samples can be processed */
+-        err = snd_pcm_sw_params_set_avail_min(handle, params, period_size);
+-        if (err < 0) {
+-                printf("Unable to set avail min for playback: %s\n", snd_strerror(err));
+-                return err;
+-												        }
++	}
+         /* align all transfers to 1 samples */
+         err = snd_pcm_sw_params_set_xfer_align(handle, params, 1);
+         if (err < 0) {
+@@ -190,7 +199,7 @@
+ 	rate		= config->speed;
+
+ 	if ( bitdepth == 0 )
+-		config->precision = bitdepth = 32;
++		config->precision = bitdepth = 16;
+
+ 	switch (bitdepth)
+ 	{
+@@ -241,7 +250,7 @@
+ 		return -1;
+ 	}
+
+-	buf = malloc(buffer_size);
++	buf = malloc(buffer_size * sample_size);
+ 	if (buf == NULL) {
+ 		audio_error="unable to allocate output buffer table";
+ 		return -1;
+@@ -279,7 +288,7 @@
+ int play(struct audio_play *play)
+ {
+ 	int err, len;
+-	char *ptr;
++	unsigned char *ptr;
+
+ 	ptr = buf;
+ 	len = play->nsamples;
+
Signature · 1 line
1.6.3.3
#11 lore raw
In reply to Thomas Petazzoni
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> The following changes since commit 4f05a61b33e5d87f23837109fb0dd538a5bd5d62:
Thomas> Peter Korsgaard (1):
Thomas> Merge branch 'misc-fixes5' of git://git.busybox.net/~tpetazzoni/git/buildroot

Thomas> are available in the git repository at:

Thomas> git://git.busybox.net/~tpetazzoni/git/buildroot fixes

Thanks! I'm not feeling confident about the pango change (as discussed on IRC), but the rest has been pulled and pushed.

Signature · 1 line
Bye, Peter Korsgaard