Hello community,

here is the log from the commit of package alsa-utils for openSUSE:Factory
checked in at Mon Jun 6 16:46:32 CEST 2011.



--------
--- alsa-utils/alsa-utils.changes       2011-01-31 17:22:15.000000000 +0100
+++ /mounts/work_src_done/STABLE/alsa-utils/alsa-utils.changes  2011-06-03 
14:50:47.000000000 +0200
@@ -1,0 +2,20 @@
+Fri Jun  3 14:50:00 CEST 2011 - [email protected]
+
+- Backport alsa-utils fixes from upstream:
+  0001-alsamixer-fix-display-of-active-inactive-controls.patch
+  0002-alsaloop-libsamplerate-requires-specific-formats-for.patch
+  0003-alsaloop-another-try-to-force-correct-formats-for-li.patch
+  0004-alsamixer-fix-build-on-uClibc.patch
+  0005-alsactl-init-Mute-CD-Playback-volume-by-default.patch
+  0006-Revert-alsactl-Display-help-for-names-command.patch
+  0007-alsaucm-Add-list1-command-for-non-tuple-lists.patch
+  0008-alsaucm-Don-t-double-free-empty-lists.patch
+  0009-aplay-Add-i-option-for-interactive-mode.patch
+  0010-aplay-Avoid-recursive-signal-handling.patch
+  0012-alsaloop-Use-AM_CFLAGS-in-Makefile.am.patch
+  0013-Updated-COPYING-with-the-recent-FSF-address.patch
+  0014-alsamixer-Fix-64bit-issues.patch
+  0015-aplay-Add-include-files-for-mkdir.patch
+  0016-aplay-Use-standard-endian-convesions.patch
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
  0001-alsamixer-fix-display-of-active-inactive-controls.patch
  0002-alsaloop-libsamplerate-requires-specific-formats-for.patch
  0003-alsaloop-another-try-to-force-correct-formats-for-li.patch
  0004-alsamixer-fix-build-on-uClibc.patch
  0005-alsactl-init-Mute-CD-Playback-volume-by-default.patch
  0006-Revert-alsactl-Display-help-for-names-command.patch
  0007-alsaucm-Add-list1-command-for-non-tuple-lists.patch
  0008-alsaucm-Don-t-double-free-empty-lists.patch
  0009-aplay-Add-i-option-for-interactive-mode.patch
  0010-aplay-Avoid-recursive-signal-handling.patch
  0012-alsaloop-Use-AM_CFLAGS-in-Makefile.am.patch
  0013-Updated-COPYING-with-the-recent-FSF-address.patch
  0014-alsamixer-Fix-64bit-issues.patch
  0015-aplay-Add-include-files-for-mkdir.patch
  0016-aplay-Use-standard-endian-convesions.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ alsa-utils.spec ++++++
--- /var/tmp/diff_new_pack.g6DaDq/_old  2011-06-06 16:45:34.000000000 +0200
+++ /var/tmp/diff_new_pack.g6DaDq/_new  2011-06-06 16:45:34.000000000 +0200
@@ -35,9 +35,24 @@
 AutoReqProv:    on
 Summary:        Advanced Linux Sound Architecture Utilities
 Version:        1.0.24.2
-Release:        1
+Release:        6
 Source:         
ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2
 # Patch:          alsa-utils-git-fixes.diff
+Patch1:         0001-alsamixer-fix-display-of-active-inactive-controls.patch
+Patch2:         0002-alsaloop-libsamplerate-requires-specific-formats-for.patch
+Patch3:         0003-alsaloop-another-try-to-force-correct-formats-for-li.patch
+Patch4:         0004-alsamixer-fix-build-on-uClibc.patch
+Patch5:         0005-alsactl-init-Mute-CD-Playback-volume-by-default.patch
+Patch6:         0006-Revert-alsactl-Display-help-for-names-command.patch
+Patch7:         0007-alsaucm-Add-list1-command-for-non-tuple-lists.patch
+Patch8:         0008-alsaucm-Don-t-double-free-empty-lists.patch
+Patch9:         0009-aplay-Add-i-option-for-interactive-mode.patch
+Patch10:        0010-aplay-Avoid-recursive-signal-handling.patch
+Patch12:        0012-alsaloop-Use-AM_CFLAGS-in-Makefile.am.patch
+Patch13:        0013-Updated-COPYING-with-the-recent-FSF-address.patch
+Patch14:        0014-alsamixer-Fix-64bit-issues.patch
+Patch15:        0015-aplay-Add-include-files-for-mkdir.patch
+Patch16:        0016-aplay-Use-standard-endian-convesions.patch
 Patch99:        alsa-utils-gettext-version-removal.diff
 # Patch100:       alsa-utils-po-pre-patch.diff
 Url:            http://www.alsa-project.org/
@@ -59,9 +74,24 @@
 # fix stupid automake's automatic action
 sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am
 # fix po changes in tarball first
-# %patch100 -p1
+# %%patch100 -p1
 # rm -f po/Makefile* po/*.gmo po/*.pot po/*.header po/stamp-*
 # %%patch -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
 %if %suse_version < 1020
 %patch99 -p1
 %endif

++++++ 0001-alsamixer-fix-display-of-active-inactive-controls.patch ++++++
>From cd26f244e7f2648a63411741552c658ca67334e9 Mon Sep 17 00:00:00 2001
From: Raymond Yau <[email protected]>
Date: Mon, 28 Feb 2011 15:36:36 +0100
Subject: [PATCH 01/16] alsamixer: fix display of active/inactive controls

Signed-off-by: Raymond Yau <[email protected]>
Signed-off-by: Clemens Ladisch <[email protected]>
---
 alsamixer/mixer_widget.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/alsamixer/mixer_widget.c b/alsamixer/mixer_widget.c
index fb352d3..caaf777 100644
--- a/alsamixer/mixer_widget.c
+++ b/alsamixer/mixer_widget.c
@@ -59,10 +59,21 @@ enum channel_mask {
 
 static int elem_callback(snd_mixer_elem_t *elem, unsigned int mask)
 {
+       unsigned int i;
+
        if (mask & (SND_CTL_EVENT_MASK_REMOVE |
                    SND_CTL_EVENT_MASK_INFO |
                    SND_CTL_EVENT_MASK_VALUE))
                controls_changed = TRUE;
+
+       if (mask & SND_CTL_EVENT_MASK_INFO)
+               for (i = 0; i < controls_count; ++i)
+                       if (controls[i].elem == elem) {
+                               controls[i].flags &= ~IS_ACTIVE;
+                               if (snd_mixer_selem_is_active(controls[i].elem))
+                                       controls[i].flags |= IS_ACTIVE;
+                       }
+
        return 0;
 }
 
-- 
1.7.5.3

++++++ 0002-alsaloop-libsamplerate-requires-specific-formats-for.patch ++++++
>From 3853175d122ef368db1f653140502ec44d4b2a4a Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <[email protected]>
Date: Mon, 7 Mar 2011 14:21:19 +0100
Subject: [PATCH 02/16] alsaloop: libsamplerate requires specific formats,
 force them for slave mode

Signed-off-by: Jaroslav Kysela <[email protected]>
---
 alsaloop/pcmjob.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 0b84803..6b50cf0 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1238,8 +1238,8 @@ static int closeit(struct loopback_handle *lhandle)
 static int init_handle(struct loopback_handle *lhandle, int alloc)
 {
        snd_pcm_uframes_t lat;
-       lhandle->frame_size = (snd_pcm_format_width(lhandle->format) / 8) *
-                                                          lhandle->channels;
+       lhandle->frame_size = (snd_pcm_format_physical_width(lhandle->format) 
+                                               / 8) * lhandle->channels;
        lhandle->sync_point = lhandle->rate * 15;       /* every 15 seconds */
        lat = lhandle->loopback->latency;
        if (lhandle->buffer_size > lat)
@@ -1358,6 +1358,23 @@ static void lhandle_start(struct loopback_handle 
*lhandle)
        lhandle->total_queued = 0;
 }
 
+static void fix_format(struct loopback *loop)
+{
+       snd_pcm_format_t format = loop->capt->format;
+
+       if (loop->sync != SYNC_TYPE_SAMPLERATE)
+               return;
+       if (format == SND_PCM_FORMAT_S16 ||
+           format == SND_PCM_FORMAT_S32)
+               return;
+       if (snd_pcm_format_width(format) > 16)
+               format = SND_PCM_FORMAT_S32;
+       else
+               format = SND_PCM_FORMAT_S16;
+       loop->capt->format = format;
+       loop->play->format = format;
+}
+
 int pcmjob_start(struct loopback *loop)
 {
        snd_pcm_uframes_t count;
@@ -1383,6 +1400,7 @@ int pcmjob_start(struct loopback *loop)
                if (err < 0)
                        goto __error;
                loop->play->format = loop->capt->format = err;
+               fix_format(loop);
                err = get_rate(loop->capt);
                if (err < 0)
                        goto __error;
-- 
1.7.5.3

++++++ 0003-alsaloop-another-try-to-force-correct-formats-for-li.patch ++++++
>From 3801e25964070390c525b9f2c39913e6ea1eb864 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <[email protected]>
Date: Tue, 8 Mar 2011 12:56:56 +0100
Subject: [PATCH 03/16] alsaloop: another try to force correct formats for
 libsamplerate

Signed-off-by: Jaroslav Kysela <[email protected]>
---
 alsaloop/pcmjob.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
index 6b50cf0..bfac2d3 100644
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -1358,11 +1358,11 @@ static void lhandle_start(struct loopback_handle 
*lhandle)
        lhandle->total_queued = 0;
 }
 
-static void fix_format(struct loopback *loop)
+static void fix_format(struct loopback *loop, int force)
 {
        snd_pcm_format_t format = loop->capt->format;
 
-       if (loop->sync != SYNC_TYPE_SAMPLERATE)
+       if (!force && loop->sync != SYNC_TYPE_SAMPLERATE)
                return;
        if (format == SND_PCM_FORMAT_S16 ||
            format == SND_PCM_FORMAT_S32)
@@ -1400,7 +1400,7 @@ int pcmjob_start(struct loopback *loop)
                if (err < 0)
                        goto __error;
                loop->play->format = loop->capt->format = err;
-               fix_format(loop);
+               fix_format(loop, 0);
                err = get_rate(loop->capt);
                if (err < 0)
                        goto __error;
@@ -1412,6 +1412,7 @@ int pcmjob_start(struct loopback *loop)
        }
        loop->reinit = 0;
        loop->use_samplerate = 0;
+__again:
        if (loop->latency_req) {
                loop->latency_reqtime = frames_to_time(loop->play->rate_req,
                                                       loop->latency_req);
@@ -1460,10 +1461,19 @@ int pcmjob_start(struct loopback *loop)
                        goto __error;
                if ((err = init_handle(loop->capt, 1)) < 0)
                        goto __error;
-               if (loop->play->rate_req != loop->play->rate)
-                       loop->use_samplerate = 1;
-               if (loop->capt->rate_req != loop->capt->rate)
+               if (loop->play->rate_req != loop->play->rate ||
+                    loop->capt->rate_req != loop->capt->rate) {
+                        snd_pcm_format_t format1, format2;
                        loop->use_samplerate = 1;
+                        format1 = loop->play->format;
+                        format2 = loop->capt->format;
+                        fix_format(loop, 1);
+                        if (loop->play->format != format1 ||
+                            loop->capt->format != format2) {
+                                pcmjob_stop(loop);
+                                goto __again;
+                        }
+                }
        }
 #ifdef USE_SAMPLERATE
        if (loop->sync == SYNC_TYPE_SAMPLERATE)
-- 
1.7.5.3

++++++ 0004-alsamixer-fix-build-on-uClibc.patch ++++++
>From a7bd33957e099dea109e219a348b131c7186ee1e Mon Sep 17 00:00:00 2001
From: Peter Korsgaard <[email protected]>
Date: Mon, 14 Mar 2011 09:48:13 +0100
Subject: [PATCH 04/16] alsamixer: fix build on uClibc

exp10 is a glibc extension, which isn't supported on uClibc. Luckily,
exp10() is trivial to compute based on exp(), so add a wrapper for
the uClibc case.

Signed-off-by: Peter Korsgaard <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
---
 alsamixer/volume_mapping.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/alsamixer/volume_mapping.c b/alsamixer/volume_mapping.c
index 9cacad8..1c0d7c4 100644
--- a/alsamixer/volume_mapping.c
+++ b/alsamixer/volume_mapping.c
@@ -37,6 +37,11 @@
 #include <stdbool.h>
 #include "volume_mapping.h"
 
+#ifdef __UCLIBC__
+/* 10^x = 10^(log e^x) = (e^x)^log10 = e^(x * log 10) */
+#define exp10(x) (exp((x) * log(10)))
+#endif /* __UCLIBC__ */
+
 #define MAX_LINEAR_DB_SCALE    24
 
 static inline bool use_linear_dB_scale(long dBmin, long dBmax)
-- 
1.7.5.3

++++++ 0005-alsactl-init-Mute-CD-Playback-volume-by-default.patch ++++++
>From 70451054e08e51f7eaebf9e7d72324acdac01cdb Mon Sep 17 00:00:00 2001
From: David Henningsson <[email protected]>
Date: Mon, 4 Apr 2011 11:28:47 +0200
Subject: [PATCH 05/16] alsactl init: Mute CD Playback volume by default

The CD analog playback line is seldom used these days, as all
modern players rip the CD and use the DAC on the sound card.
In addition, it causes background hum on some machines.
Therefore keep it muted by default.

BugLink: http://bugs.launchpad.net/bugs/747184
Signed-off-by: David Henningsson <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
---
 alsactl/init/default |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/alsactl/init/default b/alsactl/init/default
index 7f8ec4c..b7cb941 100644
--- a/alsactl/init/default
+++ b/alsactl/init/default
@@ -144,17 +144,10 @@ CTL{name}="Music Playback Switch",CTL{do_search}=="1", \
   CTL{values}="on"
 
 CTL{reset}="mixer"
-CTL{name}="CD Playback Volume",PROGRAM!="__ctl_search", GOTO=""
-# if master volume control is present, turn CD volume to max
-ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO=""
-ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO=""
-# exception - some HDA codecs have shifted dB range
-CTL{dBmin}=="-34.50dB",CTL{dBmax}=="12.00dB",CTL{write}=="0dB",GOTO=""
-CTL{dBmin}=="-30.00dB",CTL{dBmax}=="0dB",CTL{write}=="0dB",GOTO=""
-CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}"
-LABEL=""
+CTL{name}="CD Playback Volume",CTL{do_search}=="1", \
+  CTL{values}="0%"
 CTL{name}="CD Playback Switch",CTL{do_search}=="1", \
-  CTL{values}="on"
+  CTL{values}="off"
 
 CTL{reset}="mixer"
 CTL{name}="Mono Playback Volume",CTL{do_search}=="1", \
-- 
1.7.5.3

++++++ 0006-Revert-alsactl-Display-help-for-names-command.patch ++++++
>From 5ee6a670751db67f9e2b2910d5b3b6fc6fff8dfd Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <[email protected]>
Date: Thu, 28 Apr 2011 08:13:28 +0200
Subject: [PATCH 06/16] Revert "alsactl - Display help for names command"

This reverts commit 6d32e055d73edfe6be90135c500dcb32491cf04d.

From: Alexander Stein <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
---
 alsactl/alsactl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/alsactl/alsactl.c b/alsactl/alsactl.c
index c2120bd..1792747 100644
--- a/alsactl/alsactl.c
+++ b/alsactl/alsactl.c
@@ -68,8 +68,6 @@ static void help(void)
        printf("  restore <card #> load current driver setup for one or each 
soundcards\n");
        printf("                   from configuration file\n");
        printf("  init    <card #> initialize driver to a default state\n");
-       printf("  names   <card #> dump information about all the known present 
(sub-)devices\n");
-       printf("                   into configuration file (DEPRECATED)\n");
 }
 
 int main(int argc, char *argv[])
-- 
1.7.5.3

++++++ 0007-alsaucm-Add-list1-command-for-non-tuple-lists.patch ++++++
>From 16bdb41b87d1f4baa3a54a4af0b85abd98cf9159 Mon Sep 17 00:00:00 2001
From: Stephen Warren <[email protected]>
Date: Thu, 2 Jun 2011 16:45:12 -0600
Subject: [PATCH 07/16] alsaucm: Add list1 command for non-tuple lists

snd_use_case_get_list returns lists of strings that are either:
a) A sequence of single strings
b) A sequence of pairs of strings all flattened into a single list

The current list command assumes layout (b) above, and hence prints
nothing when printing a single-entry list that's actually in layout (a).
Add a new command "list1" to dump lists in layout (a).

Signed-off-by: Stephen Warren <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
---
 alsaucm/usecase.c |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/alsaucm/usecase.c b/alsaucm/usecase.c
index 83781d0..f24e63e 100644
--- a/alsaucm/usecase.c
+++ b/alsaucm/usecase.c
@@ -63,7 +63,8 @@ enum uc_cmd {
        OM_RESET,
        OM_RELOAD,
        OM_LISTCARDS,
-       OM_LIST,
+       OM_LIST2,
+       OM_LIST1,
 
        /* set/get */
        OM_SET,
@@ -87,7 +88,8 @@ static struct cmd cmds[] = {
        { OM_RESET, 0, 1, "reset" },
        { OM_RELOAD, 0, 1, "reload" },
        { OM_LISTCARDS, 0, 0, "listcards" },
-       { OM_LIST, 1, 1, "list" },
+       { OM_LIST1, 1, 1, "list1" },
+       { OM_LIST2, 1, 1, "list" },
        { OM_SET, 2, 1, "set" },
        { OM_GET, 1, 1, "get" },
        { OM_GETI, 1, 1, "geti" },
@@ -172,7 +174,7 @@ static int do_one(struct context *context, struct cmd *cmd, 
char **argv)
 {
        const char **list, *str;
        long lval;
-       int err, i;
+       int err, i, j, entries;
 
        if (cmd->opencard && context->uc_mgr == NULL) {
                fprintf(stderr, "%s: command '%s' requires an open card\n",
@@ -233,7 +235,17 @@ static int do_one(struct context *context, struct cmd 
*cmd, char **argv)
                }
                snd_use_case_free_list(list, err);
                break;
-       case OM_LIST:
+       case OM_LIST1:
+       case OM_LIST2:
+               switch (cmd->code) {
+               case OM_LIST1:
+                   entries = 1;
+                   break;
+               case OM_LIST2:
+                   entries = 2;
+                   break;
+               }
+
                err = snd_use_case_get_list(context->uc_mgr,
                                            argv[0],
                                            &list);
@@ -246,10 +258,11 @@ static int do_one(struct context *context, struct cmd 
*cmd, char **argv)
                }
                if (err == 0)
                        printf("  list is empty\n");
-               for (i = 0; i < err / 2; i++) {
-                       printf("  %i: %s\n", i, list[i*2]);
-                       if (list[i*2+1])
-                               printf("    %s\n", list[i*2+1]);
+               for (i = 0; i < err / entries; i++) {
+                       printf("  %i: %s\n", i, list[i*entries]);
+                       for (j = 0; j < entries - 1; j++)
+                               if (list[i*entries+j+1])
+                                       printf("    %s\n", list[i*entries+j+1]);
                }
                snd_use_case_free_list(list, err);
                break;
-- 
1.7.5.3

++++++ 0008-alsaucm-Don-t-double-free-empty-lists.patch ++++++
>From f30fbe3901da0f57a6b40102ae1c3ab3a9ff6744 Mon Sep 17 00:00:00 2001
From: Stephen Warren <[email protected]>
Date: Thu, 2 Jun 2011 16:45:13 -0600
Subject: [PATCH 08/16] alsaucm: Don't double-free empty lists

When snd_use_case_get_list (and hence also snd_use_case_card_list) returns
an empty list, alsaucm still attempts to free it. This ends up double-
freeing the returned list, or worse, freeing an invalid pointer, depending
on how snd_use_case_get_list gets implemented. Fix alsaucm to return early
on empty lists to avoid this.

Signed-off-by: Stephen Warren <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
---
 alsaucm/usecase.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/alsaucm/usecase.c b/alsaucm/usecase.c
index f24e63e..1c94680 100644
--- a/alsaucm/usecase.c
+++ b/alsaucm/usecase.c
@@ -226,8 +226,10 @@ static int do_one(struct context *context, struct cmd 
*cmd, char **argv)
                                snd_strerror(err));
                        return err;
                }
-               if (err == 0)
+               if (err == 0) {
                        printf("  list is empty\n");
+                       return 0;
+               }
                for (i = 0; i < err / 2; i++) {
                        printf("  %i: %s\n", i, list[i*2]);
                        if (list[i*2+1])
@@ -256,8 +258,10 @@ static int do_one(struct context *context, struct cmd 
*cmd, char **argv)
                                snd_strerror(err));
                        return err;
                }
-               if (err == 0)
+               if (err == 0) {
                        printf("  list is empty\n");
+                       return 0;
+               }
                for (i = 0; i < err / entries; i++) {
                        printf("  %i: %s\n", i, list[i*entries]);
                        for (j = 0; j < entries - 1; j++)
-- 
1.7.5.3

++++++ 0009-aplay-Add-i-option-for-interactive-mode.patch ++++++
>From d67a965aec800483ba48d6de736cb3851163e678 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 3 Jun 2011 12:41:26 +0200
Subject: [PATCH 09/16] aplay: Add -i option for interactive mode

The recent addition of pause/resume control via keyboard brought
a problem when aplay/arecord is invoked in background.  For avoiding
regressions, it's safer to use non-interactive mode as default and
enable the new feature via an option.

Tested-by: Stephen Warren <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
---
 aplay/aplay.1 |    4 ++++
 aplay/aplay.c |   14 +++++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/aplay/aplay.1 b/aplay/aplay.1
index b6caf0b..8ccf556 100644
--- a/aplay/aplay.1
+++ b/aplay/aplay.1
@@ -137,6 +137,10 @@ by typing aplay.
 Record.  This is the default if the program is invoked
 by typing arecord.
 .TP
+\fI\-i, \-\-interactive\fP
+Allow interactive operation via stdin.
+Currently only pause/resume via space or enter key is implemented.
+.TP
 \fI\-\-disable\-resample\fP
 Disable automatic rate resample.
 .TP
diff --git a/aplay/aplay.c b/aplay/aplay.c
index c09f23c..04959b8 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -103,6 +103,7 @@ static int avail_min = -1;
 static int start_delay = 0;
 static int stop_delay = 0;
 static int monotonic = 0;
+static int interactive = 0;
 static int can_pause = 0;
 static int verbose = 0;
 static int vumeter = VUMETER_NONE;
@@ -200,6 +201,7 @@ _("Usage: %s [OPTION]... [FILE]...\n"
 "-v, --verbose           show PCM structure and setup (accumulative)\n"
 "-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
 "-I, --separate-channels one file for each channel\n"
+"-i, --interactive       allow interactive operation from stdin\n"
 "    --disable-resample  disable automatic rate resample\n"
 "    --disable-channels  disable automatic channel conversions\n"
 "    --disable-format    disable automatic format conversions\n"
@@ -404,7 +406,7 @@ enum {
 int main(int argc, char *argv[])
 {
        int option_index;
-       static const char short_options[] = 
"hnlLD:qt:c:f:r:d:MNF:A:R:T:B:vV:IPC";
+       static const char short_options[] = 
"hnlLD:qt:c:f:r:d:MNF:A:R:T:B:vV:IPCi";
        static const struct option long_options[] = {
                {"help", 0, 0, 'h'},
                {"version", 0, 0, OPT_VERSION},
@@ -442,6 +444,7 @@ int main(int argc, char *argv[])
                {"max-file-time", 1, 0, OPT_MAX_FILE_TIME},
                {"process-id-file", 1, 0, OPT_PROCESS_ID_FILE},
                {"use-strftime", 0, 0, OPT_USE_STRFTIME},
+               {"interactive", 0, 0, 'i'},
                {0, 0, 0, 0}
        };
        char *pcm_name = "default";
@@ -608,6 +611,9 @@ int main(int argc, char *argv[])
                        if (file_type == FORMAT_DEFAULT)
                                file_type = FORMAT_WAVE;
                        break;
+               case 'i':
+                       interactive = 1;
+                       break;
                case OPT_DISABLE_RESAMPLE:
                        open_mode |= SND_PCM_NO_AUTO_RESAMPLE;
                        break;
@@ -1206,6 +1212,8 @@ static void init_stdin(void)
        struct termios term;
        long flags;
 
+       if (!interactive)
+               return;
        tcgetattr(fileno(stdin), &term);
        term_c_lflag = term.c_lflag;
        if (fd == fileno(stdin))
@@ -1221,6 +1229,8 @@ static void done_stdin(void)
 {
        struct termios term;
 
+       if (!interactive)
+               return;
        if (fd == fileno(stdin) || term_c_lflag == -1)
                return;
        tcgetattr(fileno(stdin), &term);
@@ -1258,6 +1268,8 @@ static void check_stdin(void)
 {
        unsigned char b;
 
+       if (!interactive)
+               return;
        if (fd != fileno(stdin)) {
                while (read(fileno(stdin), &b, 1) == 1) {
                        if (b == ' ' || b == '\r') {
-- 
1.7.5.3

++++++ 0010-aplay-Avoid-recursive-signal-handling.patch ++++++
>From a3ebe640a74d4a0e8acd15e31dd83c210b3c1be4 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 3 Jun 2011 12:44:17 +0200
Subject: [PATCH 10/16] aplay: Avoid recursive signal handling

When abort() is issued in snd_pcm_close() path, it may loop recursively
and crash.

Signed-off-by: Takashi Iwai <[email protected]>
---
 aplay/aplay.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/aplay/aplay.c b/aplay/aplay.c
index 04959b8..72852b0 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -358,6 +358,12 @@ static void prg_exit(int code)
 
 static void signal_handler(int sig)
 {
+       static int in_aborting;
+
+       if (in_aborting)
+               return;
+
+       in_aborting = 1;
        if (verbose==2)
                putchar('\n');
        if (!quiet_mode)
-- 
1.7.5.3

++++++ 0012-alsaloop-Use-AM_CFLAGS-in-Makefile.am.patch ++++++
>From 2a627cfaed498e9175da2ffe3f43030013bb21be Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 3 Jun 2011 14:21:53 +0200
Subject: [PATCH 12/16] alsaloop: Use AM_CFLAGS in Makefile.am

Signed-off-by: Takashi Iwai <[email protected]>
---
 alsaloop/Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/alsaloop/Makefile.am b/alsaloop/Makefile.am
index f76eafd..a694911 100644
--- a/alsaloop/Makefile.am
+++ b/alsaloop/Makefile.am
@@ -1,6 +1,6 @@
 INCLUDES = -I$(top_srcdir)/include
 LDADD = -lm
-CFLAGS += -D_GNU_SOURCE
+AM_CFLAGS = -D_GNU_SOURCE
 if HAVE_SAMPLERATE
 LDADD += -lsamplerate
 endif
-- 
1.7.5.3

++++++ 0013-Updated-COPYING-with-the-recent-FSF-address.patch ++++++
>From ac2be7b33ad1ece1dd031d54be1a17a5f902cece Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 3 Jun 2011 14:24:30 +0200
Subject: [PATCH 13/16] Updated COPYING with the recent FSF address

Signed-off-by: Takashi Iwai <[email protected]>
---
 COPYING |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/COPYING b/COPYING
index 5b6e7c6..623b625 100644
--- a/COPYING
+++ b/COPYING
@@ -2,7 +2,7 @@
                       Version 2, June 1991
 
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice 
is found.
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
 
 
 Also add information on how to contact you by electronic and paper mail.
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic 
and paper mail.
 If the program is interactive, make it output a short notice like this
 when it starts in an interactive mode:
 
-    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision version 69, Copyright (C) year  name of author
     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     This is free software, and you are welcome to redistribute it
     under certain conditions; type `show c' for details.
-- 
1.7.5.3

++++++ 0014-alsamixer-Fix-64bit-issues.patch ++++++
>From 3bea722b3bfdbec2e26218aca66e55b019a24436 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 3 Jun 2011 14:28:28 +0200
Subject: [PATCH 14/16] alsamixer: Fix 64bit issues

lrint() returns a long int.

Signed-off-by: Takashi Iwai <[email protected]>
---
 alsamixer/mixer_display.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/alsamixer/mixer_display.c b/alsamixer/mixer_display.c
index 51a1546..8ba396a 100644
--- a/alsamixer/mixer_display.c
+++ b/alsamixer/mixer_display.c
@@ -486,17 +486,17 @@ static void display_control(unsigned int control_index)
                if (control->flags & IS_ACTIVE)
                        wattrset(mixer_widget.window, attr_mixer_active);
                if (!(control->flags & HAS_VOLUME_1)) {
-                       sprintf(buf, "%d", lrint(volumes[0] * 100));
+                       sprintf(buf, "%d", (int)lrint(volumes[0] * 100));
                        display_string_in_field(values_y, frame_left - 2, buf, 
8, ALIGN_CENTER);
                } else {
                        mvwprintw(mixer_widget.window, values_y, frame_left - 2,
-                                 "%3d", lrint(volumes[0] * 100));
+                                 "%3d", (int)lrint(volumes[0] * 100));
                        if (control->flags & IS_ACTIVE)
                                wattrset(mixer_widget.window, attr_ctl_frame);
                        waddstr(mixer_widget.window, "<>");
                        if (control->flags & IS_ACTIVE)
                                wattrset(mixer_widget.window, 
attr_mixer_active);
-                       wprintw(mixer_widget.window, "%-3d", lrint(volumes[1] * 
100));
+                       wprintw(mixer_widget.window, "%-3d", 
(int)lrint(volumes[1] * 100));
                }
        }
 
-- 
1.7.5.3

++++++ 0015-aplay-Add-include-files-for-mkdir.patch ++++++
>From ce2d64b48addd16c2ba25c76b795a9f7b277e642 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 3 Jun 2011 14:30:55 +0200
Subject: [PATCH 15/16] aplay: Add include files for mkdir()

Signed-off-by: Takashi Iwai <[email protected]>
---
 aplay/aplay.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/aplay/aplay.c b/aplay/aplay.c
index 72852b0..7175652 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -46,6 +46,8 @@
 #include <sys/uio.h>
 #include <sys/time.h>
 #include <sys/signal.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <asm/byteorder.h>
 #include "aconfig.h"
 #include "gettext.h"
-- 
1.7.5.3

++++++ 0016-aplay-Use-standard-endian-convesions.patch ++++++
>From 36d642f4481b54c035782ec1a71f7c67f64ed3bf Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Fri, 3 Jun 2011 14:35:44 +0200
Subject: [PATCH 16/16] aplay: Use standard endian convesions

asm/*.h stuff shouldn't be used directly from the user-space apps.

Signed-off-by: Takashi Iwai <[email protected]>
---
 aplay/aplay.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/aplay/aplay.c b/aplay/aplay.c
index 7175652..50e01ef 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -48,7 +48,7 @@
 #include <sys/signal.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <asm/byteorder.h>
+#include <endian.h>
 #include "aconfig.h"
 #include "gettext.h"
 #include "formats.h"
@@ -1508,9 +1508,9 @@ static void compute_max_peak(u_char *data, size_t count)
                c = 0;
                while (count-- > 0) {
                        if (format_little_endian)
-                               sval = __le16_to_cpu(*valp);
+                               sval = le16toh(*valp);
                        else
-                               sval = __be16_to_cpu(*valp);
+                               sval = be16toh(*valp);
                        sval = abs(sval) ^ mask;
                        if (max_peak[c] < sval)
                                max_peak[c] = sval;
@@ -1553,9 +1553,9 @@ static void compute_max_peak(u_char *data, size_t count)
                c = 0;
                while (count-- > 0) {
                        if (format_little_endian)
-                               val = __le32_to_cpu(*valp);
+                               val = le32toh(*valp);
                        else
-                               val = __be32_to_cpu(*valp);
+                               val = be32toh(*valp);
                        val = abs(val) ^ mask;
                        if (max_peak[c] < val)
                                max_peak[c] = val;
-- 
1.7.5.3


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to