Philippe Latulippe | 26 Jul 12:12 2016
Picon
Gravatar

Multiple Bluetooth sources

Hello!

I would like to connect many Bluetooth sources (devices that emit
audio over bluetooth) and listen to them simultaneously. I am using
Pulseaudio 5.0 and BlueZ 5.23.

I managed to connect a single device and listen to it using the
loopback module. But when I try to connect a second device, it
immediately disconnects.

Using hcidump, I can see that it all goes wrong with this packet, sent
by the device receiving audio:

< ACL data: handle 62 flags 0x00 dlen 10
    L2CAP(d): cid 0x0042 len 6 [psm 25]
      AVDTP(s): Discover rsp: transaction 0 nsp 0x00
        ACP SEID 1 - Audio Source
        ACP SEID 2 - Audio Sink (InUse)

Notice how the sink is marked as InUse. After seeing this, the source
ends the Bluetooth connection.

It would seem that a BlueZ sink can only be used by one device. Is
Pulseaudio supposed to register multiple endpoints with BlueZ, one for
each device? Or is this an issue with BlueZ?

Cheers,
Philippe
_______________________________________________
pulseaudio-discuss mailing list
(Continue reading)

Dhananjay Joshi | 23 Jul 14:38 2016
Picon

Issue in libpulse crash for calc_next_timeout

Hi
we are getting the below assertion failed in libpulse ultimately causes crash.

static pa_usec_t calc_next_timeout(pa_mainloop *m) {
    pa_time_event *t;
    pa_usec_t clock_now;

    if (m->n_enabled_time_events <= 0)
        return PA_USEC_INVALID;

    pa_assert_se(t = find_next_time_event(m)); //// assertion failed here and causes the crash

    if (t->time <= 0)
        return 0;

    clock_now = pa_rtclock_now();

    if (t->time <= clock_now)
        return 0;

    return t->time - clock_now;
}


this crash happened due to the following API call.

pa_context_suspend_sink_by_name(context,sink_name,suspend/resume,NULL.NULL);

above function causes a crash in libpulse code.

#0  __GI_raise (sig=sig <at> entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:57
#1  0xb6bd5690 in __GI_abort () at abort.c:89
#2  0xb525dbe0 in calc_next_timeout (m=<optimized out>) at /usr/src/debug/pulseaudio/6.0-r0/pulseaudio-6.0/src/pulse/mainloop.c:719
#3  pa_mainloop_prepare (m=0x0, m <at> entry=0xb37d8, timeout=timeout <at> entry=-1) at /usr/src/debug/pulseaudio/6.0-r0/pulseaudio-6.0/src/pulse/mainloop.c:800
#4  0xb525e4dc in pa_mainloop_iterate (m=m <at> entry=0xb37d8, block=block <at> entry=1, retval=retval <at> entry=0x0) at /usr/src/debug/pulseaudio/6.0-r0/pulseaudio-6.0/src/pulse/mainloop.c:923
#5  0xb525e5bc in pa_mainloop_run (m=0xb37d8, retval=retval <at> entry=0x0) at /usr/src/debug/pulseaudio/6.0-r0/pulseaudio-6.0/src/pulse/mainloop.c:944
#6  0xb526e1a0 in thread (userdata=0xb2820) at /usr/src/debug/pulseaudio/6.0-r0/pulseaudio-6.0/src/pulse/thread-mainloop.c:88
#7  0xb51fc11c in internal_thread_func (userdata=0xb62c0) at /usr/src/debug/pulseaudio/6.0-r0/pulseaudio-6.0/src/pulsecore/thread-posix.c:81
#8  0xb6df4040 in start_thread (arg=0xb00fe420) at pthread_create.c:314

Note: This issue occurs randomly. with pulseaudio-6.0

Request to help in resolution of this issue:

Regards,
Dhananjay


_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Adam Seering | 23 Jul 09:10 2016
Picon

libpulse clients with no datagram sockets?

Hi all,
    I have a bit of an odd question:  Is there any pulse client
configuration that does not use datagram sockets at all, internally or
externally?

    As background:  I'm playing with the new Windows Subsystem for
Linux, which lets you run Linux userspace binaries directly on top of
the NT kernel.  (It ships with an Ubuntu 14.04 chroot.)  I want my
Linux binaries to be able to play sound.  WSL doesn't expose hardware
to the Linux userspace, but it does expose TCP.  And there exists a
Windows build of pulseaudio.  So I'm thinking, run a Windows
pulseaudio daemon, configure it to listen over TCP, and modify WSL's
/etc/pulse/client.conf to instruct all libpulse-based applications to
connect over TCP.

    Nice plan; not-so-simple execution:  WSL implements many aspects
of Linux, but its initial release still lacks SOCK_DGRAM sockets.
When I make the required modifications to client.conf, I see the
following in 'strace', followed immediately by an error message and a
failure to play audio:

socketpair(PF_LOCAL, SOCK_DGRAM, 0, 0x21daae0) = -1 ESOCKTNOSUPPORT
(Socket type not supported)

    The only reference to socketpair() I can find in the libpulse
source code is in src/pulse/def/h , on "struct pa_spawn_api".  Looking
briefly through the source, it looks like the libpulse-based
application might be spinning up a side process of some sort and using
the datagram socket to communicate with that process?

Thanks,
Adam
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Doug McCasland | 21 Jul 17:40 2016
Picon

add delay

Hi, not sure if this got sent already...

My setup:
- Ubuntu headless  TigerVNC server
- Windows 10 PC on same LAN (gigabit), with speakers and Cygwin 
pulseaudio.exe daemon, TigerVNC viewer

I'm sending sound from Linux to Windows with this setting in Linux 
/etc/pulse/client.conf:

default-server = winhostname

Problem is when watching a video (being rendered by the browser on 
Linux), the sound is ahead of the video in Windows VNCViewer by about a 
half-second as heard on the Windows speakers.

Is there a way to delay the sound sent from Linux to Windows?

I see there is latency_msec  in module-loopback, but I don't know to 
configure that.

thanks

--

-- 
Doug McCasland
San Francisco

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Sangchul Lee | 20 Jul 18:21 2016
Picon

[PATCH 0/3] role-ducking: Add support for fading feature

Fading feature in case of ducking/unducking can be applied as per module arguments.
It also can be set by groups according to the configuration. We expect it can bring
a better audio experience to user.

Sangchul Lee (3):
  stream-interaction: Modify codes to use idxset and macro
  stream-interaction: Add support for fading in case of ducking/unducking
  role-ducking: Add support for fading feature

 src/modules/module-role-ducking.c |   4 +
 src/modules/stream-interaction.c  | 298 +++++++++++++++++++++++++++++++-------
 2 files changed, 251 insertions(+), 51 deletions(-)

--
These patches are based on the previous patches for volume ramping.
It could be revised as a change of the previous patches that are not merged yet.
2.7.4

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Felipe Sateler | 20 Jul 15:57 2016
Picon

[PATCH] launch: make pulseaudio.service properly order and require the socket

This commit fixes two problems:

1. Because there are no implicit dependencies between sockets and services,
   the socket, as set up by systemd will race with the socket, as set up
   by the pulseaudio daemon. This can cause the pulseaudio.socket unit to
   fail (even though the pulseaudio service started just fine), which can
   confuse users.
2. While it is possible to use the service without the socket, it is not
   clear why it would be desirable. And a user installing pulseaudio and
   doing `systemctl --user start pulseaudio` will not get the socket
   started, which might be confusing and problematic if the server is to
   be restarted later on, as the client autospawn feature might kick in.
---
 src/daemon/systemd/user/pulseaudio.service.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/daemon/systemd/user/pulseaudio.service.in b/src/daemon/systemd/user/pulseaudio.service.in
index df42fc3..0bd2a91 100644
--- a/src/daemon/systemd/user/pulseaudio.service.in
+++ b/src/daemon/systemd/user/pulseaudio.service.in
 <at>  <at>  -1,5 +1,7  <at>  <at> 
 [Unit]
 Description=Sound Service
+Requires=pulseaudio.socket
+After=pulseaudio.socket

 [Service]
 # Note that notify will only work if --daemonize=no
--

-- 
2.8.1

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Alexandros Chronopoulos | 17 Jul 06:20 2016
Picon

Write callback during stream setup

I wonder if I can de-activate the auto call of write callback existing before uncork a stream.

Reading the documentation I had the impression that if prebuf attribute is set to 0 and make use of PA_STREAM_START_CORKED flag in playback connect, playback will not start automatically. In practice using the above does not prevent the write callback to be triggered once during the setup.

In order to achieve the desired behavior I register the write callback after calling the connect method and after stream get in ready state. In addition I had to combine this with the configuration above (prebuf == 0 and the flag set). If prebuf==-1 and the flag is set with this workaround write callback is never called even after uncork the stream

My question is if this is a valid method to achieve the desired behavior and if not which is the best way to do it?

Thanks!
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Wim Taymans | 15 Jul 11:05 2016
Picon
Gravatar

Access control

Hi guys,

I'm having another look at the access control patches. I revived my old
patches and found some trouble with the async stuff that I fixed here:


There is also an example on how to start and complete an async access
check for starting a recording. I believe Ahmed Darwish is building on
top of that so it might be useful to get it working.

Now I'm taking a look at the info in pa_client that is available to decide
what access checks we need to do for each client.

Ideally we would need the pid of the process with we can currently find
in the pa_proplist of the client. Unfortunately this pid is whatever the client
sends us in a proplist in the set_client_name command so we need something
more secure.

We do send the pid and gid with the SCM_CREDENTIALS ancillary data in
the AUTH command. Since the kernel checks things, we can be guaranteed
that when we get the credentials, they are correct. 

What I would like to do is make these credentials available somewhere. I
would like to make a new key in the client proplist with the verified pid from
the credentials but the problem is that we then need to make sure that a
set_client_name command can't overwrite the value, which involves some
filtering or keys.

Alternatively we could make a new pa_client field to store the verified pid
and gid.. Does this sound better or worse?

Wim







_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Arun Raghavan | 14 Jul 04:38 2016
Picon

[PATCH] daemon: Tone down system mode snarkiness

We do support system mode for the cases where it makes sense, so it's
really not sensible to be unconditionally snarky at our users for doing
it.

Signed-off-by: Arun Raghavan <arun <at> arunraghavan.net>
---
 src/daemon/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/daemon/main.c b/src/daemon/main.c
index a5faba5..15b862e 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
 <at>  <at>  -972,8 +972,7  <at>  <at>  int main(int argc, char *argv[]) {
     pa_log_info("Running in system mode: %s", pa_yes_no(pa_in_system_mode()));

     if (pa_in_system_mode())
-        pa_log_warn(_("OK, so you are running PA in system mode. Please note that you most likely shouldn't be
doing that.\n"
-                      "If you do it nonetheless then it's your own fault if things don't work as expected.\n"
+        pa_log_warn(_("OK, so you are running PA in system mode. Please make sure that you actually do want to do that.\n"
                       "Please read
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/
for an explanation why system mode is usually a bad idea."));

     if (conf->use_pid_file) {
--

-- 
2.7.4

_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Sangchul Lee | 7 Jul 21:00 2016
Picon

[PATCH 4/4] sink, sink-input: Code cleanup regarding volume ramping

Remove unused parameter of
pa_sink_input_set_volume_ramp()/pa_sink_set_volume_ramp().
Use bool instead of pa_bool_t.

Signed-off-by: Sangchul Lee <sc11.lee <at> samsung.com>
---
 src/pulsecore/sink-input.c | 7 ++-----
 src/pulsecore/sink-input.h | 2 +-
 src/pulsecore/sink.c       | 3 +--
 src/pulsecore/sink.h       | 2 +-
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 50dc992..7fa9c84 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
 <at>  <at>  -929,7 +929,6  <at>  <at>  void pa_sink_input_peek(pa_sink_input *i, size_t
slength /* in sink bytes */, pa
             pa_memchunk wchunk;
             bool nvfs = need_volume_factor_sink;
             pa_cvolume target;
-            pa_bool_t tmp;

             wchunk = tchunk;
             pa_memblock_ref(wchunk.memblock);
 <at>  <at>  -970,7 +969,7  <at>  <at>  void pa_sink_input_peek(pa_sink_input *i, size_t
slength /* in sink bytes */, pa
                 if (pa_cvolume_ramp_active(&i->thread_info.ramp)) {
                     pa_memchunk_make_writable(&wchunk, 0);
                     pa_volume_ramp_memchunk(&wchunk,
&i->sink->sample_spec, &(i->thread_info.ramp));
-                } else if ((tmp =
pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) {
+                } else if
((pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) {
                     pa_memchunk_make_writable(&wchunk, 0);
                     pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target);
                     pa_volume_memchunk(&wchunk,
&i->sink->sample_spec, &target);
 <at>  <at>  -1370,9 +1369,7  <at>  <at>  int
pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key)
{
 void pa_sink_input_set_volume_ramp(
         pa_sink_input *i,
         const pa_cvolume_ramp *ramp,
-        pa_bool_t send_msg,
-        pa_bool_t save) {
-
+        bool send_msg) {
     pa_sink_input_assert_ref(i);
     pa_assert_ctl_context();
     pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index 85a0e54..0efc7e0 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.h
 <at>  <at>  -376,7 +376,7  <at>  <at>  void pa_sink_input_set_volume(pa_sink_input *i,
const pa_cvolume *volume, bool s
 void pa_sink_input_add_volume_factor(pa_sink_input *i, const char
*key, const pa_cvolume *volume_factor);
 int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key);
 pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume
*volume, bool absolute);
-void pa_sink_input_set_volume_ramp(pa_sink_input *i, const
pa_cvolume_ramp *ramp, pa_bool_t send_msg, pa_bool_t save);
+void pa_sink_input_set_volume_ramp(pa_sink_input *i, const
pa_cvolume_ramp *ramp, bool send_msg);

 void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save);

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 0450f52..82b5268 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
 <at>  <at>  -2144,8 +2144,7  <at>  <at>  void pa_sink_set_volume(
 void pa_sink_set_volume_ramp(
         pa_sink *s,
         const pa_cvolume_ramp *ramp,
-        pa_bool_t send_msg,
-        pa_bool_t save) {
+        bool send_msg) {

     pa_sink_assert_ref(s);
     pa_assert_ctl_context();
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index 85f1ddf..d4993af 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
 <at>  <at>  -462,12 +462,12  <at>  <at>  void pa_sink_leave_passthrough(pa_sink *s);

 void pa_sink_set_volume(pa_sink *sink, const pa_cvolume *volume, bool
sendmsg, bool save);
 const pa_cvolume *pa_sink_get_volume(pa_sink *sink, bool force_refresh);
+void pa_sink_set_volume_ramp(pa_sink *s, const pa_cvolume_ramp *ramp,
bool send_msg);

 void pa_sink_set_mute(pa_sink *sink, bool mute, bool save);
 bool pa_sink_get_mute(pa_sink *sink, bool force_refresh);

 bool pa_sink_update_proplist(pa_sink *s, pa_update_mode_t mode,
pa_proplist *p);
-void pa_sink_set_volume_ramp(pa_sink *s, const pa_cvolume_ramp *ramp,
pa_bool_t send_msg, pa_bool_t save);

 int pa_sink_set_port(pa_sink *s, const char *name, bool save);
 void pa_sink_set_mixer_dirty(pa_sink *s, bool is_dirty);
--

-- 
2.7.4
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
Sangchul Lee | 7 Jul 20:57 2016
Picon

[PATCH 3/4] volume ramp: adding volume ramping to sink-input

The original patch is
 - https://review.tizen.org/git/?p=platform/upstream/pulseaudio.git;a=commit;h=98042248fd67ce0ab3807c5c472c0d5d8b0f99d3
 - by Jaska Uimonen <jaska.uimonen <at> helsinki.fi>

Signed-off-by: Sangchul Lee <sc11.lee <at> samsung.com>
---
 src/pulsecore/sink-input.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 src/pulsecore/sink-input.h | 12 +++++++++-
 2 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index a7f6d55..50dc992 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
 <at>  <at>  -526,6 +526,11  <at>  <at>  int pa_sink_input_new(
     reset_callbacks(i);
     i->userdata = NULL;

+    if (data->flags & PA_SINK_INPUT_START_RAMP_MUTED)
+        pa_cvolume_ramp_int_init(&i->ramp, PA_VOLUME_MUTED,
data->sample_spec.channels);
+    else
+        pa_cvolume_ramp_int_init(&i->ramp, PA_VOLUME_NORM,
data->sample_spec.channels);
+
     i->thread_info.state = i->state;
     i->thread_info.attached = false;
     pa_atomic_store(&i->thread_info.drained, 1);
 <at>  <at>  -542,6 +547,8  <at>  <at>  int pa_sink_input_new(
     i->thread_info.playing_for = 0;
     i->thread_info.direct_outputs =
pa_hashmap_new(pa_idxset_trivial_hash_func,
pa_idxset_trivial_compare_func);

+    i->thread_info.ramp = i->ramp;
+
     pa_assert_se(pa_idxset_put(core->sink_inputs, i, &i->index) == 0);
     pa_assert_se(pa_idxset_put(i->sink->inputs, pa_sink_input_ref(i),
NULL) == 0);

 <at>  <at>  -921,6 +928,8  <at>  <at>  void pa_sink_input_peek(pa_sink_input *i, size_t
slength /* in sink bytes */, pa
         while (tchunk.length > 0) {
             pa_memchunk wchunk;
             bool nvfs = need_volume_factor_sink;
+            pa_cvolume target;
+            pa_bool_t tmp;

             wchunk = tchunk;
             pa_memblock_ref(wchunk.memblock);
 <at>  <at>  -957,6 +966,16  <at>  <at>  void pa_sink_input_peek(pa_sink_input *i, size_t
slength /* in sink bytes */, pa
                     pa_volume_memchunk(&wchunk,
&i->sink->sample_spec, &i->volume_factor_sink);
                 }

+                /* check for possible volume ramp */
+                if (pa_cvolume_ramp_active(&i->thread_info.ramp)) {
+                    pa_memchunk_make_writable(&wchunk, 0);
+                    pa_volume_ramp_memchunk(&wchunk,
&i->sink->sample_spec, &(i->thread_info.ramp));
+                } else if ((tmp =
pa_cvolume_ramp_target_active(&(i->thread_info.ramp)))) {
+                    pa_memchunk_make_writable(&wchunk, 0);
+                    pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target);
+                    pa_volume_memchunk(&wchunk,
&i->sink->sample_spec, &target);
+                }
+

pa_memblockq_push_align(i->thread_info.render_memblockq, &wchunk);
             } else {
                 pa_memchunk rchunk;
 <at>  <at>  -973,6 +992,16  <at>  <at>  void pa_sink_input_peek(pa_sink_input *i, size_t
slength /* in sink bytes */, pa
                         pa_volume_memchunk(&rchunk,
&i->sink->sample_spec, &i->volume_factor_sink);
                     }

+                    /* check for possible volume ramp */
+                    if (pa_cvolume_ramp_active(&(i->thread_info.ramp))) {
+                        pa_memchunk_make_writable(&rchunk, 0);
+                        pa_volume_ramp_memchunk(&rchunk,
&i->sink->sample_spec, &(i->thread_info.ramp));
+                    } else if
(pa_cvolume_ramp_target_active(&(i->thread_info.ramp))) {
+                        pa_memchunk_make_writable(&rchunk, 0);
+
pa_cvolume_ramp_get_targets(&i->thread_info.ramp, &target);
+                        pa_volume_memchunk(&rchunk,
&i->sink->sample_spec, &target);
+                    }
+

pa_memblockq_push_align(i->thread_info.render_memblockq, &rchunk);
                     pa_memblock_unref(rchunk.memblock);
                 }
 <at>  <at>  -1337,6 +1366,31  <at>  <at>  int
pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key)
{
     return 0;
 }

+/* Called from main thread */
+void pa_sink_input_set_volume_ramp(
+        pa_sink_input *i,
+        const pa_cvolume_ramp *ramp,
+        pa_bool_t send_msg,
+        pa_bool_t save) {
+
+    pa_sink_input_assert_ref(i);
+    pa_assert_ctl_context();
+    pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
+    pa_assert(ramp);
+
+    pa_cvolume_ramp_convert(ramp, &i->ramp, i->sample_spec.rate);
+
+    pa_log_debug("setting volume ramp with target vol:%d and length:%ld",
+ i->ramp.ramps[0].target,
+ i->ramp.ramps[0].length);
+
+
+    /* This tells the sink that volume ramp changed */
+    if (send_msg)
+        pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq,
PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP,
+                                       NULL, 0, NULL) == 0);
+}
+
 /* Called from main context */
 static void set_real_ratio(pa_sink_input *i, const pa_cvolume *v) {
     pa_sink_input_assert_ref(i);
 <at>  <at>  -2015,6 +2069,12  <at>  <at>  int pa_sink_input_process_msg(pa_msgobject *o,
int code, void *userdata, int64_t
             }
             return 0;

+        case PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP:
+            /* we have ongoing ramp where we take current start values */
+            pa_cvolume_ramp_start_from(&i->thread_info.ramp, &i->ramp);
+            i->thread_info.ramp = i->ramp;
+            return 0;
+
         case PA_SINK_INPUT_MESSAGE_SET_SOFT_MUTE:
             if (i->thread_info.muted != i->muted) {
                 i->thread_info.muted = i->muted;
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index 8bbee4e..85a0e54 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.h
 <at>  <at>  -32,6 +32,7  <at>  <at> 
 #include <pulsecore/client.h>
 #include <pulsecore/sink.h>
 #include <pulsecore/core.h>
+#include <pulsecore/mix.h>

 typedef enum pa_sink_input_state {
     PA_SINK_INPUT_INIT,         /*< The stream is not active yet,
because pa_sink_input_put() has not been called yet */
 <at>  <at>  -58,7 +59,8  <at>  <at>  typedef enum pa_sink_input_flags {
     PA_SINK_INPUT_DONT_INHIBIT_AUTO_SUSPEND = 256,
     PA_SINK_INPUT_NO_CREATE_ON_SUSPEND = 512,
     PA_SINK_INPUT_KILL_ON_SUSPEND = 1024,
-    PA_SINK_INPUT_PASSTHROUGH = 2048
+    PA_SINK_INPUT_PASSTHROUGH = 2048,
+    PA_SINK_INPUT_START_RAMP_MUTED = 4096,
 } pa_sink_input_flags_t;

 struct pa_sink_input {
 <at>  <at>  -121,6 +123,9  <at>  <at>  struct pa_sink_input {
      * this.*/
     bool save_sink:1, save_volume:1, save_muted:1;

+    /* for volume ramps */
+    pa_cvolume_ramp_int ramp;
+
     pa_resample_method_t requested_resample_method, actual_resample_method;

     /* Returns the chunk of audio data and drops it from the
 <at>  <at>  -249,6 +254,8  <at>  <at>  struct pa_sink_input {
         pa_usec_t requested_sink_latency;

         pa_hashmap *direct_outputs;
+
+        pa_cvolume_ramp_int ramp;
     } thread_info;

     void *userdata;
 <at>  <at>  -265,6 +272,7  <at>  <at>  enum {
     PA_SINK_INPUT_MESSAGE_SET_STATE,
     PA_SINK_INPUT_MESSAGE_SET_REQUESTED_LATENCY,
     PA_SINK_INPUT_MESSAGE_GET_REQUESTED_LATENCY,
+    PA_SINK_INPUT_MESSAGE_SET_VOLUME_RAMP,
     PA_SINK_INPUT_MESSAGE_MAX
 };

 <at>  <at>  -368,11 +376,13  <at>  <at>  void pa_sink_input_set_volume(pa_sink_input *i,
const pa_cvolume *volume, bool s
 void pa_sink_input_add_volume_factor(pa_sink_input *i, const char
*key, const pa_cvolume *volume_factor);
 int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key);
 pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume
*volume, bool absolute);
+void pa_sink_input_set_volume_ramp(pa_sink_input *i, const
pa_cvolume_ramp *ramp, pa_bool_t send_msg, pa_bool_t save);

 void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save);

 void pa_sink_input_set_property(pa_sink_input *i, const char *key,
const char *value);
 void pa_sink_input_set_property_arbitrary(pa_sink_input *i, const
char *key, const uint8_t *value, size_t nbytes);
+
 void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t
mode, pa_proplist *p);

 pa_resample_method_t pa_sink_input_get_resample_method(pa_sink_input *i);
--

-- 
2.7.4
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss <at> lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Gmane