[pulseaudio-commits] 2 commits - src/modules src/pulsecore

Arun Raghavan arun at kemper.freedesktop.org
Wed Aug 17 21:41:52 PDT 2011


 src/modules/alsa/alsa-sink.c  |   14 +++++++++++++-
 src/pulsecore/sink-input.c    |    2 +-
 src/pulsecore/source-output.c |    2 +-
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 358d92170a4df59a3e93059f5827f2301b9d4e2a
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Thu Aug 18 10:10:22 2011 +0530

    formats: Fix bad passsthrough check
    
    Fixes breakage from commit adbdb6259becab57fff893671e58fff5786420db

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 4cd51d7..7aee546 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -321,7 +321,7 @@ int pa_sink_input_new(
     pa_return_val_if_fail(pa_channel_map_compatible(&data->channel_map, &data->sample_spec), -PA_ERR_INVALID);
 
     /* Don't restore (or save) stream volume for passthrough streams */
-    if (!pa_sink_input_new_data_is_passthrough(data)) {
+    if (pa_sink_input_new_data_is_passthrough(data)) {
         data->volume_is_set = FALSE;
         data->volume_factor_is_set = FALSE;
     }
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index d99bafe..ce94095 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -299,7 +299,7 @@ int pa_source_output_new(
     pa_return_val_if_fail(pa_channel_map_compatible(&data->channel_map, &data->sample_spec), -PA_ERR_INVALID);
 
     /* Don't restore (or save) stream volume for passthrough streams */
-    if (!pa_source_output_new_data_is_passthrough(data)) {
+    if (pa_source_output_new_data_is_passthrough(data)) {
         data->volume_is_set = FALSE;
         data->volume_factor_is_set = FALSE;
     }

commit 814c0371a493cf47df4e6e27253cfd5ec3cef783
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Wed Aug 17 22:38:43 2011 +0530

    alsa: Open iec958 device with NONAUDIO bit set in passthrough mode
    
    This is required for E-AC3 streams, as well as to let receivers we're
    sending non-PCM data (which avoids playing noise if the data is
    incorrect for some reason).

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 2bf19c6..88a7506 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -990,13 +990,22 @@ static int unsuspend(struct userdata *u) {
     int err;
     pa_bool_t b, d;
     snd_pcm_uframes_t period_size, buffer_size;
+    char *device_name = NULL;
 
     pa_assert(u);
     pa_assert(!u->pcm_handle);
 
     pa_log_info("Trying resume...");
 
-    if ((err = snd_pcm_open(&u->pcm_handle, u->device_name, SND_PCM_STREAM_PLAYBACK,
+    if ((is_spdif(u) || is_hdmi(u)) && pa_sink_is_passthrough(u->sink)) {
+        /* Need to open device in NONAUDIO mode */
+        int len = strlen(u->device_name) + 8;
+
+        device_name = pa_xmalloc(len);
+        pa_snprintf(device_name, len, "%s,AES0=6", u->device_name);
+    }
+
+    if ((err = snd_pcm_open(&u->pcm_handle, device_name ? device_name : u->device_name, SND_PCM_STREAM_PLAYBACK,
                             SND_PCM_NONBLOCK|
                             SND_PCM_NO_AUTO_RESAMPLE|
                             SND_PCM_NO_AUTO_CHANNELS|
@@ -1050,6 +1059,7 @@ static int unsuspend(struct userdata *u) {
 
     pa_log_info("Resumed successfully...");
 
+    pa_xfree(device_name);
     return 0;
 
 fail:
@@ -1058,6 +1068,8 @@ fail:
         u->pcm_handle = NULL;
     }
 
+    pa_xfree(device_name);
+
     return -PA_ERR_IO;
 }
 



More information about the pulseaudio-commits mailing list