[meego-commits] 15435: Changes to devel:multimedia/pulseaudio

fbarthesx no_reply at build.meego.com
Tue Mar 29 11:56:42 UTC 2011


Hi,
I have made the following changes to pulseaudio in project devel:multimedia. Please review and accept ASAP.

Thank You,
fbarthesx

[This message was auto-generated]

---

Request #15435:

  submit:   home:fbarthesx:branches:devel:multimedia/pulseaudio(r3)(cleanup) -> devel:multimedia/pulseaudio


Message:
    * Tue Mar 29 2011 Fabien Barthes <fabienx.barthes at intel.com> - 0.9.19 (BMC#14918)
- 2 patches for small correction in log module
 pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch
 pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch

State:   new          2011-03-29T04:56:31 fbarthesx
Comment: None



changes files:
--------------
--- pulseaudio.changes
+++ pulseaudio.changes
@@ -0,0 +1,5 @@
+* Tue Mar 29 2011 Fabien Barthes <fabienx.barthes at intel.com> - 0.9.19 (BMC#14918)
+- 2 patches for small correction in log module
+ pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch
+ pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch
+

new:
----
  pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch
  pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch

spec files:
-----------
--- pulseaudio.spec
+++ pulseaudio.spec
@@ -51,6 +51,8 @@
 Patch27:     fix-9972-auto-route-audio-to-bt-sink.patch
 Patch28:     use-a2dp-profile-for-non-mfld.patch
 Patch29:     fix-12649-add-hfp-gateway-support.patch
+Patch30:     pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch
+Patch31:     pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch
 Requires:   udev >= 145-3
 Requires:   xcb-util
 Requires(post): /sbin/ldconfig
@@ -177,6 +179,12 @@
 %patch28 -p1
 # fix-12649-add-hfp-gateway-support.patch
 %patch29 -p1
+# pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch
+%patch30 -p1
+# pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch
+%patch31 -p1
+
+
 # >> setup
 # << setup
 

other changes:
--------------

++++++ pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch (new)
--- pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch
+++ pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch
+From c5e02ad5a716d312eb153093a556a67d4a05c37e Mon Sep 17 00:00:00 2001
+From: Vincent Becker <vincentx.becker at intel.com>
+Date: Mon, 21 Mar 2011 17:44:10 +0100
+Subject: [PATCH 2/2] Log feature: correction of review from upstream.
+
+Same version of code as in upstream.
+
+Signed-off-by: Vincent Becker <vincentx.becker at intel.com>
+---
+ src/daemon/cmdline.c     |   99 ++++++++++++++++++++-------------------
+ src/daemon/daemon-conf.c |  117 +++++++---------------------------------------
+ src/pulsecore/log.c      |   38 ++++++++-------
+ src/pulsecore/log.h      |   12 ++---
+ 4 files changed, 93 insertions(+), 173 deletions(-)
+
+diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c
+index 7f72b8c..caa5b2b 100644
+--- a/src/daemon/cmdline.c
++++ b/src/daemon/cmdline.c
+@@ -114,59 +114,60 @@ void pa_cmdline_help(const char *argv0) {
+ 
+     printf(_("%s [options]\n\n"
+            "COMMANDS:\n"
+-           "  -h, --help                                       Show this help\n"
+-           "      --version                                    Show version\n"
+-           "      --dump-conf                                  Dump default configuration\n"
+-           "      --dump-modules                               Dump list of available modules\n"
+-           "      --dump-resample-methods                      Dump available resample methods\n"
+-           "      --cleanup-shm                                Cleanup stale shared memory segments\n"
+-           "      --start                                      Start the daemon if it is not running\n"
+-           "  -k  --kill                                       Kill a running daemon\n"
+-           "      --check                                      Check for a running daemon (only returns exit code)\n\n"
++           "  -h, --help                            Show this help\n"
++           "      --version                         Show version\n"
++           "      --dump-conf                       Dump default configuration\n"
++           "      --dump-modules                    Dump list of available modules\n"
++           "      --dump-resample-methods           Dump available resample methods\n"
++           "      --cleanup-shm                     Cleanup stale shared memory segments\n"
++           "      --start                           Start the daemon if it is not running\n"
++           "  -k  --kill                            Kill a running daemon\n"
++           "      --check                           Check for a running daemon (only returns exit code)\n\n"
+ 
+            "OPTIONS:\n"
+-           "      --system[=BOOL]                              Run as system-wide instance\n"
+-           "  -D, --daemonize[=BOOL]                           Daemonize after startup\n"
+-           "      --fail[=BOOL]                                Quit when startup fails\n"
+-           "      --high-priority[=BOOL]                       Try to set high nice level\n"
+-           "                                                   (only available as root, when SUID or\n"
+-           "                                                   with elevated RLIMIT_NICE)\n"
+-           "      --realtime[=BOOL]                            Try to enable realtime scheduling\n"
+-           "                                                   (only available as root, when SUID or\n"
+-           "                                                   with elevated RLIMIT_RTPRIO)\n"
+-           "      --disallow-module-loading[=BOOL]             Disallow module user requested module\n"
+-           "                                                   loading/unloading after startup\n"
+-           "      --disallow-exit[=BOOL]                       Disallow user requested exit\n"
+-           "      --exit-idle-time=SECS                        Terminate the daemon when idle and this\n"
+-           "                                                   time passed\n"
+-           "      --module-idle-time=SECS                      Unload autoloaded modules when idle and\n"
+-           "                                                   this time passed\n"
+-           "      --scache-idle-time=SECS                      Unload autoloaded samples when idle and\n"
+-           "                                                   this time passed\n"
+-           "      --log-level[=LEVEL]                          Increase or set verbosity level\n"
+-           "  -v                                               Increase the verbosity level\n"
+-           "      --log-target={auto,syslog,stderr,FILE PATH}  Specify the log target\n"
+-           "      --log-meta[=BOOL]                            Include code location in log messages\n"
+-           "      --log-time[=BOOL]                            Include timestamps in log messages\n"
+-           "      --log-backtrace=FRAMES                       Include a backtrace in log messages\n"
+-           "  -p, --dl-search-path=PATH                        Set the search path for dynamic shared\n"
+-           "                                                   objects (plugins)\n"
+-           "      --resample-method=METHOD                     Use the specified resampling method\n"
+-           "                                                   (See --dump-resample-methods for\n"
+-           "                                                   possible values)\n"
+-           "      --use-pid-file[=BOOL]                        Create a PID file\n"
+-           "      --no-cpu-limit[=BOOL]                        Do not install CPU load limiter on\n"
+-           "                                                   platforms that support it.\n"
+-           "      --disable-shm[=BOOL]                         Disable shared memory support.\n\n"
++           "      --system[=BOOL]                   Run as system-wide instance\n"
++           "  -D, --daemonize[=BOOL]                Daemonize after startup\n"
++           "      --fail[=BOOL]                     Quit when startup fails\n"
++           "      --high-priority[=BOOL]            Try to set high nice level\n"
++           "                                        (only available as root, when SUID or\n"
++           "                                        with elevated RLIMIT_NICE)\n"
++           "      --realtime[=BOOL]                 Try to enable realtime scheduling\n"
++           "                                        (only available as root, when SUID or\n"
++           "                                        with elevated RLIMIT_RTPRIO)\n"
++           "      --disallow-module-loading[=BOOL]  Disallow module user requested module\n"
++           "                                        loading/unloading after startup\n"
++           "      --disallow-exit[=BOOL]            Disallow user requested exit\n"
++           "      --exit-idle-time=SECS             Terminate the daemon when idle and this\n"
++           "                                        time passed\n"
++           "      --module-idle-time=SECS           Unload autoloaded modules when idle and\n"
++           "                                        this time passed\n"
++           "      --scache-idle-time=SECS           Unload autoloaded samples when idle and\n"
++           "                                        this time passed\n"
++           "      --log-level[=LEVEL]               Increase or set verbosity level\n"
++           "  -v                                    Increase the verbosity level\n"
++           "      --log-target={auto,syslog,stderr,\n"
++           "                    file:PATH}          Specify the log target\n"
++           "      --log-meta[=BOOL]                 Include code location in log messages\n"
++           "      --log-time[=BOOL]                 Include timestamps in log messages\n"
++           "      --log-backtrace=FRAMES            Include a backtrace in log messages\n"
++           "  -p, --dl-search-path=PATH             Set the search path for dynamic shared\n"
++           "                                        objects (plugins)\n"
++           "      --resample-method=METHOD          Use the specified resampling method\n"
++           "                                        (See --dump-resample-methods for\n"
++           "                                        possible values)\n"
++           "      --use-pid-file[=BOOL]             Create a PID file\n"
++           "      --no-cpu-limit[=BOOL]             Do not install CPU load limiter on\n"
++           "                                        platforms that support it.\n"
++           "      --disable-shm[=BOOL]              Disable shared memory support.\n\n"
+ 
+            "STARTUP SCRIPT:\n"
+-           "  -L, --load=\"MODULE ARGUMENTS\"                  Load the specified plugin module with\n"
+-           "                                                   the specified argument\n"
+-           "  -F, --file=FILENAME                              Run the specified script\n"
+-           "  -C                                               Open a command line on the running TTY\n"
+-           "                                                   after startup\n\n"
++           "  -L, --load=\"MODULE ARGUMENTS\"         Load the specified plugin module with\n"
++           "                                        the specified argument\n"
++           "  -F, --file=FILENAME                   Run the specified script\n"
++           "  -C                                    Open a command line on the running TTY\n"
++           "                                        after startup\n\n"
+ 
+-           "  -n                                               Don't load default script file\n"),
++           "  -n                                    Don't load default script file\n"),
+            pa_path_get_filename(argv0));
+ }
+ 
+@@ -318,7 +319,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d
+ 
+             case ARG_LOG_TARGET:
+                 if (pa_daemon_conf_set_log_target(conf, optarg) < 0) {
+-                    pa_log(_("Invalid log target: use either 'syslog', 'stderr', 'auto' or a valid file path name (./log_file.txt)."));
++                    pa_log(_("Invalid log target: use either 'syslog', 'stderr' or 'auto' or a valid file name 'file:<path>'."));
+                     goto fail;
+                 }
+                 break;
+diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
+index 7fe922b..a92f798 100644
+--- a/src/daemon/daemon-conf.c
++++ b/src/daemon/daemon-conf.c
+@@ -56,80 +56,6 @@
+ #define ENV_CONFIG_FILE "PULSE_CONFIG"
+ #define ENV_DL_SEARCH_PATH "PULSE_DLPATH"
+ 
+-
+-static char *insert_substr(char *dest, char *substr, int pos) {
+-    int len_dest,len_substr;
+-
+-    pa_assert(pos >= 0);
+-    pa_assert(dest);
+-    pa_assert(substr);
+-
+-    len_dest = strlen(dest);
+-    len_substr = strlen(substr);
+-
+-    /* If pos is outside dest string, copy at end of dest string */
+-    if (len_dest <= pos)
+-        strcpy(dest + len_dest, substr);
+-    /* Copy substring into destination string at position pos */
+-    else {
+-	memmove(dest + pos + len_substr, dest + pos, len_dest - pos + 1);
+-	memcpy(dest + pos, substr, len_substr + 1);
+-    }
+-
+-    return dest;
+-}
+-
+-static int rename_file_with_date(char *file_string, int file_size) {
+-
+-    time_t rawtime;
+-    struct tm * timeinfo;
+-    char *temp_date;
+-    char *string_with_date;
+-    char date[30];
+-    char file_ext[10];
+-    char *p, *slash, *dot, *end_of_str;
+-    int length_date;
+-
+-    pa_assert(file_string);
+-    pa_assert(file_size < 512);
+-
+-    /* Append the date to the filename */
+-    time(&rawtime);
+-    timeinfo = localtime(&rawtime);
+-    temp_date = asctime(timeinfo);
+-
+-    length_date = strlen(temp_date);
+-
+-    memcpy(date, temp_date, length_date + 1);
+-
+-    if((file_size + length_date) >= 512)
+-      return -1;
+-
+-    while((p = strchr(date, ' ')))
+-        *p = '_';
+-
+-    /* Date format ends with '\n'. Replace '\n' by '\0' */
(206 more lines skipped)

++++++ pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch (new)
--- pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch
+++ pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch
+From 4715181a79fc33adeca5210f69730c90e266c200 Mon Sep 17 00:00:00 2001
+From: Vincent Becker <vincentx.becker at intel.com>
+Date: Fri, 18 Mar 2011 16:35:24 +0100
+Subject: [PATCH 1/2] Module log PCM: Updated version of module.
+
+Better management of working source outputs. Bug fixing
+
+Signed-off-by: Vincent Becker <vincentx.becker at intel.com>
+---
+ src/modules/log/local-file-serializer.c |   11 +-
+ src/modules/log/log-pcm-serializer.c    |    1 +
+ src/modules/log/module-log-pcm.c        |  383 +++++++++++++++++--------------
+ 3 files changed, 208 insertions(+), 187 deletions(-)
+
+diff --git a/src/modules/log/local-file-serializer.c b/src/modules/log/local-file-serializer.c
+index 6b80177..75e41b2 100755
+--- a/src/modules/log/local-file-serializer.c
++++ b/src/modules/log/local-file-serializer.c
+@@ -70,10 +70,7 @@ int open_wav_file(const char *t, struct pcm_log_data *pl) {
+     pl->sfi.format |= file_format;
+     pl->sfi.seekable = TRUE;
+ 
+-    pa_log_debug("SFI format : 0x%x", pl->sfi.format);
+-    pa_log_debug("SFI channels : %d ", pl->sfi.channels);
+-    pa_log_debug("SFI Seekable : %d",  pl->sfi.seekable);
+-    pa_log_debug("SFI Sample Rate : %d", pl->sfi.samplerate );
++    pa_log_debug("SFI format : 0x%x\nSFI channels : %d\nSFI Seekable : %d\nSFI Sample Rate : %d\n", pl->sfi.format, pl->sfi.channels, pl->sfi.seekable, pl->sfi.samplerate);
+ 
+     pa_snprintf(filename, sizeof(filename), "%s%s%s%s", t, "/", pl->audio_flow_name, ".wav");
+ 
+@@ -95,8 +92,6 @@ int open_wav_file(const char *t, struct pcm_log_data *pl) {
+     if(pa_sndfile_write_channel_map(pl->sndfile, &pl->channel_map_to_log) < 0)
+         pa_log_error("Fail to write channel map");
+ 
+-    pa_log_debug("Sample spec rate,format : %d & %d", pl->sample_spec_to_log.rate, pl->sample_spec_to_log.format);
+-
+     pl->write_sound_file = pa_sndfile_writef_function(&pl->sample_spec_to_log);
+ 
+     return 0;
+@@ -157,16 +152,12 @@ int write_in_wav_files(const void *rawdata, int length, struct pcm_log_data *pl)
+             else
+                 return -1;
+         }
+-
+     }
+ 
+     return 0;
+ }
+ 
+ int close_wav_file(struct pcm_log_data *pl) {
+-
+-    /* Update the header now. Useful ?? */
+-    /*  sf_command (sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ;*/
+     int r;
+ 
+     if ((r = sf_close(pl->sndfile))) {
+diff --git a/src/modules/log/log-pcm-serializer.c b/src/modules/log/log-pcm-serializer.c
+index f996922..4b2b090 100755
+--- a/src/modules/log/log-pcm-serializer.c
++++ b/src/modules/log/log-pcm-serializer.c
+@@ -27,6 +27,7 @@
+ 
+ PA_DEFINE_PUBLIC_CLASS(log_pcm_serializer, pa_object);
+ 
++/* Mother class of local-file-serializer and remote-device-serializer classes */
+ log_pcm_serializer *log_pcm_serializer_new_internal(size_t size, const char *type_id, pa_bool_t (*check_type)(const char *type_name)) {
+     log_pcm_serializer *l;
+ 
+diff --git a/src/modules/log/module-log-pcm.c b/src/modules/log/module-log-pcm.c
+index edbf1f7..730d567 100755
+--- a/src/modules/log/module-log-pcm.c
++++ b/src/modules/log/module-log-pcm.c
+@@ -108,6 +108,8 @@ struct userdata {
+     unsigned int sink_input_moves;
+     unsigned int source_output_moves;
+ 
++    unsigned int handovers;
++
+     /* Used to log sink inputs and/or source outputs */
+     pa_bool_t trace_ports;
+ };
+@@ -123,17 +125,16 @@ static void free_audiolog_data(void *v, void *userdata) {
+ 
+ 
+ static void* acquire_data_at_format(pa_sample_format_t format, const pa_memchunk *chunk) {
+-
+     void *rawsnd;
+     uint8_t *rawsnd8;
+     short *rawsnd16;
+     uint32_t *rawsnd32;
+ 
+     switch (format) {
+-
+         case PA_SAMPLE_U8:
+         case PA_SAMPLE_ULAW:
+         case PA_SAMPLE_ALAW:
++        case PA_SAMPLE_S24NE:
+             rawsnd8 = (uint8_t*)(pa_memblock_acquire(chunk->memblock)) + chunk->index/sizeof(uint8_t);
+             rawsnd = rawsnd8;
+             break;
+@@ -143,11 +144,6 @@ static void* acquire_data_at_format(pa_sample_format_t format, const pa_memchunk
+             rawsnd = rawsnd16;
+             break;
+ 
+-        case PA_SAMPLE_S24NE:
+-            rawsnd8 = (uint8_t*)(pa_memblock_acquire(chunk->memblock)) + chunk->index/sizeof(uint8_t);
+-            rawsnd = rawsnd8;
+-          break;
+-
+         case PA_SAMPLE_S24_32NE:
+         case PA_SAMPLE_S32NE:
+         case PA_SAMPLE_FLOAT32NE:
+@@ -164,34 +160,55 @@ static void* acquire_data_at_format(pa_sample_format_t format, const pa_memchunk
+     return rawsnd;
+ }
+ 
++static pa_bool_t is_a_working_so(pa_source_output *o) {
++    const char *n;
++    pa_bool_t is_wso = FALSE;
++
++    if((n = pa_proplist_gets(o->proplist, PA_PROP_MEDIA_NAME)) && pa_startswith(n, LOG_PCM_SOURCE_OUTPUT_NAME)) {
++        is_wso = TRUE;
++        pa_log_info("Source output used for log : %s", n);
++    }
++
++    return is_wso;
++}
++
+ /* Push callback for all the sources/sinks logged. To get the corresponding source/sink,
+    search the name in the audio tree map */
+ static void log_working_source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk) {
+     struct userdata *u;
+     struct pcm_log_data *p;
+     void *rawsnd = NULL;
++    unsigned nb_uncorked_so;
+ 
+     pa_assert_se(u = o->userdata);
+ 
++    /* Check the number of uncorked sources. If it falls to one, it means that only the working source
++       output is uncorked and that this source is not logged anymore. */
++    nb_uncorked_so = pa_idxset_size(o->source->outputs) - o->source->n_corked;
+     p = pa_hashmap_get(u->audiotree_log_map, o->source->name);
+ 
+     /* We tried unsuccessfully to search with a sink.monitor key. Get the name of the sink instead */
+-    if(!p)
++    if(!p) {
+         p = pa_hashmap_get(u->audiotree_log_map, o->source->monitor_of->name);
++        /* For a sink, only one source output is considered (from sink.monitor) */
++        nb_uncorked_so = 2;
++    }
+ 
+-    pa_assert(p);
++    if(nb_uncorked_so > 1) {
++        pa_assert(p);
+ 
+-    /* Get the binary data from the sample specification format */
+-    rawsnd = acquire_data_at_format(p->sample_spec_to_log.format, chunk);
++        /* Get the binary data from the sample specification format */
++        rawsnd = acquire_data_at_format(p->sample_spec_to_log.format, chunk);
+ 
+-    if(p->file_des != -1) {
+-        if(u->l->write_pcm_log(rawsnd, chunk->length, p) < 0) {
+-            u->l->close_target(p);
+-               p->file_des = -1;
++        if(p->file_des != -1) {
++            if(u->l->write_pcm_log(rawsnd, chunk->length, p) < 0) {
++                u->l->close_target(p);
++                p->file_des = -1;
++            }
+         }
+-    }
+ 
+-    pa_memblock_release(chunk->memblock);
++        pa_memblock_release(chunk->memblock);
++    }
+ }
+ 
+ 
+@@ -209,20 +226,22 @@ static pa_hook_result_t sink_state_changed_hook_cb(pa_core *c, pa_sink *s, struc
+     pa_source_output *so;
+     uint32_t idx;
+ 
++    pa_assert(c);
++    pa_assert(s);
++    pa_assert(u);
++
+     if(pa_sink_get_state(s) == PA_SINK_RUNNING) {
+         PA_IDXSET_FOREACH(so, s->monitor_source->outputs, idx) {
+-            const char *n;
+-            if((n = pa_proplist_gets(so->proplist, PA_PROP_MEDIA_NAME)) && pa_startswith(n, LOG_PCM_SOURCE_OUTPUT_NAME)) {
+-                pa_log_debug("Sink %s is running. Working source output needs to be uncorked (state : %d). It's time to start logging !", s->name, so->state);
++            if(is_a_working_so(so)) {
++                pa_log_debug("Sink %s is running. Working source output needs to be uncorked (state : %d) to start logging !", s->name, so->state);
+                 pa_source_output_cork(so, FALSE);
+             }
+         }
+     }
+     else {
(636 more lines skipped)

++++++ pulseaudio.yaml
--- pulseaudio.yaml
+++ pulseaudio.yaml
@@ -46,7 +46,10 @@
     - pa-0.9.19-mfld-Fix-various-bugs-Support-new-option-trace_ports.patch
     - fix-9972-auto-route-audio-to-bt-sink.patch
     - use-a2dp-profile-for-non-mfld.patch
+    - pa-0.9.19-mfld-Module-log-PCM-Updated-version-of-module.patch
+    - pa-0.9.19-mfld-Log-feature-correction-of-review-from-upstream.patch
     - fix-12649-add-hfp-gateway-support.patch
+
 Description: |
     PulseAudio is a sound server for Linux and other Unix like operating
     systems. It is intended to be an improved drop-in replacement for the




More information about the MeeGo-commits mailing list