Re: [pulseaudio-discuss] several seconds delay while playing video with timer-based audio scheduling enabled

2011-05-10 Thread Zhang, Vivian
Trying paplay, it has the same result, then I think it has nothing to do with 
the video player.

Thanks
vivian

-Original Message-
From: pulseaudio-discuss-boun...@mail.0pointer.de 
[mailto:pulseaudio-discuss-boun...@mail.0pointer.de] On Behalf Of xing wang
Sent: Friday, May 06, 2011 11:38 AM
To: General PulseAudio Discussion
Subject: Re: [pulseaudio-discuss] several seconds delay while playing video 
with timer-based audio scheduling enabled

2011/5/5 xing wang wangxingchao2...@gmail.com:
 2011/5/5 Colin Guthrie gm...@colin.guthr.ie:
 'Twas brillig, and xing wang at 05/05/11 10:24 did gyre and gimble:
 Hi community,

 I met a weird issue when playing video on Meego Platform.
 if turn on timer-based audio scheduling, there's nearly seconds voice
 delay during playing video.
 The abnormal phenomenon disappeared after turn it off.

 I use 2.6.37 kernel and 0.9.22 pulseaudio version. As suggestions
 (http://0pointer.de/blog/projects/pulse-glitch-free.html)
 the pulseaudio's glitch-free works on newest Alsa/Kernel/Pulseaudio,
 newest everything.

 After some google search, there's no obvious finding about similar
 issues. Meanwhile i guess the official release of glitch-free
 must be verified about tsched feature, so it's not a bug but a usage
 mistake,such as some config file wrong for my platform.

 So if anyone had meet same issue or could you provide some
 suggestions, that would be appreciated much.

 What video player is being used? It is perhaps making some really dumb
 assumptions about things and thus breaking (and using too much power too!)

 It's Meego default player meego-qml-launcher.

Maybe wrong here. Qml-launcher is only one app launcher, the exact app name is
meego-app-video, it's one QML based application.

--xingchao


 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


___
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


[pulseaudio-discuss] How pulseaudio support autospawn?

2011-05-10 Thread Lin, Mengdong
How pulseaudio support autospawn?
After pulse audio daemon is killed manually, how it will be executed 
automatically?  How can it know some client is attempts to connect to it? Could 
someone introduce its internal implementation?

I got a explanation of autospawn:  if the daemon is not running when the first 
client attempts to connect, it will be executed automatically
(From 
http://www.linux-archive.org/ubuntu-development/246411-notable-changes-jauntys-pulseaudio.html)
 But I hope someone can give more detail.

Great Thanks!
Amanda



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


[pulseaudio-discuss] [PATCH] echo-cancel: Remove unnecessary noalign attribute

2011-05-10 Thread Arun Raghavan
This was just introduced for debugging and should not have been in the
final commit. Won't make a difference at the moment since this function
is used as a pointer, but removing this in case we change this in the
future.
---
 src/modules/echo-cancel/adrian-aec.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/modules/echo-cancel/adrian-aec.c 
b/src/modules/echo-cancel/adrian-aec.c
index dfe8ada..e969e8c 100644
--- a/src/modules/echo-cancel/adrian-aec.c
+++ b/src/modules/echo-cancel/adrian-aec.c
@@ -40,7 +40,6 @@ static REAL dotp(REAL a[], REAL b[])
   return sum0 + sum1;
 }
 
-static REAL dotp_sse(REAL a[], REAL b[]) __attribute__((noinline));
 static REAL dotp_sse(REAL a[], REAL b[])
 {
 #ifdef __SSE__
-- 
1.7.5.rc3

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


[pulseaudio-discuss] PulseAudio automatically shutting down?

2011-05-10 Thread mar...@saepia.net
Hi,

I am running pulseaudio 0.9.21-63-gd3efa-dirty from ubuntu 10.10 packages.

I need to use pulseaudio in the server environment to perform audio
routing tasks.

I run it with minimal configuration:

load-module module-null-sink sink_name=tuned_fake
load-module module-rescue-streams
load-module module-always-sink
load-module module-intended-roles
set-default-source tuned_fake.monitor
set-default-sink tuned_fake

It seems that if no client is connected, daemon exits after some
(short, +/- 1 min) time.

Is it correct behaviour?

Thank you in advance,

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


Re: [pulseaudio-discuss] PulseAudio automatically shutting down?

2011-05-10 Thread Colin Guthrie
'Twas brillig, and mar...@saepia.net at 10/05/11 12:35 did gyre and gimble:
 Hi,
 
 I am running pulseaudio 0.9.21-63-gd3efa-dirty from ubuntu 10.10 packages.
 
 I need to use pulseaudio in the server environment to perform audio
 routing tasks.
 
 I run it with minimal configuration:
 
 load-module module-null-sink sink_name=tuned_fake
 load-module module-rescue-streams
 load-module module-always-sink
 load-module module-intended-roles
 set-default-source tuned_fake.monitor
 set-default-sink tuned_fake
 
 It seems that if no client is connected, daemon exits after some
 (short, +/- 1 min) time.
 
 Is it correct behaviour?
 
 Thank you in advance,

Yup!


man pulse-daemon.conf and see exit-idle-time :D

HTHs

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] How pulseaudio support autospawn?

2011-05-10 Thread Colin Guthrie
Hello,

'Twas brillig, and Lin, Mengdong at 10/05/11 08:37 did gyre and gimble:
 How pulseaudio support autospawn?
 
 After pulse audio daemon is killed manually, how it will be executed
 automatically?  How can it know some client is attempts to connect to
 it? Could someone introduce its internal implementation?

This is performed automatically by libpulse.

All pulseaudio client appliations (be them native applications
supporting PA directly or an ALSA application using the alsa-pulse
plugin) use libpulse. It has code that tries to connect to the daemon,
and if that connection fails it will automatically attempt to spawn a
pulseaudio daemon and then connect to it.

There are some exceptions to this e.g.
 * when the client application is trying to connect to a remote address.
 * when autospawn=no is set in client.conf
 * possibly a couple more I forget off the top of my head :D

 
 I got a explanation of autospawn: “ if the daemon is not running when
 the first client attempts to connect, it will be executed automatically”
 
 (From
 http://www.linux-archive.org/ubuntu-development/246411-notable-changes-jauntys-pulseaudio.html)
 But I hope someone can give more detail.

So the code itself is here:
http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/pulse/context.c;h=1480af533a57cc4eca39bff405973ba4bc8f94c6;hb=HEAD#l802

which is triggered from here:
http://git.0pointer.de/?p=pulseaudio.git;a=blob;f=src/pulse/context.c;h=1480af533a57cc4eca39bff405973ba4bc8f94c6;hb=HEAD#l868


Hopefully you can follow things through from here, but feel free to ask
any other questions if you're stuck :)

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] PulseAudio automatically shutting down?

2011-05-10 Thread mar...@saepia.net
whoops, it so obvious that I missed that :P

thank you!

m.

2011/5/10 Colin Guthrie gm...@colin.guthr.ie:
 'Twas brillig, and mar...@saepia.net at 10/05/11 12:35 did gyre and gimble:
 Hi,

 I am running pulseaudio 0.9.21-63-gd3efa-dirty from ubuntu 10.10 packages.

 I need to use pulseaudio in the server environment to perform audio
 routing tasks.

 I run it with minimal configuration:

 load-module module-null-sink sink_name=tuned_fake
 load-module module-rescue-streams
 load-module module-always-sink
 load-module module-intended-roles
 set-default-source tuned_fake.monitor
 set-default-sink tuned_fake

 It seems that if no client is connected, daemon exits after some
 (short, +/- 1 min) time.

 Is it correct behaviour?

 Thank you in advance,

 Yup!


 man pulse-daemon.conf and see exit-idle-time :D

 HTHs

 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

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


[pulseaudio-discuss] [PATCHv3 1/4] alsa: Export alsa-mixer API

2011-05-10 Thread Jorge Eduardo Candelaria
From: Margarita Olaya Cabrera m...@slimlogic.co.uk

The UCM core needs the alsa-mixer API to be exported, so that it can
create its UCM mappings.

Signed-off-by: Margarita Olaya Cabrera m...@slimlogic.co.uk
Signed-off-by: Jorge Eduardo Candelaria j...@slimlogic.co.uk
---
src/modules/alsa/alsa-mixer.c |   10 +-
src/modules/alsa/alsa-mixer.h |   12 
2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 3eef5f9..07670f0 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -2909,7 +2909,7 @@ void pa_alsa_profile_set_free(pa_alsa_profile_set *ps) {
pa_xfree(ps);
}

-static pa_alsa_mapping *mapping_get(pa_alsa_profile_set *ps, const char *name) 
{
+pa_alsa_mapping *mapping_get(pa_alsa_profile_set *ps, const char *name) {
pa_alsa_mapping *m;

if (!pa_startswith(name, Mapping ))
@@ -3364,7 +3364,7 @@ fail:
return -1;
}

-static int mapping_verify(pa_alsa_mapping *m, const pa_channel_map *bonus) {
+int mapping_verify(pa_alsa_mapping *m, const pa_channel_map *bonus) {

static const struct description_map well_known_descriptions[] = {
{ analog-mono,N_(Analog Mono) },
@@ -3437,7 +3437,7 @@ void pa_alsa_mapping_dump(pa_alsa_mapping *m) {
 m-direction);
}

-static void profile_set_add_auto_pair(
+void profile_set_add_auto_pair(
pa_alsa_profile_set *ps,
pa_alsa_mapping *m, /* output */
pa_alsa_mapping *n  /* input */) {
@@ -3485,7 +3485,7 @@ static void profile_set_add_auto_pair(
pa_hashmap_put(ps-profiles, p-name, p);
}

-static void profile_set_add_auto(pa_alsa_profile_set *ps) {
+void profile_set_add_auto(pa_alsa_profile_set *ps) {
pa_alsa_mapping *m, *n;
void *m_state, *n_state;

@@ -3502,7 +3502,7 @@ static void profile_set_add_auto(pa_alsa_profile_set *ps) 
{
profile_set_add_auto_pair(ps, NULL, n);
}

-static int profile_verify(pa_alsa_profile *p) {
+int profile_verify(pa_alsa_profile *p) {

static const struct description_map well_known_descriptions[] = {
{ output:analog-mono+input:analog-mono, N_(Analog Mono Duplex) 
},
diff --git a/src/modules/alsa/alsa-mixer.h b/src/modules/alsa/alsa-mixer.h
index c24a896..ad8e980 100644
--- a/src/modules/alsa/alsa-mixer.h
+++ b/src/modules/alsa/alsa-mixer.h
@@ -220,6 +220,11 @@ int pa_alsa_path_set_mute(pa_alsa_path *path, snd_mixer_t 
*m, pa_bool_t muted);
int pa_alsa_path_select(pa_alsa_path *p, snd_mixer_t *m);
void pa_alsa_path_set_callback(pa_alsa_path *p, snd_mixer_t *m, 
snd_mixer_elem_callback_t cb, void *userdata);
void pa_alsa_path_free(pa_alsa_path *p);
+pa_alsa_mapping *mapping_get(pa_alsa_profile_set *ps, const char *name);
+int mapping_verify(pa_alsa_mapping *m, const pa_channel_map *bonus);
+void profile_set_add_auto(pa_alsa_profile_set *ps);
+void profile_set_add_auto_pair(pa_alsa_profile_set *ps, pa_alsa_mapping *m, 
pa_alsa_mapping *n);
+int profile_verify(pa_alsa_profile *p);

pa_alsa_path_set *pa_alsa_path_set_new(pa_alsa_mapping *m, pa_alsa_direction_t 
direction);
void pa_alsa_path_set_probe(pa_alsa_path_set *s, snd_mixer_t *m, pa_bool_t 
ignore_dB);
@@ -227,6 +232,13 @@ void pa_alsa_path_set_dump(pa_alsa_path_set *s);
void pa_alsa_path_set_set_callback(pa_alsa_path_set *ps, snd_mixer_t *m, 
snd_mixer_elem_callback_t cb, void *userdata);
void pa_alsa_path_set_free(pa_alsa_path_set *s);

+/* Data structure that UCM uses to extract alsa profile
+ * information. 
+ */
+struct profile_data {
+pa_alsa_profile *profile;
+};
+
struct pa_alsa_mapping {
pa_alsa_profile_set *profile_set;

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


[pulseaudio-discuss] [PATCHv3 0/4] Read and store UCM data as proplist

2011-05-10 Thread Jorge Eduardo Candelaria
This is the third version of the Pulseaudio and UCM integration. 

This set of patches cover adding ucm data to proplist, adding a ucm API
to get and set data to proplist, and lets module-alsa-card scan ucm data
when the card is probed.

Another set of patches dealing with jack module detection will be sent
separately.

Changes from v2:
- clean up and add documentation to some structures and functions.
- changed commit subjects to better reflect changes in code.
- used pa_log_debug() instead of pa_log() to avoid saturating the output.


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


[pulseaudio-discuss] [PATCHv3 2/4] alsa: Add UCM proplist items

2011-05-10 Thread Jorge Eduardo Candelaria
From: Margarita Olaya Cabrera m...@slimlogic.co.uk

UCM has various items we would like to store in a proplist. Add
these to the proplist property types.

Signed-off-by: Margarita Olaya Cabrera m...@slimlogic.co.uk
Signed-off-by: Jorge Eduardo Candelaria j...@slimlogic.co.uk
---
src/pulse/proplist.h |   27 +++
1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/src/pulse/proplist.h b/src/pulse/proplist.h
index 5db3ada..26429d7 100644
--- a/src/pulse/proplist.h
+++ b/src/pulse/proplist.h
@@ -245,6 +245,33 @@ PA_C_DECL_BEGIN
/** For modules: a version string for the module. e.g. 0.9.15 */
#define PA_PROP_MODULE_VERSION module.version

+/** For devices: List of verbs, devices or modifiers availables */
+#define PA_PROP_UCM_NAME   ucm.name
+
+/** For devices: List of supported devices per verb*/
+#define PA_PROP_UCM_DESCRIPTIONucm.description
+
+/** For devices: Playback device name e.g PlaybackPCM */
+#define PA_PROP_UCM_SINK   ucm.sink
+
+/** For devices: Capture device name e.g CapturePCM*/
+#define PA_PROP_UCM_SOURCE ucm.source
+
+/** For devices: Playback control volume ID string. e.g PlaybackVolume */
+#define PA_PROP_UCM_PLAYBACK_VOLUMEucm.playback.volume
+
+/** For devices: Playback switch e.g PlaybackSwitch */
+#define PA_PROP_UCM_PLAYBACK_SWITCHucm.playback.switch
+
+/** For devices: Capture controls volume ID string. e.g CaptureVolume */
+#define PA_PROP_UCM_CAPTURE_VOLUME ucm.capture.volume
+
+/** For devices: Capture switch e.g CaptureSwitch */
+#define PA_PROP_UCM_CAPTURE_SWITCH ucm.capture.switch
+
+/** For devices: Quality of Service */
+#define PA_PROP_UCM_QOSucm.qos
+
/** A property list object. Basically a dictionary with ASCII strings
 * as keys and arbitrary data as values. \since 0.9.11 */
typedef struct pa_proplist pa_proplist;
-- 
1.7.1
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCHv3 4/4] alsa: Support UCM profiles in module-alsa-card

2011-05-10 Thread Jorge Eduardo Candelaria
From: Margarita Olaya Cabrera m...@slimlogic.co.uk

This patch adds ALSA UCM (Use Case Manager) support to module alsa card.
It checks if UCM is available for each card and if found it uses the profiles
generated with ucm data.

Using a udev-rule user can decide if UCM will be used or not,
Depending on the status of USE_UCM property, a flag is passed as
module argument to module-alsa-card.

Signed-off-by: Margarita Olaya Cabrera m...@slimlogic.co.uk
Signed-off-by: Jorge Eduardo Candelaria j...@slimlogic.co.uk
---
src/modules/alsa/module-alsa-card.c |  120 +++
src/modules/module-udev-detect.c|   11 +++-
2 files changed, 117 insertions(+), 14 deletions(-)

diff --git a/src/modules/alsa/module-alsa-card.c 
b/src/modules/alsa/module-alsa-card.c
index e60aa5e..312a42b 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -39,6 +39,7 @@
#include alsa-util.h
#include alsa-sink.h
#include alsa-source.h
+#include alsa-ucm.h
#include module-alsa-card-symdef.h

PA_MODULE_AUTHOR(Lennart Poettering);
@@ -66,7 +67,8 @@ PA_MODULE_USAGE(
profile=profile name 
ignore_dB=ignore dB information from the device? 
sync_volume=syncronize sw and hw voluchanges in IO-thread? 
-profile_set=profile set configuration file );
+profile_set=profile set configuration file 
+use_ucm=Load Use Case Manager );

static const char* const valid_modargs[] = {
name,
@@ -90,6 +92,7 @@ static const char* const valid_modargs[] = {
ignore_dB,
sync_volume,
profile_set,
+use_ucm,
NULL
};

@@ -106,10 +109,8 @@ struct userdata {
pa_modargs *modargs;

pa_alsa_profile_set *profile_set;
-};

-struct profile_data {
-pa_alsa_profile *profile;
+pa_alsa_ucm_config ucm;
};

static void add_profiles(struct userdata *u, pa_hashmap *h) {
@@ -207,6 +208,15 @@ static int card_set_profile(pa_card *c, pa_card_profile 
*new_profile) {
am-source = NULL;
}

+/* if UCM is avalible for this card then update the verb */
+if (u-ucm.status == PA_ALSA_UCM_ENABLED) {
+struct profile_data *d;
+   /* current profile */
+d = PA_CARD_PROFILE_DATA(u-card-active_profile);
+if (ucm_set_profile(u-ucm, nd-profile-name, d)  0)
+return -1;
+}
+
if (nd-profile  nd-profile-output_mappings)
PA_IDXSET_FOREACH(am, nd-profile-output_mappings, idx) {

@@ -240,15 +250,40 @@ static int card_set_profile(pa_card *c, pa_card_profile 
*new_profile) {
return 0;
}

-static void init_profile(struct userdata *u) {
+static int init_profile(struct userdata *u) {
uint32_t idx;
pa_alsa_mapping *am;
struct profile_data *d;
+char *device_name, *verb_name, *tmp;
+struct pa_alsa_ucm_config *ucm = u-ucm;

pa_assert(u);

d = PA_CARD_PROFILE_DATA(u-card-active_profile);

+if (u-ucm.status == PA_ALSA_UCM_ENABLED) {
+/* Set initial verb and device */
+verb_name = pa_xstrdup(d-profile-name);
+tmp = strchr(verb_name, ':');
+if (!tmp) {
+pa_log(no new verb found for %s, d-profile-name);
+pa_xfree(verb_name);
+return -1;
+}
+*tmp = 0;
+
+if ((snd_use_case_set(ucm-ucm_mgr, _verb, verb_name))  0) {
+pa_log(failed to set verb %s, d-profile-name);
+return -1;
+}
+
+device_name = strchr(d-profile-name, ':') + 2;
+if (snd_use_case_set(ucm-ucm_mgr, _enadev, device_name)  0) {
+pa_log(failed to set device %s, device_name);
+return -1;
+}
+}
+
if (d-profile  d-profile-output_mappings)
PA_IDXSET_FOREACH(am, d-profile-output_mappings, idx)
am-sink = pa_alsa_sink_new(u-module, u-modargs, __FILE__, 
u-card, am);
@@ -256,6 +291,8 @@ static void init_profile(struct userdata *u) {
if (d-profile  d-profile-input_mappings)
PA_IDXSET_FOREACH(am, d-profile-input_mappings, idx)
am-source = pa_alsa_source_new(u-module, u-modargs, __FILE__, 
u-card, am);
+
+return 0;
}

static void set_card_name(pa_card_new_data *data, pa_modargs *ma, const char 
*device_id) {
@@ -284,6 +321,56 @@ static void set_card_name(pa_card_new_data *data, 
pa_modargs *ma, const char *de
pa_xfree(t);
}

+static int card_query_ucm_profiles(struct userdata *u, int card_index)
+{
+char *card_name;
+const char **verb_list;
+int num_verbs, i, err;
+
+/* is UCM available for this card ? */
+snd_card_get_name(card_index, card_name);
+err = snd_use_case_mgr_open(u-ucm.ucm_mgr, card_name);
+if (err  0) {
+pa_log(UCM not avaliable for card %s, card_name);
+u-ucm.status = PA_ALSA_UCM_DISABLED;
+return 0;
+}
+
+pa_log_info(UCM avaliable for card %s, card_name);
+
+/* get a list of all UCM verbs (profiles) for this card */
+num_verbs = snd_use_case_verb_list(u-ucm.ucm_mgr, verb_list);
+if (num_verbs = 

[pulseaudio-discuss] [PATCHv3 3/4] alsa: Add UCM API for managing UCM propoerties

2011-05-10 Thread Jorge Eduardo Candelaria
From: Margarita Olaya Cabrera m...@slimlogic.co.uk

The UCM stores the mixer settings per use case in configuration files, these
files contains information such:
- list of use case verbs per card or machine
- supported devices per use case verb
- use case sink device
- use case source device
- hardware playback volume control id (per use case verb and device)
- hardware playback mute switch id
- hardware capture volume control id
- hardware capture mute switch id

The new ucm data structures are used to store that info so it can be used by
pulseaudio.

This patch also adds ALSA UCM (Use Case Manager) calls.
It checks if UCM is available for each card and if found, scans each UCM
property verb, device and modifier for the card. It then then creates
mappings for each supported UCM verb and device so that changes to the
pulseaudio profile cause corresponding changes to the UCM verb and
device for the card.

Signed-off-by: Margarita Olaya Cabrera m...@slimlogic.co.uk
Signed-off-by: Jorge Eduardo Candelaria j...@slimlogic.co.uk
---
src/Makefile.am |2 +-
src/modules/alsa/alsa-ucm.c |  532 +++
src/modules/alsa/alsa-ucm.h |   80 +++
3 files changed, 613 insertions(+), 1 deletions(-)
create mode 100644 src/modules/alsa/alsa-ucm.c
create mode 100644 src/modules/alsa/alsa-ucm.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 71ad19b..38bc903 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1553,7 +1553,7 @@ module_coreaudio_device_la_LIBADD = $(MODULE_LIBADD)

# ALSA

-libalsa_util_la_SOURCES = modules/alsa/alsa-util.c modules/alsa/alsa-util.h 
modules/alsa/alsa-mixer.c modules/alsa/alsa-mixer.h modules/alsa/alsa-sink.c 
modules/alsa/alsa-sink.h modules/alsa/alsa-source.c modules/alsa/alsa-source.h 
modules/reserve-wrap.c modules/reserve-wrap.h
+libalsa_util_la_SOURCES = modules/alsa/alsa-util.c modules/alsa/alsa-util.h 
modules/alsa/alsa-mixer.c modules/alsa/alsa-mixer.h modules/alsa/alsa-sink.c 
modules/alsa/alsa-sink.h modules/alsa/alsa-source.c modules/alsa/alsa-source.h 
modules/alsa/alsa-ucm.c modules/alsa/alsa-ucm.h modules/reserve-wrap.c 
modules/reserve-wrap.h
libalsa_util_la_LDFLAGS = -avoid-version
libalsa_util_la_LIBADD = $(MODULE_LIBADD) $(ASOUNDLIB_LIBS)
libalsa_util_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS)
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
new file mode 100644
index 000..8182a3b
--- /dev/null
+++ b/src/modules/alsa/alsa-ucm.c
@@ -0,0 +1,532 @@
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2011 Wolfson Microelectronics PLC
+ Author Margarita Olaya m...@slimlogic.co.uk
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+
+***/
+
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
+#include sys/types.h
+#include limits.h
+#include asoundlib.h
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+#include valgrind/memcheck.h
+#endif
+
+#include pulse/sample.h
+#include pulse/xmalloc.h
+#include pulse/timeval.h
+#include pulse/util.h
+#include pulse/i18n.h
+#include pulse/utf8.h
+
+#include pulsecore/log.h
+#include pulsecore/macro.h
+#include pulsecore/core-util.h
+#include pulsecore/atomic.h
+#include pulsecore/core-error.h
+#include pulsecore/once.h
+#include pulsecore/thread.h
+#include pulsecore/conf-parser.h
+#include pulsecore/strbuf.h
+
+#include alsa-mixer.h
+#include alsa-util.h
+#include alsa-ucm.h
+
+struct ucm_items {
+const char *id;
+const char *property;
+};
+
+struct ucm_info {
+const char *id;
+int priority;
+pa_alsa_direction_t direction;
+int channels;
+};
+
+/* UCM items - structure to set proplist items*/
+static struct ucm_items item[] = {
+{PlaybackPCM, PA_PROP_UCM_SINK},
+{CapturePCM, PA_PROP_UCM_SOURCE},
+{PlaybackVolume, PA_PROP_UCM_PLAYBACK_VOLUME},
+{PlaybackSwitch, PA_PROP_UCM_PLAYBACK_SWITCH},
+{CaptureVolume, PA_PROP_UCM_CAPTURE_VOLUME},
+{CaptureSwitch, PA_PROP_UCM_CAPTURE_SWITCH},
+{TQ, PA_PROP_UCM_QOS},
+{NULL, NULL},
+};
+
+/* UCM device info - this should eventually be part of policy manangement */
+static struct ucm_info dev_info[] = {
+{SND_USE_CASE_DEV_SPEAKER, 100, PA_ALSA_DIRECTION_OUTPUT, 2},
+{SND_USE_CASE_DEV_LINE, 100, PA_ALSA_DIRECTION_ANY, 2},
+{SND_USE_CASE_DEV_HEADPHONES, 100, PA_ALSA_DIRECTION_OUTPUT, 2},
+{SND_USE_CASE_DEV_HEADSET, 

[pulseaudio-discuss] Is it possible to compress pulseaudio's network streams?

2011-05-10 Thread Aitor Pazos
Dear list,
I've been using Pulseaudio over the network for a while. When my laptop is 
docked it works pretty well through the wired connection, but when I go 
wireless sound gets choppy. This situation makes the whole network 
functionality almost non-sense for me as I could attach my usb sound card 
directly to my dock station (with 5.1 speakers). Checking the traffic I get an 
around 4mb/s sustained flow which I guess is too high for my unreliable 
wireless network.
I've googled quite a lot and I haven't found any real effective solution to 
this issue. I guess the better solution would be to compress these streams in 
order to reduce bandwidth requirements. Is it possible to do this in 
pulseaudio. Are there any plans of implementing some solution for this 
situation? Which are the most important parameters I should try to tune apart 
from default-fragments and default-fragment-size-msec?

Thank you very much,
Aitor Pazos


signature.asc
Description: This is a digitally signed message part.
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss