Re: [pulseaudio-discuss] [PATCH v2 1/6] gccmacro: Disable printf-like format checking on mingw32 compilers.

2012-10-23 Thread Arun Raghavan
On Tue, 2012-08-21 at 13:32 +0200, Thomas Martitz wrote:
 Am 21.08.2012 08:51, schrieb Rémi Denis-Courmont:
  Le mardi 21 août 2012 00:50:34 Thomas Martitz, vous avez écrit :
  There are tons of warnings, most of them because the function is not
  recognized as printf-like.
  Removing checks looks very fishy.
 
  To use C99 and/or GNU format specifiers on MingW, you need to use the
  gnuprintf attribute instead of printf. With printf, the format string is
  validated according to the antiquated MSVC rules.
 
 
 Interesting, I didn't know about gnuprintf. FWIW, what are those 
 antiquated MSVC rules? I assumed the return value which isn't int for 
 some affected functions?

Is this one going to be respun?

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 3/6] Proper poll() emulation to fix pacat and friends on windows.

2012-10-23 Thread Arun Raghavan
On Mon, 2012-08-20 at 23:50 +0200, Thomas Martitz wrote:
 Currently, Windows versions of pacat and friends fail because the current
 poll emulation is not sufficient (it only works for socket fds).
 
 Luckily Gnulib has a much better emulation that seems to work perfect
 all over. The implementation has been largely copied (except a bug fix
 regarding timeout handling, to be pushed upstream) and works on pipes
 and files as well.
 
 This fixes the Assertion (!e-dead) failed error coming and lets pacat
 and friends stream happily to/from a server (I didn't actually test parec).
 ---

The changes look okay to me, but the gnulib code is GPL -- any chance
that the author would agree to a dual-license for this?

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 0/6] Fixes for pulseaudio on Windows.

2012-10-23 Thread Arun Raghavan
On Mon, 2012-08-20 at 23:50 +0200, Thomas Martitz wrote:
 I've been tryng to run pulseaudio (including utils) on windows. This
 series is the first to contribute fixes to achieve this.
 
 One issue I came across is the assertion failue (!e-dead) in pacat. This
 is fixed by the third patch. Uncovered by this and fixed by patch 2 is that
 stdio needs to be switched to binary mode in order to pipe data through it.
 Patch 1 works around massive build warnings on mingw32, but it's not mission
 critical (note: I don't know why the patch order of 1-3 is different to the
 first set). Another issue was pa_read() failure in flush(), which wasn't 
 actually failure, but rather not handling non-blocking sockets. Actually,
 I'm not sure if the fix is correct (perhaps because pa_read() should not wait
 for non-block sockets or the fix is windows-only) but it functions as a work-
 around. The last 2 patches are more or less minor and speak for themselves.
 
 Please review and comment on my patches, especually patch#4. This is my 
 first contribution to PA, but surely not the last one so I would like to 
 get things right.
 

Sorry about an awful wait for your first patches. I've commented on a
few of them, and I'm pushing out the rest now. There are minor cosmetic
changes to some of them (and I've not bothered rewrapping them at 80
columns, but that would be nice).

Thanks for the work!

Regards,
Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] modules: Fix false warning in webrtc AEC

2012-10-23 Thread Tanu Kaskinen
On Mon, 2012-10-22 at 23:48 +0200, Peter Meerwald wrote:
 From: Peter Meerwald p.meerw...@bct-electronic.com
 
   CXX  libwebrtc_util_la-webrtc.lo
 modules/echo-cancel/webrtc.cc: In function 'pa_bool_t 
 pa_webrtc_ec_init(pa_core*, pa_echo_canceller*, pa_sample_spec*, 
 pa_channel_map*, pa_sample_spec*, pa_channel_map*, uint32_t*, const char*)':
 modules/echo-cancel/webrtc.cc:196:9: warning: 'rm' may be used uninitialized 
 in this function [-Wuninitialized]
 
 Signed-off-by: Peter Meerwald p.meerw...@bct-electronic.com

Thanks, applied. (Changed the modules label to echo-cancel.)

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v0 01/11] card: Support adding profiles dynamically

2012-10-23 Thread David Henningsson

On 10/23/2012 08:01 AM, Mikel Astiz wrote:

Hi David,

On Mon, Oct 22, 2012 at 6:10 PM, David Henningsson
david.hennings...@canonical.com wrote:

On 10/22/2012 10:46 AM, Mikel Astiz wrote:


From: Mikel Astiz mikel.as...@bmw-carit.de

Some cards might need to add profiles during their lifetime, that is,
after the card has been created.



How are volume control UIs, other modules, etc made aware that the profiles
or ports of a card has changed?


I believe the D-Bus API as well as the subscription events would have
to be extended for this purpose, but I haven't addressed either of
these here. Any thoughts?


Just that being able to change a card in ways that was not possible 
before, is something that require careful thought. Removal even more so; 
what if a volume control UI starts (that was built before we made this 
change), and suddenly a profile is removed, and then the user tries to 
select this profile?


I'm also not sure if there are other parts of the PulseAudio core that 
needs to know if things like these change, do you know?


I'm not opposed to the change, maybe it is inevitable - e g, the 
capabilities of HDMI sinks can also change during PulseAudio's life 
time, so that's another example of dynamic profiles. What I'm trying to 
say here is that:


1) This is a quite fundamental change of behaviour, have we thought this 
through thoroughly, with all the consequences not only for us but for 
our client software as well?


and

2) I don't want to release with this being half-done; e g, if we add 
profiles without a subscription mechanism and then release, we might end 
up with volume control UIs polling us all the time to work around our 
own shortcomings.



--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] directory to place the 90-pulseaudio.rule and other profile configure files

2012-10-23 Thread Tanu Kaskinen
On Mon, 2012-10-22 at 09:46 -0700, Dongjiu Geng wrote:
 Hi David:
The target device is a embedded device mobile phone. not computer.
 Thanks

(Please don't top-post.)

I don't see how the form factor is relevant here. You asked which
directory to place the files, and David answered that. Were you somehow
unhappy with the answer?

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v0 09/11] bluetooth: Refactor code to create card profiles

2012-10-23 Thread Tanu Kaskinen
On Mon, 2012-10-22 at 10:46 +0200, Mikel Astiz wrote:
 From: Mikel Astiz mikel.as...@bmw-carit.de
 
 Use a helper function to create the card profiles, given an UUID.

Thanks, applied.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v0 10/11] bluetooth: Refactor code to create profile ports

2012-10-23 Thread Tanu Kaskinen
On Mon, 2012-10-22 at 10:46 +0200, Mikel Astiz wrote:
 From: Mikel Astiz mikel.as...@bmw-carit.de
 
 Put the created ports in a hashmap, but not necessarily inside a struct
 pa_card_new_data.

Thanks, applied.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [pulseaudio] error: Sufficiently new version of libasound not found.

2012-10-23 Thread Tanu Kaskinen
On Mon, 2012-10-22 at 00:12 -0700, Dongjiu Geng wrote:
 HI all:
 when I build the pulseaudio with alsa-lib,  the error log is 
   checking for libasound headers version = 1.0.24... not present.
configure: error: Sufficiently new version of libasound not found.
 could you help me about this bug?  Thank you very much.

Either your alsa-lib version is too old in the build environment (you're
doing cross-compilation, right?) or the alsa-lib pkg-config file doesn't
exist where pkg-config is looking for it.

The pkg-config file for alsa-lib has name alsa.pc. Check that the file
exists in the right directory. On my system it's
at /usr/lib/x86_64-linux-gnu/pkgconfig/alsa.pc. If I would have compiled
and installed alsa-lib myself from source, it would probably be
at /usr/local/lib/pkgconfig/alsa.pc. If you're cross-compiling, the
right directory may be something else.

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] pulseaudio stops to work suddenly

2012-10-23 Thread Antonio Trande
2012/10/23 Paul Menzel paulepan...@users.sourceforge.net

 Dear Antonio,


 please just send plain text messages and no HTML to lists [1].


OpenSUSE mailing list ?
I did not know of sending mail to this list.




 Am Montag, den 22.10.2012, 19:25 +0200 schrieb Antonio Trande:
  2012/10/19 Antonio Trande anto.tra...@gmail.com

 […]

   2012/10/18 Tanu Kaskinen ta...@iki.fi
  
   On Thu, 2012-10-18 at 20:07 +0200, Antonio Trande wrote:
No sound after reboot.
  
   There's some other problem then too. The pulseaudio log would be
 useful.
  
$ pulseaudio -
  
   snip
  
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.
  
   That's not very useful, though. You need to ensure that there's no
   daemon running before you try to start pulseaudio in a terminal.
 Killing
   the old daemon instance doesn't necessary help, due to autospawning.
   Therefore, do this first to disable autospawning:
  
   echo autospawn = no  ~/.pulse/client.conf
  
   Ok. If I start Fedora with  'cat /etc/modprobe.d/dist-alsa.conf 
 options
   snd-hda-intel model=auto', sound is present for few seconds. Then, it
 is no
   more udible.
   In attached you can see the 'pulseaudio -' log (this log doesn't
   stop, I must do a Ctrl-C)  using the gnome-shell audio settings menu
   (choose of the sound hardware, sound tests, ...).

 […]

   I forgot ... If I plug an headphone, audio can be heared always.
 
  Resolved with 'options snd-hda-intel model=acer-aspire' on
  '/etc/modprobe.d/dist-alsa.conf' file.

 Thank you for the follow up. I still do not understand how PulseAudio
 can work for some though and then stops.

 Anyway, could you please run the Skript `alsa-info.sh` [2] on your
 system and report your issue and solution to the alsa-devel mailing list
 [3] or create a ticket in the Linux Kernel bug tracker [4] or in the bug
 tracker of your distribution.


I wil do it.
Thank you.


-- 
*Antonio Trande
Fedora Ambassador*
*Fedora italian translation group*
*Blogger

**mail*: mailto:sagit...@fedoraproject.org sagit...@fedoraproject.org
*Homepage*: http://www.fedora-os.org
*Sip Address* : sip:sagitter AT ekiga.net
*Jabber http://jabber.org/* :sagitter AT jabber.org
*GPG Key: **D400D6C4*
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 3/6] Proper poll() emulation to fix pacat and friends on windows.

2012-10-23 Thread Thomas Martitz

Am 23.10.2012 08:40, schrieb Arun Raghavan:

On Mon, 2012-08-20 at 23:50 +0200, Thomas Martitz wrote:

Currently, Windows versions of pacat and friends fail because the current
poll emulation is not sufficient (it only works for socket fds).

Luckily Gnulib has a much better emulation that seems to work perfect
all over. The implementation has been largely copied (except a bug fix
regarding timeout handling, to be pushed upstream) and works on pipes
and files as well.

This fixes the Assertion (!e-dead) failed error coming and lets pacat
and friends stream happily to/from a server (I didn't actually test parec).
---

The changes look okay to me, but the gnulib code is GPL -- any chance
that the author would agree to a dual-license for this?


Actually, I took the copy from git[1], which has it under GPLv2 or later.

[1] https://github.com/git/git/blob/master/compat/poll/poll.c

Best regards.
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Brrr ... freeze imminent

2012-10-23 Thread Arun Raghavan
On Fri, 2012-10-19 at 19:26 +0300, Tanu Kaskinen wrote:
 On Fri, 2012-10-19 at 19:24 +0530, Arun Raghavan wrote:
  Hello,
  I'm hoping to freeze master for 3.0 early next week, with a release in
  2-3 weeks after that if everything is quiet. Mostly, it's just pending
  on me finishing with Peter's NEON patches.
 
 Thanks, I've been meaning to bring up the release discussion again...
 
  If there's anything that
  needs to go into this release that is in your sekrit branches or on the
  list and not been given attention, now's the time to holler!
 
 Here's a list of fixes from me that have not been reviewed yet,
 according to my bookkeeping. I'd like to get them in 3.0. There
 shouldn't be anything particularly complicated. The earliest patches are
 from March, so I'm not sure if they all apply cleanly anymore... If
 there are patches that don't apply cleanly, complain about it and I'll
 resend rebased versions.
 
 bluetooth: Don't free read_smoother in pa__done().
 bluetooth: Fix uninitialized variable.
 rtp: Get rid of an unitialized value warning from Coverity.
 pasuspender: Check pa_context_connect() return value.
 Fix pa_parse_boolean() return value checking.
 rtsp-client: Fix rtp_port reading.
 smoother-test: Fix array overflow.
 mainloop-signal: Explicitly ignore pa_write() return value.
 mainloop: Change wakeup_requested type from pa_bool_t to pa_atomic_t.
 mainloop: Remove useless pa_mainloop_wakeup() calls.
 mainloop: Remove redundant wakeup_pipe validity checks.
 mainloop: Write to the wakeup pipe unconditionally when waking up the 
 mainloop.
 mainloop: Check pa_write() return value.
 oss: Check pa_read() return value.
 cpulimit: Explicitly ignore pa_read() return value.
 daemon: Don't rely on prctl(PR_SET_KEEPCAPS, 0) for dropping caps.
 device-restore: Fix empty argument list declaration.
 memblockq: Use pa_xnew0() to avoid manual zeroing.
 memblockq: Fix the order of setting minreq and prebuf.
 modargs: Don't fail needlessly in 
 pa_modargs_get_sample_spec_and_channel_map().
 sink, source: New functions: pa_{sink,source}_new_data_add_port().
 core-util: Don't accept random words in pa_parse_boolean().
 pasuspender: Resume before exiting in case of SIGINT or fork() failure.
 object: Initialize allocated memory to zero.
 card: Store a pa_card pointer in pa_card_profile.
 switch-on-port-available: Prepare for port-is_{out, in}put going away.
 alsa-mixer: Introduce description-key option for paths.
 alsa-mixer: Remove the name option from the General section of path 
 configuration files.
 device-port: Make it impossible to have a dual-direction port.
 resampler: Make sure that there are no overflows when multiplying potentially 
 big numbers.
 loopback: Use the real sample spec once it's known.
 loopback: Don't fix the source output format/rate/channels.
 virtual-surround-sink: Fix setting max_request and max_rewind.
 sink: Process rewind requests also when suspended.
 combine: Keep the timer active in the null mode only when running.
 Propagate the PA_{SINK, SOURCE}_LATENCY flag changes through a chain of 
 filter sinks/sources.
 Propagate the PA_{SINK, SOURCE}_DYNAMIC_LATENCY flag changes through a chain 
 of filter sinks/sources.
 sink, source: Really set the fixed latency in 
 set_fixed_latency_within_thread(), always.
 build: Don't enable BlueZ if libbluetooth is not found.
 match: Use the SINK_INPUT_FIXATE hook instead of NEW.
 build: Add PROTOCOL to EXTRA_DIST.
 build: Add a2dp-codecs.h to libbluetooth-util sources.
 build: Add .gitignore files to EXTRA_DIST.

:) Let's try to work through the list and get as much done as possible.

 Are we going to make a pavucontrol release too? Here's one patch for
 pavucontrol:
 
 Enable Automake's silent-rules option.

If that's the only one, I'm not to keen on a new release.

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 1/6] gccmacro: Disable printf-like format checking on mingw32 compilers.

2012-10-23 Thread Thomas Martitz

Am 23.10.2012 08:25, schrieb Arun Raghavan:

On Tue, 2012-08-21 at 13:32 +0200, Thomas Martitz wrote:

Am 21.08.2012 08:51, schrieb Rémi Denis-Courmont:

Le mardi 21 août 2012 00:50:34 Thomas Martitz, vous avez écrit :

There are tons of warnings, most of them because the function is not
recognized as printf-like.

Removing checks looks very fishy.

To use C99 and/or GNU format specifiers on MingW, you need to use the
gnuprintf attribute instead of printf. With printf, the format string is
validated according to the antiquated MSVC rules.


Interesting, I didn't know about gnuprintf. FWIW, what are those
antiquated MSVC rules? I assumed the return value which isn't int for
some affected functions?

Is this one going to be respun?



Yes, here you go.
From c5f15eec69bf95c9a1261e0d82abbd039156e75e Mon Sep 17 00:00:00 2001
From: Thomas Martitz k...@rockbox.org
Date: Wed, 8 Aug 2012 17:38:04 +0200
Subject: [PATCH 1/3] gccmacro: Work around warnings due to printf redirection
 by libintl.

Libintl defines printf as libintl_printf, which breaks the format
attribue. Unfortunately the workaround around provided by libintl
is only enabled for cygwin, but not for mingw builds. Therefore
install the workaround manually.
---
 src/pulse/gccmacro.h |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/pulse/gccmacro.h b/src/pulse/gccmacro.h
index 1e818ff..e906f59 100644
--- a/src/pulse/gccmacro.h
+++ b/src/pulse/gccmacro.h
@@ -25,8 +25,15 @@
 /** \file
  * GCC attribute macros */
 
-#ifdef __GNUC__
+#if defined(__GNUC__)
+#ifdef __MINGW32__
+/* libintl overrides printf with a #define. As this breaks this attribute,
+ * it has a workaround. However the workaround isn't enabled for MINGW
+ * builds (only cygwin) */
+#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (__printf__, a, b)))
+#else
 #define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
+#endif
 #else
 /** If we're in GNU C, use some magic for detecting invalid format strings */
 #define PA_GCC_PRINTF_ATTR(a,b)
-- 
1.7.10.4

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Brrr ... freeze imminent

2012-10-23 Thread Arun Raghavan
On Mon, 2012-10-22 at 15:21 +0200, Peter Meerwald wrote:
 Hello Arun,
 
  I'm hoping to freeze master for 3.0 early next week, with a release in
  2-3 weeks after that if everything is quiet. Mostly, it's just pending
  on me finishing with Peter's NEON patches. If there's anything that
  needs to go into this release that is in your sekrit branches or on the
  list and not been given attention, now's the time to holler!
 
 what approach are we taking w.r.t ARM NEON patches?
 
 compile-time check vs. runtime check + separate build of NEON code?

I'm tending towards building the code in a .S separately as Rémi
suggests and selecting the right function at run-time. We probably will
need a configure-time option to enable compiling the code in at all, but
it'll allow us to have a single binary for multiple architectures, which
should be useful to binary ARM distros.

-- Arun


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] svolume_mmx fails to build on OS X

2012-10-23 Thread Tanu Kaskinen
Hi,

A bug[1] was filed about a build failure on OS X. Both Clang and GCC
give similar errors for the assembly code in svolume_mmx.c. Since
bugzilla probably isn't followed actively by many people, and since I'm
pretty clueless about this assembly stuff, I decided to raise the issue
here on the mailing list, where there may be more people with more clue.

Here are the errors from Clang:

CC   libpulsecore_2.98_la-svolume_mmx.lo
pulsecore/svolume_mmx.c:108:43: error: register %rcx is only available in 
64-bit mode
 je 2f \n\t
  ^
inline asm:5:9: note: instantiated into assembly here
 movd (%rcx, %edi, 4), %mm0  
   ^~~~
pulsecore/svolume_mmx.c:124:43: error: register %rcx is only available in 
64-bit mode
3: \n\t /* do samples in groups of 2 */
  ^
inline asm:33:9: note: instantiated into assembly here
 movq (%rcx, %edi, 4), %mm0  
   ^~~~
pulsecore/svolume_mmx.c:137:43: error: register %rcx is only available in 
64-bit mode
5: \n\t /* do samples in groups of 4 */
  ^
inline asm:59:9: note: instantiated into assembly here
 movq (%rcx, %edi, 4), %mm0  
   ^~~~
pulsecore/svolume_mmx.c:138:43: error: register %rcx is only available in 
64-bit mode
 movq (%q1, %3, 4), %%mm0  \n\t /* |  v1h  |  v1l  |  v0h  |  v0l 
 | */
  ^
inline asm:60:10: note: instantiated into assembly here
 movq 8(%rcx, %edi, 4), %mm2 
^~~~
pulsecore/svolume_mmx.c:181:43: error: register %rcx is only available in 
64-bit mode
 je 2f \n\t
  ^
inline asm:9:9: note: instantiated into assembly here
 movd (%rcx, %edi, 4), %mm0  
   ^~~~
pulsecore/svolume_mmx.c:199:43: error: register %rcx is only available in 
64-bit mode
3: \n\t /* do samples in groups of 2 */
  ^
inline asm:39:9: note: instantiated into assembly here
 movq (%rcx, %edi, 4), %mm0  
   ^~~~
pulsecore/svolume_mmx.c:214:43: error: register %rcx is only available in 
64-bit mode
5: \n\t /* do samples in groups of 4 */
  ^
inline asm:73:9: note: instantiated into assembly here
 movq (%rcx, %edi, 4), %mm0  
   ^~~~
pulsecore/svolume_mmx.c:215:43: error: register %rcx is only available in 
64-bit mode
 movq (%q1, %3, 4), %%mm0  \n\t /* |  v1h  |  v1l  |  v0h  |  v0l 
 | */
  ^
inline asm:74:10: note: instantiated into assembly here
 movq 8(%rcx, %edi, 4), %mm2 
^~~~
8 errors generated.
make[3]: *** [libpulsecore_2.98_la-svolume_mmx.lo] Error 1
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2

[1] https://bugs.freedesktop.org/show_bug.cgi?id=55733

-- 
Tanu

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Brrr ... freeze imminent

2012-10-23 Thread Thomas Martitz

Am 23.10.2012 12:10, schrieb Arun Raghavan:

Are we going to make a pavucontrol release too? Here's one patch for
pavucontrol:

Enable Automake's silent-rules option.

If that's the only one, I'm not to keen on a new release.





Speaking of it, I had it working on Windows with some (more or less) 
nasty workarounds in it and related libs. I hope to clean it up and 
publish the patches sooner or later, but I doubt it will be in time for 3.0.


Are pavucontrol releases generally aligned to PA?

Best regards.
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Brrr ... freeze imminent

2012-10-23 Thread Tanu Kaskinen
On Tue, 2012-10-23 at 15:40 +0530, Arun Raghavan wrote:
 On Fri, 2012-10-19 at 19:26 +0300, Tanu Kaskinen wrote:
  On Fri, 2012-10-19 at 19:24 +0530, Arun Raghavan wrote:
   Hello,
   I'm hoping to freeze master for 3.0 early next week, with a release in
   2-3 weeks after that if everything is quiet. Mostly, it's just pending
   on me finishing with Peter's NEON patches.
  
  Thanks, I've been meaning to bring up the release discussion again...
  
   If there's anything that
   needs to go into this release that is in your sekrit branches or on the
   list and not been given attention, now's the time to holler!
  
  Here's a list of fixes from me that have not been reviewed yet,
  according to my bookkeeping. I'd like to get them in 3.0. There
  shouldn't be anything particularly complicated. The earliest patches are
  from March, so I'm not sure if they all apply cleanly anymore... If
  there are patches that don't apply cleanly, complain about it and I'll
  resend rebased versions.
  
  bluetooth: Don't free read_smoother in pa__done().
  bluetooth: Fix uninitialized variable.
  rtp: Get rid of an unitialized value warning from Coverity.
  pasuspender: Check pa_context_connect() return value.
  Fix pa_parse_boolean() return value checking.
  rtsp-client: Fix rtp_port reading.

This one is actually already reviewed, so I pushed it now.

  smoother-test: Fix array overflow.
  mainloop-signal: Explicitly ignore pa_write() return value.
  mainloop: Change wakeup_requested type from pa_bool_t to pa_atomic_t.
  mainloop: Remove useless pa_mainloop_wakeup() calls.
  mainloop: Remove redundant wakeup_pipe validity checks.
  mainloop: Write to the wakeup pipe unconditionally when waking up the 
  mainloop.
  mainloop: Check pa_write() return value.
  oss: Check pa_read() return value.
  cpulimit: Explicitly ignore pa_read() return value.
  daemon: Don't rely on prctl(PR_SET_KEEPCAPS, 0) for dropping caps.
  device-restore: Fix empty argument list declaration.
  memblockq: Use pa_xnew0() to avoid manual zeroing.
  memblockq: Fix the order of setting minreq and prebuf.
  modargs: Don't fail needlessly in 
  pa_modargs_get_sample_spec_and_channel_map().
  sink, source: New functions: pa_{sink,source}_new_data_add_port().
  core-util: Don't accept random words in pa_parse_boolean().
  pasuspender: Resume before exiting in case of SIGINT or fork() failure.
  object: Initialize allocated memory to zero.
  card: Store a pa_card pointer in pa_card_profile.
  switch-on-port-available: Prepare for port-is_{out, in}put going away.
  alsa-mixer: Introduce description-key option for paths.
  alsa-mixer: Remove the name option from the General section of path 
  configuration files.
  device-port: Make it impossible to have a dual-direction port.
  resampler: Make sure that there are no overflows when multiplying 
  potentially big numbers.
  loopback: Use the real sample spec once it's known.
  loopback: Don't fix the source output format/rate/channels.
  virtual-surround-sink: Fix setting max_request and max_rewind.
  sink: Process rewind requests also when suspended.
  combine: Keep the timer active in the null mode only when running.
  Propagate the PA_{SINK, SOURCE}_LATENCY flag changes through a chain of 
  filter sinks/sources.
  Propagate the PA_{SINK, SOURCE}_DYNAMIC_LATENCY flag changes through a 
  chain of filter sinks/sources.
  sink, source: Really set the fixed latency in 
  set_fixed_latency_within_thread(), always.
  build: Don't enable BlueZ if libbluetooth is not found.
  match: Use the SINK_INPUT_FIXATE hook instead of NEW.
  build: Add PROTOCOL to EXTRA_DIST.
  build: Add a2dp-codecs.h to libbluetooth-util sources.
  build: Add .gitignore files to EXTRA_DIST.
 
 :) Let's try to work through the list and get as much done as possible.

The list is much longer than what I anticipated when I wrote I'd like
to get them in 3.0. Here's a list of serious bug fixes, they could be
prioritized for 3.0:

memblockq: Fix the order of setting minreq and prebuf.
pasuspender: Resume before exiting in case of SIGINT or fork() failure.
resampler: Make sure that there are no overflows when multiplying potentially 
big numbers.
loopback: Use the real sample spec once it's known.
loopback: Don't fix the source output format/rate/channels.
virtual-surround-sink: Fix setting max_request and max_rewind.
sink: Process rewind requests also when suspended.
combine: Keep the timer active in the null mode only when running.
match: Use the SINK_INPUT_FIXATE hook instead of NEW.
build: Add a2dp-codecs.h to libbluetooth-util sources.

I think make distcheck doesn't work without that last patch...

These would be nice too, since we need them in Mer and Nemo (they are
currently shipped as patches on top of v2.1, but I'd really like to
minimize the amount of patches):

Propagate the PA_{SINK, SOURCE}_LATENCY flag changes through a chain of filter 
sinks/sources.
Propagate the PA_{SINK, SOURCE}_DYNAMIC_LATENCY flag changes through a chain 

Re: [pulseaudio-discuss] [PATCH] core: Fix a litte-endian bug in ARM svolume code

2012-10-23 Thread Peter Meerwald
Hello Arun,

checking NEON volume_float32ne
NEON: 10223 usec.
ref: 46480 usec.
checking NEON volume_s16ne
NEON: 8484 usec.
ARM: 339272 usec.
ref: 20203 usec.

I was testing with SAMPLES 1019; while you are likely testing with
SAMPLES 1022

Checking ARMv6 svolume (with 1019 samples)
func: 33923743 usec (min = 338868, max = 341919, stddev = 365.753).
orig: 2430664 usec (min = 24261, max = 24445, stddev = 42.2141).

Checking ARMv6 svolume (with 1022 samples)
func: 915036 usec (min = 9094, max = 9338, stddev = 50.2385).
orig: 2437988 usec (min = 24322, max = 24536, stddev = 48.1282).

   That's odd indeed. I have this on a Freescale i.mx53 (also Cortex A8)
   Checking ARM svolume
   func: 905150 usec (min = 9006, max = 9562, stddev = 76.1938).
   orig: 2278824 usec (min = 22760, max = 23252, stddev = 65.5575).

I get similar numbers with SAMPLES 1022 on a beagle-xm; I think you'll 
see catastrophic runtime with SAMPLES 1019

comparing ARM vs. NEON code, the svolume s16 NEON code uses two MULs, 
while ARM can do with one -- the ARM instructions (smulwb, ssat) look 
ideal for the svolume_s16 code

three observations:

(1) when the number of samples is odd, the ARM code processes the first 
sample before switching to the unrolled 4-samples-at-a-time loop; this 
causes the samples pointer to become misaligned (2-byte align) (assuming 
it was 4-byte aligned initially)

I am not sure what guarantees PulseAudio gives on buffer alignment 

(2) the NEON code generally fails when input data length  4; can be 
easily fixed

(3) neither ARM nor NEON code cares about alignment; just the strategy is 
different

ARM handles cases where length % 3 != 0 first (before entering the 
unrolled loop); which is bad when the sample buffer is aligned
NEON takes care of length % 3 != 0 for the last samples; which is good 
when the smaple buffer is aligned


  # ./cpu-test 
  Running suite(s): CPU
  CPU flags: V6 V7 VFP EDSP NEON VFPV3 Cortex-A8 
  Initialising ARM optimized volume functions.
  Checking ARM svolume
  0: 1ac8 != 390e (43e9 * d716)
  Orc not supported. Skipping
  50%: Checks: 2, Failures: 1, Errors: 0
  tests/cpu-test.c:52:F:svolume:svolume_arm_test:0: Failed

 Does this include the little-endianness fix?

my fault; took the latest source, but failed to make sure that the proper 
.so was linked - it works with little-endian fixes actually deployed

 My current testing shows NEON svolume code with int16 samples
 consistently slower than the ARM code (tried on the Pandaboard, i.mx51,
 i,mx53, imx.6) by ~10% in most cases.

I agree; I think the ARM code is pretty good for s16 handling plus I think 
enabling NEON is expensive power-wise -- so svolume_s16_neon should be 
dropped and svolume_s16_arm should be improved to handle odd buffers 
nicely

I just ignored the ARM code before since I was always testing with SAMPLES 
1019 this hitting the worst case runtime wise

regards, p.

-- 

Peter Meerwald
+43-664-218 (mobile)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] core: Fix a litte-endian bug in ARM svolume code

2012-10-23 Thread Arun Raghavan
On Tue, 2012-10-23 at 15:48 +0200, Peter Meerwald wrote:
 Hello myself,
 
  comparing ARM vs. NEON code, the svolume s16 NEON code uses two MULs, 
  while ARM can do with one -- the ARM instructions (smulwb, ssat) look 
  ideal for the svolume_s16 code
 
 for the records, NEON can also do it with one MUL:
 
 static inline void vol_s16_neon(const uint32x4_t *vol4, int16_t *samples, 
 unsigned length) {
 asm volatile (
 mov%[length], %[length], lsr #2\n\t
 vld1.s32   {q1}, [%[vol]]\n\t
 1:\n\t
 vld1.16{d0}, [%[samples]]\n\t
 vshll.s16  q0, d0, #15\n\t
 vqdmulhq.s32 q0, q0, q1\n\t
 vmovn.s32  d0, q0\n\t
 subs   %[length], %[length], #1\n\t
 vst1.16{d0}, [%[samples]]!\n\t
 bgt1b\n\t
   /* output operands (or input operands that get modified) */
 : [samples] +r (samples), [length] +r (length)
 : [vol] r (vol4) /* input operands */
 : memory, cc, q0, q1 /* clobber list */
 );
 }
 
 Checking ARM NEON svolume
 func: 1291289 usec (min = 12817, max = 13184, stddev = 65.9113).
 orig: 2438875 usec (min = 24322, max = 25605, stddev = 130.359).
 Orc not supported. Skipping
 100%: Checks: 3, Failures: 0, Errors: 0
 
 this is a bit better than the previous NEON code (~130 vs. ~151), 
 but still slower than ARM (~92)

Nice catch on the alignment. I'm trying to extend our tests to catch
these cases. A couple of notes: Rémi Denis-Courmont mentions that you
will likely see performance benefits in the NEON code by sprinkling in
some preloads (PLD). I've also factored out the sconv code and that does
provide a win on all the boards I tried.

To get this moving for 3.0, could you respin just the sconv patches on
top of master (I'll push out my testing code soon) so that we can push
that bit out first while we work on the others?

Cheers,
Arun


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH v1 0/6] Bluetooth: Late UUID support

2012-10-23 Thread Mikel Astiz
From: Mikel Astiz mikel.as...@bmw-carit.de

v1 proposal with the changes suggested by Tanu, most significantly:
- Assertions used to detect duplicated card profiles instead of errors.
- Hashmap memory freed in callers-side after pa_card_add_ports().
- Added core hooks to report added profiles and ports.
- Subscription mechanism used to report card changes.
- New UUID hook renamed to _HOOK_UUID_ADDED.
- D-Bus API extended with signal NewProfile (patch v1 4/6).

From original cover-letter:

PulseAudio does not currently support creating card profiles dynamically. This 
patchset proposes such feature in order to be used by the Bluetooth modules.

Mikel Astiz (6):
  card: Support adding profiles dynamically
  card: Support adding ports dynamically
  dbus: Support dynamically created card profiles
  dbus: Add signal org.PulseAudio.Core1.Card.NewProfile
  bluetooth: Add hook to announce late UUIDs
  bluetooth: Handle UUIDs announced later

 src/modules/bluetooth/bluetooth-util.c  |  8 
 src/modules/bluetooth/bluetooth-util.h  |  1 +
 src/modules/bluetooth/module-bluetooth-device.c | 39 +++
 src/modules/dbus/iface-card.c   | 52 +
 src/pulsecore/card.c| 29 ++
 src/pulsecore/card.h|  3 ++
 src/pulsecore/core.h|  2 +
 7 files changed, 134 insertions(+)

-- 
1.7.11.7

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH v1 1/6] card: Support adding profiles dynamically

2012-10-23 Thread Mikel Astiz
From: Mikel Astiz mikel.as...@bmw-carit.de

Some cards might need to add profiles during their lifetime, that is,
after the card has been created.
---
 src/pulsecore/card.c | 12 
 src/pulsecore/card.h |  2 ++
 src/pulsecore/core.h |  1 +
 3 files changed, 15 insertions(+)

diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index 492c051..eb1fcc0 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -79,6 +79,18 @@ void pa_card_new_data_set_name(pa_card_new_data *data, const 
char *name) {
 data-name = pa_xstrdup(name);
 }
 
+void pa_card_add_profile(pa_card *c, struct pa_card_profile *profile) {
+pa_assert(c);
+pa_assert(profile);
+
+/* take ownership of the profile */
+pa_assert_se(pa_hashmap_put(c-profiles, profile-name, profile) = 0);
+
+pa_subscription_post(c-core, 
PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, c-index);
+
+pa_hook_fire(c-core-hooks[PA_CORE_HOOK_CARD_PROFILE_ADDED], profile);
+}
+
 void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile) 
{
 pa_assert(data);
 
diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
index 6f942e8..4d0a9a2 100644
--- a/src/pulsecore/card.h
+++ b/src/pulsecore/card.h
@@ -100,6 +100,8 @@ void pa_card_new_data_done(pa_card_new_data *data);
 pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
 void pa_card_free(pa_card *c);
 
+void pa_card_add_profile(pa_card *c, struct pa_card_profile *profile);
+
 int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save);
 
 int pa_card_suspend(pa_card *c, pa_bool_t suspend, pa_suspend_cause_t cause);
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index ba21fa9..aec7f80 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -113,6 +113,7 @@ typedef enum pa_core_hook {
 PA_CORE_HOOK_CARD_PUT,
 PA_CORE_HOOK_CARD_UNLINK,
 PA_CORE_HOOK_CARD_PROFILE_CHANGED,
+PA_CORE_HOOK_CARD_PROFILE_ADDED,
 PA_CORE_HOOK_PORT_AVAILABLE_CHANGED,
 PA_CORE_HOOK_MAX
 } pa_core_hook_t;
-- 
1.7.11.7

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH v1 2/6] card: Support adding ports dynamically

2012-10-23 Thread Mikel Astiz
From: Mikel Astiz mikel.as...@bmw-carit.de

Card profiles -specially the ones registered with pa_card_add_profile()-
might need to create new ports during the lifetime of the card.
---
 src/pulsecore/card.c | 17 +
 src/pulsecore/card.h |  1 +
 src/pulsecore/core.h |  1 +
 3 files changed, 19 insertions(+)

diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index eb1fcc0..7c18c26 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -91,6 +91,23 @@ void pa_card_add_profile(pa_card *c, struct pa_card_profile 
*profile) {
 pa_hook_fire(c-core-hooks[PA_CORE_HOOK_CARD_PROFILE_ADDED], profile);
 }
 
+void pa_card_add_ports(pa_card *c, pa_hashmap *ports) {
+pa_device_port *p;
+void *state;
+
+pa_assert(c);
+pa_assert(ports);
+
+/* take ownership of the ports */
+PA_HASHMAP_FOREACH(p, ports, state)
+pa_assert_se(pa_hashmap_put(c-ports, p-name, p) = 0);
+
+pa_subscription_post(c-core, 
PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, c-index);
+
+while ((p = pa_hashmap_steal_first(ports)) != NULL)
+pa_hook_fire(c-core-hooks[PA_CORE_HOOK_PORT_ADDED], p);
+}
+
 void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile) 
{
 pa_assert(data);
 
diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
index 4d0a9a2..c82a369 100644
--- a/src/pulsecore/card.h
+++ b/src/pulsecore/card.h
@@ -101,6 +101,7 @@ pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
 void pa_card_free(pa_card *c);
 
 void pa_card_add_profile(pa_card *c, struct pa_card_profile *profile);
+void pa_card_add_ports(pa_card *c, pa_hashmap *ports);
 
 int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save);
 
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index aec7f80..cf7cc11 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -115,6 +115,7 @@ typedef enum pa_core_hook {
 PA_CORE_HOOK_CARD_PROFILE_CHANGED,
 PA_CORE_HOOK_CARD_PROFILE_ADDED,
 PA_CORE_HOOK_PORT_AVAILABLE_CHANGED,
+PA_CORE_HOOK_PORT_ADDED,
 PA_CORE_HOOK_MAX
 } pa_core_hook_t;
 
-- 
1.7.11.7

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH v1 4/6] dbus: Add signal org.PulseAudio.Core1.Card.NewProfile

2012-10-23 Thread Mikel Astiz
From: Mikel Astiz mikel.as...@bmw-carit.de

Add a new D-Bus signal to report profiles that have been dynamically
created for already existing cards.
---
 src/modules/dbus/iface-card.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/src/modules/dbus/iface-card.c b/src/modules/dbus/iface-card.c
index 902b21c..57fd248 100644
--- a/src/modules/dbus/iface-card.c
+++ b/src/modules/dbus/iface-card.c
@@ -108,15 +108,18 @@ static pa_dbus_method_handler 
method_handlers[METHOD_HANDLER_MAX] = {
 
 enum signal_index {
 SIGNAL_ACTIVE_PROFILE_UPDATED,
+SIGNAL_NEW_PROFILE,
 SIGNAL_PROPERTY_LIST_UPDATED,
 SIGNAL_MAX
 };
 
 static pa_dbus_arg_info active_profile_updated_args[] = { { profile,   
o,  NULL } };
+static pa_dbus_arg_info new_profile_args[] ={ { profile,   
o,  NULL } };
 static pa_dbus_arg_info property_list_updated_args[] =  { { property_list, 
a{say}, NULL } };
 
 static pa_dbus_signal_info signals[SIGNAL_MAX] = {
 [SIGNAL_ACTIVE_PROFILE_UPDATED] = { .name = ActiveProfileUpdated, 
.arguments = active_profile_updated_args, .n_arguments = 1 },
+[SIGNAL_NEW_PROFILE]= { .name = NewProfile,   
.arguments = new_profile_args,.n_arguments = 1 },
 [SIGNAL_PROPERTY_LIST_UPDATED]  = { .name = PropertyListUpdated,  
.arguments = property_list_updated_args,  .n_arguments = 1 }
 };
 
@@ -496,6 +499,8 @@ static pa_hook_result_t card_profile_added_cb(void 
*hook_data, void *call_data,
 pa_dbusiface_card *c = slot_data;
 pa_card_profile *profile = call_data;
 pa_dbusiface_card_profile *p;
+const char *object_path;
+DBusMessage *signal_msg;
 
 if (!card_has_profile(c-card, profile))
 return PA_HOOK_OK;
@@ -506,6 +511,17 @@ static pa_hook_result_t card_profile_added_cb(void 
*hook_data, void *call_data,
 p = pa_dbusiface_card_profile_new(c, core, profile, 
c-next_profile_index++);
 pa_hashmap_put(c-profiles, pa_dbusiface_card_profile_get_name(p), p);
 
+/* Send D-Bus signal */
+object_path = pa_dbusiface_card_profile_get_path(p);
+
+pa_assert_se(signal_msg = dbus_message_new_signal(c-path,
+ 
PA_DBUSIFACE_CARD_INTERFACE,
+ 
signals[SIGNAL_NEW_PROFILE].name));
+pa_assert_se(dbus_message_append_args(signal_msg, DBUS_TYPE_OBJECT_PATH, 
object_path, DBUS_TYPE_INVALID));
+
+pa_dbus_protocol_send_signal(c-dbus_protocol, signal_msg);
+dbus_message_unref(signal_msg);
+
 return PA_HOOK_OK;
 }
 
-- 
1.7.11.7

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH v1 5/6] bluetooth: Add hook to announce late UUIDs

2012-10-23 Thread Mikel Astiz
From: Mikel Astiz mikel.as...@bmw-carit.de

UUIDs might be announced at any time, so a hook is needed to notify any
interested module. In practice, the UUIDs are quite stable with the
exception of the pairing procedure, where the UUIDs are reported by
BlueZ as soon as they are discovered.
---
 src/modules/bluetooth/bluetooth-util.c | 8 
 src/modules/bluetooth/bluetooth-util.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/modules/bluetooth/bluetooth-util.c 
b/src/modules/bluetooth/bluetooth-util.c
index 1e81864..272b6ce 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -383,9 +383,17 @@ static int parse_device_property(pa_bluetooth_discovery 
*y, pa_bluetooth_device
 const char *value;
 
 dbus_message_iter_get_basic(ai, value);
+
+if (pa_bluetooth_uuid_has(d-uuids, value)) {
+dbus_message_iter_next(ai);
+continue;
+}
+
 node = uuid_new(value);
 PA_LLIST_PREPEND(pa_bluetooth_uuid, d-uuids, node);
 
+
pa_hook_fire(d-hooks[PA_BLUETOOTH_DEVICE_HOOK_UUID_ADDED], (char *) value);
+
 /* Vudentz said the interfaces are here when the UUIDs are 
announced */
 if (strcasecmp(HSP_AG_UUID, value) == 0 || 
strcasecmp(HFP_AG_UUID, value) == 0) {
 pa_assert_se(m = 
dbus_message_new_method_call(org.bluez, d-path, 
org.bluez.HandsfreeGateway, GetProperties));
diff --git a/src/modules/bluetooth/bluetooth-util.h 
b/src/modules/bluetooth/bluetooth-util.h
index 4e3b5f0..8a3f2ad 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -94,6 +94,7 @@ typedef enum pa_bt_audio_state {
 /* Hook data: pa_bluetooth_device pointer. */
 typedef enum pa_bluetooth_device_hook {
 PA_BLUETOOTH_DEVICE_HOOK_REMOVED, /* Call data: NULL. */
+PA_BLUETOOTH_DEVICE_HOOK_UUID_ADDED, /* Call data: const char *uuid. */
 PA_BLUETOOTH_DEVICE_HOOK_MAX
 } pa_bluetooth_device_hook_t;
 
-- 
1.7.11.7

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH v1 6/6] bluetooth: Handle UUIDs announced later

2012-10-23 Thread Mikel Astiz
From: Mikel Astiz mikel.as...@bmw-carit.de

In some cases (typically during pairing) UUIDs might be reported by
BlueZ incrementally, that is, as soon as they have been discovered. At
this point module-bluetooth-device might already be loaded, so the late
UUID announcements need to be handled and additional card profiles
might need to be created accordingly.
---
 src/modules/bluetooth/module-bluetooth-device.c | 39 +
 1 file changed, 39 insertions(+)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c 
b/src/modules/bluetooth/module-bluetooth-device.c
index 8c2efa4..0442035 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -140,6 +140,7 @@ struct userdata {
 pa_module *module;
 
 pa_bluetooth_device *device;
+pa_hook_slot *uuid_added_slot;
 char *address;
 char *path;
 pa_bluetooth_transport *transport;
@@ -2495,6 +2496,38 @@ static pa_bluetooth_device* find_device(struct userdata 
*u, const char *address,
 }
 
 /* Run from main thread */
+static pa_hook_result_t uuid_added_cb(pa_bluetooth_device *d, const char 
*uuid, struct userdata *u) {
+pa_card_profile *p;
+pa_hashmap *new_ports;
+
+pa_assert(d);
+pa_assert(uuid);
+pa_assert(u);
+
+p = create_card_profile(u, uuid);
+
+if (!p)
+return PA_HOOK_OK;
+
+if (pa_hashmap_get(u-card-profiles, p-name)) {
+pa_card_profile_free(p);
+return PA_HOOK_OK;
+}
+
+pa_card_add_profile(u-card, p);
+
+new_ports = pa_hashmap_new(pa_idxset_string_hash_func, 
pa_idxset_string_compare_func);
+
+create_ports_for_profile(u, new_ports, p);
+
+pa_card_add_ports(u-card, new_ports);
+
+pa_device_port_hashmap_free(new_ports);
+
+return PA_HOOK_OK;
+}
+
+/* Run from main thread */
 static int setup_dbus(struct userdata *u) {
 DBusError err;
 
@@ -2597,6 +2630,9 @@ int pa__init(pa_module* m) {
 
 u-device = device;
 
+u-uuid_added_slot = 
pa_hook_connect(device-hooks[PA_BLUETOOTH_DEVICE_HOOK_UUID_ADDED], 
PA_HOOK_NORMAL,
+ (pa_hook_cb_t) uuid_added_cb, u);
+
 /* Add the card structure. This will also initialize the default profile */
 if (add_card(u)  0)
 goto fail;
@@ -2714,6 +2750,9 @@ void pa__done(pa_module *m) {
 pa_dbus_connection_unref(u-connection);
 }
 
+if (u-uuid_added_slot)
+pa_hook_slot_free(u-uuid_added_slot);
+
 if (u-msg)
 pa_xfree(u-msg);
 
-- 
1.7.11.7

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] module rtp-recv: Fix warning using pa_assert_not_reached()

2012-10-23 Thread Peter Meerwald
From: Peter Meerwald p.meerw...@bct-electronic.com

  modules/rtp/module-rtp-recv.c:462:8: warning: 'r' may be used uninitialized 
in this function [-Wuninitialized]

Signed-off-by: Peter Meerwald p.meerw...@bct-electronic.com
---
 src/modules/rtp/module-rtp-recv.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/modules/rtp/module-rtp-recv.c 
b/src/modules/rtp/module-rtp-recv.c
index 412f4c3..3e9250c 100644
--- a/src/modules/rtp/module-rtp-recv.c
+++ b/src/modules/rtp/module-rtp-recv.c
@@ -451,13 +451,14 @@ static int mcast_socket(const struct sockaddr* sa, 
socklen_t salen) {
 mr4.imr_multiaddr = ((const struct sockaddr_in*) sa)-sin_addr;
 r = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, mr4, sizeof(mr4));
 #ifdef HAVE_IPV6
-} else {
+} else if (af == AF_INET6) {
 struct ipv6_mreq mr6;
 memset(mr6, 0, sizeof(mr6));
 mr6.ipv6mr_multiaddr = ((const struct sockaddr_in6*) sa)-sin6_addr;
 r = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, mr6, sizeof(mr6));
 #endif
-}
+} else
+pa_assert_not_reached();
 
 if (r  0) {
 pa_log_info(Joining mcast group failed: %s, pa_cstrerror(errno));
-- 
1.7.9.5

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 1/2] core: Initialize ARM NEON code if available

2012-10-23 Thread Peter Meerwald
From: Peter Meerwald p.meerw...@bct-electronic.com

Signed-off-by: Peter Meerwald p.meerw...@bct-electronic.com
---
 src/pulsecore/cpu-arm.c |4 +++-
 src/pulsecore/cpu-arm.h |2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/pulsecore/cpu-arm.c b/src/pulsecore/cpu-arm.c
index 934c7fe..60e047f 100644
--- a/src/pulsecore/cpu-arm.c
+++ b/src/pulsecore/cpu-arm.c
@@ -140,7 +140,9 @@ pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
 #if defined (__linux__)
 pa_cpu_get_arm_flags(flags);
 
-if (*flags  PA_CPU_ARM_V6)
+if (*flags  PA_CPU_ARM_NEON)
+pa_convert_func_init_neon(*flags);
+else if (*flags  PA_CPU_ARM_V6)
 pa_volume_func_init_arm(*flags);
 
 return TRUE;
diff --git a/src/pulsecore/cpu-arm.h b/src/pulsecore/cpu-arm.h
index 91aa659..88b2aec 100644
--- a/src/pulsecore/cpu-arm.h
+++ b/src/pulsecore/cpu-arm.h
@@ -41,4 +41,6 @@ pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags);
 /* some optimized functions */
 void pa_volume_func_init_arm(pa_cpu_arm_flag_t flags);
 
+void pa_convert_func_init_neon(pa_cpu_arm_flag_t flags);
+
 #endif /* foocpuarmhfoo */
-- 
1.7.9.5

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 2/2] core: Add ARM NEON optimized sample conversion code

2012-10-23 Thread Peter Meerwald
From: Peter Meerwald p.meerw...@bct-electronic.com

v4:
* fix for sample length  4
v3:
* convert from intrinsics to inline assembly
v2:
* load and store data with vld1/vld1q and vst1/vst1q, resp., to work
  around alignment issues of compiler-generated vldmia instruction
* remove redundant check for NEON flags

Ubuntu/Linaro gcc 4.6.3
arm-linux-gnueabi-gcc -O2 -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon

runtime on beagle-xm:

D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_from_float
I: [pulseaudio] sconv_neon.c: NEON: 3754 usec.
I: [pulseaudio] sconv_neon.c: ref: 58594 usec.
D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_to_float
I: [pulseaudio] sconv_neon.c: NEON: 1831 usec.
I: [pulseaudio] sconv_neon.c: ref: 10528 usec.
I: [pulseaudio] sconv_neon.c: Initialising ARM NEON optimized conversions.

conversion may be off by one for some samples due to rounding issues

Signed-off-by: Peter Meerwald p.meerw...@bct-electronic.com
---
 src/Makefile.am|2 +-
 src/pulsecore/sconv_neon.c |  213 
 2 files changed, 214 insertions(+), 1 deletion(-)
 create mode 100644 src/pulsecore/sconv_neon.c

diff --git a/src/Makefile.am b/src/Makefile.am
index 6212c74..0ca1ec2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -850,7 +850,7 @@ libpulsecore_@PA_MAJORMINOR@_la_SOURCES = \
pulsecore/svolume_mmx.c pulsecore/svolume_sse.c \
pulsecore/sconv-s16be.c pulsecore/sconv-s16be.h \
pulsecore/sconv-s16le.c pulsecore/sconv-s16le.h \
-   pulsecore/sconv_sse.c \
+   pulsecore/sconv_sse.c pulsecore/sconv_neon.c \
pulsecore/sconv.c pulsecore/sconv.h \
pulsecore/shared.c pulsecore/shared.h \
pulsecore/sink-input.c pulsecore/sink-input.h \
diff --git a/src/pulsecore/sconv_neon.c b/src/pulsecore/sconv_neon.c
new file mode 100644
index 000..96e91ca
--- /dev/null
+++ b/src/pulsecore/sconv_neon.c
@@ -0,0 +1,213 @@
+/***
+  This file is part of PulseAudio.
+
+  Copyright 2012 Peter Meerwald p.meerw...@bct-electronic.com
+
+  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.
+***/
+
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
+#include pulse/rtclock.h
+
+#include pulsecore/macro.h
+#include pulsecore/endianmacros.h
+
+#include cpu-arm.h
+#include sconv.h
+
+#if defined(__ARM_NEON__)
+
+#include math.h
+#include arm_neon.h
+
+#define RUN_TEST
+
+static void pa_sconv_s16le_from_f32ne_neon(unsigned n, const float *src, 
int16_t *dst) {
+unsigned i = n  3;
+
+asm volatile (
+movs   %[n], %[n], lsr #2\n\t
+beq2f\n\t
+vdup.f32   q2, %[plusone]\n\t
+vneg.f32   q3, q2\n\t
+vdup.f32   q4, %[scale]\n\t
+vdup.u32   q5, %[mask]\n\t
+vdup.f32   q6, %[half]\n\t
+1:\n\t
+vld1.32{q0}, [%[src]]!\n\t
+vmin.f32   q0, q0, q2\n\t /* clamp */
+vmax.f32   q0, q0, q3\n\t
+vmul.f32   q0, q0, q4\n\t /* scale */
+vand.u32   q1, q0, q5\n\t
+vorr.u32   q1, q1, q6\n\t /* round */
+vadd.f32   q0, q0, q1\n\t
+vcvt.s32.f32 q0, q0\n\t /* narrow */
+vmovn.i32  d0, q0\n\t
+subs   %[n], %[n], #1\n\t
+vst1.16{d0}, [%[dst]]!\n\t
+bgt1b\n\t
+2:\n\t
+  /* output operands (or input operands that get modified) */
+: [dst] +r (dst), [src] +r (src), [n] +r (n)
+: [plusone] r (1.0f), [scale] r (32767.0f),
+  [half] r (0.5f), [mask] r (0x8000) /* input operands */
+: memory, cc, q0, q1, q2, q3, q4, q5, q6 /* clobber list 
*/
+);
+
+// leftovers
+while (i--) {
+*dst++ = (int16_t) lrintf(PA_CLAMP_UNLIKELY(*src, -1.0f, 1.0f) * 
0x7FFF);
+src++;
+}
+}
+
+static void pa_sconv_s16le_to_f32ne_neon(unsigned n, const int16_t *src, float 
*dst) {
+unsigned i = n  3;
+
+const float invscale = 1.0f / 0x7FFF;
+
+asm volatile (
+movs%[n], %[n], lsr #2\n\t
+beq2f\n\t
+vdup.f32   q1, %[invscale]\n\t
+1:\n\t
+vld1.16{d0}, [%[src]]!\n\t
+vmovl.s16  q0, d0\n\t
+vcvt.f32.s32 q0, q0\n\t
+vmul.f32   q0, q0, q1\n\t
+subs   %[n], %[n], #1\n\t
+vst1.32{q0}, [%[dst]]!\n\t
+bgt1b\n\t
+2:\n\t
+  /* output operands (or input operands that get modified) */
+: [dst] +r (dst), [src] +r (src), [n] +r (n)
+: [invscale] r (invscale) /* input operands */
+: memory, cc, q0, q1 /* clobber list */
+);
+
+// leftovers
+while (i--) {
+*dst++ = *src++ * invscale;
+}

Re: [pulseaudio-discuss] [PATCH] core: Fix a litte-endian bug in ARM svolume code

2012-10-23 Thread Peter Meerwald

 To get this moving for 3.0, could you respin just the sconv patches on
 top of master (I'll push out my testing code soon) so that we can push
 that bit out first while we work on the others?

just sent the sconv stuff only
thank you for your efforts!

p.

-- 

Peter Meerwald
+43-664-218 (mobile)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] device-restore: When restoring volume, print the restored volume to the log.

2012-10-23 Thread Tanu Kaskinen
---
 src/modules/module-device-restore.c |   16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/modules/module-device-restore.c 
b/src/modules/module-device-restore.c
index b9bd498..c9ffbb1 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -779,12 +779,13 @@ static pa_hook_result_t sink_fixate_hook_callback(pa_core 
*c, pa_sink_new_data *
 
 if (!new_data-volume_is_set) {
 pa_cvolume v;
+char buf[PA_CVOLUME_SNPRINT_MAX];
 
 pa_log_info(Restoring volume for sink %s., new_data-name);
-
 v = e-volume;
 pa_cvolume_remap(v, e-channel_map, new_data-channel_map);
 pa_sink_new_data_set_volume(new_data, v);
+pa_log_info(Restored volume: %s, pa_cvolume_snprint(buf, 
PA_CVOLUME_SNPRINT_MAX, new_data-volume));
 
 new_data-save_volume = TRUE;
 } else
@@ -823,14 +824,15 @@ static pa_hook_result_t sink_port_hook_callback(pa_core 
*c, pa_sink *sink, struc
 if ((e = perportentry_read(u, name, (sink-active_port ? 
sink-active_port-name : NULL {
 
 if (u-restore_volume  e-volume_valid) {
-
+char buf[PA_CVOLUME_SNPRINT_MAX];
 pa_cvolume v;
 
 pa_log_info(Restoring volume for sink %s., sink-name);
-
 v = e-volume;
 pa_cvolume_remap(v, e-channel_map, sink-channel_map);
 pa_sink_set_volume(sink, v, TRUE, FALSE);
+pa_log_info(Restored volume: %s, pa_cvolume_snprint(buf, 
PA_CVOLUME_SNPRINT_MAX, sink-reference_volume));
+
 sink-save_volume = TRUE;
 }
 
@@ -919,13 +921,14 @@ static pa_hook_result_t 
source_fixate_hook_callback(pa_core *c, pa_source_new_da
 if (u-restore_volume  e-volume_valid) {
 
 if (!new_data-volume_is_set) {
+char buf[PA_CVOLUME_SNPRINT_MAX];
 pa_cvolume v;
 
 pa_log_info(Restoring volume for source %s., new_data-name);
-
 v = e-volume;
 pa_cvolume_remap(v, e-channel_map, new_data-channel_map);
 pa_source_new_data_set_volume(new_data, v);
+pa_log_info(Restored volume: %s, pa_cvolume_snprint(buf, 
PA_CVOLUME_SNPRINT_MAX, new_data-volume));
 
 new_data-save_volume = TRUE;
 } else
@@ -964,14 +967,15 @@ static pa_hook_result_t source_port_hook_callback(pa_core 
*c, pa_source *source,
 if ((e = perportentry_read(u, name, (source-active_port ? 
source-active_port-name : NULL {
 
 if (u-restore_volume  e-volume_valid) {
-
+char buf[PA_CVOLUME_SNPRINT_MAX];
 pa_cvolume v;
 
 pa_log_info(Restoring volume for source %s., source-name);
-
 v = e-volume;
 pa_cvolume_remap(v, e-channel_map, source-channel_map);
 pa_source_set_volume(source, v, TRUE, FALSE);
+pa_log_info(Restored volume: %s, pa_cvolume_snprint(buf, 
PA_CVOLUME_SNPRINT_MAX, source-reference_volume));
+
 source-save_volume = TRUE;
 }
 
-- 
1.7.10.4

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Brrr ... freeze imminent

2012-10-23 Thread Niels Ole Salscheider
Hello,

please consider to also merge version 2 of my patch module-virtual-surround-
sink: add silence to hrir if necessary.

The problem is, that the libsndfile based resamplers do not guarantee to output 
any samples for too short input sequences. Thus, we should append silence to 
the hrir if we do not get enough samples from the resampler.

Regards,

Ole
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] pulse: Fix for volume documentation

2012-10-23 Thread Arun Raghavan
On Thu, 2012-08-09 at 15:52 -0300, Flavio Ceolin wrote:
 Fixing the documentation for the function pa_cvolume_dec().
 ---
  src/pulse/volume.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Pulled, thanks!

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] a question about audio synchronization between local sink and tunnel sink

2012-10-23 Thread Arun Raghavan
On Thu, 2012-10-18 at 23:17 +, Sun, Xiaodong wrote:
 Tanu,
 
 Yes, I am new to PulseAudio code. All I have done so far with code is, 
 reading a few module source code (i.e. module-combine-sink.c, 
 module-tunnel.c, sink.c, etc.) to understand the nature of this 
 unsynchronized issue I met. I didn't expect I will be involved as a developer 
 at all. Since this feature is very important to me, it seems I have to dive 
 deeper. My time is very tight though. Is there any design document you can 
 share with me. I can only find the document for developer on freedesktop.org. 
[...]

The only resources available are:

* Assorted developer docs:
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer

* API: http://freedesktop.org/software/pulseaudio/doxygen/

* The code :)

As Tanu mentions, feel free to drop by IRC to talk to us, or post any
questions you have about the code / design on list.

-- Arun

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss