[Pkg-pulseaudio-devel] r113 - in /pulseaudio/trunk/debian: ./ patches/

neurocyte-guest at users.alioth.debian.org neurocyte-guest at users.alioth.debian.org
Thu May 24 21:09:00 UTC 2007


Author: neurocyte-guest
Date: Thu May 24 21:08:59 2007
New Revision: 113

URL: http://svn.debian.org/wsvn/pkg-pulseaudio/?sc=1&rev=113
Log:
Backport various minor fixes from upstream trunk

Added:
    pulseaudio/trunk/debian/patches/r1336-increase-operation-timeout.patch
    pulseaudio/trunk/debian/patches/r1355-fix-a-race-condition.patch
    pulseaudio/trunk/debian/patches/r1377-fix-alsa-sink-example.patch
    pulseaudio/trunk/debian/patches/r1378-add-missing-channel-names-fix.patch
    pulseaudio/trunk/debian/patches/r1411-check-correct-variable-for-return-value.patch
    pulseaudio/trunk/debian/patches/r1416-r1417-fix-incorrect-assert.patch
    pulseaudio/trunk/debian/patches/r1422-make-sure-we-report-success-for-SNDCTL_DSP_SETDUPLEX.patch
    pulseaudio/trunk/debian/patches/r1423-dont-abort-config-loading-when-user-config-cannot-be-loaded.patch
    pulseaudio/trunk/debian/patches/r1437-add-support-for-SNDCTL_DSP_SETTRIGGER.patch
Modified:
    pulseaudio/trunk/debian/changelog
    pulseaudio/trunk/debian/patches/r1433-handle-suspended-alsa-devices.patch
    pulseaudio/trunk/debian/patches/series

Modified: pulseaudio/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/changelog?rev=113&op=diff
==============================================================================
--- pulseaudio/trunk/debian/changelog (original)
+++ pulseaudio/trunk/debian/changelog Thu May 24 21:08:59 2007
@@ -8,8 +8,18 @@
     + Refreshed. Updated to the version commited upstream.
   * debian/patches: r1361-fix-esdcompat-for-non-bash-shells
     + Added. Corrects parameter handling in esdcompat. (Closes: #414355)
+  * debian/patches:
+    Backport multiple minor bug fixes from upstream trunk.
+    + Added r1336-increase-operation-timeout
+    + Added r1355-fix-a-race-condition
+    + Added r1377-fix-alsa-sink-example
+    + Added r1378-add-missing-channel-names-fix
+    + Added r1411-check-correct-variable-for-return-value
+    + Added r1416-r1417-fix-incorrect-assert
+    + Added r1422-make-sure-we-report-success-for-SNDCTL_DSP_SETDUPLEX
+    + Added r1423-dont-abort-config-loading-when-user-config-cannot-be-loaded
 
- -- CJ van den Berg <cj at vdbonline.com>  Tue, 15 May 2007 13:29:19 +0200
+ -- CJ van den Berg <cj at vdbonline.com>  Tue, 15 May 2007 16:25:26 +0200
 
 pulseaudio (0.9.5-7) unstable; urgency=low
 

Added: pulseaudio/trunk/debian/patches/r1336-increase-operation-timeout.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1336-increase-operation-timeout.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1336-increase-operation-timeout.patch (added)
+++ pulseaudio/trunk/debian/patches/r1336-increase-operation-timeout.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,23 @@
+increase operation timeout
+
+From: Lennart Poettering <lennart at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1336 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/pulse/internal.h |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/pulse/internal.h b/src/pulse/internal.h
+index fa7d5bb..4eef4b4 100644
+--- a/src/pulse/internal.h
++++ b/src/pulse/internal.h
+@@ -41,7 +41,7 @@
+ 
+ #include "client-conf.h"
+ 
+-#define DEFAULT_TIMEOUT (10)
++#define DEFAULT_TIMEOUT (30)
+ 
+ struct pa_context {
+     int ref;

Added: pulseaudio/trunk/debian/patches/r1355-fix-a-race-condition.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1355-fix-a-race-condition.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1355-fix-a-race-condition.patch (added)
+++ pulseaudio/trunk/debian/patches/r1355-fix-a-race-condition.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,89 @@
+fix a race condition with stream connection vs. latency measuremtn (found by theBear)
+
+From: Lennart Poettering <lennart at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1355 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/modules/module-tunnel.c |   36 +++++++++++++++++++-----------------
+ 1 files changed, 19 insertions(+), 17 deletions(-)
+
+diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
+index 18e1d97..a110c57 100644
+--- a/src/modules/module-tunnel.c
++++ b/src/modules/module-tunnel.c
+@@ -490,8 +490,21 @@ static void start_subscribe(struct userdata *u) {
+     pa_pstream_send_tagstruct(u->pstream, t);
+ }
+ 
++static void timeout_callback(pa_mainloop_api *m, pa_time_event*e, PA_GCC_UNUSED const struct timeval *tv, void *userdata) {
++    struct userdata *u = userdata;
++    struct timeval ntv;
++    assert(m && e && u);
++
++    request_latency(u);
++    
++    pa_gettimeofday(&ntv);
++    ntv.tv_sec += LATENCY_INTERVAL;
++    m->time_restart(e, &ntv);
++}
++
+ static void create_stream_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED uint32_t tag, pa_tagstruct *t, void *userdata) {
+     struct userdata *u = userdata;
++    struct timeval ntv;
+     assert(pd && u && u->pdispatch == pd);
+ 
+     if (command != PA_COMMAND_REPLY) {
+@@ -535,6 +548,11 @@ static void create_stream_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UN
+     start_subscribe(u);
+     request_info(u);
+ 
++    assert(!u->time_event);
++    pa_gettimeofday(&ntv);
++    ntv.tv_sec += LATENCY_INTERVAL;
++    u->time_event = u->core->mainloop->time_new(u->core->mainloop, &ntv, timeout_callback, u);
++
+     request_latency(u);
+ #ifdef TUNNEL_SINK
+     send_bytes(u);
+@@ -840,18 +858,6 @@ static int source_set_hw_mute(pa_source *source) {
+ }
+ #endif
+ 
+-static void timeout_callback(pa_mainloop_api *m, pa_time_event*e, PA_GCC_UNUSED const struct timeval *tv, void *userdata) {
+-    struct userdata *u = userdata;
+-    struct timeval ntv;
+-    assert(m && e && u);
+-
+-    request_latency(u);
+-    
+-    pa_gettimeofday(&ntv);
+-    ntv.tv_sec += LATENCY_INTERVAL;
+-    m->time_restart(e, &ntv);
+-}
+-
+ static int load_key(struct userdata *u, const char*fn) {
+     assert(u);
+ 
+@@ -883,10 +889,8 @@ int pa__init(pa_core *c, pa_module*m) {
+     struct userdata *u = NULL;
+     pa_sample_spec ss;
+     pa_channel_map map;
+-    struct timeval ntv;
+     char *t, *dn = NULL;
+     
+-    
+     assert(c && m);
+ 
+     if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
+@@ -986,9 +990,7 @@ int pa__init(pa_core *c, pa_module*m) {
+     
+     pa_xfree(dn);
+ 
+-    pa_gettimeofday(&ntv);
+-    ntv.tv_sec += LATENCY_INTERVAL;
+-    u->time_event = c->mainloop->time_new(c->mainloop, &ntv, timeout_callback, u);
++    u->time_event = NULL;
+ 
+     pa_modargs_free(ma);
+ 

Added: pulseaudio/trunk/debian/patches/r1377-fix-alsa-sink-example.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1377-fix-alsa-sink-example.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1377-fix-alsa-sink-example.patch (added)
+++ pulseaudio/trunk/debian/patches/r1377-fix-alsa-sink-example.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,23 @@
+fix alsa-sink example
+
+From: Lennart Poettering <lennart at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1377 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/daemon/default.pa.in |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in
+index aa36375..b769e3f 100755
+--- a/src/daemon/default.pa.in
++++ b/src/daemon/default.pa.in
+@@ -20,7 +20,7 @@
+ 
+ ### Load audio drivers statically
+ #load-module module-alsa-sink
+-#load-module module-alsa-source device=plughw:1,0
++#load-module module-alsa-source device=hw:1,0
+ #load-module module-oss device="/dev/dsp" sink_name=output source_name=input
+ #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
+ #load-module module-null-sink

Added: pulseaudio/trunk/debian/patches/r1378-add-missing-channel-names-fix.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1378-add-missing-channel-names-fix.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1378-add-missing-channel-names-fix.patch (added)
+++ pulseaudio/trunk/debian/patches/r1378-add-missing-channel-names-fix.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,37 @@
+add missing channel names (fixes a segfault when parsing invalid channel maps)
+
+From: Lennart Poettering <lennart at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1378 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/pulse/channelmap.c |   16 ++++++++++++++++
+ 1 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/src/pulse/channelmap.c b/src/pulse/channelmap.c
+index a4f1337..69b0908 100644
+--- a/src/pulse/channelmap.c
++++ b/src/pulse/channelmap.c
+@@ -68,6 +68,22 @@ const char *const table[] = {
+     [PA_CHANNEL_POSITION_AUX13] = "aux13",
+     [PA_CHANNEL_POSITION_AUX14] = "aux14",
+     [PA_CHANNEL_POSITION_AUX15] = "aux15",
++    [PA_CHANNEL_POSITION_AUX16] = "aux16",
++    [PA_CHANNEL_POSITION_AUX17] = "aux17",
++    [PA_CHANNEL_POSITION_AUX18] = "aux18",
++    [PA_CHANNEL_POSITION_AUX19] = "aux19",
++    [PA_CHANNEL_POSITION_AUX20] = "aux20",
++    [PA_CHANNEL_POSITION_AUX21] = "aux21",
++    [PA_CHANNEL_POSITION_AUX22] = "aux22",
++    [PA_CHANNEL_POSITION_AUX23] = "aux23",
++    [PA_CHANNEL_POSITION_AUX24] = "aux24",
++    [PA_CHANNEL_POSITION_AUX25] = "aux25",
++    [PA_CHANNEL_POSITION_AUX26] = "aux26",
++    [PA_CHANNEL_POSITION_AUX27] = "aux27",
++    [PA_CHANNEL_POSITION_AUX28] = "aux28",
++    [PA_CHANNEL_POSITION_AUX29] = "aux29",
++    [PA_CHANNEL_POSITION_AUX30] = "aux30",
++    [PA_CHANNEL_POSITION_AUX31] = "aux31",
+ 
+     [PA_CHANNEL_POSITION_TOP_CENTER] = "top-center",
+     

Added: pulseaudio/trunk/debian/patches/r1411-check-correct-variable-for-return-value.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1411-check-correct-variable-for-return-value.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1411-check-correct-variable-for-return-value.patch (added)
+++ pulseaudio/trunk/debian/patches/r1411-check-correct-variable-for-return-value.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,23 @@
+Check correct variable for return value. Closes #37.
+
+From: Pierre Ossman <ossman at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1411 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/pulsecore/protocol-esound.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
+index 80aeb27..c36f820 100644
+--- a/src/pulsecore/protocol-esound.c
++++ b/src/pulsecore/protocol-esound.c
+@@ -463,7 +463,7 @@ static int esd_proto_stream_record(struct connection *c, esd_proto_t request, co
+     sdata.client = c->client;
+     
+     c->source_output = pa_source_output_new(c->protocol->core, &sdata, 9);
+-    CHECK_VALIDITY(c->sink_input, "Failed to create source_output.");
++    CHECK_VALIDITY(c->source_output, "Failed to create source_output.");
+ 
+     l = (size_t) (pa_bytes_per_second(&ss)*RECORD_BUFFER_SECONDS); 
+     c->output_memblockq = pa_memblockq_new(

Added: pulseaudio/trunk/debian/patches/r1416-r1417-fix-incorrect-assert.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1416-r1417-fix-incorrect-assert.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1416-r1417-fix-incorrect-assert.patch (added)
+++ pulseaudio/trunk/debian/patches/r1416-r1417-fix-incorrect-assert.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,23 @@
+Fix incorrect assert.
+
+From: Pierre Ossman <ossman at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1416 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/pulsecore/autoload.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/pulsecore/autoload.c b/src/pulsecore/autoload.c
+index f686909..6030420 100644
+--- a/src/pulsecore/autoload.c
++++ b/src/pulsecore/autoload.c
+@@ -102,7 +102,7 @@ int pa_autoload_add(pa_core *c, const char*name, pa_namereg_type_t type, const c
+ 
+ int pa_autoload_remove_by_name(pa_core *c, const char*name, pa_namereg_type_t type) {
+     pa_autoload_entry *e;
+-    assert(c && name && type);
++    assert(c && name && (type == PA_NAMEREG_SINK || type == PA_NAMEREG_SOURCE));
+ 
+     if (!c->autoload_hashmap || !(e = pa_hashmap_get(c->autoload_hashmap, name)) || e->type != type)
+         return -1;

Added: pulseaudio/trunk/debian/patches/r1422-make-sure-we-report-success-for-SNDCTL_DSP_SETDUPLEX.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1422-make-sure-we-report-success-for-SNDCTL_DSP_SETDUPLEX.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1422-make-sure-we-report-success-for-SNDCTL_DSP_SETDUPLEX.patch (added)
+++ pulseaudio/trunk/debian/patches/r1422-make-sure-we-report-success-for-SNDCTL_DSP_SETDUPLEX.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,30 @@
+Make sure we report success for SNDCTL_DSP_SETDUPLEX.
+
+From: Pierre Ossman <ossman at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+(Patch by ZlatkO)
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1422 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/utils/padsp.c |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/src/utils/padsp.c b/src/utils/padsp.c
+index dbbb9d5..b894009 100644
+--- a/src/utils/padsp.c
++++ b/src/utils/padsp.c
+@@ -2109,7 +2109,12 @@ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno)
+         case SNDCTL_DSP_GETIPTR:
+             debug(DEBUG_LEVEL_NORMAL, __FILE__": invalid ioctl SNDCTL_DSP_GETIPTR\n");
+             goto inval;
+-            
++
++        case SNDCTL_DSP_SETDUPLEX:
++            debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_SETDUPLEX\n");
++	    /* this is a no-op */
++	    break;
++	
+         default:
+             debug(DEBUG_LEVEL_NORMAL, __FILE__": unknown ioctl 0x%08lx\n", request);
+ 

Added: pulseaudio/trunk/debian/patches/r1423-dont-abort-config-loading-when-user-config-cannot-be-loaded.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1423-dont-abort-config-loading-when-user-config-cannot-be-loaded.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1423-dont-abort-config-loading-when-user-config-cannot-be-loaded.patch (added)
+++ pulseaudio/trunk/debian/patches/r1423-dont-abort-config-loading-when-user-config-cannot-be-loaded.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,47 @@
+Don't abort config loading when the user specific cannot be loaded.
+
+From: Pierre Ossman <ossman at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1423 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/pulsecore/core-util.c |   14 ++++++++++----
+ 1 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
+index 5f72b34..2c4503e 100644
+--- a/src/pulsecore/core-util.c
++++ b/src/pulsecore/core-util.c
+@@ -184,7 +184,7 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
+         goto fail;
+     }
+ #else
+-	pa_log_warn("secure directory creation not supported on Win32.");
++    pa_log_warn("secure directory creation not supported on Win32.");
+ #endif
+     
+     return 0;
+@@ -952,14 +952,20 @@ FILE *pa_open_config_file(const char *global, const char *local, const char *env
+                 return NULL;
+             fn = buf;
+ #endif
+-            
+-            if ((f = fopen(fn, mode)) || errno != ENOENT) {
++
++            f = fopen(fn, mode);
++            if (f != NULL) {
+                 if (result)
+                     *result = pa_xstrdup(fn);
+                 pa_xfree(lfn);
+                 return f;
+             }
+-        
++
++            if (errno != ENOENT) {
++                pa_log_warn("WARNING: failed to open configuration file '%s': %s",
++                    lfn, pa_cstrerror(errno));
++            }
++
+             pa_xfree(lfn);
+         }
+     }

Modified: pulseaudio/trunk/debian/patches/r1433-handle-suspended-alsa-devices.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1433-handle-suspended-alsa-devices.patch?rev=113&op=diff
==============================================================================
--- pulseaudio/trunk/debian/patches/r1433-handle-suspended-alsa-devices.patch (original)
+++ pulseaudio/trunk/debian/patches/r1433-handle-suspended-alsa-devices.patch Thu May 24 21:08:59 2007
@@ -10,7 +10,7 @@
  2 files changed, 77 insertions(+), 0 deletions(-)
 
 diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
-index 6ff9a6e..acf116d 100644
+index df04281..0ae4fd7 100644
 --- a/src/modules/module-alsa-sink.c
 +++ b/src/modules/module-alsa-sink.c
 @@ -138,6 +138,33 @@ static int xrun_recovery(struct userdata *u) {
@@ -47,7 +47,7 @@
  static void do_write(struct userdata *u) {
      assert(u);
  
-@@ -169,6 +196,13 @@ static void do_write(struct userdata *u) {
+@@ -173,6 +200,13 @@ static void do_write(struct userdata *u) {
                  continue;
              }
  
@@ -61,7 +61,7 @@
              pa_log("snd_pcm_writei() failed: %s", snd_strerror(-frames));
  
              clear_up(u);
-@@ -200,6 +234,10 @@ static void fdl_callback(void *userdata) {
+@@ -204,6 +238,10 @@ static void fdl_callback(void *userdata) {
          if (xrun_recovery(u) < 0)
              return;
  

Added: pulseaudio/trunk/debian/patches/r1437-add-support-for-SNDCTL_DSP_SETTRIGGER.patch
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/r1437-add-support-for-SNDCTL_DSP_SETTRIGGER.patch?rev=113&op=file
==============================================================================
--- pulseaudio/trunk/debian/patches/r1437-add-support-for-SNDCTL_DSP_SETTRIGGER.patch (added)
+++ pulseaudio/trunk/debian/patches/r1437-add-support-for-SNDCTL_DSP_SETTRIGGER.patch Thu May 24 21:08:59 2007
@@ -1,0 +1,218 @@
+Add support for SNDCTL_DSP_SETTRIGGER. (closes #56)
+
+From: Pierre Ossman <ossman at fefdeb5f-60dc-0310-8127-8f9354f1896f>
+
+git-svn-id: svn://svn.0pointer.net/pulseaudio/trunk@1437 fefdeb5f-60dc-0310-8127-8f9354f1896f
+---
+
+ src/utils/padsp.c |  113 +++++++++++++++++++++++++++++++++++++++++++++--------
+ 1 files changed, 97 insertions(+), 16 deletions(-)
+
+diff --git a/src/utils/padsp.c b/src/utils/padsp.c
+index b894009..97507d8 100644
+--- a/src/utils/padsp.c
++++ b/src/utils/padsp.c
+@@ -2,7 +2,10 @@
+ 
+ /***
+   This file is part of PulseAudio.
+- 
++
++  Copyright 2006 Lennart Poettering
++  Copyright 2006-2007 Pierre Ossman <ossman at cendio.se> for Cendio AB
++
+   PulseAudio is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published
+   by the Free Software Foundation; either version 2 of the License,
+@@ -76,6 +79,8 @@ struct fd_info {
+     pa_context *context;
+     pa_stream *play_stream;
+     pa_stream *rec_stream;
++    int play_precork;
++    int rec_precork;
+ 
+     pa_io_event *io_event;
+     pa_io_event_flags_t io_flags;
+@@ -189,7 +194,7 @@ if (!(i)->context || pa_context_get_state((i)->context) != PA_CONTEXT_READY) { \
+     debug(DEBUG_LEVEL_NORMAL, __FILE__": Not connected: %s", (i)->context ? pa_strerror(pa_context_errno((i)->context)) : "NULL"); \
+     goto label; \
+ } \
+-} while(0);
++} while(0)
+ 
+ #define PLAYBACK_STREAM_CHECK_DEAD_GOTO(i, label) do { \
+ if (!(i)->context || pa_context_get_state((i)->context) != PA_CONTEXT_READY || \
+@@ -197,7 +202,7 @@ if (!(i)->context || pa_context_get_state((i)->context) != PA_CONTEXT_READY || \
+     debug(DEBUG_LEVEL_NORMAL, __FILE__": Not connected: %s", (i)->context ? pa_strerror(pa_context_errno((i)->context)) : "NULL"); \
+     goto label; \
+ } \
+-} while(0);
++} while(0)
+ 
+ #define RECORD_STREAM_CHECK_DEAD_GOTO(i, label) do { \
+ if (!(i)->context || pa_context_get_state((i)->context) != PA_CONTEXT_READY || \
+@@ -205,7 +210,7 @@ if (!(i)->context || pa_context_get_state((i)->context) != PA_CONTEXT_READY || \
+     debug(DEBUG_LEVEL_NORMAL, __FILE__": Not connected: %s", (i)->context ? pa_strerror(pa_context_errno((i)->context)) : "NULL"); \
+     goto label; \
+ } \
+-} while(0);
++} while(0)
+ 
+ static void debug(int level, const char *format, ...) PA_GCC_PRINTF_ATTR(2,3);
+ 
+@@ -564,6 +569,8 @@ static fd_info* fd_info_new(fd_info_type_t type, int *_errno) {
+     i->context = NULL;
+     i->play_stream = NULL;
+     i->rec_stream = NULL;
++    i->play_precork = 0;
++    i->rec_precork = 0;
+     i->io_event = NULL;
+     i->io_flags = 0;
+     pthread_mutex_init(&i->mutex, NULL);
+@@ -917,8 +924,8 @@ static void stream_state_cb(pa_stream *s, void * userdata) {
+ 
+ static int create_playback_stream(fd_info *i) {
+     pa_buffer_attr attr;
+-    int n;
+-    
++    int n, flags;
++
+     assert(i);
+ 
+     fix_metrics(i);
+@@ -937,8 +944,13 @@ static int create_playback_stream(fd_info *i) {
+     attr.tlength = i->fragment_size * i->n_fragments;
+     attr.prebuf = i->fragment_size;
+     attr.minreq = i->fragment_size;
+-    
+-    if (pa_stream_connect_playback(i->play_stream, NULL, &attr, PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL) < 0) {
++
++    flags = PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE;
++    if (i->play_precork) {
++        flags |= PA_STREAM_START_CORKED;
++        debug(DEBUG_LEVEL_NORMAL, __FILE__": creating stream corked\n");
++    }
++    if (pa_stream_connect_playback(i->play_stream, NULL, &attr, flags, NULL, NULL) < 0) {
+         debug(DEBUG_LEVEL_NORMAL, __FILE__": pa_stream_connect_playback() failed: %s\n", pa_strerror(pa_context_errno(i->context)));
+         goto fail;
+     }
+@@ -956,8 +968,8 @@ fail:
+ 
+ static int create_record_stream(fd_info *i) {
+     pa_buffer_attr attr;
+-    int n;
+-    
++    int n, flags;
++
+     assert(i);
+ 
+     fix_metrics(i);
+@@ -974,9 +986,14 @@ static int create_record_stream(fd_info *i) {
+     memset(&attr, 0, sizeof(attr));
+     attr.maxlength = i->fragment_size * (i->n_fragments+1);
+     attr.fragsize = i->fragment_size;
+-    
+-    if (pa_stream_connect_record(i->rec_stream, NULL, &attr, PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE) < 0) {
+-        debug(DEBUG_LEVEL_NORMAL, __FILE__": pa_stream_connect_playback() failed: %s\n", pa_strerror(pa_context_errno(i->context)));
++
++    flags = PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE;
++    if (i->rec_precork) {
++        flags |= PA_STREAM_START_CORKED;
++        debug(DEBUG_LEVEL_NORMAL, __FILE__": creating stream corked\n");
++    }
++    if (pa_stream_connect_record(i->rec_stream, NULL, &attr, flags) < 0) {
++        debug(DEBUG_LEVEL_NORMAL, __FILE__": pa_stream_connect_record() failed: %s\n", pa_strerror(pa_context_errno(i->context)));
+         goto fail;
+     }
+ 
+@@ -1771,6 +1788,44 @@ fail:
+     return 0;
+ }
+ 
++static int dsp_cork(fd_info *i, pa_stream *s, int b) {
++    pa_operation *o = NULL;
++    int r = -1;
++
++    pa_threaded_mainloop_lock(i->mainloop);
++
++    if (!(o = pa_stream_cork(s, b, stream_success_cb, i))) {
++        debug(DEBUG_LEVEL_NORMAL, __FILE__": pa_stream_cork(): %s\n", pa_strerror(pa_context_errno(i->context)));
++        goto fail;
++    }
++
++    i->operation_success = 0;
++    while (!pa_operation_get_state(o) != PA_OPERATION_DONE) {
++        if (s == i->play_stream)
++            PLAYBACK_STREAM_CHECK_DEAD_GOTO(i, fail);
++        else if (s == i->rec_stream)
++            RECORD_STREAM_CHECK_DEAD_GOTO(i, fail);
++
++        pa_threaded_mainloop_wait(i->mainloop);
++    }
++
++    if (!i->operation_success) {
++        debug(DEBUG_LEVEL_NORMAL, __FILE__": pa_stream_cork(): %s\n", pa_strerror(pa_context_errno(i->context)));
++        goto fail;
++    }
++
++    r = 0;
++
++fail:
++
++    if (o)
++        pa_operation_unref(o);
++
++    pa_threaded_mainloop_unlock(i->mainloop);
++
++    return 0;
++}
++
+ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno) {
+     int ret = -1;
+     
+@@ -1889,8 +1944,8 @@ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno)
+             
+         case SNDCTL_DSP_GETCAPS:
+             debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_CAPS\n");
+-            
+-            *(int*)  argp = DSP_CAP_DUPLEX
++
++            *(int*)  argp = DSP_CAP_DUPLEX | DSP_CAP_TRIGGER
+ #ifdef DSP_CAP_MULTI
+ 	      | DSP_CAP_MULTI
+ #endif
+@@ -1971,7 +2026,33 @@ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno)
+                 *_errno = EIO;
+             break;
+ 
+-        case SNDCTL_DSP_SYNC: 
++        case SNDCTL_DSP_SETTRIGGER:
++            debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_SETTRIGGER: 0x%08x\n", *(int*) argp);
++
++            if (!i->io_event) {
++                *_errno = EIO;
++                break;
++            }
++
++            i->play_precork = !((*(int*) argp) & PCM_ENABLE_OUTPUT);
++
++            if (i->play_stream) {
++                if (dsp_cork(i, i->play_stream, !((*(int*) argp) & PCM_ENABLE_OUTPUT)) < 0)
++                    *_errno = EIO;
++                if (dsp_trigger(i) < 0)
++                    *_errno = EIO;
++            }
++
++            i->rec_precork = !((*(int*) argp) & PCM_ENABLE_INPUT);
++
++            if (i->rec_stream) {
++                if (dsp_cork(i, i->rec_stream, !((*(int*) argp) & PCM_ENABLE_INPUT)) < 0)
++                    *_errno = EIO;
++            }
++
++            break;
++
++        case SNDCTL_DSP_SYNC:
+             debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_SYNC\n");
+             
+             if (dsp_drain(i) < 0) 

Modified: pulseaudio/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-pulseaudio/pulseaudio/trunk/debian/patches/series?rev=113&op=diff
==============================================================================
--- pulseaudio/trunk/debian/patches/series (original)
+++ pulseaudio/trunk/debian/patches/series Thu May 24 21:08:59 2007
@@ -1,8 +1,17 @@
 # This series applies on GIT commit 2cf3c9da45ac80ba341eb9319b9a8f764ab0bba5
 use-ifexists-in-default-pa.patch
 ifexists-else-endif.patch
+r1336-increase-operation-timeout.patch
 r1352-work-around-bug-in-firefox-in-padsp.patch
+r1355-fix-a-race-condition.patch
 r1361-fix-esdcompat-for-non-bash-shells.patch
 r1373-implement-a-few-more-ioctls-in-padsp.patch
+r1377-fix-alsa-sink-example.patch
+r1378-add-missing-channel-names-fix.patch
+r1411-check-correct-variable-for-return-value.patch
 r1412-support-reversed-endian-floats.patch
+r1416-r1417-fix-incorrect-assert.patch
+r1422-make-sure-we-report-success-for-SNDCTL_DSP_SETDUPLEX.patch
+r1423-dont-abort-config-loading-when-user-config-cannot-be-loaded.patch
 r1433-handle-suspended-alsa-devices.patch
+r1437-add-support-for-SNDCTL_DSP_SETTRIGGER.patch




More information about the Pkg-pulseaudio-devel mailing list