[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.16-test5-9-gfe9a577

Lennart Poettering gitmailer-noreply at 0pointer.de
Thu Aug 20 18:45:51 PDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  a562978509674f37f3cc7d5d5d1002f52a59654d (commit)

- Log -----------------------------------------------------------------
fe9a577 alsa: leave headphone jack enabled in normal mixer paths
ac05619 combine: quieten gcc a bit
8a2a6b2 adjust various data/library paths automatically if we are run from a build tree
-----------------------------------------------------------------------

Summary of changes:
 src/Makefile.am                                    |    5 +++--
 src/daemon/daemon-conf.c                           |   20 ++++++++++++++++++--
 src/daemon/main.c                                  |    2 ++
 src/modules/alsa/alsa-mixer.c                      |   16 +++++++++++++---
 .../mixer/paths/analog-output-lfe-on-mono.conf     |    7 +++++--
 .../alsa/mixer/paths/analog-output-mono.conf       |    7 +++++--
 src/modules/alsa/mixer/paths/analog-output.conf    |    7 +++++--
 src/modules/module-combine.c                       |    2 ++
 src/pulsecore/core-util.c                          |   19 +++++++++++++++++++
 src/pulsecore/core-util.h                          |    4 ++++
 10 files changed, 76 insertions(+), 13 deletions(-)

-----------------------------------------------------------------------

commit 8a2a6b2004cd299467de1955f7f99e25033faa63
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Aug 21 03:43:53 2009 +0200

    adjust various data/library paths automatically if we are run from a build tree

diff --git a/src/Makefile.am b/src/Makefile.am
index 17011cd..fd44099 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -74,6 +74,7 @@ AM_CFLAGS = \
 	$(LIBSAMPLERATE_CFLAGS) \
 	$(LIBSNDFILE_CFLAGS) \
 	$(LIBSPEEX_CFLAGS) \
+	-DPA_BUILDDIR=\"$(abs_builddir)\" \
 	-DPA_DLSEARCHPATH=\"$(modlibexecdir)\" \
 	-DPA_DEFAULT_CONFIG_DIR=\"$(PA_DEFAULT_CONFIG_DIR)\" \
 	-DPA_BINARY=\"$(PA_BINARY)\" \
@@ -83,8 +84,8 @@ AM_CFLAGS = \
 	-DAO_REQUIRE_CAS \
 	-DPULSE_LOCALEDIR=\"$(pulselocaledir)\" \
 	-DPA_MACHINE_ID=\"$(localstatedir)/lib/dbus/machine-id\" \
-	-DPA_ALSA_PATHS_DIR=\"$(alsapathsdir)\" \
-	-DPA_ALSA_PROFILE_SETS_DIR=\"$(alsaprofilesetsdir)\"
+        -DPA_ALSA_PATHS_DIR=\"$(alsapathsdir)\" \
+        -DPA_ALSA_PROFILE_SETS_DIR=\"$(alsaprofilesetsdir)\"
 
 AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS)
 AM_LDADD = $(PTHREAD_LIBS) $(INTLLIBS)
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 9a87b55..ec1ec5c 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -133,9 +133,25 @@ static const pa_daemon_conf default_conf = {
 };
 
 pa_daemon_conf* pa_daemon_conf_new(void) {
-    pa_daemon_conf *c = pa_xnewdup(pa_daemon_conf, &default_conf, 1);
+    pa_daemon_conf *c;
+
+    c = pa_xnewdup(pa_daemon_conf, &default_conf, 1);
+
+#if defined(__linux__) && !defined(__OPTIMIZE__)
+
+    /* We abuse __OPTIMIZE__ as a check whether we are a debug build
+     * or not. If we are and are run from the build tree then we
+     * override the search path to point to our build tree */
+
+    if (pa_run_from_build_tree()) {
+        pa_log_notice("Detected that we are run from the build tree, fixing search path.");
+        c->dl_search_path = pa_xstrdup(PA_BUILDDIR "/.libs/");
+
+    } else
+
+#endif
+        c->dl_search_path = pa_xstrdup(PA_DLSEARCHPATH);
 
-    c->dl_search_path = pa_xstrdup(PA_DLSEARCHPATH);
     return c;
 }
 
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 8521e72..7298459 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -774,6 +774,8 @@ int main(int argc, char *argv[]) {
     pa_log_info(_("Using state directory %s."), s);
     pa_xfree(s);
 
+    pa_log_info(_("Using modules directory %s."), conf->dl_search_path);
+
     pa_log_info(_("Running in system mode: %s"), pa_yes_no(pa_in_system_mode()));
 
     if (pa_in_system_mode())
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index a4c2ee0..61c92cd 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -929,7 +929,7 @@ static int element_zero_volume(pa_alsa_element *e, snd_mixer_t *m) {
 
 int pa_alsa_path_select(pa_alsa_path *p, snd_mixer_t *m) {
     pa_alsa_element *e;
-    int r;
+    int r = 0;
 
     pa_assert(m);
     pa_assert(p);
@@ -1849,7 +1849,12 @@ pa_alsa_path* pa_alsa_path_new(const char *fname, pa_alsa_direction_t direction)
     items[1].data = &p->description;
     items[2].data = &p->name;
 
-    fn = pa_maybe_prefix_path(fname, PA_ALSA_PATHS_DIR);
+    fn = pa_maybe_prefix_path(fname,
+#if defined(__linux__) && !defined(__OPTIMIZE__)
+                              pa_run_from_build_tree() ? PA_BUILDDIR "/modules/alsa/mixer/paths/" :
+#endif
+                              PA_ALSA_PATHS_DIR);
+
     r = pa_config_parse(fn, NULL, items, p);
     pa_xfree(fn);
 
@@ -3110,7 +3115,12 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel
     if (!fname)
         fname = "default.conf";
 
-    fn = pa_maybe_prefix_path(fname, PA_ALSA_PROFILE_SETS_DIR);
+    fn = pa_maybe_prefix_path(fname,
+#if defined(__linux__) && !defined(__OPTIMIZE__)
+                              pa_run_from_build_tree() ? PA_BUILDDIR "/modules/alsa/mixer/profile-sets/" :
+#endif
+                              PA_ALSA_PROFILE_SETS_DIR);
+
     r = pa_config_parse(fn, NULL, items, ps);
     pa_xfree(fn);
 
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index ef8c847..843c837 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2862,3 +2862,22 @@ void pa_reset_personality(void) {
 #endif
 
 }
+
+#if defined(__linux__) && !defined(__OPTIMIZE__)
+
+pa_bool_t pa_run_from_build_tree(void) {
+    char *rp;
+    pa_bool_t b = FALSE;
+
+    /* We abuse __OPTIMIZE__ as a check whether we are a debug build
+     * or not. */
+
+    if ((rp = pa_readlink("/proc/self/exe"))) {
+        b = pa_startswith(rp, PA_BUILDDIR);
+        pa_xfree(rp);
+    }
+
+    return b;
+}
+
+#endif
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index 3d3aec7..2551f79 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -243,4 +243,8 @@ size_t pa_pipe_buf(int fd);
 
 void pa_reset_personality(void);
 
+#if defined(__linux__) && !defined(__OPTIMIZE__)
+pa_bool_t pa_run_from_build_tree(void);
+#endif
+
 #endif

commit ac056191410b67466b429720778fe87279d9912a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Aug 21 03:45:17 2009 +0200

    combine: quieten gcc a bit

diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index 582cbce..e90ef11 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -1161,6 +1161,8 @@ int pa__init(pa_module*m) {
         pa_channel_map slaves_map;
         pa_bool_t is_first_slave = TRUE;
 
+        pa_sample_spec_init(&slaves_spec);
+
         while ((n = pa_split(slaves, ",", &split_state))) {
             pa_sink *slave_sink;
 

commit fe9a577cf2799c0864a05a08c785161ba3738d88
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Aug 21 03:45:58 2009 +0200

    alsa: leave headphone jack enabled in normal mixer paths

diff --git a/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf b/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf
index 2db976a..3457d4a 100644
--- a/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf
@@ -41,9 +41,12 @@ volume = merge
 override-map.1 = lfe
 override-map.2 = lfe,lfe
 
+; This profile path is intended to control the speaker, not the
+; headphones. But it should not hurt if we leave the headphone jack
+; enabled nonetheless.
 [Element Headphone]
-switch = off
-volume = off
+switch = mute
+volume = zero
 
 [Element Speaker]
 switch = mute
diff --git a/src/modules/alsa/mixer/paths/analog-output-mono.conf b/src/modules/alsa/mixer/paths/analog-output-mono.conf
index a58cc97..dc270cf 100644
--- a/src/modules/alsa/mixer/paths/analog-output-mono.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-mono.conf
@@ -38,9 +38,12 @@ volume = merge
 override-map.1 = all
 override-map.2 = all-left,all-right
 
+; This profile path is intended to control the speaker, not the
+; headphones. But it should not hurt if we leave the headphone jack
+; enabled nonetheless.
 [Element Headphone]
-switch = off
-volume = off
+switch = mute
+volume = zero
 
 [Element Speaker]
 switch = mute
diff --git a/src/modules/alsa/mixer/paths/analog-output.conf b/src/modules/alsa/mixer/paths/analog-output.conf
index b412a43..f71a05a 100644
--- a/src/modules/alsa/mixer/paths/analog-output.conf
+++ b/src/modules/alsa/mixer/paths/analog-output.conf
@@ -37,9 +37,12 @@ override-map.2 = all-left,all-right
 switch = off
 volume = off
 
+; This profile path is intended to control the speaker, not the
+; headphones. But it should not hurt if we leave the headphone jack
+; enabled nonetheless.
 [Element Headphone]
-switch = off
-volume = off
+switch = mute
+volume = zero
 
 [Element Speaker]
 switch = mute

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list