Re: [pulseaudio-discuss] [PATCH] Add a target to the PA log feature and improve PA log core

2011-02-24 Thread Becker, VincentX
From: Maarten Bosmans [mailto:mkbosm...@gmail.com]

2011/2/23 Becker, VincentX vincentx.bec...@intel.com:
 Thanks for your review Maarten. So you suggest to split this into
several patches (2). One for the outer implementation and the other for
the inner one. I will try to attend to the irc meeting tomorrow so I can
catch your remarks in real time.

I'm not sure what you mean by outer and inner implementation. What I
meant was one patch thats adds the option to log to a file (this patch
touches all four files) and one patch that does the metadata,
append_data thing (should only change src/pulsecore/log.c)

Having two clean patches (see my other comments) tomorrow would help
to keep thing moving in the meeting.

Hi Maarten, 
Here are the 2 patches as you suggested (both patches can be compiled 
separately). I also integrated one of your remarks, but not all. Like 
concerning the file naming, as you said it might be a bit too complicated and 
appending the file or creating a new one might be enough. But it remains a 
powerful way to debug pulseaudio and it is more direct than using syslog.
I also wrote a module dedicated to log PCM samples, configurable for sinks 
and/or sources with or without their respective sink inputs/source outputs. I 
will submit it probably next month.

Vince


Sorry for getting this rolling on such a short notice.
No problem at all!

Maarten


 Cheers,
 V.
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: Les Montalets- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


0001-Add-a-new-log-target-to-a-file-descriptor-in-daemon-.patch
Description: 0001-Add-a-new-log-target-to-a-file-descriptor-in-daemon-.patch


0001-Format-log-messages-with-generic-prepended-and-appen.patch
Description: 0001-Format-log-messages-with-generic-prepended-and-appen.patch
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Add a target to the PA log feature and improve PA log core

2011-02-24 Thread Maarten Bosmans
2011/2/24 Becker, VincentX vincentx.bec...@intel.com:
From: Maarten Bosmans [mailto:mkbosm...@gmail.com]
2011/2/23 Becker, VincentX vincentx.bec...@intel.com:
 Thanks for your review Maarten. So you suggest to split this into
several patches (2). One for the outer implementation and the other for
the inner one. I will try to attend to the irc meeting tomorrow so I can
catch your remarks in real time.

I'm not sure what you mean by outer and inner implementation. What I
meant was one patch thats adds the option to log to a file (this patch
touches all four files) and one patch that does the metadata,
append_data thing (should only change src/pulsecore/log.c)

Having two clean patches (see my other comments) tomorrow would help
to keep thing moving in the meeting.

 Hi Maarten,
 Here are the 2 patches as you suggested (both patches can be compiled 
 separately). I also integrated one of your remarks, but not all. Like 
 concerning the file naming, as you said it might be a bit too complicated and 
 appending the file or creating a new one might be enough. But it remains a 
 powerful way to debug pulseaudio and it is more direct than using syslog.
 I also wrote a module dedicated to log PCM samples, configurable for sinks 
 and/or sources with or without their respective sink inputs/source outputs. I 
 will submit it probably next month.

 Vince

But these two patches cannot be appied on top of eachother, as
PA_LOG_FILED is added in log.h in both. Also, I would expect the two
case PA_LOG_FILED branches to be introduced in the
0001-Add-a-new-log-target-to-a-file-descriptor-in-daemon patch, not
the other one.

Anyway, I added a link to the meeting page
http://pulseaudio.org/wiki/Meetings/2011-02-24 , we'll see where it
goes.

Maarten
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] command-line control - increase/decrease volume of default output

2011-02-24 Thread Ng Oon-Ee
Hi all,

It seems the only way to achieve the above would be to script the
following:-

1. Obtain the default device using pacmd list-sinks | grep * or
similar
2. Get that device's current volume using some multi-line parsing of
pacmd list-sinks or pacmd info (output in %)
3. Convert the given % to the hex input expected by pacmd
set-sink-volume
4. Actually set the new volume

Is there an easier way to do this? pacmd isn't really VERY
script-friendly. To be fair that's probably not its purpose, I guess,
but it would be nice if Pulse as a Linux app was as scriptable as most
older Linux apps.

Alternatively, is there a 'shortcut' dbus method to do the above?

And yes, of course I could just use gnome volume control, not all
systems have gnome installed though (I'm looking at getting it off my
system actually, since I stopped using the DE itself).

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] command-line control - increase/decrease volume of default output

2011-02-24 Thread Colin Guthrie
'Twas brillig, and Ng Oon-Ee at 24/02/11 12:07 did gyre and gimble:
 Hi all,
 
 It seems the only way to achieve the above would be to script the
 following:-
 
 1. Obtain the default device using pacmd list-sinks | grep * or
 similar
 2. Get that device's current volume using some multi-line parsing of
 pacmd list-sinks or pacmd info (output in %)
 3. Convert the given % to the hex input expected by pacmd
 set-sink-volume
 4. Actually set the new volume
 
 Is there an easier way to do this? pacmd isn't really VERY
 script-friendly. To be fair that's probably not its purpose, I guess,
 but it would be nice if Pulse as a Linux app was as scriptable as most
 older Linux apps.
 
 Alternatively, is there a 'shortcut' dbus method to do the above?
 
 And yes, of course I could just use gnome volume control, not all
 systems have gnome installed though (I'm looking at getting it off my
 system actually, since I stopped using the DE itself).

When alsa redirection is available I find that amixer set Master +5%
works fine :D

But it would be nice to have a simple cmd-line tool that did some basic
tasks more easily... e.g. change volume of the default or a given sink,
changed the volume of a given stream, changed the device of a given
stream list the devices, list the streams.

If it did all this in a consume from script friendly kind of way, then
I'd happily include it and ship it with PA as it's something that does
crop up fairly often.

Patches welcome :D

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] command-line control - increase/decrease volume of default output

2011-02-24 Thread Ng Oon-Ee
On Thu, 2011-02-24 at 12:46 +, Colin Guthrie wrote:
 'Twas brillig, and Ng Oon-Ee at 24/02/11 12:07 did gyre and gimble:
  Hi all,
  
  It seems the only way to achieve the above would be to script the
  following:-
  
  1. Obtain the default device using pacmd list-sinks | grep * or
  similar
  2. Get that device's current volume using some multi-line parsing of
  pacmd list-sinks or pacmd info (output in %)
  3. Convert the given % to the hex input expected by pacmd
  set-sink-volume
  4. Actually set the new volume
  
  Is there an easier way to do this? pacmd isn't really VERY
  script-friendly. To be fair that's probably not its purpose, I guess,
  but it would be nice if Pulse as a Linux app was as scriptable as most
  older Linux apps.
  
  Alternatively, is there a 'shortcut' dbus method to do the above?
  
  And yes, of course I could just use gnome volume control, not all
  systems have gnome installed though (I'm looking at getting it off my
  system actually, since I stopped using the DE itself).
 
 When alsa redirection is available I find that amixer set Master +5%
 works fine :D
 
 But it would be nice to have a simple cmd-line tool that did some basic
 tasks more easily... e.g. change volume of the default or a given sink,
 changed the volume of a given stream, changed the device of a given
 stream list the devices, list the streams.
 
 If it did all this in a consume from script friendly kind of way, then
 I'd happily include it and ship it with PA as it's something that does
 crop up fairly often.
 
 Patches welcome :D
 
 Col
 
This would have to be part of pacmd or separate? I thought this is what pactl 
was supposed to be for, but it seems development on that just stopped.

And yes I forgot I had alsa's ctl bound to hardware, that would be a
workaround. I still think PA should have something to cater to the
commandline, but yes it would need code of course. I may look into it
once I graduate...


___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 0/6] Volume sharing

2011-02-24 Thread Tanu Kaskinen
Here's a bunch of patches related to the volume sharing feature. The first
patch is the main one. It's now tested to some degree (quite well, I believe),
but of course reviewing should still be done. The rest of the patches are fixes
and improvements for the virtual sink and source modules, which I used for
testing the new functionality.

Tanu Kaskinen (6):
  Implement the volume sharing feature.
  virtual-sink: Add a modarg for enabling volume sharing.
  virtual-sink: Add a modarg for forcing flat volume.
  virtual-sink/source: Use a more descriptive stream name.
  virtual-sink/source: Remove an unused variable.
  virtual-sink: Fix a crash when moving the sink to a new master right
after setup.

 src/modules/module-virtual-sink.c   |   48 ++-
 src/modules/module-virtual-source.c |7 +-
 src/modules/rtp/rtp.h   |3 +
 src/pulse/def.h |   11 +
 src/pulsecore/play-memblockq.c  |6 +
 src/pulsecore/protocol-native.c |2 +-
 src/pulsecore/sink-input.c  |  204 +++--
 src/pulsecore/sink.c|  555 +--
 src/pulsecore/sink.h|4 +
 9 files changed, 633 insertions(+), 207 deletions(-)

-- 
1.7.3.4

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 1/6] Implement the volume sharing feature.

2011-02-24 Thread Tanu Kaskinen
When we have a filter sink that does some processing, currently the
benefits of the flat volume feature are not really available. That's
because if you have a music player that is connected to the filter sink,
the hardware sink doesn't have any idea of the music player's stream
volume.

This problem is solved by this volume sharing feature. The volume
sharing feature works so that the filter sinks that want to avoid the
previously described problem declare that they don't want to have
independent volume, but they follow the master sink volume instead.
The PA_SINK_SHARE_VOLUME_WITH_MASTER sink flag is used for that
declaration. Then the volume logic is changed so that the hardware
sink calculates its real volume using also the streams connected to the
filter sink in addition to the streams that are connected directly to
the hardware sink. Basically we're trying to create an illusion that
from volume point of view all streams are connected directly to the
hardware sink.

For that illusion to work, the volumes of the filter sinks and their
virtual streams have to be managed carefully according to a set of
rules:

If a filter sink follows the hardware sink volume, then the filter sink's
 * reference_volume always equals the hw sink's reference_volume
 * real_volume always equals the hw sink's real_volume
 * soft_volume is always 0dB (ie. no soft volume)

If a filter sink doesn't follow the hardware sink volume, then the filter
sink's
 * reference_volume can be whatever (completely independent from the hw sink)
 * real_volume always equals reference_volume
 * soft_volume always equals real_volume (and reference_volume)

If a filter sink follows the hardware sink volume, and the hardware sink
supports flat volume, then the filter sink's virtual stream's
 * volume always equals the hw sink's real_volume
 * reference_ratio is calculated normally from the stream volume and the hw
   sink's reference_volume
 * real_ratio always equals 0dB (follows from the first point)
 * soft_volume always equals volume_factor (follows from the previous point)

If a filter sink follows the hardware sink volume, and the hardware sink
doesn't support flat volume, then the filter sink's virtual stream's
 * volume is always 0dB
 * reference_ratio is always 0dB
 * real_ratio is always 0dB
 * soft_volume always equals volume_factor

If a filter sink doesn't follow the hardware sink volume, then the filter
sink's virtual stream is handled as a regular stream.

Since the volumes of the virtual streams are controlled by a set of rules,
the user is not allowed to change the virtual streams' volumes. It would
probably also make sense to forbid changing the filter sinks' volume, but
that's not strictly necessary, and currently changing a filter sink's volume
changes actually the hardware sink's volume, and from there it propagates to
all filter sinks (funny effects are expected when adjusting a single
channel in cases where all sinks don't have the same channel maps).
---
 src/pulse/def.h |   11 +
 src/pulsecore/protocol-native.c |2 +-
 src/pulsecore/sink-input.c  |  204 +--
 src/pulsecore/sink.c|  555 ---
 src/pulsecore/sink.h|4 +
 5 files changed, 591 insertions(+), 185 deletions(-)

diff --git a/src/pulse/def.h b/src/pulse/def.h
index 4a8da13..f6de7b3 100644
--- a/src/pulse/def.h
+++ b/src/pulse/def.h
@@ -749,6 +749,16 @@ typedef enum pa_sink_flags {
 /** The HW volume changes are syncronized with SW volume.
  * \since 1.0 */
 
+/** \cond fulldocs */
+/* PRIVATE: Server-side values -- do not try to use these at client-side.
+ * The server will filter out these flags anyway, so you should never see
+ * these flags in sinks. */
+
+PA_SINK_SHARE_VOLUME_WITH_MASTER = 0x0400U,
+/** This sink shares the volume with the master sink (used by some filter
+ * sinks). */
+/** \endcond */
+
 } pa_sink_flags_t;
 
 /** \cond fulldocs */
@@ -762,6 +772,7 @@ typedef enum pa_sink_flags {
 #define PA_SINK_DYNAMIC_LATENCY PA_SINK_DYNAMIC_LATENCY
 #define PA_SINK_PASSTHROUGH PA_SINK_PASSTHROUGH
 #define PA_SINK_SYNC_VOLUME PA_SINK_SYNC_VOLUME
+#define PA_SINK_SHARE_VOLUME_WITH_MASTER PA_SINK_SHARE_VOLUME_WITH_MASTER
 
 /** \endcond */
 
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 9257524..c812a3e 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -2902,7 +2902,7 @@ static void sink_fill_tagstruct(pa_native_connection *c, 
pa_tagstruct *t, pa_sin
 PA_TAG_STRING, sink-monitor_source ? sink-monitor_source-name : 
NULL,
 PA_TAG_USEC, pa_sink_get_latency(sink),
 PA_TAG_STRING, sink-driver,
-PA_TAG_U32, sink-flags,
+PA_TAG_U32, sink-flags  ~PA_SINK_SHARE_VOLUME_WITH_MASTER,
 PA_TAG_INVALID);
 
 if (c-version = 13) {
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 283d026..0c421da 

[pulseaudio-discuss] [PATCH 2/6] virtual-sink: Add a modarg for enabling volume sharing.

2011-02-24 Thread Tanu Kaskinen
---
 src/modules/module-virtual-sink.c |   17 -
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/modules/module-virtual-sink.c 
b/src/modules/module-virtual-sink.c
index 40bab5a..ceb2697 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -57,6 +57,7 @@ PA_MODULE_USAGE(
   rate=sample rate 
   channels=number of channels 
   channel_map=channel map 
+  use_volume_sharing=yes or no 
 ));
 
 #define MEMBLOCKQ_MAXLENGTH (16*1024*1024)
@@ -81,6 +82,7 @@ static const char* const valid_modargs[] = {
 rate,
 channels,
 channel_map,
+use_volume_sharing,
 NULL
 };
 
@@ -478,6 +480,7 @@ int pa__init(pa_module*m) {
 pa_sink_input_new_data sink_input_data;
 pa_sink_new_data sink_data;
 pa_bool_t *use_default = NULL;
+pa_bool_t use_volume_sharing = FALSE;
 
 pa_assert(m);
 
@@ -501,6 +504,11 @@ int pa__init(pa_module*m) {
 goto fail;
 }
 
+if (pa_modargs_get_value_boolean(ma, use_volume_sharing, 
use_volume_sharing)  0) {
+pa_log(use_volume_sharing= expects a boolean argument);
+goto fail;
+}
+
 u = pa_xnew0(struct userdata, 1);
 u-module = m;
 m-userdata = u;
@@ -531,9 +539,8 @@ int pa__init(pa_module*m) {
 pa_proplist_setf(sink_data.proplist, PA_PROP_DEVICE_DESCRIPTION, 
Virtual Sink %s on %s, sink_data.name, z ? z : master-name);
 }
 
-u-sink = pa_sink_new(m-core, sink_data,
-  
PA_SINK_HW_MUTE_CTRL|PA_SINK_HW_VOLUME_CTRL|PA_SINK_DECIBEL_VOLUME|
-  (master-flags  
(PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY)));
+u-sink = pa_sink_new(m-core, sink_data, (master-flags  
(PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY))
+   | (use_volume_sharing ? 
PA_SINK_SHARE_VOLUME_WITH_MASTER : 0));
 pa_sink_new_data_done(sink_data);
 
 if (!u-sink) {
@@ -545,7 +552,7 @@ int pa__init(pa_module*m) {
 u-sink-set_state = sink_set_state_cb;
 u-sink-update_requested_latency = sink_update_requested_latency_cb;
 u-sink-request_rewind = sink_request_rewind_cb;
-u-sink-set_volume = sink_set_volume_cb;
+u-sink-set_volume = use_volume_sharing ? NULL : sink_set_volume_cb;
 u-sink-set_mute = sink_set_mute_cb;
 u-sink-userdata = u;
 
@@ -580,7 +587,7 @@ int pa__init(pa_module*m) {
 u-sink_input-state_change = sink_input_state_change_cb;
 u-sink_input-may_move_to = sink_input_may_move_to_cb;
 u-sink_input-moving = sink_input_moving_cb;
-u-sink_input-volume_changed = sink_input_volume_changed_cb;
+u-sink_input-volume_changed = use_volume_sharing ? NULL : 
sink_input_volume_changed_cb;
 u-sink_input-mute_changed = sink_input_mute_changed_cb;
 u-sink_input-userdata = u;
 
-- 
1.7.3.4

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 3/6] virtual-sink: Add a modarg for forcing flat volume.

2011-02-24 Thread Tanu Kaskinen
---
 src/modules/module-virtual-sink.c |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/modules/module-virtual-sink.c 
b/src/modules/module-virtual-sink.c
index ceb2697..e55e890 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -58,6 +58,7 @@ PA_MODULE_USAGE(
   channels=number of channels 
   channel_map=channel map 
   use_volume_sharing=yes or no 
+  force_flat_volume=yes or no 
 ));
 
 #define MEMBLOCKQ_MAXLENGTH (16*1024*1024)
@@ -83,6 +84,7 @@ static const char* const valid_modargs[] = {
 channels,
 channel_map,
 use_volume_sharing,
+force_flat_volume,
 NULL
 };
 
@@ -481,6 +483,7 @@ int pa__init(pa_module*m) {
 pa_sink_new_data sink_data;
 pa_bool_t *use_default = NULL;
 pa_bool_t use_volume_sharing = FALSE;
+pa_bool_t force_flat_volume = FALSE;
 
 pa_assert(m);
 
@@ -509,6 +512,16 @@ int pa__init(pa_module*m) {
 goto fail;
 }
 
+if (pa_modargs_get_value_boolean(ma, force_flat_volume, 
force_flat_volume)  0) {
+pa_log(force_flat_volume= expects a boolean argument);
+goto fail;
+}
+
+if (use_volume_sharing  force_flat_volume) {
+pa_log(Flat volume can't be forced when using volume sharing.);
+goto fail;
+}
+
 u = pa_xnew0(struct userdata, 1);
 u-module = m;
 m-userdata = u;
@@ -540,7 +553,8 @@ int pa__init(pa_module*m) {
 }
 
 u-sink = pa_sink_new(m-core, sink_data, (master-flags  
(PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY))
-   | (use_volume_sharing ? 
PA_SINK_SHARE_VOLUME_WITH_MASTER : 0));
+   | (use_volume_sharing ? 
PA_SINK_SHARE_VOLUME_WITH_MASTER : 0)
+   | (force_flat_volume ? 
PA_SINK_FLAT_VOLUME : 0));
 pa_sink_new_data_done(sink_data);
 
 if (!u-sink) {
-- 
1.7.3.4

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 4/6] virtual-sink/source: Use a more descriptive stream name.

2011-02-24 Thread Tanu Kaskinen
---
 src/modules/module-virtual-sink.c   |2 +-
 src/modules/module-virtual-source.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/module-virtual-sink.c 
b/src/modules/module-virtual-sink.c
index e55e890..a45f4f5 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -578,7 +578,7 @@ int pa__init(pa_module*m) {
 sink_input_data.module = m;
 sink_input_data.sink = master;
 sink_input_data.origin_sink = u-sink;
-pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, Virtual 
Sink Stream);
+pa_proplist_setf(sink_input_data.proplist, PA_PROP_MEDIA_NAME, Virtual 
Sink Stream from %s, pa_proplist_gets(u-sink-proplist, 
PA_PROP_DEVICE_DESCRIPTION));
 pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, filter);
 pa_sink_input_new_data_set_sample_spec(sink_input_data, ss);
 pa_sink_input_new_data_set_channel_map(sink_input_data, map);
diff --git a/src/modules/module-virtual-source.c 
b/src/modules/module-virtual-source.c
index a2b073f..2b27b05 100644
--- a/src/modules/module-virtual-source.c
+++ b/src/modules/module-virtual-source.c
@@ -633,7 +633,7 @@ int pa__init(pa_module*m) {
 /* FIXME
source_output_data.flags = PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND; 
*/
 
-pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_NAME, Virtual 
Source Stream);
+pa_proplist_setf(source_output_data.proplist, PA_PROP_MEDIA_NAME, Virtual 
Source Stream of %s, pa_proplist_gets(u-source-proplist, 
PA_PROP_DEVICE_DESCRIPTION));
 pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_ROLE, 
filter);
 pa_source_output_new_data_set_sample_spec(source_output_data, ss);
 pa_source_output_new_data_set_channel_map(source_output_data, map);
-- 
1.7.3.4

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 5/6] virtual-sink/source: Remove an unused variable.

2011-02-24 Thread Tanu Kaskinen
---
 src/modules/module-virtual-sink.c   |5 -
 src/modules/module-virtual-source.c |5 -
 2 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/src/modules/module-virtual-sink.c 
b/src/modules/module-virtual-sink.c
index a45f4f5..bad159c 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -481,7 +481,6 @@ int pa__init(pa_module*m) {
 pa_sink *master=NULL;
 pa_sink_input_new_data sink_input_data;
 pa_sink_new_data sink_data;
-pa_bool_t *use_default = NULL;
 pa_bool_t use_volume_sharing = FALSE;
 pa_bool_t force_flat_volume = FALSE;
 
@@ -619,16 +618,12 @@ int pa__init(pa_module*m) {
 
 pa_modargs_free(ma);
 
-pa_xfree(use_default);
-
 return 0;
 
  fail:
 if (ma)
 pa_modargs_free(ma);
 
-pa_xfree(use_default);
-
 pa__done(m);
 
 return -1;
diff --git a/src/modules/module-virtual-source.c 
b/src/modules/module-virtual-source.c
index 2b27b05..d7e1c21 100644
--- a/src/modules/module-virtual-source.c
+++ b/src/modules/module-virtual-source.c
@@ -535,7 +535,6 @@ int pa__init(pa_module*m) {
 pa_source *master=NULL;
 pa_source_output_new_data source_output_data;
 pa_source_new_data source_data;
-pa_bool_t *use_default = NULL;
 
 /* optional for uplink_sink */
 pa_sink_new_data sink_data;
@@ -714,16 +713,12 @@ int pa__init(pa_module*m) {
 
 pa_modargs_free(ma);
 
-pa_xfree(use_default);
-
 return 0;
 
  fail:
 if (ma)
 pa_modargs_free(ma);
 
-pa_xfree(use_default);
-
 pa__done(m);
 
 return -1;
-- 
1.7.3.4

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] command-line control - increase/decrease volume of default output

2011-02-24 Thread Colin Guthrie
'Twas brillig, and Ng Oon-Ee at 24/02/11 13:14 did gyre and gimble:
 This would have to be part of pacmd or separate? I thought this is
 what pactl was supposed to be for, but it seems development on that
 just stopped.
 
 And yes I forgot I had alsa's ctl bound to hardware, that would be a 
 workaround. I still think PA should have something to cater to the 
 commandline, but yes it would need code of course. I may look into
 it once I graduate...

Integrating it into pactl would be fine.

pacmd is quite a difference beast really as it communicates directly
with the daemon via a CLI socket and thus doesn't work over the wire,
only on the local machine.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 1/2] Add a target to the PA log feature

2011-02-24 Thread Becker, VincentX
From: Maarten Bosmans [mailto:mkbosm...@gmail.com]

2011/2/23 Becker, VincentX vincentx.bec...@intel.com:
 Thanks for your review Maarten. So you suggest to split this into
several patches (2). One for the outer implementation and the other for
the inner one. I will try to attend to the irc meeting tomorrow so I
can catch your remarks in real time.

I'm not sure what you mean by outer and inner implementation. What I
meant was one patch thats adds the option to log to a file (this patch
touches all four files) and one patch that does the metadata,
append_data thing (should only change src/pulsecore/log.c)

Having two clean patches (see my other comments) tomorrow would help to
keep thing moving in the meeting.

Hi Maarten,
Here are the 2 patches as you suggested (both patches can be compiled
separately). I also integrated one of your remarks, but not all. Like
concerning the file naming, as you said it might be a bit too
complicated and appending the file or creating a new one might be
enough. But it remains a powerful way to debug pulseaudio and it is more
direct than using syslog.
I also wrote a module dedicated to log PCM samples, configurable for
sinks and/or sources with or without their respective sink inputs/source
outputs. I will submit it probably next month.

Vince


I send again the patches as the older ones could not be applied.


Sorry for getting this rolling on such a short notice.
No problem at all!

Maarten


 Cheers,
 V.
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: Les Montalets- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


0001-Add-a-new-log-target-to-a-file-descriptor-in-daemon-.patch
Description: 0001-Add-a-new-log-target-to-a-file-descriptor-in-daemon-.patch
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 2/2] Improve and optimize PA log core

2011-02-24 Thread Becker, VincentX
This patch goes with previous one 
(0001-Add-a-new-log-target-to-a-file-descriptor-in-daemon-.patch)

Vincent
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: Les Montalets- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


0001-Format-log-messages-with-generic-prepended-and-appen.patch
Description: 0001-Format-log-messages-with-generic-prepended-and-appen.patch
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [RFC] Alsa UCM integration.

2011-02-24 Thread pl bossart
 The initial version of the UCM module is available at the following link:
 http://git.slimlogic.co.uk/cgi-bin/cgit.cgi/pulseaudio.git/log/?h=9.20-ucm_module

 I'm still working in the module, It is work in progress to verify the
 current verb when the stream is closed, also it is needed to add more
 code to work with the profiles and the use cases. Sink, source and
 device data could be taken from the proplist of the verb, and this is
 pending too.

Hi Margarita,
I looked at your patches and have the following comments:
- any reason why your version of PulseAudio is 1.3 years old. The
previous patches on your branch are from 2009-11-18, quite a while
ago. It'll make upstreaming difficult.
- you now have a separate module-alsa-ucm module, but it's called with
a device name as a parameter. So if I have one USB headphone and one
USB mic, this module will be called twice. It's not clear to me then
how the virtual device would be handled, and how this is different
from inserting all the code in module-alsa-card as you did it in your
previous version?
- can you explain why you set the verb using the hook
PA_CORE_HOOK_SINK_INPUT_NEW, with priority PA_HOOK_EARLY+15. There are
other audio-policy related modules that may use different hooks, such
as PA_CORE_HOOK_SINK_INPUT_PUT. I would think you want to set the verb
at the UCM level after all this logic has made decisions, at the last
possible moment before data start flowing.
- how do we make use of modifiers?
- is there a better way to detect that UCM is supported, instead of
having a #define in module-alsa-card.c?

I realize I have more questions than suggestions, this is a good start anyway...
Thanks,
-Pierre
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [RFC] Alsa UCM integration.

2011-02-24 Thread Colin Guthrie
'Twas brillig, and pl bossart at 24/02/11 20:20 did gyre and gimble:
 The initial version of the UCM module is available at the following link:
 http://git.slimlogic.co.uk/cgi-bin/cgit.cgi/pulseaudio.git/log/?h=9.20-ucm_module

 I'm still working in the module, It is work in progress to verify the
 current verb when the stream is closed, also it is needed to add more
 code to work with the profiles and the use cases. Sink, source and
 device data could be taken from the proplist of the verb, and this is
 pending too.
 
 Hi Margarita,
 I looked at your patches and have the following comments:
 - any reason why your version of PulseAudio is 1.3 years old. The
 previous patches on your branch are from 2009-11-18, quite a while
 ago. It'll make upstreaming difficult.
 - you now have a separate module-alsa-ucm module, but it's called with
 a device name as a parameter. So if I have one USB headphone and one
 USB mic, this module will be called twice. It's not clear to me then
 how the virtual device would be handled, and how this is different
 from inserting all the code in module-alsa-card as you did it in your
 previous version?
 - can you explain why you set the verb using the hook
 PA_CORE_HOOK_SINK_INPUT_NEW, with priority PA_HOOK_EARLY+15. There are
 other audio-policy related modules that may use different hooks, such
 as PA_CORE_HOOK_SINK_INPUT_PUT. I would think you want to set the verb
 at the UCM level after all this logic has made decisions, at the last
 possible moment before data start flowing.
 - how do we make use of modifiers?
 - is there a better way to detect that UCM is supported, instead of
 having a #define in module-alsa-card.c?
 
 I realize I have more questions than suggestions, this is a good start 
 anyway...

Pierre, If you are able to get to IRC in the next 10 minutes, we can
discuss this in real time with Margarita! It would be great if you could
join us on #pulseaudio-meeting.

I'm not sure the email address I used to notify you directly a couple
days ago works (the nospam bit makes me suspicious!).

Cheers

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 1/2] Add a target to the PA log feature

2011-02-24 Thread Paul Menzel
Dear VincentX,


please note in the subject what iteration your patch is, e. g. »[PATCH
1/2 v2]«. See `--subject-prefix` in `git help format-patch`.

Am Donnerstag, den 24.02.2011, 16:30 + schrieb Becker, VincentX:
 From 55f84afd8575dadba697c746daa61ee07b333c57 Mon Sep 17 00:00:00 2001
 From: Vincent Becker vincentx.bec...@intel.com
 Date: Thu, 24 Feb 2011 16:52:05 +0100
 Subject: [PATCH] Add a new log target to a file descriptor in daemon 
 configuration
  Signed-off-by: Vincent Becker vincentx.bec...@intel.com
  This patches adds the option to log pulseaudio messages into a file 
 descriptor.
  The file descriptor can be a regular file or other type (character, block..).
  If the file given in parameter already exists, it is automatically renamed 
 with current date infos.

You are missing a blank line after the commit summary (first line).
Applying your patch, e. g. with `git am …`, needs therefore manual
editing.

It is also common to add the Signed-off-by line at the end.

Could you add an example to the commit message about how to use the new
functionality so that people can easily test you new feature?

 ---
  src/daemon/cmdline.c |   98 +-
  src/daemon/daemon-conf.c |  108 
 +-
  src/pulsecore/log.c  |6 +++
  src/pulsecore/log.h  |5 ++
  4 files changed, 166 insertions(+), 51 deletions(-)
 
 diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c
 index f6cdcdc..7f72b8c 100644
 --- a/src/daemon/cmdline.c
 +++ b/src/daemon/cmdline.c
 @@ -114,59 +114,59 @@ void pa_cmdline_help(const char *argv0) {
  
  printf(_(%s [options]\n\n
 COMMANDS:\n
 - -h, --helpShow this help\n
 - --version Show version\n
 - --dump-conf   Dump default 
 configuration\n
 - --dump-modulesDump list of available 
 modules\n
 - --dump-resample-methods   Dump available resample 
 methods\n
 - --cleanup-shm Cleanup stale shared 
 memory segments\n
 - --start   Start the daemon if it 
 is not running\n
 - -k  --killKill a running daemon\n
 - --check   Check for a running 
 daemon (only returns exit code)\n\n
 + -h, --help   Show this 
 help\n
 + --versionShow 
 version\n
 + --dump-conf  Dump default 
 configuration\n
 + --dump-modules   Dump list of 
 available modules\n
 + --dump-resample-methods  Dump 
 available resample methods\n
 + --cleanup-shmCleanup stale 
 shared memory segments\n
 + --start  Start the 
 daemon if it is not running\n
 + -k  --kill   Kill a 
 running daemon\n
 + --check  Check for a 
 running daemon (only returns exit code)\n\n
  
 OPTIONS:\n
 - --system[=BOOL]   Run as system-wide 
 instance\n
 - -D, --daemonize[=BOOL]Daemonize after 
 startup\n
 - --fail[=BOOL] Quit when startup 
 fails\n
 - --high-priority[=BOOL]Try to set high nice 
 level\n
 -   (only available as root, 
 when SUID or\n
 -   with elevated 
 RLIMIT_NICE)\n
 - --realtime[=BOOL] Try to enable realtime 
 scheduling\n
 -   (only available as root, 
 when SUID or\n
 -   with elevated 
 RLIMIT_RTPRIO)\n
 - --disallow-module-loading[=BOOL]  Disallow module user 
 requested module\n
 -   loading/unloading after 
 startup\n
 - --disallow-exit[=BOOL]Disallow user requested 
 exit\n
 - --exit-idle-time=SECS Terminate the daemon 
 when idle and this\n
 -   time passed\n
 - --module-idle-time=SECS   Unload autoloaded 
 modules when idle and\n
 -   this time passed\n
 - --scache-idle-time=SECS   Unload autoloaded 
 samples when idle and\n
 -   this time passed\n
 - --log-level[=LEVEL]   Increase 

Re: [pulseaudio-discuss] [PATCH 1/2] Add a target to the PA log feature

2011-02-24 Thread Maarten Bosmans
2011/2/24 Becker, VincentX vincentx.bec...@intel.com:
From: Maarten Bosmans [mailto:mkbosm...@gmail.com]
2011/2/23 Becker, VincentX vincentx.bec...@intel.com:
 Thanks for your review Maarten. So you suggest to split this into
several patches (2). One for the outer implementation and the other for
the inner one. I will try to attend to the irc meeting tomorrow so I
can catch your remarks in real time.

I'm not sure what you mean by outer and inner implementation. What I
meant was one patch thats adds the option to log to a file (this patch
touches all four files) and one patch that does the metadata,
append_data thing (should only change src/pulsecore/log.c)

Having two clean patches (see my other comments) tomorrow would help to
keep thing moving in the meeting.

Hi Maarten,
Here are the 2 patches as you suggested (both patches can be compiled
separately). I also integrated one of your remarks, but not all. Like
concerning the file naming, as you said it might be a bit too
complicated and appending the file or creating a new one might be
enough. But it remains a powerful way to debug pulseaudio and it is more
direct than using syslog.
I also wrote a module dedicated to log PCM samples, configurable for
sinks and/or sources with or without their respective sink inputs/source
outputs. I will submit it probably next month.

Vince


 I send again the patches as the older ones could not be applied.

The patches were handled at the meeting yesterday
http://colin.guthr.ie/meetings/pulseaudio-meeting/2011/pulseaudio-meeting.2011-02-24-21.02.html

Some changes are necessary, but basically adding the file log target
is ACKed. The other change about string format handling needs further
review though.

If you need some help with getting patches ready, I can be of
assistance, just let me know.

Maarten
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 1/2] Add a target to the PA log feature

2011-02-24 Thread Colin Guthrie
'Twas brillig, and Paul Menzel at 24/02/11 22:14 did gyre and gimble:
 Could you add that indentation change in a separate patch? It makes it
 easier to review in my opinion. It is not necessary though.

I think we'll try and avoid the majority of the indentation changes if
possible. I appreciate why but it would be better to just move to a new
line for the case where the indentation is needed rather than change
everything.

People still like 80 char limits too.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [RFC] Alsa UCM integration.

2011-02-24 Thread Margarita Olaya
Pierre,

On Thu, Feb 24, 2011 at 2:20 PM, pl bossart bossart.nos...@gmail.com wrote:
 The initial version of the UCM module is available at the following link:
 http://git.slimlogic.co.uk/cgi-bin/cgit.cgi/pulseaudio.git/log/?h=9.20-ucm_module

 I'm still working in the module, It is work in progress to verify the
 current verb when the stream is closed, also it is needed to add more
 code to work with the profiles and the use cases. Sink, source and
 device data could be taken from the proplist of the verb, and this is
 pending too.

 Hi Margarita,
 I looked at your patches and have the following comments:

Thanks for the review and feedback on the meeting.

 - any reason why your version of PulseAudio is 1.3 years old. The
 previous patches on your branch are from 2009-11-18, quite a while
 ago. It'll make upstreaming difficult.

Well, I had some troubles at the begging so I started  by taking an
stable rls but for sure I'll move soon the code to latest commit
before upstream it.

 - you now have a separate module-alsa-ucm module, but it's called with
 a device name as a parameter. So if I have one USB headphone and one
 USB mic, this module will be called twice. It's not clear to me then
 how the virtual device would be handled, and how this is different
 from inserting all the code in module-alsa-card as you did it in your
 previous version?

the idea was to have at least one card working, so yes this is pretty
much the same approach than the code in module-alsa-card. Do you have
any idea on how to manage virtual cards? I'm not clear on they way
that ALSA manages virtual cards.

 - can you explain why you set the verb using the hook
 PA_CORE_HOOK_SINK_INPUT_NEW, with priority PA_HOOK_EARLY+15. There are
 other audio-policy related modules that may use different hooks, such
 as PA_CORE_HOOK_SINK_INPUT_PUT. I would think you want to set the verb
 at the UCM level after all this logic has made decisions, at the last
 possible moment before data start flowing.

The initial approach was a bit different but after the IRC discussion
I agree to use a different  hook so verb will be set after all the
analysis with profiles has been done but it is needed first to map a
profile with a verb instead of the current approach with roles.

 - how do we make use of modifiers?
I have not really thought about this.

 - is there a better way to detect that UCM is supported, instead of
 having a #define in module-alsa-card.c?


there will be, that is on my to-do list atm

Thanks,
Margarita

 I realize I have more questions than suggestions, this is a good start 
 anyway...
 Thanks,
 -Pierre
 ___
 pulseaudio-discuss mailing list
 pulseaudio-discuss@mail.0pointer.de
 https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss