[Pkg-pulseaudio-devel] [SCM] pulseaudio packaging branch, patches, updated. upstream/0.9.15-1-g270ab5f

sjoerd at users.alioth.debian.org sjoerd at users.alioth.debian.org
Sun Jun 7 21:04:39 UTC 2009


The branch, patches has been updated
       via  270ab5f0f2c049f842e5b4a7f69c59db84827c5d (commit)
       via  2333d7cffc05252fa3185ca126ef1ff0b5d73aa6 (commit)
      from  897e73dc49c7f4019450a21fec07d054d769d1dc (commit)


- Shortlog ------------------------------------------------------------
270ab5f alsa: allow configuration of fallback device strings in profiles

Summary of changes:
 ChangeLog                                          |  442 ++++-
 Makefile.in                                        |   19 -
 configure                                          |  115 +-
 configure.ac                                       |    2 +-
 doxygen/Makefile.in                                |   19 -
 m4/intltool.m4                                     |   64 +-
 man/Makefile.in                                    |   19 -
 po/ChangeLog                                       |   24 +
 po/LINGUAS                                         |   14 +-
 po/Makefile.in.in                                  |    4 +-
 po/POTFILES.in                                     |    7 +-
 po/as.po                                           | 2435 +++++++++++++++++++
 po/bn_IN.po                                        | 2451 +++++++++++++++++++
 po/ca.po                                           |  733 ++++---
 po/cs.po                                           |  326 ++-
 po/de.po                                           |  326 ++-
 po/el.po                                           |  326 ++-
 po/es.po                                           |  759 ++++---
 po/fi.po                                           |  943 +++++---
 po/fr.po                                           |  326 ++-
 po/gu.po                                           | 2432 +++++++++++++++++++
 po/it.po                                           |  475 +++--
 po/kn.po                                           | 2451 +++++++++++++++++++
 po/mr.po                                           | 2433 +++++++++++++++++++
 po/nl.po                                           | 2114 +++++++++++++++++
 po/or.po                                           | 2437 +++++++++++++++++++
 po/pa.po                                           | 2126 +++++++++++++++++
 po/pl.po                                           |  347 ++-
 po/pt_BR.po                                        |  326 ++-
 po/sr.po                                           | 2462 +++++++++++++++++++
 po/sr at latin.po                                     | 2465 ++++++++++++++++++++
 po/sv.po                                           |  326 ++-
 po/ta.po                                           | 2454 +++++++++++++++++++
 po/te.po                                           | 2431 +++++++++++++++++++
 po/zh_CN.po                                        |  760 ++++---
 src/Makefile.am                                    |   36 +-
 src/Makefile.in                                    |  280 +--
 src/daemon/cpulimit.c                              |    2 +-
 src/daemon/default.pa.in                           |    6 +-
 src/daemon/main.c                                  |   73 +-
 src/map-file                                       |    1 +
 src/modules/alsa/alsa-sink.c                       |   86 +-
 src/modules/alsa/alsa-source.c                     |   70 +-
 src/modules/alsa/alsa-util.c                       |  244 ++-
 src/modules/alsa/alsa-util.h                       |   20 +-
 src/modules/alsa/module-alsa-card.c                |    3 +-
 src/modules/alsa/module-alsa-sink.c                |    4 +-
 src/modules/alsa/module-alsa-source.c              |    4 +-
 src/modules/bluetooth/bluetooth-util.c             |  373 ++--
 src/modules/bluetooth/bluetooth-util.h             |   58 +-
 src/modules/bluetooth/ipc.c                        |    1 +
 src/modules/bluetooth/ipc.h                        |   73 +-
 src/modules/bluetooth/module-bluetooth-device.c    | 1058 +++++----
 src/modules/bluetooth/module-bluetooth-discover.c  |  106 +-
 src/modules/bluetooth/module-bluetooth-proximity.c |    6 +-
 src/modules/bluetooth/sbc.c                        |   49 +-
 src/modules/bluetooth/sbc.h                        |   28 +-
 src/modules/dbus-util.c                            |  431 ----
 src/modules/dbus-util.h                            |   67 -
 src/modules/hal-util.c                             |    2 +-
 src/modules/module-card-restore.c                  |    3 +
 src/modules/module-combine.c                       |   24 +-
 src/modules/module-console-kit.c                   |    2 +-
 src/modules/module-cork-music-on-phone.c           |    1 -
 src/modules/module-default-device-restore.c        |    4 +-
 src/modules/module-device-restore.c                |    2 +-
 src/modules/module-esound-sink.c                   |   24 +-
 src/modules/module-hal-detect.c                    |   35 +-
 src/modules/module-jack-sink.c                     |   21 +-
 src/modules/module-jack-source.c                   |   10 +-
 src/modules/module-ladspa-sink.c                   |   12 +-
 src/modules/module-lirc.c                          |   33 +-
 src/modules/module-match.c                         |    2 +-
 src/modules/module-mmkbd-evdev.c                   |   39 +-
 src/modules/module-null-sink.c                     |   20 +-
 src/modules/module-pipe-sink.c                     |    2 +
 src/modules/module-pipe-source.c                   |    1 +
 src/modules/module-raop-discover.c                 |    2 +-
 src/modules/module-raop-sink.c                     |   22 +-
 src/modules/module-remap-sink.c                    |   10 +-
 src/modules/module-sine-source.c                   |    7 +-
 src/modules/module-solaris.c                       |  105 +-
 src/modules/module-stream-restore.c                |  150 +-
 src/modules/module-tunnel.c                        |  254 ++-
 src/modules/module-x11-publish.c                   |   14 +-
 src/modules/module-zeroconf-discover.c             |    2 +-
 src/modules/oss/module-oss.c                       |    6 +-
 src/modules/reserve-wrap.c                         |   21 +-
 src/modules/rtp/module-rtp-recv.c                  |   87 +-
 src/modules/rtp/module-rtp-send.c                  |    6 +-
 src/modules/rtp/rtp.c                              |   21 +-
 src/modules/rtp/rtp.h                              |    2 +-
 src/modules/rtp/rtsp_client.c                      |    4 +-
 src/modules/udev-util.c                            |    4 +-
 src/pulse/channelmap.h                             |    6 +-
 src/pulse/client-conf-x11.c                        |   15 +
 src/pulse/client-conf.c                            |   31 +-
 src/pulse/client-conf.h                            |    2 +-
 src/pulse/context.c                                |  130 +-
 src/pulse/context.h                                |    7 +-
 src/pulse/def.h                                    |   39 +-
 src/pulse/fork-detect.c                            |    2 +-
 src/pulse/internal.h                               |   19 +-
 src/pulse/introspect.h                             |   20 +-
 src/pulse/mainloop-signal.c                        |    5 +-
 src/pulse/mainloop.h                               |    2 +-
 src/pulse/proplist.h                               |    2 +-
 src/pulse/pulseaudio.h                             |    2 +-
 src/pulse/sample.h                                 |    4 +-
 src/pulse/stream.c                                 |  162 +-
 src/pulse/stream.h                                 |   90 +-
 src/pulse/subscribe.h                              |    2 +-
 src/pulse/timeval.h                                |    2 +-
 src/pulse/version.h                                |    2 +-
 src/pulse/volume.c                                 |   10 +-
 src/pulse/volume.h                                 |    8 +-
 src/pulsecore/authkey.c                            |    2 +-
 src/pulsecore/card.c                               |   11 +-
 src/pulsecore/card.h                               |    6 +-
 src/pulsecore/cli-command.c                        |   30 +-
 src/pulsecore/cli-text.c                           |   68 +-
 src/pulsecore/core-util.c                          |   56 +-
 src/pulsecore/core-util.h                          |    1 +
 src/pulsecore/dbus-shared.c                        |  107 +
 src/pulsecore/dbus-shared.h                        |   42 +
 src/pulsecore/dbus-util.c                          |  410 ++++
 src/pulsecore/dbus-util.h                          |   63 +
 src/pulsecore/hook-list.c                          |    6 +
 src/pulsecore/hook-list.h                          |    2 +
 src/pulsecore/log.c                                |   39 +-
 src/pulsecore/log.h                                |    4 +
 src/pulsecore/macro.h                              |   34 +-
 src/pulsecore/memblock.c                           |   43 +-
 src/pulsecore/memblockq.c                          |   82 +-
 src/pulsecore/memblockq.h                          |    7 +-
 src/pulsecore/native-common.h                      |    6 +-
 src/pulsecore/parseaddr.c                          |   10 +-
 src/pulsecore/pdispatch.c                          |   15 +-
 src/pulsecore/proplist-util.c                      |    9 +-
 src/pulsecore/protocol-esound.c                    |   15 +-
 src/pulsecore/protocol-native.c                    |  647 +++---
 src/pulsecore/refcnt.h                             |   44 +-
 src/pulsecore/rtclock.c                            |   16 +-
 src/pulsecore/sink-input.c                         |  216 ++-
 src/pulsecore/sink-input.h                         |   33 +-
 src/pulsecore/sink.c                               |  376 +++-
 src/pulsecore/sink.h                               |   29 +-
 src/pulsecore/socket-server.c                      |   23 +-
 src/pulsecore/source-output.c                      |  114 +-
 src/pulsecore/source-output.h                      |   14 +-
 src/pulsecore/source.c                             |  205 ++-
 src/pulsecore/source.h                             |   11 +-
 src/pulsecore/time-smoother.c                      |   79 +-
 src/pulsecore/time-smoother.h                      |   14 +-
 src/tests/alsa-time-test.c                         |    2 +-
 src/tests/gtk-test.c                               |   41 +-
 src/tests/interpol-test.c                          |   42 +-
 src/tests/mainloop-test.c                          |    2 +-
 src/tests/memblockq-test.c                         |   18 +-
 src/tests/smoother-test.c                          |    8 +-
 src/tests/voltest.c                                |    3 +
 src/utils/pacat.c                                  |   10 +-
 162 files changed, 37777 insertions(+), 5226 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 270ab5f0f2c049f842e5b4a7f69c59db84827c5d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Apr 29 01:58:18 2009 +0200

    alsa: allow configuration of fallback device strings in profiles
    
    This has the benefit that we can properly support ALSA devices where
    only the raw 'hw' device exists but no 'front' although it's a proper
    2ch stereo device.

diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index d2dc6e8..2ea0c3d 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -526,7 +526,7 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min) {
 
 static const struct pa_alsa_profile_info device_table[] = {
     {{ 1, { PA_CHANNEL_POSITION_MONO }},
-     "hw",
+     "hw", NULL,
      N_("Analog Mono"),
      "analog-mono",
      1,
@@ -534,7 +534,7 @@ static const struct pa_alsa_profile_info device_table[] = {
      "Capture", "Mic" },
 
     {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
-     "front",
+     "front", "hw",
      N_("Analog Stereo"),
      "analog-stereo",
      10,
@@ -542,7 +542,7 @@ static const struct pa_alsa_profile_info device_table[] = {
      "Capture", "Mic" },
 
     {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
-     "iec958",
+     "iec958", NULL,
      N_("Digital Stereo (IEC958)"),
      "iec958-stereo",
      5,
@@ -550,7 +550,7 @@ static const struct pa_alsa_profile_info device_table[] = {
      "IEC958 In", NULL },
 
     {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
-     "hdmi",
+     "hdmi", NULL,
      N_("Digital Stereo (HDMI)"),
      "hdmi-stereo",
      4,
@@ -559,7 +559,7 @@ static const struct pa_alsa_profile_info device_table[] = {
 
     {{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
             PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }},
-     "surround40",
+     "surround40", NULL,
      N_("Analog Surround 4.0"),
      "analog-surround-40",
      7,
@@ -568,7 +568,7 @@ static const struct pa_alsa_profile_info device_table[] = {
 
     {{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
             PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }},
-     "a52",
+     "a52", NULL,
      N_("Digital Surround 4.0 (IEC958/AC3)"),
      "iec958-ac3-surround-40",
      2,
@@ -578,7 +578,7 @@ static const struct pa_alsa_profile_info device_table[] = {
     {{ 5, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
             PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
             PA_CHANNEL_POSITION_LFE }},
-     "surround41",
+     "surround41", NULL,
      N_("Analog Surround 4.1"),
      "analog-surround-41",
      7,
@@ -588,7 +588,7 @@ static const struct pa_alsa_profile_info device_table[] = {
     {{ 5, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
             PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
             PA_CHANNEL_POSITION_CENTER }},
-     "surround50",
+     "surround50", NULL,
      N_("Analog Surround 5.0"),
      "analog-surround-50",
      7,
@@ -598,7 +598,7 @@ static const struct pa_alsa_profile_info device_table[] = {
     {{ 6, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
             PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
             PA_CHANNEL_POSITION_CENTER, PA_CHANNEL_POSITION_LFE }},
-     "surround51",
+     "surround51", NULL,
      N_("Analog Surround 5.1"),
      "analog-surround-51",
      8,
@@ -608,7 +608,7 @@ static const struct pa_alsa_profile_info device_table[] = {
     {{ 6, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
             PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
             PA_CHANNEL_POSITION_FRONT_CENTER, PA_CHANNEL_POSITION_LFE}},
-     "a52",
+     "a52", NULL,
      N_("Digital Surround 5.1 (IEC958/AC3)"),
      "iec958-ac3-surround-51",
      3,
@@ -619,16 +619,72 @@ static const struct pa_alsa_profile_info device_table[] = {
             PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
             PA_CHANNEL_POSITION_CENTER, PA_CHANNEL_POSITION_LFE,
             PA_CHANNEL_POSITION_SIDE_LEFT, PA_CHANNEL_POSITION_SIDE_RIGHT }},
-     "surround71",
+     "surround71", NULL,
      N_("Analog Surround 7.1"),
      "analog-surround-71",
      7,
      "Master", "PCM",
      "Capture", "Mic" },
 
-    {{ 0, { 0 }}, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL }
+    {{ 0, { 0 }}, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL }
 };
 
+static snd_pcm_t *open_by_device_string_with_fallback(
+        const char *prefix,
+        const char *prefix_fallback,
+        const char *dev_id,
+        char **dev,
+        pa_sample_spec *ss,
+        pa_channel_map* map,
+        int mode,
+        uint32_t *nfrags,
+        snd_pcm_uframes_t *period_size,
+        snd_pcm_uframes_t tsched_size,
+        pa_bool_t *use_mmap,
+        pa_bool_t *use_tsched,
+        pa_bool_t require_exact_channel_number) {
+
+    snd_pcm_t *pcm_handle;
+    char *d;
+
+    d = pa_sprintf_malloc("%s:%s", prefix, dev_id);
+
+    pcm_handle = pa_alsa_open_by_device_string(
+            d,
+            dev,
+            ss,
+            map,
+            mode,
+            nfrags,
+            period_size,
+            tsched_size,
+            use_mmap,
+            use_tsched,
+            require_exact_channel_number);
+    pa_xfree(d);
+
+    if (!pcm_handle && prefix_fallback) {
+
+        d = pa_sprintf_malloc("%s:%s", prefix_fallback, dev_id);
+
+        pcm_handle = pa_alsa_open_by_device_string(
+                d,
+                dev,
+                ss,
+                map,
+                mode,
+                nfrags,
+                period_size,
+                tsched_size,
+                use_mmap,
+                use_tsched,
+                require_exact_channel_number);
+        pa_xfree(d);
+    }
+
+    return pcm_handle;
+}
+
 snd_pcm_t *pa_alsa_open_by_device_id_auto(
         const char *dev_id,
         char **dev,
@@ -669,14 +725,14 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
 
             pa_log_debug("Checking for %s (%s)", device_table[i].name, device_table[i].alsa_name);
 
-            d = pa_sprintf_malloc("%s:%s", device_table[i].alsa_name, dev_id);
-
             try_ss.channels = device_table[i].map.channels;
             try_ss.rate = ss->rate;
             try_ss.format = ss->format;
 
-            pcm_handle = pa_alsa_open_by_device_string(
-                    d,
+            pcm_handle = open_by_device_string_with_fallback(
+                    device_table[i].alsa_name,
+                    device_table[i].alsa_name_fallback,
+                    dev_id,
                     dev,
                     &try_ss,
                     map,
@@ -688,8 +744,6 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
                     use_tsched,
                     TRUE);
 
-            pa_xfree(d);
-
             if (pcm_handle) {
 
                 *ss = try_ss;
@@ -701,6 +755,7 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto(
 
                 return pcm_handle;
             }
+
         }
 
         if (direction > 0) {
@@ -773,7 +828,6 @@ snd_pcm_t *pa_alsa_open_by_device_id_profile(
         pa_bool_t *use_tsched,
         const pa_alsa_profile_info *profile) {
 
-    char *d;
     snd_pcm_t *pcm_handle;
     pa_sample_spec try_ss;
 
@@ -785,14 +839,14 @@ snd_pcm_t *pa_alsa_open_by_device_id_profile(
     pa_assert(period_size);
     pa_assert(profile);
 
-    d = pa_sprintf_malloc("%s:%s", profile->alsa_name, dev_id);
-
     try_ss.channels = profile->map.channels;
     try_ss.rate = ss->rate;
     try_ss.format = ss->format;
 
-    pcm_handle = pa_alsa_open_by_device_string(
-            d,
+    pcm_handle = open_by_device_string_with_fallback(
+            profile->alsa_name,
+            profile->alsa_name_fallback,
+            dev_id,
             dev,
             &try_ss,
             map,
@@ -804,8 +858,6 @@ snd_pcm_t *pa_alsa_open_by_device_id_profile(
             use_tsched,
             TRUE);
 
-    pa_xfree(d);
-
     if (!pcm_handle)
         return NULL;
 
@@ -858,6 +910,8 @@ snd_pcm_t *pa_alsa_open_by_device_string(
             goto fail;
         }
 
+        pa_log_debug("Managed to open %s", d);
+
         if ((err = pa_alsa_set_hw_params(pcm_handle, ss, nfrags, period_size, tsched_size, use_mmap, use_tsched, require_exact_channel_number)) < 0) {
 
             if (!reformat) {
@@ -926,26 +980,25 @@ int pa_alsa_probe_profiles(
         snd_pcm_t *pcm_i = NULL;
 
         if (i->alsa_name) {
-            char *id;
             pa_sample_spec try_ss;
             pa_channel_map try_map;
 
             pa_log_debug("Checking for playback on %s (%s)", i->name, i->alsa_name);
-            id = pa_sprintf_malloc("%s:%s", i->alsa_name, dev_id);
 
             try_ss = *ss;
             try_ss.channels = i->map.channels;
             try_map = i->map;
 
-            pcm_i = pa_alsa_open_by_device_string(
-                    id, NULL,
+            pcm_i = open_by_device_string_with_fallback(
+                    i->alsa_name,
+                    i->alsa_name_fallback,
+                    dev_id,
+                    NULL,
                     &try_ss, &try_map,
                     SND_PCM_STREAM_PLAYBACK,
                     NULL, NULL, 0, NULL, NULL,
                     TRUE);
 
-            pa_xfree(id);
-
             if (!pcm_i)
                 continue;
         }
@@ -954,26 +1007,25 @@ int pa_alsa_probe_profiles(
             snd_pcm_t *pcm_j = NULL;
 
             if (j->alsa_name) {
-                char *jd;
                 pa_sample_spec try_ss;
                 pa_channel_map try_map;
 
                 pa_log_debug("Checking for capture on %s (%s)", j->name, j->alsa_name);
-                jd = pa_sprintf_malloc("%s:%s", j->alsa_name, dev_id);
 
                 try_ss = *ss;
                 try_ss.channels = j->map.channels;
                 try_map = j->map;
 
-                pcm_j = pa_alsa_open_by_device_string(
-                        jd, NULL,
+                pcm_j = open_by_device_string_with_fallback(
+                        j->alsa_name,
+                        j->alsa_name_fallback,
+                        dev_id,
+                        NULL,
                         &try_ss, &try_map,
                         SND_PCM_STREAM_CAPTURE,
                         NULL, NULL, 0, NULL, NULL,
                         TRUE);
 
-                pa_xfree(jd);
-
                 if (!pcm_j)
                     continue;
             }
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index c8acc7c..c3a8117 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -56,6 +56,7 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min);
 typedef struct pa_alsa_profile_info {
     pa_channel_map map;
     const char *alsa_name;
+    const char *alsa_name_fallback;
     const char *description; /* internationalized */
     const char *name;
     unsigned priority;

-- 
pulseaudio packaging



More information about the Pkg-pulseaudio-devel mailing list