[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test5-124-g92ae5f1

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Mar 30 16:05:53 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  facc46d5bfe8120424e9cb0679da91a35c9003ec (commit)

- Log -----------------------------------------------------------------
92ae5f1 Specifying ALSA mixer control
-----------------------------------------------------------------------

Summary of changes:
 src/modules/alsa/alsa-sink.c          |    2 +-
 src/modules/alsa/alsa-source.c        |    2 +-
 src/modules/alsa/alsa-util.c          |   13 ++++++++++---
 src/modules/alsa/alsa-util.h          |    2 +-
 src/modules/alsa/module-alsa-sink.c   |    4 +++-
 src/modules/alsa/module-alsa-source.c |    4 +++-
 6 files changed, 19 insertions(+), 8 deletions(-)

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

commit 92ae5f1a742d52a72562251a0b550bf39af28d8c
Author: Kyle Cronan <kyle at pbx.org>
Date:   Mon Mar 30 12:49:37 2009 -0500

    Specifying ALSA mixer control
    
    On Fri, Mar 27, 2009 at 7:21 AM, Lennart Poettering <lennart at poettering.net> wrote:
    
    >> I tried installing the latest git sources on my Ubuntu Jaunty box but
    >> it just broke sound in all my applications.  For my own purposes, I'm
    >> going to need to start with the Ubuntu-patched 0.9.14.  However, if
    >> you are willing to accept this patch I will forward port it so that it
    >> applies to the latest sources.  It's a completely harmless change, so
    >> why not apply it?
    >
    > Yes, I am happy to apply it. Could you please update it for current git?
    >
    
    Great.  An updated patch is attached.  For symmetry, I added this
    option to the alsa source module as well.
    
    The Ubuntu folks have customized pulse so much that it is difficult
    for me to get this version working on my system.  For this patch I
    have only made sure that it compiles.  But it does pretty much the
    same thing as the one for 0.9.14, which is working great for me.
    
    Thanks,
    Kyle

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 0296f64..0dc0e2b 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1644,7 +1644,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
     /* ALSA might tweak the sample spec, so recalculate the frame size */
     frame_size = pa_frame_size(&ss);
 
-    pa_alsa_find_mixer_and_elem(u->pcm_handle, &u->mixer_handle, &u->mixer_elem);
+    pa_alsa_find_mixer_and_elem(u->pcm_handle, &u->mixer_handle, &u->mixer_elem, pa_modargs_get_value(ma, "control", NULL));
 
     pa_sink_new_data_init(&data);
     data.driver = driver;
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index ef365a2..348cd08 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1496,7 +1496,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
     /* ALSA might tweak the sample spec, so recalculate the frame size */
     frame_size = pa_frame_size(&ss);
 
-    pa_alsa_find_mixer_and_elem(u->pcm_handle, &u->mixer_handle, &u->mixer_elem);
+    pa_alsa_find_mixer_and_elem(u->pcm_handle, &u->mixer_handle, &u->mixer_elem, pa_modargs_get_value(ma, "control", NULL));
 
     pa_source_new_data_init(&data);
     data.driver = driver;
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 2d0ca10..5b5270b 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -1094,7 +1094,8 @@ success:
 int pa_alsa_find_mixer_and_elem(
         snd_pcm_t *pcm,
         snd_mixer_t **_m,
-        snd_mixer_elem_t **_e) {
+        snd_mixer_elem_t **_e,
+        const char *control_name) {
 
     int err;
     snd_mixer_t *m;
@@ -1146,11 +1147,17 @@ int pa_alsa_find_mixer_and_elem(
     switch (snd_pcm_stream(pcm)) {
 
         case SND_PCM_STREAM_PLAYBACK:
-            e = pa_alsa_find_elem(m, "Master", "PCM", TRUE);
+            if (control_name)
+                e = pa_alsa_find_elem(m, control_name, NULL, TRUE);
+            else
+                e = pa_alsa_find_elem(m, "Master", "PCM", TRUE);
             break;
 
         case SND_PCM_STREAM_CAPTURE:
-            e = pa_alsa_find_elem(m, "Capture", "Mic", FALSE);
+            if (control_name)
+                e = pa_alsa_find_elem(m, control_name, NULL, FALSE);
+            else
+                e = pa_alsa_find_elem(m, "Capture", "Mic", FALSE);
             break;
 
         default:
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index 68496d5..5cad295 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -54,7 +54,7 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min);
 
 int pa_alsa_prepare_mixer(snd_mixer_t *mixer, const char *dev);
 snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const char *fallback, pa_bool_t playback);
-int pa_alsa_find_mixer_and_elem(snd_pcm_t *pcm, snd_mixer_t **_m, snd_mixer_elem_t **_e);
+int pa_alsa_find_mixer_and_elem(snd_pcm_t *pcm, snd_mixer_t **_m, snd_mixer_elem_t **_e, const char *control_name);
 
 typedef struct pa_alsa_profile_info {
     pa_channel_map map;
diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c
index c728a44..8e600ab 100644
--- a/src/modules/alsa/module-alsa-sink.c
+++ b/src/modules/alsa/module-alsa-sink.c
@@ -52,7 +52,8 @@ PA_MODULE_USAGE(
         "tsched=<enable system timer based scheduling mode?> "
         "tsched_buffer_size=<buffer size when using timer based scheduling> "
         "tsched_buffer_watermark=<lower fill watermark> "
-        "ignore_dB=<ignore dB information from the device?>");
+        "ignore_dB=<ignore dB information from the device?> "
+        "control=<name of mixer control>");
 
 static const char* const valid_modargs[] = {
     "name",
@@ -70,6 +71,7 @@ static const char* const valid_modargs[] = {
     "tsched_buffer_size",
     "tsched_buffer_watermark",
     "ignore_dB",
+    "control",
     NULL
 };
 
diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c
index 6188019..e6b27b3 100644
--- a/src/modules/alsa/module-alsa-source.c
+++ b/src/modules/alsa/module-alsa-source.c
@@ -76,7 +76,8 @@ PA_MODULE_USAGE(
         "tsched=<enable system timer based scheduling mode?> "
         "tsched_buffer_size=<buffer size when using timer based scheduling> "
         "tsched_buffer_watermark=<upper fill watermark> "
-        "ignore_dB=<ignore dB information from the device?>");
+        "ignore_dB=<ignore dB information from the device?> "
+        "control=<name of mixer control>");
 
 static const char* const valid_modargs[] = {
     "name",
@@ -94,6 +95,7 @@ static const char* const valid_modargs[] = {
     "tsched_buffer_size",
     "tsched_buffer_watermark",
     "ignore_dB",
+    "control",
     NULL
 };
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list