update buildroot to 2017.02.11

This commit is contained in:
jbnadal
2018-05-22 15:35:47 +02:00
parent 4bf1f5e091
commit a3c10bd762
9257 changed files with 433426 additions and 1701 deletions

View File

@@ -0,0 +1,173 @@
Switch madplay to the new API. This is done thanks to a patch written
by Micha Nelissen <micha@neli.hopto.org> 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 at 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;

View File

@@ -0,0 +1,109 @@
From ce661985c098635965573aac8fc983a72f60d396 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Tue, 30 May 2017 16:42:34 +0200
Subject: [PATCH] buildroot-libtool-v1.5.patch
Apply buildroot-libtool-v1.5.patch rebased on libtool 1.5.2 used
in madplay and fixing all conflicts.
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
ltmain.sh | 40 ++++++++++++++++++++++++++++++----------
1 file changed, 30 insertions(+), 10 deletions(-)
diff --git a/ltmain.sh b/ltmain.sh
index 4b9f940..0b71220 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -164,6 +164,11 @@ do
arg="$1"
shift
+ # Make -static behave as -all-static
+ case $arg in
+ -static) arg="-all-static" ;;
+ esac
+
case $arg in
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
@@ -549,8 +554,9 @@ if test -z "$show_help"; then
# line option must be used.
if test -z "$tagname"; then
$echo "$modename: unable to infer tagged configuration"
- $echo "$modename: specify a tag with \`--tag'" 1>&2
- exit 1
+ $echo "$modename: defaulting to \`CC'"
+ $echo "$modename: if this is not correct, specify a tag with \`--tag'"
+# exit 1
# else
# $echo "$modename: using $tagname tagged configuration"
fi
@@ -1228,7 +1234,8 @@ EOF
prevarg="$arg"
case $arg in
- -all-static)
+ # Make -static behave like -all-static
+ -all-static | -static)
if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
@@ -2135,8 +2142,14 @@ EOF
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$libdir"
- absdir="$libdir"
+ # Adding 'libdir' from the .la file to our library search paths
+ # breaks crosscompilation horribly. We cheat here and don't add
+ # it, instead adding the path where we found the .la. -CL
+ dir="$abs_ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ #dir="$libdir"
+ #absdir="$libdir"
fi
else
dir="$ladir/$objdir"
@@ -2261,7 +2274,7 @@ EOF
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
+ need_relink=no
fi
# This is a shared library
@@ -5146,6 +5159,10 @@ fi\
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
+ # Replacing uninstalled with installed can easily break crosscompilation,
+ # since the installed path is generally the wrong architecture. -CL
+ newdependency_libs="$newdependency_libs $deplib"
+ continue
case $deplib in
*.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
@@ -5464,10 +5481,13 @@ relink_command=\"$relink_command\""
# At present, this check doesn't affect windows .dll's that
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
- if test "$inst_prefix_dir" = "$destdir"; then
- $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
- exit 1
- fi
+ #
+ # This breaks install into our staging area. -PB
+ #
+ # if test "$inst_prefix_dir" = "$destdir"; then
+ # $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ # exit 1
+ # fi
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
--
2.9.4

View File

@@ -0,0 +1,22 @@
config BR2_PACKAGE_MADPLAY
bool "madplay"
select BR2_PACKAGE_LIBMAD
select BR2_PACKAGE_LIBID3TAG
select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
help
Command-line front-end to libmad, a high-quality MPEG audio decoder.
It currently supports MPEG-1 and the MPEG-2 extension to lower
sampling frequencies, as well as the de facto MPEG 2.5 format. All
three audio layers — Layer I, Layer II, and Layer III (i.e. MP3) —
are fully implemented.
http://www.underbit.com/products/mad/
if BR2_PACKAGE_MADPLAY
config BR2_PACKAGE_MADPLAY_ALSA
bool
default y
depends on BR2_PACKAGE_ALSA_LIB
endif

View File

@@ -0,0 +1,2 @@
# Locally computed:
sha256 5a79c7516ff7560dffc6a14399a389432bc619c905b13d3b73da22fa65acede0 madplay-0.15.2b.tar.gz

View File

@@ -0,0 +1,30 @@
################################################################################
#
# madplay
#
################################################################################
MADPLAY_VERSION = 0.15.2b
MADPLAY_SITE = http://downloads.sourceforge.net/project/mad/madplay/$(MADPLAY_VERSION)
MADPLAY_LICENSE = GPLv2+
MADPLAY_LICENSE_FILES = COPYING COPYRIGHT
MADPLAY_LIBTOOL_PATCH = NO
MADPLAY_DEPENDENCIES = libmad libid3tag $(if $(BR2_PACKAGE_GETTEXT),gettext)
# Workaround a bug in uClibc-ng, which exposes madvise() but doesn't
# provide the corresponding MADV_* definitions. Bug reported at
# http://mailman.uclibc-ng.org/pipermail/devel/2016-December/001306.html. madvise()
# is anyway useless on noMMU.
ifeq ($(BR2_USE_MMU),)
MADPLAY_CONF_ENV += ac_cv_func_madvise=no
endif
# Check if ALSA is built, then we should configure after alsa-lib so
# ./configure can find alsa-lib.
ifeq ($(BR2_PACKAGE_MADPLAY_ALSA),y)
MADPLAY_CONF_OPTS += --with-alsa
MADPLAY_DEPENDENCIES += host-pkgconf alsa-lib
MADPLAY_CONF_ENV += LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs alsa`"
endif
$(eval $(autotools-package))