Re: [pulseaudio-discuss] [PACKAGERS] New dep
2011/5/27 Luke Yelavich them...@ubuntu.com: On Fri, May 27, 2011 at 04:52:02AM EST, Arun Raghavan wrote: The website worked fine as of a month ago. I don't know why it's down now. The library serves the purpose we need well (light weight, doesn't invent its own type system, allows you to parse out values individually instead of mandating key-value pairs), and is available on every major distribution ... It is availab ein Ubuntu yes, however its in our universe component of the package archive, universe being unsupported by Canonical. If PulseAudio master was used in future versions of Ubuntu, I would feel comfortable knowing that the json c library being used will reguaruly receive upstrea maintenance, as that in turn makes it easier for Canonical to commit to supporting the package in long term releases. The website is (sort of) up again. Although the latest release was almost two years ago, it seems from the svn logs that there is still development going on and that the project is very responsive to bug reports. (I've submitted a few patches for mingw cross-compiling myself, so let's see where that goes) The mailing lists still don't work and the project infrastructure could be a bit better (such as svn web access), but in general I think it looks like a solid upstream. Luke Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PACKAGERS] New dep
2011/5/16 Colin Guthrie gm...@colin.guthr.ie: Hi, I've just pushed Arun's (mostly, Pierre-Louis also had a hand!) passthrough work to master. This carries with it a new dependency: json-c What is the upstream location of that software? Googling for json implementations gives a lot of small libraries, it is not clear which one is needed as the pulse dep. I guess it could be the one at http://oss.metaparadigm.com/json-c/, but that website is out of order for some time now. The .tar file is only locatable through the packaging systems of various Linux distros/BSDs. Needless to say, such an unclear status of a dependency is not really helpfull in packaging PulseAudio. We may yet remove this and write our own parser for the simple subset of JSON formatting we use but there may ultimately be other reasons to keep this longer term. But in the interests of simplicity, I'd certainly not be against any native implementation patches that came along provided they were simple and clean. Please test these changes. I'm sure Arun will post more details and test requests in due course. Col Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] How to debug a protocol error message?
2011/5/23 Quinn Plattel qie...@gmail.com: Hi, I am currently having problems with communication between a version 0.9.22 pulseaudio client and a version 0.9.15 pulseaudio server. Here are the steps to reproduce the error message: pulseaudio server side: ssh -X -R 4713:localhost:4713 remote-pulseaudio-client PULSE_SERVER=localhost:4713 pactl stat client reports: Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472 Trying to connect to localhost:4713... SHM possible: yes Protocol version: remote 16, local 16 Negotiated SHM: no Connection failure: Connection terminated - server reports: -- protocol error, kicking client -- I have done some testing and a 0.9.15 server has no problems communicating with a 0.9.14 client, but a 0.9.15 server has this error when communicating with a 0.9.19 or 0.9.22 client. Where do I begin to debug this error? The difficulty here is of course that while the server throws an error, you're looking to fix the client side, because there won't be a maintainance release of the 0.9.15 series anymore. If you can install debug symbols, you can set a breakpoint at protocol_error(). This will break in command_stat() (src/pulsecore/protocol-native.c), right after the !pa_tagstruct_eof(t) check. There you can inspect what kind of unexpected extra data is in the tagstruct and take it from there. Please also try whether other commands work. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [RFC] Source Output Volumes
2011/5/20 Colin Guthrie gm...@colin.guthr.ie: Hello, As some of you know I've been working on restoring a little more symmetry to our API to allow the adjustment of source output (capture stream) volumes. In the past, when stream volumes were added to sink inputs, it was thought that this feature wouldn't be overly useful for capture streams and while this argument still holds true, there is one feature that has since been added to PA that would make it useful - flat volumes. Flat volumes allow for multiple streams to be connected to the same device and when they differ in stream volume, the maximum one is chosen and the h/w is set to that, with the difference in volume between the streams applied in software. This in theory allows for optimum power efficiency where the software stays out of the loop whenever possible. With flat volumes, adding per-stream volumes to capture streams makes sense. With these changes, would it still be possible to record audio without software gain? As it is now, I can record from a source that has its volume set to 100% and be confident that I'm getting the signal direct from the soundcard. Is that still the case with the default source output volume? Maarten It does also simplify client code when they want to adjust their own volumes, they don't have to implement their own asymmetry to deal with ours. So I am proud to announce my work to try and achieve this. There are no doubt still bugs, so a thorough review is very much appreciated. I will not post patches to the list (unless screamed for) as some of them are necessarily rather large (+400 and +2k lines in the biggest patches). Most of the code is mirrored from the sink or sink input side. There is a lot of scope to cut down on code duplication but for the purposes of getting this out there I'll leave that for after the next release. In some cases, applying the patch and comparing e.g. sink.c with source.c is a better way of reviewing the changes (while there are still several differences it isn't too hard to compare them). I originally added support for synchronised streams for recording but then realised that this makes little sense practically and removed it again. I did the removal in a separate commit as it may be easier to compare the sink vs. source files before this patch to cut down on asymmetry) Known niggles; There are still some strange things with volumes. The flat volume stuff doesn't seem to work perfectly as when adjusting a recording stream volume down from NORM, the h/w volume does not drop... only when the hardware volume has been moved down to 0 and back to NORM does flat volume stuff work seem to work properly. I think there are still a few niggles with volume setting generally (for outputs too) as I still have a problem reported earlier that the initial volume of things is disconnected to the h/w state and while PA thinks it's got 100% it's actually not... I still need to look at that properly. So without further ado, here is the branch for review: http://colin.guthr.ie/git/pulseaudio/log/?h=master-source-volume git://colin.guthr.ie/pulseaudio (master-source-volume branch) For convenience of testing you can also use this patch to pavucontrol: http://colin.guthr.ie/git/pavucontrol/log/?h=master-source-volumes Have fun! 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
Re: [pulseaudio-discuss] [RFC] Source Output Volumes
2011/5/20 Colin Guthrie gm...@colin.guthr.ie: 'Twas brillig, and Maarten Bosmans at 20/05/11 10:23 did gyre and gimble: With flat volumes, adding per-stream volumes to capture streams makes sense. With these changes, would it still be possible to record audio without software gain? As it is now, I can record from a source that has its volume set to 100% and be confident that I'm getting the signal direct from the soundcard. Is that still the case with the default source output volume? Yeah, that should still be the case. If you set the volume to of your stream to 100%, even if some other stream is recording at 50%, the h/w volume should be set to 100% Of course this is all rather arbitrary, as on my h/w the gain is 0dB when I set the volume to 0 at 100% it's +22.5dB, so to say direct from the sound card at 100% is a little strange it's getting +22.5dB :) Ah, well I should probably have given some context. I'm recording from a 24bit/96Hz USB audio interface, so I want the PCM signal of the A/D converter as it is send over USB. This soundcard has no ALSA mixer element, so that part is easy. I just want to make sure Pulse doesn't do anything with that signal. I guess the problem would come when recording two things at once. If you set one to 100% (thus +22.5dB on my system) and one to the base volume of the source it's attached to (thus ALSA's 0dB*), then the one that expects to be recording at 0dB will actually get a signal that has gone up to +22.5dB and then come back down in software to 0dB. This isn't ideal, but then it's as non-ideal as it is currently and the use case for recording two streams at the same time is rather minimal anyway, so I don't think in all practicality, this is a big issue. Actually in my setup, I specifically put Pulse in the audio pipeline to be able to start multiple independent recordings simultaneously, without that requirement I could have just as well used ALSA directly (it's a headless audio server, not a desktop). The reason for this is that I want to be able to start a recording and separately decide whether the audio should be streamed (either RTP over LAN, or HTTP/Ogg/Vorbis over the internet, or both) and Pulse lets me start and stop the recording and live stream independently, which is great. Of course if you don't use flat volumes and only use per-stream recording volumes in your app, then the difference between the source volume and the stream volume does come into play AFAIUI. But then if you take the time to disable flat volumes, that's presumably a consequence you can live with. I have some experimenting to do with Pulse git, but I might very well end up disabling flat volumes, thanks for the hint. Col * I have one USB mic that reports it's range as +20dB to +50dB in alsa, so the base volume for it is actually significantly below the ALSA 0 point on the kcontrol! Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] Receiving RTP streams with pulseaudio
2011/5/18 Colin Guthrie gm...@colin.guthr.ie: 'Twas brillig, and Rémi Denis-Courmont at 18/05/11 07:37 did gyre and gimble: On Tue, 17 May 2011 21:51:35 +0200, Michael Trunner mich...@trunner.de wrote: I'm trying to setup Pulseaudio to receive RTP/Multicast steams. Sender should be vlc, (and receiver should be pulseaudio). I activated module-rtp-recv (and module-rtp-send) with papref, but I can't get it work. Can some one explain me what I have to do? Or how to debug it. First you need to make sure that VLC uses an RTP payload format that PulseAudio understands, typically L16/44100/2 (signed big endian 16-bits stereo at 44100 Hz). By default, VLC will not decode the audio. Also make sure SAP is enabled. For example: # IP=224.0.0.42 # vlc --sout-keep --no-sout-video --no-sout-spu \ --sout #transcode{acodec=s16b,samplerate=44100}:gather:rtp{sap,dst=$IP} Then you need to configure PulseAudio to use the standard SAP address as specified in IETF RFC2974 §3, corresponding to the multicast scope that VLC is configured to use, in particular: - 224.2.127.254 (SAP.MCAST.NET) for global IPv4, - ff0e::2:7ffe for global IPv6, - 224.0.0.255 for link-local IPv4, - ff02::2:7ffe for link-local IPv6. Many thanks for the info Rémi :) By default, PulseAudio uses a proprietary non-standard SAP group, namely 224.0.0.56. This cannot interoperate with VLC. Interesting. I see from the history: Then there is also http://www.pulseaudio.org/ticket/436 Can we decide now what to change the default to? commit e1887b552ceb324f70732c85c7458119e03718b7 Author: Lennart Poettering lenn...@poettering.net Date: Sun Apr 16 11:13:20 2006 + change default mcast address once again, to make sure our traffic doesn't leave the network by default Previously the address was 224.0.1.3 The change before that is: commit c999fe40b841b035c7d0c873b4a4875e12e9c9a4 Author: Lennart Poettering lenn...@poettering.net Date: Sun Apr 16 09:15:51 2006 + * deal properly with underruns, overflows and packet losses * change default mcast address * detect RTP loops Which had the address as 224.0.1.2. This was the address used when the module was committed. This default can be overridden in the module-rtp-recv module with the sap_address= argument. And with the module-rtp-send module with the destination= argument. Hope that helps. If you have any recommendations for the defaults, please feel free to suggest them, but I guess the intention was to keep the traffic in house by default. We should likely expose via paprefs the ability to choose a public mutlicast group or something. WDYT? 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
Re: [pulseaudio-discuss] Reciving RTP streams with pulseaudio
The catch is that module-rtp-receive waits for a SDP/SAP announcement on the specified multicast group before it begins playing the RTP audio stream. VLC probably only send an RTP stream. I have no clear recipe for you how to instruct VLC to send SAP messages. You could of course send VLC output to a local pulse server, on which you configure module-rtp-send, but that is a bit of a roundabout way to do it. Maarten 2011/5/17 Michael Trunner mich...@trunner.de: Hi, I'm trying to setup Pulseaudio to receive RTP/Multicast steams. Sender should be vlc, (and receiver should be pulseaudio). I activated module-rtp-recv (and module-rtp-send) with papref, but I can't get it work. Can some one explain me what I have to do? Or how to debug it. The other way sending an audiostream from pulseaudio over rtp to vlc works just fine. Thanks Michael ___ 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
Re: [pulseaudio-discuss] Is it possible to compress pulseaudio's network streams?
There are currently no plans and no active development on compressed network streams for PulseAudio. That said, it would be nice to have some day. It seems that the consensus is that the CELT codec would be best suited for this, because of it's tight control over latency. When streaming audio (especially over wifi) latency and jitter are much more of a concern than bandwidth. There is certainly some room for improvement there, even without adding a crompressed stream format. Maarten 2011/5/10 Aitor Pazos m...@aitorpazos.es: 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 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] module combine not respecting requested latencies
2011/5/9 Maarten Lankhorst m.b.lankho...@gmail.com: Hi all, I was toying around with the combine module, but it appears it adds a lot latency for no good reason, changing it from 200 ms to 10 ms makes some applications like wine happier. I wanted to see if I could fix it myself, but I must admit I don't understand what the various parts of that code do. Please have another look at your patch. This is setting BLOCK_USEC to 10 seconds, not ms. Moreover, I don't think BLOCK_USEC is related in any way to the default adjust_time, so if changing BLOCK_USEC, better set it to some other hardcoded value, to avoid the suggestion that it has anything to do with the adjust_time. The fact that is's both an input and output make it even harder.. A naive patch to fix it is here, but it would have been nice if module combine would just respect the latency I ask it to set, and maybe just set a high latency by default otherwise. ~Maarten Maarten diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c index 09af942..138e3e8 100644 --- a/src/modules/module-combine-sink.c +++ b/src/modules/module-combine-sink.c @@ -72,7 +72,7 @@ PA_MODULE_USAGE( #define DEFAULT_ADJUST_TIME_USEC (10*PA_USEC_PER_SEC) -#define BLOCK_USEC (PA_USEC_PER_MSEC * 200) +#define BLOCK_USEC DEFAULT_ADJUST_TIME_USEC static const char* const valid_modargs[] = { sink_name, ___ 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
Re: [pulseaudio-discuss] ORC buildsystem problems
2011/5/3 Paul Menzel paulepan...@users.sourceforge.net: Am Dienstag, den 03.05.2011, 08:39 +0530 schrieb Arun Raghavan: On Mon, 2011-05-02 at 11:52 +0200, Maarten Bosmans wrote: Recently, I encountered some problems when enabling orc in some less usual situations. When compiling with --enable-orc from a tarball generated from a --disable-orc configured tree, the following error occurs. make[2]: *** No rule to make target `pulsecore/svolume-orc-gen.c', needed by `all'. Stop I haven't really looked at a solution. Perhaps the nodist_ prefix for some files inside if HAVE_ORC in src/Makefile.am should be dropped? May be Colin needs to do his make distchecks with this situation, in order to catch it earlier. There should not be a dist'ed tarball without those generated files. Whether they are used or not is a configure-time option, then. Right. Any idea on how to fix that then? Secondly, there is a problem when cross-compiling. The pkg-config check for ORC is used to find the usual include files and linking flags, but also to find the location of orcc. This is a problem, because when configure is run with the correct configuration, such that pkg-config finds the host package, it also finds the host orcc (in the case of my mingw32 test, it finds orcc.exe), which is of course useless in the build environment. Why is it useless in your environment? The files generated by orcc are architecture-neutral. The binary that make ends up trying to use (orcc.exe) is useless, because it's a win32 binary on a Linux platform. So the architecture-neutral files can't even be generated. For your second issue please take a look at the thread on the gstreamer-devel list [1]. Ah, yes. It seems that my workaround of setting ORCC= is the advised solution. Still it would be better to autodetect a broken return value of pkg-config. I could make a patch to orc.m4 that does just that, but I can't seem to find the file in the orc git repo. Is orc.m4 managed locally in the pulse tree, or is there some upstream that improvements should also be submitted to? Thanks, Paul [1] http://lists.freedesktop.org/archives/gstreamer-devel/2011-March/030983.html Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] Cleanup of configure.ac
This patch series cleans up the --enable-feature handling part of configure.ac. It changes the testing of features so that they are all done in the same way. The linecount of configure.ac is reduced from around 1800 with 450 lines. This is partly because os using macro's, partly due to simplification of if/else logic and also a bit due to rewriting stuff to one line. I think the readability of configure.ac is greatly improved. The only feature that is lost is the error message when --enable-foo=arg is used with arg something other than yes or no. Instead now silently the default is used. This is no big loss IMHO, because usually just --enable-foo or --disable-foo is given to configure. Maarten [PATCH 1/7] build-system: Simplify AC_ARG_ENABLE usage [PATCH 2/7] build-system: Use AS_IF macro for configure output [PATCH 3/7] build-system: Move AC_DEFINE to separate line with AS_IF [PATCH 4/7] build-system: Move dependency error messages to outer scope [PATCH 5/7] build-system: Replace some more conditionals with AS_IF [PATCH 6/7] build-system: Rearrange database selection [PATCH 7/7] build-system: Small fixes ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 2/7] build-system: Use AS_IF macro for configure output
And add some HAVE_[feature] variables for clarity. --- configure.ac | 198 ++ 1 files changed, 48 insertions(+), 150 deletions(-) diff --git a/configure.ac b/configure.ac index a816052..403b935 100644 --- a/configure.ac +++ b/configure.ac @@ -754,26 +754,32 @@ if test x$enable_oss_output != xno || test x$enable_oss_wrapper != xno; AC_CHECK_HEADERS([sys/soundcard.h], [ if test x$enable_oss_output != xno; then +HAVE_OSS_OUTPUT=1 AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?]) fi if test x$enable_oss_wrapper != xno; then +HAVE_OSS_WRAPPER=1 AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?]) fi HAVE_OSS=1 ], [ HAVE_OSS=0 +HAVE_OSS_OUTPUT=0 +HAVE_OSS_WRAPPER=0 if test x$enable_oss_output = xyes || test x$enable_oss_wrapper = xyes; then AC_MSG_ERROR([*** OSS support not found]) fi ]) else HAVE_OSS=0 +HAVE_OSS_OUTPUT=0 +HAVE_OSS_WRAPPER=0 fi AC_SUBST(HAVE_OSS) -AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test x$HAVE_OSS = x1 test x$enable_oss_output != xno]) -AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test x$HAVE_OSS = x1 test x$enable_oss_wrapper != xno]) +AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test x$HAVE_OSS_OUTPUT = x1]) +AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test x$HAVE_OSS_WRAPPER = x1]) CoreAudio support (optional) @@ -1021,11 +1027,15 @@ AC_ARG_ENABLE([tcpwrap], if test x$enable_tcpwrap != xno; then ACX_LIBWRAP -if test x${LIBWRAP_LIBS} = x test x$enable_tcpwrap = xyes; then -AC_MSG_ERROR([*** TCP wrappers support not found]) +HAVE_TCPWRAP=1 +if test x${LIBWRAP_LIBS} = x; then +HAVE_TCPWRAP=0 +if test x$enable_tcpwrap = xyes; then +AC_MSG_ERROR([*** TCP wrappers support not found]) +fi fi else -LIBWRAP_LIBS= +HAVE_TCPWRAP=0 fi AC_SUBST(LIBWRAP_LIBS) @@ -1274,7 +1284,10 @@ AC_ARG_ENABLE([per-user-esound-socket], AS_HELP_STRING([--disable-per-user-esound-socket],[Use global esound socket directory /tmp/.esd/socket.])) if test x$enable_per_user_esound_socket != xno; then - AC_DEFINE([USE_PER_USER_ESOUND_SOCKET], [1], [Define this if you want per-user esound socket directories]) +USE_PER_USER_ESOUND_SOCKET=1 +AC_DEFINE([USE_PER_USER_ESOUND_SOCKET], [1], [Define this if you want per-user esound socket directories]) +else +USE_PER_USER_ESOUND_SOCKET=0 fi PulseAudio system runtime dir @@ -1362,151 +1375,36 @@ po/Makefile.in AC_OUTPUT # == -ENABLE_X11=no -if test x$HAVE_X11 = x1 ; then - ENABLE_X11=yes -fi - -ENABLE_OSS_OUTPUT=no -ENABLE_OSS_WRAPPER=no -if test x$HAVE_OSS = x1 ; then - if test x$enable_oss_output != xno; then - ENABLE_OSS_OUTPUT=yes - fi - if test x$enable_oss_wrapper != xno; then - ENABLE_OSS_WRAPPER=yes - fi -fi - -ENABLE_COREAUDIO=no -if test x$HAVE_COREAUDIO = x1 ; then - ENABLE_COREAUDIO=yes -fi - -ENABLE_ALSA=no -if test x$HAVE_ALSA = x1 ; then - ENABLE_ALSA=yes -fi - -ENABLE_SOLARIS=no -if test x$HAVE_SOLARIS = x1 ; then - ENABLE_SOLARIS=yes -fi - -ENABLE_WAVEOUT=no -if test x$HAVE_WAVEOUT = x1 ; then - ENABLE_WAVEOUT=yes -fi - -ENABLE_GTK20=no -if test x$HAVE_GTK20 = x1 ; then - ENABLE_GTK20=yes -fi - -ENABLE_GLIB20=no -if test x$HAVE_GLIB20 = x1 ; then - ENABLE_GLIB20=yes -fi - -ENABLE_GCONF=no -if test x$HAVE_GCONF = x1 ; then - ENABLE_GCONF=yes -fi - -ENABLE_AVAHI=no -if test x$HAVE_AVAHI = x1 ; then - ENABLE_AVAHI=yes -fi - -ENABLE_JACK=no -if test x$HAVE_JACK = x1 ; then - ENABLE_JACK=yes -fi - -ENABLE_LIBASYNCNS=no -if test x$HAVE_LIBASYNCNS = x1 ; then - ENABLE_LIBASYNCNS=yes -fi - -ENABLE_LIRC=no -if test x$HAVE_LIRC = x1 ; then - ENABLE_LIRC=yes -fi - -ENABLE_DBUS=no -if test x$HAVE_DBUS = x1 ; then - ENABLE_DBUS=yes -fi - -ENABLE_HAL=no -if test x$HAVE_HAL = x1 ; then - ENABLE_HAL=yes -fi - -ENABLE_UDEV=no -if test x$HAVE_UDEV = x1 ; then - ENABLE_UDEV=yes -fi - -ENABLE_HAL_COMPAT=no -if test x$HAVE_HAL_COMPAT = x1 ; then - ENABLE_HAL_COMPAT=yes -fi - -ENABLE_TCPWRAP=no -if test x${LIBWRAP_LIBS} != x ; then - ENABLE_TCPWRAP=yes -fi - -ENABLE_LIBSAMPLERATE=no -if test x${HAVE_LIBSAMPLERATE} = x1 ; then - ENABLE_LIBSAMPLERATE=yes -fi - -ENABLE_BLUEZ=no -if test x${HAVE_BLUEZ} = x1 ; then - ENABLE_BLUEZ=yes -fi - -ENABLE_GDBM=no -if test x${HAVE_GDBM} = x1 ; then - ENABLE_GDBM=yes -fi -ENABLE_TDB=no -if test x${HAVE_TDB} = x1 ; then - ENABLE_TDB=yes -fi - -ENABLE_SIMPLEDB=no -if test x${HAVE_SIMPLEDB} = x1 ; then -ENABLE_SIMPLEDB=yes -fi - -ENABLE_FFTW=no -if test x${HAVE_FFTW} = x1 ; then - ENABLE_FFTW=yes -fi - -ENABLE_ORC=no -if test x${HAVE_ORC} = xyes ; then - ENABLE_ORC=yes
[pulseaudio-discuss] [PATCH 4/7] build-system: Move dependency error messages to outer scope
--- configure.ac | 107 +++-- 1 files changed, 43 insertions(+), 64 deletions(-) diff --git a/configure.ac b/configure.ac index 72cfbb7..18a136d 100644 --- a/configure.ac +++ b/configure.ac @@ -576,13 +576,12 @@ if test x$enable_x11 != xno; then HAVE_X11=1, [ HAVE_X11=0 -if test x$enable_x11 = xyes; then -AC_MSG_ERROR([*** X11 not found]) -fi ]) else HAVE_X11=0 fi +AS_IF([test x$enable_x11 = xyes test x$HAVE_X11 = x0], +[AC_MSG_ERROR([*** X11 not found])]) AC_SUBST(X11_CFLAGS) AC_SUBST(X11_LIBS) @@ -650,13 +649,12 @@ if test x$enable_samplerate != xno; then HAVE_LIBSAMPLERATE=1, [ HAVE_LIBSAMPLERATE=0 -if test x$enable_samplerate = xyes; then -AC_MSG_ERROR([*** Libsamplerate not found]) -fi ]) else HAVE_LIBSAMPLERATE=0 fi +AS_IF([test x$enable_samplerate = xyes test x$HAVE_LIBSAMPLERATE = x0], +[AC_MSG_ERROR([*** Libsamplerate not found])]) AC_SUBST(LIBSAMPLERATE_CFLAGS) AC_SUBST(LIBSAMPLERATE_LIBS) @@ -679,12 +677,10 @@ if test x${with_database} = xauto -o x${with_database} = xtdb ; then [ HAVE_TDB=1 with_database=tdb -], [ -if test x${with_database} = xtdb ; then -AC_MSG_ERROR([*** tdb not found]) -fi -]) +], []) fi +AS_IF([test x$with_database = xtdb test x$HAVE_TDB = x0], +[AC_MSG_ERROR([*** tdb not found])]) if test x${with_database} = xauto -o x${with_database} = xgdbm ; then have_gdbm=yes @@ -697,10 +693,10 @@ if test x${with_database} = xauto -o x${with_database} = xgdbm ; then GDBM_CFLAGS= GDBM_LIBS=-lgdbm with_database=gdbm - elif test x${with_database} = xgdbm; then - AC_MSG_ERROR([*** gdbm not found]) fi fi +AS_IF([test x$with_database = xgdbm test x$HAVE_GDBM = x0], +[AC_MSG_ERROR([*** gdbm not found])]) if test x${with_database} = xauto -o x${with_database} = xsimple ; then HAVE_SIMPLEDB=1 @@ -750,15 +746,14 @@ if test x$enable_oss_output != xno || test x$enable_oss_wrapper != xno; HAVE_OSS=0 HAVE_OSS_OUTPUT=0 HAVE_OSS_WRAPPER=0 -if test x$enable_oss_output = xyes || test x$enable_oss_wrapper = xyes; then -AC_MSG_ERROR([*** OSS support not found]) -fi ]) else HAVE_OSS=0 HAVE_OSS_OUTPUT=0 HAVE_OSS_WRAPPER=0 fi +AS_IF([test x$enable_oss_output = xyes -o x$enable_oss_wrapper = xyes test x$HAVE_ALSA = x0], +[AC_MSG_ERROR([*** OSS support not found])]) AC_SUBST(HAVE_OSS) AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test x$HAVE_OSS_OUTPUT = x1]) @@ -792,13 +787,12 @@ if test x$enable_alsa != xno; then ], [ HAVE_ALSA=0 -if test x$enable_alsa = xyes; then -AC_MSG_ERROR([*** Needed alsa = 1.0.19 support not found]) -fi ]) else HAVE_ALSA=0 fi +AS_IF([test x$enable_alsa = xyes test x$HAVE_ALSA = x0], +[AC_MSG_ERROR([*** Needed alsa = 1.0.19 support not found])]) AC_SUBST(ASOUNDLIB_CFLAGS) AC_SUBST(ASOUNDLIB_LIBS) @@ -818,13 +812,12 @@ if test x$enable_solaris != xno; then ], [ HAVE_SOLARIS=0 -if test x$enable_solaris = xyes; then -AC_MSG_ERROR([*** Solaris audio support not found]) -fi ]) else HAVE_SOLARIS=0 fi +AS_IF([test x$enable_solaris = xyes test x$HAVE_SOLARIS = x0], +[AC_MSG_ERROR([*** Solaris audio support not found])]) AC_SUBST(HAVE_SOLARIS) AM_CONDITIONAL([HAVE_SOLARIS], [test x$HAVE_SOLARIS = x1]) @@ -842,14 +835,13 @@ if test x$enable_waveout != xno; then ], [ HAVE_WAVEOUT=0 -if test x$enable_waveout = xyes; then -AC_MSG_ERROR([*** WaveOut audio support not found]) -fi ], [#include windows.h]) else HAVE_WAVEOUT=0 fi +AS_IF([test x$enable_waveout = xyes test x$HAVE_WAVEOUT = x0], +[AC_MSG_ERROR([*** WaveOut audio support not found])]) AC_SUBST(HAVE_WAVEOUT) AM_CONDITIONAL([HAVE_WAVEOUT], [test x$HAVE_WAVEOUT = x1]) @@ -865,13 +857,12 @@ if test x$enable_glib2 != xno; then HAVE_GLIB20=1, [ HAVE_GLIB20=0 -if test x$enable_glib2 = xyes; then -AC_MSG_ERROR([*** GLib 2 support not found]) -fi ]) else HAVE_GLIB20=0 fi +AS_IF([test x$enable_glib2 = xyes test x$HAVE_GLIB20 = x0], +[AC_MSG_ERROR([*** GLib 2 support not found])]) AC_SUBST(GLIB20_CFLAGS) AC_SUBST(GLIB20_LIBS) @@ -889,13 +880,12 @@ if test x$enable_gtk2 != xno; then HAVE_GTK20=1, [ HAVE_GTK20=0 -if test x$enable_gtk2 = xyes; then -AC_MSG_ERROR([*** Gtk+ 2 support not found]) -
[pulseaudio-discuss] [PATCH 3/7] build-system: Move AC_DEFINE to separate line with AS_IF
--- configure.ac | 59 - 1 files changed, 17 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index 403b935..72cfbb7 100644 --- a/configure.ac +++ b/configure.ac @@ -584,14 +584,11 @@ else HAVE_X11=0 fi -if test x${HAVE_X11} = x1 ; then - AC_DEFINE([HAVE_X11], 1, [Have X11?]) -fi - AC_SUBST(X11_CFLAGS) AC_SUBST(X11_LIBS) AC_SUBST(HAVE_X11) AM_CONDITIONAL([HAVE_X11], [test x$HAVE_X11 = x1]) +AS_IF([test x$HAVE_X11 = x1], AC_DEFINE([HAVE_X11], 1, [Have X11?])) Capabilities (optional) @@ -661,14 +658,11 @@ else HAVE_LIBSAMPLERATE=0 fi -if test x${HAVE_LIBSAMPLERATE} = x1 ; then - AC_DEFINE([HAVE_LIBSAMPLERATE], 1, [Have libsamplerate?]) -fi - AC_SUBST(LIBSAMPLERATE_CFLAGS) AC_SUBST(LIBSAMPLERATE_LIBS) AC_SUBST(HAVE_LIBSAMPLERATE) AM_CONDITIONAL([HAVE_LIBSAMPLERATE], [test x$HAVE_LIBSAMPLERATE = x1]) +AS_IF([test x$HAVE_LIBSAMPLERATE = x1], AC_DEFINE([HAVE_LIBSAMPLERATE], 1, [Have libsamplerate?])) Database support @@ -717,30 +711,21 @@ if test x${HAVE_TDB} != x1 -a x${HAVE_GDBM} != x1 -a x${HAVE_SIMPLEDB} != AC_MSG_ERROR([*** missing database backend]) fi -if test x${HAVE_TDB} = x1 ; then - AC_DEFINE([HAVE_TDB], 1, [Have tdb?]) -fi - -if test x${HAVE_GDBM} = x1 ; then - AC_DEFINE([HAVE_GDBM], 1, [Have gdbm?]) -fi - -if test x${HAVE_SIMPLEDB} = x1 ; then -AC_DEFINE([HAVE_SIMPLEDB], 1, [Have simple?]) -fi - AC_SUBST(TDB_CFLAGS) AC_SUBST(TDB_LIBS) AC_SUBST(HAVE_TDB) AM_CONDITIONAL([HAVE_TDB], [test x$HAVE_TDB = x1]) +AS_IF([test x$HAVE_TDB = x1], AC_DEFINE([HAVE_TDB], 1, [Have tdb?])) AC_SUBST(GDBM_CFLAGS) AC_SUBST(GDBM_LIBS) AC_SUBST(HAVE_GDBM) AM_CONDITIONAL([HAVE_GDBM], [test x$HAVE_GDBM = x1]) +AS_IF([test x$HAVE_GDBM = x1], AC_DEFINE([HAVE_GDBM], 1, [Have gdbm?])) AC_SUBST(HAVE_SIMPLEDB) AM_CONDITIONAL([HAVE_SIMPLEDB], [test x$HAVE_SIMPLEDB = x1]) +AS_IF([test x$HAVE_SIMPLEDB = x1], AC_DEFINE([HAVE_SIMPLEDB], 1, [Have simple?])) OSS support (optional) @@ -755,11 +740,9 @@ if test x$enable_oss_output != xno || test x$enable_oss_wrapper != xno; [ if test x$enable_oss_output != xno; then HAVE_OSS_OUTPUT=1 -AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?]) fi if test x$enable_oss_wrapper != xno; then HAVE_OSS_WRAPPER=1 -AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?]) fi HAVE_OSS=1 ], @@ -780,6 +763,8 @@ fi AC_SUBST(HAVE_OSS) AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test x$HAVE_OSS_OUTPUT = x1]) AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test x$HAVE_OSS_WRAPPER = x1]) +AS_IF([test x$HAVE_OSS_OUTPUT = x1], AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?])) +AS_IF([test x$HAVE_OSS_WRAPPER = x1], AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?])) CoreAudio support (optional) @@ -804,7 +789,6 @@ if test x$enable_alsa != xno; then PKG_CHECK_MODULES(ASOUNDLIB, [ alsa = 1.0.19 ], [ HAVE_ALSA=1 -AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?]) ], [ HAVE_ALSA=0 @@ -820,6 +804,7 @@ AC_SUBST(ASOUNDLIB_CFLAGS) AC_SUBST(ASOUNDLIB_LIBS) AC_SUBST(HAVE_ALSA) AM_CONDITIONAL([HAVE_ALSA], [test x$HAVE_ALSA = x1]) +AS_IF([test x$HAVE_ALSA = x1], AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])) Solaris audio support (optional) @@ -830,7 +815,6 @@ if test x$enable_solaris != xno; then AC_CHECK_HEADERS([sys/audio.h], [ HAVE_SOLARIS=1 -AC_DEFINE([HAVE_SOLARIS], 1, [Have Solaris audio?]) ], [ HAVE_SOLARIS=0 @@ -844,6 +828,7 @@ fi AC_SUBST(HAVE_SOLARIS) AM_CONDITIONAL([HAVE_SOLARIS], [test x$HAVE_SOLARIS = x1]) +AS_IF([test x$HAVE_SOLARIS = x1], AC_DEFINE([HAVE_SOLARIS], 1, [Have Solaris audio?])) WaveOut audio support (optional) @@ -854,7 +839,6 @@ if test x$enable_waveout != xno; then AC_CHECK_HEADERS([mmsystem.h], [ HAVE_WAVEOUT=1 -AC_DEFINE([HAVE_WAVEOUT], 1, [Have WaveOut audio?]) ], [ HAVE_WAVEOUT=0 @@ -869,6 +853,7 @@ fi AC_SUBST(HAVE_WAVEOUT) AM_CONDITIONAL([HAVE_WAVEOUT], [test x$HAVE_WAVEOUT = x1]) +AS_IF([test x$HAVE_WAVEOUT = x1], AC_DEFINE([HAVE_WAVEOUT], 1, [Have WaveOut audio?])) GLib 2 support (optional) @@ -892,10 +877,7 @@ AC_SUBST(GLIB20_CFLAGS) AC_SUBST(GLIB20_LIBS) AC_SUBST(HAVE_GLIB20) AM_CONDITIONAL([HAVE_GLIB20], [test x$HAVE_GLIB20 = x1]) - -if test x$HAVE_GLIB20 = x1 ; then - AC_DEFINE([HAVE_GLIB], 1, [Have GLIB?]) -fi +AS_IF([test x$HAVE_GLIB20 = x1], AC_DEFINE([HAVE_GLIB], 1, [Have GLIB?])) GTK2 support (optional) @@ -919,10 +901,7 @@ AC_SUBST(GTK20_CFLAGS) AC_SUBST(GTK20_LIBS) AC_SUBST(HAVE_GTK20) AM_CONDITIONAL([HAVE_GTK20], [test x$HAVE_GTK20 = x1]) - -if test
[pulseaudio-discuss] [PATCH 5/7] build-system: Replace some more conditionals with AS_IF
--- configure.ac | 311 +++--- 1 files changed, 103 insertions(+), 208 deletions(-) diff --git a/configure.ac b/configure.ac index 18a136d..9755800 100644 --- a/configure.ac +++ b/configure.ac @@ -571,15 +571,10 @@ PKG_PROG_PKG_CONFIG AC_ARG_ENABLE([x11], AS_HELP_STRING([--disable-x11],[Disable optional X11 support])) -if test x$enable_x11 != xno; then -PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ], -HAVE_X11=1, -[ -HAVE_X11=0 -]) -else -HAVE_X11=0 -fi +AS_IF([test x$enable_x11 != xno], +[PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ], HAVE_X11=1, HAVE_X11=0)], +HAVE_X11=0) + AS_IF([test x$enable_x11 = xyes test x$HAVE_X11 = x0], [AC_MSG_ERROR([*** X11 not found])]) @@ -644,15 +639,10 @@ fi AC_ARG_ENABLE([samplerate], AS_HELP_STRING([--disable-samplerate],[Disable optional libsamplerate support])) -if test x$enable_samplerate != xno; then -PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate = 0.1.0 ], -HAVE_LIBSAMPLERATE=1, -[ -HAVE_LIBSAMPLERATE=0 -]) -else -HAVE_LIBSAMPLERATE=0 -fi +AS_IF([test x$enable_samplerate != xno], +[PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate = 0.1.0 ], HAVE_LIBSAMPLERATE=1, HAVE_LIBSAMPLERATE=0)], +HAVE_LIBSAMPLERATE=0) + AS_IF([test x$enable_samplerate = xyes test x$HAVE_LIBSAMPLERATE = x0], [AC_MSG_ERROR([*** Libsamplerate not found])]) @@ -731,30 +721,21 @@ AC_ARG_ENABLE([oss-output], AC_ARG_ENABLE([oss-wrapper], AS_HELP_STRING([--disable-oss-wrapper],[Disable optional OSS wrapper support])) -if test x$enable_oss_output != xno || test x$enable_oss_wrapper != xno; then -AC_CHECK_HEADERS([sys/soundcard.h], -[ -if test x$enable_oss_output != xno; then -HAVE_OSS_OUTPUT=1 -fi -if test x$enable_oss_wrapper != xno; then -HAVE_OSS_WRAPPER=1 -fi -HAVE_OSS=1 -], -[ -HAVE_OSS=0 -HAVE_OSS_OUTPUT=0 -HAVE_OSS_WRAPPER=0 -]) -else -HAVE_OSS=0 -HAVE_OSS_OUTPUT=0 -HAVE_OSS_WRAPPER=0 -fi -AS_IF([test x$enable_oss_output = xyes -o x$enable_oss_wrapper = xyes test x$HAVE_ALSA = x0], +AS_IF([test x$enable_oss_output != xno -o x$enable_oss_wrapper != xno], +[AC_CHECK_HEADERS([sys/soundcard.h], HAVE_OSS=1, HAVE_OSS=0)], +HAVE_OSS=0) + +AS_IF([test x$enable_oss_output = xyes -o x$enable_oss_wrapper = xyes test x$HAVE_OSS = x0], [AC_MSG_ERROR([*** OSS support not found])]) +AS_IF([test x$enable_oss_output != xno], +[AS_IF([test x$HAVE_OSS = x1], HAVE_OSS_OUTPUT=1, HAVE_OSS_OUTPUT=0)], +HAVE_OSS_OUTPUT=0) + +AS_IF([test x$enable_oss_wrapper != xno], +[AS_IF([test x$HAVE_OSS = x1], HAVE_OSS_WRAPPER=1, HAVE_OSS_WRAPPER=0)], +HAVE_OSS_WRAPPER=0) + AC_SUBST(HAVE_OSS) AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test x$HAVE_OSS_OUTPUT = x1]) AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test x$HAVE_OSS_WRAPPER = x1]) @@ -766,11 +747,9 @@ AS_IF([test x$HAVE_OSS_WRAPPER = x1], AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have AC_ARG_ENABLE([coreaudio-output], AS_HELP_STRING([--disable-coreaudio-output],[Disable optional CoreAudio output support])) -if test x$enable_coreaudio_output != xno; then -AC_CHECK_HEADERS([CoreAudio/CoreAudio.h], HAVE_COREAUDIO=1) -else -HAVE_COREAUDIO=0 -fi +AS_IF([test x$enable_coreaudio_output != xno], +[AC_CHECK_HEADERS([CoreAudio/CoreAudio.h], HAVE_COREAUDIO=1, HAVE_COREAUDIO=0)], +HAVE_COREAUDIO=0) AC_SUBST(HAVE_COREAUDIO) AM_CONDITIONAL([HAVE_COREAUDIO], [test x$HAVE_COREAUDIO = x1 test x$enable_coreaudio_output != xno]) @@ -780,17 +759,10 @@ AM_CONDITIONAL([HAVE_COREAUDIO], [test x$HAVE_COREAUDIO = x1 test x$enab AC_ARG_ENABLE([alsa], AS_HELP_STRING([--disable-alsa],[Disable optional ALSA support])) -if test x$enable_alsa != xno; then -PKG_CHECK_MODULES(ASOUNDLIB, [ alsa = 1.0.19 ], -[ -HAVE_ALSA=1 -], -[ -HAVE_ALSA=0 -]) -else -HAVE_ALSA=0 -fi +AS_IF([test x$enable_alsa != xno], +[PKG_CHECK_MODULES(ASOUNDLIB, [ alsa = 1.0.19 ], HAVE_ALSA=1, HAVE_ALSA=0)], +HAVE_ALSA=0) + AS_IF([test x$enable_alsa = xyes test x$HAVE_ALSA = x0], [AC_MSG_ERROR([*** Needed alsa = 1.0.19 support not found])]) @@ -805,17 +777,10 @@ AS_IF([test x$HAVE_ALSA = x1], AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])) AC_ARG_ENABLE([solaris], AS_HELP_STRING([--disable-solaris],[Disable optional Solaris audio support])) -if test x$enable_solaris != xno; then -AC_CHECK_HEADERS([sys/audio.h], -[ -HAVE_SOLARIS=1 -], -[ -HAVE_SOLARIS=0 -]) -else -HAVE_SOLARIS=0 -fi +AS_IF([test x$enable_solaris != xno], +[AC_CHECK_HEADERS([sys/audio.h], HAVE_SOLARIS=1, HAVE_SOLARIS=0)], +HAVE_SOLARIS=0) + AS_IF([test
[pulseaudio-discuss] [PATCH 7/7] build-system: Small fixes
--- configure.ac | 24 ++-- 1 files changed, 10 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 79df100..16fb03d 100644 --- a/configure.ac +++ b/configure.ac @@ -382,7 +382,6 @@ AM_CONDITIONAL(HAVE_AF_UNIX, test x$HAVE_AF_UNIX = x1) # Linux AC_CHECK_HEADERS([linux/input.h], [HAVE_EVDEV=1], [HAVE_EVDEV=0]) - AM_CONDITIONAL([HAVE_EVDEV], [test x$HAVE_EVDEV = x1]) AC_CHECK_HEADERS_ONCE([sys/prctl.h]) @@ -452,12 +451,6 @@ AC_SEARCH_LIBS([pthread_setname_np], [pthread]) AC_SEARCH_LIBS([connect], [socket]) AC_SEARCH_LIBS([backtrace], [execinfo]) -# Non-standard - -# This magic is needed so we do not needlessly add static libs to the win32 -# build, disabling its ability to make dlls. -AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])]) - # Darwin/OS X if test x$os_is_darwin = x1 ; then AC_MSG_CHECKING([looking for Apple CoreService Framework]) @@ -474,7 +467,10 @@ fi AC_SUBST(HAVE_BONJOUR) AM_CONDITIONAL([HAVE_BONJOUR], [test x$HAVE_BONJOUR = x1]) +# Windows AC_SEARCH_LIBS([regexec], [pcreposix]) +# This magic is needed so we do not needlessly add static libs to the win32 build, disabling its ability to make dlls. +AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])]) Check for functions @@ -1022,7 +1018,7 @@ AC_SUBST(HAVE_DBUS) AM_CONDITIONAL([HAVE_DBUS], [test x$HAVE_DBUS = x1]) AS_IF([test x$HAVE_DBUS = x1], AC_DEFINE([HAVE_DBUS], 1, [Have D-Bus.])) -# udev and HAL depend on D-Bus: So double check if they were explicitly enabled. +# HAL and BlueZ depend on D-Bus: So double check if they were explicitly enabled. if test x$HAVE_DBUS != x1 ; then HAVE_HAL=0 if test x$enable_hal = xyes; then @@ -1035,7 +1031,6 @@ if test x$HAVE_DBUS != x1 ; then fi fi - HAL compat support (optional) AC_ARG_ENABLE([hal-compat], @@ -1268,11 +1263,11 @@ echo CFLAGS:${CFLAGS} LIBS: ${LIBS} -Have X11: ${ENABLE_X11} +Enable X11:${ENABLE_X11} Enable OSS Output: ${ENABLE_OSS_OUTPUT} Enable OSS Wrapper:${ENABLE_OSS_WRAPPER} -Enable CoreAudio: ${ENABLE_COREAUDIO} Enable Alsa: ${ENABLE_ALSA} +Enable CoreAudio: ${ENABLE_COREAUDIO} Enable Solaris:${ENABLE_SOLARIS} Enable WaveOut:${ENABLE_WAVEOUT} Enable GLib 2.0: ${ENABLE_GLIB20} @@ -1291,11 +1286,12 @@ echo Enable libsamplerate: ${ENABLE_LIBSAMPLERATE} Enable IPv6: ${ENABLE_IPV6} Enable OpenSSL (for Airtunes): ${ENABLE_OPENSSL} -Enable tdb:${ENABLE_TDB} -Enable gdbm: ${ENABLE_GDBM} -Enable simple database:${ENABLE_SIMPLEDB} Enable fftw: ${ENABLE_FFTW} Enable orc:${ENABLE_ORC} +Database + tdb: ${ENABLE_TDB} + gdbm:${ENABLE_GDBM} + simple database: ${ENABLE_SIMPLEDB} System User: ${PA_SYSTEM_USER} System Group: ${PA_SYSTEM_GROUP} -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH] Make connect-stress test compile for win32
--- src/tests/connect-stress.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/connect-stress.c b/src/tests/connect-stress.c index 5476675..eadcf88 100644 --- a/src/tests/connect-stress.c +++ b/src/tests/connect-stress.c @@ -118,7 +118,7 @@ static void stream_write_callback(pa_stream *stream, size_t nbytes, void *userda memset(silence, 0, sizeof(silence)); while (nbytes) { -int n = MIN(sizeof(silence), nbytes); +int n = PA_MIN(sizeof(silence), nbytes); pa_stream_write(stream, silence, n, NULL, 0, 0); nbytes -= n; } @@ -195,9 +195,9 @@ int main(int argc, char *argv[]) { for (i = 0; i NTESTS; i++) { connect(argv[0], i); -usleep(random() % 50); +usleep(rand() % 50); disconnect(); -usleep(random() % 50); +usleep(rand() % 50); } fprintf(stderr, Done.\n); -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] More patches for better OS X support
2011/4/23 Colin Guthrie gm...@colin.guthr.ie: This should still work for you on OSX (if not, then I apologise!). I added the OS_IS_DARWIN bit as the API for pthread_setname_np does not appear to be totally stable (two args here, and I presume just one arg on OSX). I figured this may actually break windows stuff if it also has the two-arg version, hence the additional check. Hope that makes sense. On Windows, I try to avoid pthreads (the pthreads-win32 implementation). While it is certainly possible to use that on Windows, the current (IMHO preferable) way is using the native win32 threading system with a minimal amount of glue code. In other words: don't worry about that. Of course it may be possible to use pthread_setname_np on linux too (albeit with it's two arg variant...) which could simplify the code a bit... Both changes squashed into your commits. Col Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] Pulseaudio recording device re-direct from local machine over cable broadband to remote server / latency problem
2011/4/18 Nick Holloway ourm...@hotmail.com: Thanks Sean and Marten, this has answered my question, very much appreciated. I had hoped to send my local machine's microphone (for voice) over the Internet to the remote machine, but through all the various configuration I've done the delay/latency problem persists. Ah well, I had fun trying! Then either use some VOIP application or setup a icecast server. Many thanks again, Cheers, Nick ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] Pulseaudio recording device re-direct from local machine over cable broadband to remote server / latency problem
2011/4/17 Sean McNamara smc...@gmail.com: I don't know if pulseaudio supports any kind of protocol compression these days, but traditionally it does not. And due to that, it is generally unsuitable for use over the public internet. Lossy compression such as mp3, and protocols such as RTP and Icecast, exist for this purpose. Even if both nodes are dedicated servers with symmetric 100mbps, your transport latency over the internet is too high for most uses of PA. Indeed, it is still the case that only raw PCM audio streaming is supported. For CD quality audio this means a 44100Hz x 16bit x 2ch = 1.4 Mbit/s bandwidth requirement. I've heard about lots of interest in extending the PA protocol to support lossy, non-PCM formats, but I don't *think* that has been added quite yet. The CELT codec would be the best candidate for that, as it is specifically designed for low-latency requirements. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] RFC: Filter module loader
2011/4/15 pl bossart bossart.nos...@gmail.com: Here is my first draft of a filter module to automatically load equalizer and/or echo-cancel modules if automagically and in a manual but convenient way. Thanks for these patches, this is interesting, Arun and I were talking last week about better support for effects, after we realized how apps such as banshee/rhythmbox handle effects and volume ramps with awful hard-coded gstreamer pipelines. All this PCM processing should move to PulseAudio really. Do the developers of those applications feel the same? Perhaps this is a right time to step back and think about what we want to achieve. I'd say that some sort of client-side access to volume ramping (fade-in/fade-out) is appropriate. But effects like equalizer is probably better off in a gstreamer pipeline. Your approach makes sense with the existing solution based on virtual sinks/sources, but with the current implementation, the effects are really global, post-mix. If you want to add an effect on a specific stream, you need to create a new sink and move the sink-input. That really doesn't scale. Ideally we would want to use a linked list of effects, so that the effects can be added/enabled/disabled/removed quickly and their order modified, and we should be able to handle That looks awfully lot like a reimplementation of gstreamer. Is that really what we want? - local/per-stream effects. - global/post-mix effects - aux effects (such as reverb) I consider the global reverb option one of the most terrible parts of a lot of windows audio drivers. What's the use case for that? We would also need a standard way for apps to set/get the parameters needed by effects. This isn't new, this is what Android/AudioFlinger/OpenSL ES implement. In most cases, users really care about global effects only, but you may want to have a specific filter on a stream (ReplayGain or some volume ramp for example). I also don't think using a 10s timer is really great to check if the effect is actually needed. If you had a linked list you wouldn't need to do this type of things. let me know if I am making any sense, it's been a long week... -Pierre I'm sorry for sounding perhaps a bit grumpy, but I am a bit hesitant. This is really something that should be planned carefully. PulseAudio can't be everything for everybody. That said, it is perfectly possible that I miss some important usage scenario's, especially you seem to be working on embedded stuff, with other demands on pulse. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH] pa_poll(): Simplify detectin of invalid fds in select() emulation mode
2011/4/14 Daniel Mack zon...@gmail.com: On Thu, Apr 14, 2011 at 12:46 AM, Maarten Bosmans mkbosm...@gmail.com wrote: return (fd = 0) (fcntl(fd, F_GETFL) != -1); For Windows, both fcntl and F_GETFL are not available. Sigh. Ok, thanks for the feedback. Attached is a new patch which keeps things as they are for Windows but fixes the problem for OS X. That should do it, yes. +#else /* !OS_IS_WINDOWS */ Minor: this is not exactly the symbol used in the #ifdef. Anyway, isn't the #else only supposed to be used for OSX? In that case the comment should probably say so. Daniel Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH] pa_poll(): Simplify detectin of invalid fds in select() emulation mode
2011/4/13 Daniel Mack zon...@gmail.com: Attached is a patch to fix for one out of the few problems I still fight with on OS X. I'm not sure whether this change breaks Windows support, so I'd be happy if someone could give it a try. This is indeed a problem. return (fd = 0) (fcntl(fd, F_GETFL) != -1); For Windows, both fcntl and F_GETFL are not available. Thanks, Daniel Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH] call-state-tracker: New component.
What are the users of this state tracker? Is it only some out-of-tree Meego modules? Are you planning to submit those too? At least a snippet of how it should be used would be nice. If I read correctly it is a global boolean state tracker that is a thin wrapper around pa_shared. Is it possible to add the update-hook capability pa_shared and just use that from the modules. It would probably mean a couple of lines more in the modules, but the functionality in pulsecore would be more generic and more widely usable then. Maarten 2011/4/5 Tanu Kaskinen tanu.kaski...@digia.com: From: Tanu Kaskinen ext-tanu.kaski...@nokia.com --- src/Makefile.am | 1 + src/pulsecore/call-state-tracker.c | 127 src/pulsecore/call-state-tracker.h | 54 +++ 3 files changed, 182 insertions(+), 0 deletions(-) create mode 100644 src/pulsecore/call-state-tracker.c create mode 100644 src/pulsecore/call-state-tracker.h diff --git a/src/Makefile.am b/src/Makefile.am index bdedded..85c5602 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -835,6 +835,7 @@ libpulsecore_@PA_MAJORMINOR@_la_SOURCES = \ pulsecore/asyncmsgq.c pulsecore/asyncmsgq.h \ pulsecore/asyncq.c pulsecore/asyncq.h \ pulsecore/auth-cookie.c pulsecore/auth-cookie.h \ + pulsecore/call-state-tracker.c pulsecore/call-state-tracker.h \ pulsecore/cli-command.c pulsecore/cli-command.h \ pulsecore/cli-text.c pulsecore/cli-text.h \ pulsecore/client.c pulsecore/client.h \ diff --git a/src/pulsecore/call-state-tracker.c b/src/pulsecore/call-state-tracker.c new file mode 100644 index 000..a605685 --- /dev/null +++ b/src/pulsecore/call-state-tracker.c @@ -0,0 +1,127 @@ +/*** + This file is part of PulseAudio. + + Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + + 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 pulsecore/core.h +#include pulsecore/hook-list.h +#include pulsecore/log.h +#include pulsecore/macro.h +#include pulsecore/refcnt.h +#include pulsecore/shared.h + +#include call-state-tracker.h + +struct pa_call_state_tracker { + PA_REFCNT_DECLARE; + + pa_core *core; + pa_bool_t active; + pa_hook hooks[PA_CALL_STATE_HOOK_MAX]; +}; + +static pa_call_state_tracker* call_state_tracker_new(pa_core *c) { + pa_call_state_tracker *t; + pa_call_state_hook_t h; + + pa_assert(c); + + t = pa_xnew0(pa_call_state_tracker, 1); + PA_REFCNT_INIT(t); + t-core = pa_core_ref(c); + t-active = FALSE; + + for (h = 0; h PA_CALL_STATE_HOOK_MAX; h++) + pa_hook_init(t-hooks[h], t); + + pa_assert_se(pa_shared_set(c, call-state-tracker, t) = 0); + + return t; +} + +pa_call_state_tracker *pa_call_state_tracker_get(pa_core *core) { + pa_call_state_tracker *t; + + if ((t = pa_shared_get(core, call-state-tracker))) + return pa_call_state_tracker_ref(t); + + return call_state_tracker_new(core); +} + +pa_call_state_tracker *pa_call_state_tracker_ref(pa_call_state_tracker *t) { + pa_assert(t); + pa_assert(PA_REFCNT_VALUE(t) = 1); + + PA_REFCNT_INC(t); + + return t; +} + +void pa_call_state_tracker_unref(pa_call_state_tracker *t) { + pa_call_state_hook_t h; + + pa_assert(t); + pa_assert(PA_REFCNT_VALUE(t) = 1); + + if (PA_REFCNT_DEC(t) 0) + return; + + for (h = 0; h PA_CALL_STATE_HOOK_MAX; h++) + pa_hook_done(t-hooks[h]); + + pa_assert_se(pa_shared_remove(t-core, call-state-tracker) = 0); + + pa_core_unref(t-core); + + pa_xfree(t); +} + +pa_bool_t pa_call_state_tracker_get_active(pa_call_state_tracker *t) { + pa_assert(t); + pa_assert(PA_REFCNT_VALUE(t) = 1); + + return t-active; +} + +void pa_call_state_tracker_set_active(pa_call_state_tracker *t, pa_bool_t active) { + pa_bool_t changed; + + pa_assert(t); + pa_assert(PA_REFCNT_VALUE(t) = 1); + + changed = active != t-active; + + t-active = active; + + if (changed) + pa_hook_fire(t-hooks[PA_CALL_STATE_HOOK_CHANGED], (void *)
Re: [pulseaudio-discuss] Serversound 2 ThinClient
Please note this is a English-speaking mailing list. Below is my answer in English, hopefully you will be able to understand it. 2011/4/4 badgerman bad-ger-...@web.de: Hallo liebe Listenleser, ich habe eine SLES11-Kvm-Maschine mit openSuse11.2/3/4 Gastsystemen. Das einloggen erfolgt über ThinClients an den jeweiligen Gastsystemen (alle mit LTSP4.2). Die (very)ThinClients haben 64MB Ram. Der SLES11-Kvm-Server hat keine eigene Soundkarte. Wie kann ich dennoch den Sound zu den Clients bringen? Assuming the thin-clients have pulseaudio running and module-protocol-native-tcp enabled with approprate permessions set, the forwarding of audio back to the client is done automatically when logging in on the server with X-forwarding enabled. Alternatively, you can start applications on the server with the PULSE_SERVER=client-name environment variable set. Vorab vielen Dank bad-ger-man Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] Help with pulsaudio
Please reply to the list. 2011/3/28 Yousif, Amgad (UK) amgad.you...@baesystems.com: Hi Maarten, I already looked at the networking page very well and couldn't see how any section on that could help with what im trying to do!. I am trying to build a Ubuntu 10.10 server which I can remotely access from a windows machine. I am using a server called freeNX. The remote desktop works great except there is no sound on the remote session. I looked into this and found out that freeNX uses ESD to transfer sound through the session. But ESD has been replaced with pulsaudio on Ubuntu. I don't want to used ESD. I want to use Pulsaidio (as this is now used instead). If you want to install PulseAudio on Windows, see http://pulseaudio.org/wiki/WindowsSupport. Enable module-native-protocol-tcp with arguments that allow your Linux PC to connect. http://pulseaudio.org/wiki/Modules#module-native-protocol-unixtcp If you then set the PULSE_SERVER environment variable to the name/IP of your Windows PC, all applications should connect to that computer for playing sound. This is the most useful information I have on getting sound through freeNX, if you can help or have any idea how this could be achieved through pulsaudio please let me know. What should I do to play sound inside my NX session? http://www.nomachine.com/ar/view.php?ar_id=AR03D00355 How to enable ESD sound support on Linux distributions not shipping the Enlightened Sound Daemon http://www.nomachine.com/ar/view.php?ar_id=AR11E00491 If NX only has ESD, that means it is crappy and outdated. You can try to make it work without installing pulse on the windows box by using http://pulseaudio.org/wiki/Modules#module-esound-sink on the Linux side. Thanks again. Regards Amgad Yousif Maarten -Original Message- From: Maarten Bosmans [mailto:mkbosm...@gmail.com] Sent: 27 March 2011 19:54 To: General PulseAudio Discussion Cc: Daniel Mack; Yousif, Amgad (UK) Subject: Re: [pulseaudio-discuss] Help with pulsaudio *** WARNING *** This message has originated outside your organisation, either from an external partner or the Global Internet. Keep this in mind if you answer this message. 2011/3/27 Daniel Mack zon...@gmail.com: On Thu, Mar 24, 2011 at 6:39 PM, Yousif, Amgad (UK) amgad.you...@baesystems.com wrote: Hi I wanted some help with using pulsaudio to getting sound from a server machine to a client machine. Please let me know the best person to contact for this. This should help you: http://pulseaudio.org/wiki/NetworkSetup And feel free to ask questions on the list (or perhaps better: IRC) if there are still things unclear. Maarten This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] Getting rid of annoying (but harmless) linking warnings
Check whether output of pkg-config --libs dbus-1 pkg-config --libs sndfile contains any offensive parameters. If there is anything out of the ordinary, cat libpulsecommon-1.0.la could also reveal something, as I suspect your problem has more to do with libtool than with autotools. Maarten 2011/3/26 Colin Guthrie gm...@colin.guthr.ie: Hi, With the build looking so neat and tidy these days, I'm curious if I can clean up one of the things that still bugs me a little! It relates to the fact that I have a 64 bit system. My 64 bit libs are in /usr/lib64, but the link path searches in /usr/lib and thus produces the following: libtool: link: gcc -std=gnu99 -I../../src -I../../src/modules -I../src/modules -pthread -D_POSIX_PTHREAD_SEMANTICS -DPA_BUILDDIR=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/src\ -DPA_DLSEARCHPATH=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/lib/pulse-1.0/modules\ -DPA_DEFAULT_CONFIG_DIR=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/etc/pulse\ -DPA_BINARY=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/bin/pulseaudio\ -DPA_SYSTEM_RUNTIME_PATH=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/var/run/pulse\ -DPA_SYSTEM_CONFIG_PATH=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/var/lib/pulse\ -DPA_SYSTEM_STATE_PATH=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/var/lib/pulse\ -DAO_REQUIRE_CAS -DPULSE_LOCALEDIR=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/share/locale\ -DPA_MACHINE_ID=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/var/lib/dbus/machine-id\ -DPA_ALSA_PATHS_DIR=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/share/pulseaudio/alsa-mixer/paths\ -DPA_ALSA_PROFILE_SETS_DIR=\/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/share/pulseaudio/alsa-mixer/profile-sets\ -g -O2 -Wall -W -Wextra -pipe -Wno-long-long -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -Wl,-z -Wl,nodelete -o .libs/pactl pactl-pactl.o ./.libs/libpulse.so -L/usr/lib /home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/src/.libs/libpulsecommon-1.0.so ./.libs/libpulsecommon-1.0.so /usr/lib64/libX11-xcb.so /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libXtst.so /usr/lib64/libXi.so /usr/lib64/libXext.so /usr/lib64/libX11.so /usr/lib64/libxcb-atom.so /usr/lib64/libxcb.so /usr/lib64/libXau.so /usr/lib64/libXdmcp.so -lwrap /usr/lib64/libsamplerate.so -lasyncns -ldbus-1 -lpthread /usr/lib64/libsndfile.so /usr/lib64/libFLAC.so /usr/lib64/libvorbisenc.so /usr/lib64/libvorbis.so /usr/lib64/libogg.so -lcap -lrt -ldl -lm -pthread -Wl,-rpath -Wl,/home/colin/Development/Personal/Mageia/pulse/pulseaudio/SOURCES/pulseaudio/build-master/lib /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt /usr/bin/ld: skipping incompatible /usr/lib/libdl.so when searching for -ldl /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so when searching for -lgcc_s /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so when searching for -lgcc_s Note the -L/usr/lib just after libpulse.so in the above command. I need to track down where this is introduced. Anyone with an appropriately advanced autotools foo to help me work out where it comes from so I can nuke it? 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
[pulseaudio-discuss] pactl improvements
This series superseeds the two patches previously sent to the list. [PATCH 1/4] pactl: Accept more volume specification formats This has relative volume adjustments now. I opted for +/- prefix to denote a relative adjustment. [PATCH 2/4] pactl: Add subcommands to the list command Roughly the same as the previous patch. [PATCH 3/4] pactl: Separate stat and info actions It always seemed weird to me to have these two together. This makes pactl more aligned with cli. [PATCH 4/4] pactl: Add short output format for list action Makes e.g. `pactl list sources short` output a tab separated list. Handy for a quick overview or script processing. I haven't really though very hard about which fields to expose, so if anyone has some ideas about what should be different here, please let yourself be heard before the 1.0 release. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 1/4] pactl: Accept more volume specification formats
With this you can specify the volume with 6554, 10%, 0.001 or -60dB, all resulting in the same volume change. --- src/utils/pactl.c | 229 +++-- 1 files changed, 171 insertions(+), 58 deletions(-) diff --git a/src/utils/pactl.c b/src/utils/pactl.c index ad5c0b8..9b6050a 100644 --- a/src/utils/pactl.c +++ b/src/utils/pactl.c @@ -65,6 +65,14 @@ static uint32_t module_index; static pa_bool_t suspend; static pa_bool_t mute; static pa_volume_t volume; +static enum volume_flags { +VOL_UINT = 0, +VOL_PERCENT = 1, +VOL_LINEAR = 2, +VOL_DECIBEL = 3, +VOL_ABSOLUTE = 0 4, +VOL_RELATIVE = 1 4, +} volume_flags; static pa_proplist *proplist = NULL; @@ -683,6 +691,78 @@ static void index_callback(pa_context *c, uint32_t idx, void *userdata) { complete_action(); } +static void volume_relative_adjust(pa_cvolume *cv) { +pa_assert((volume_flags VOL_RELATIVE) == VOL_RELATIVE); + +/* Relative volume change is additive in case of UINT or PERCENT + * and multiplicative for LINEAR or DECIBEL */ +if ((volume_flags 0x0F) == VOL_UINT || (volume_flags 0x0F) == VOL_PERCENT) { +pa_volume_t v = pa_cvolume_avg(cv); +v = v + volume PA_VOLUME_NORM ? PA_VOLUME_MUTED : v + volume - PA_VOLUME_NORM; +pa_cvolume_set(cv, 1, v); +} +if ((volume_flags 0x0F) == VOL_LINEAR || (volume_flags 0x0F) == VOL_DECIBEL) { +pa_sw_cvolume_multiply_scalar(cv, cv, volume); +} +} + +static void get_sink_volume_callback(pa_context *c, const pa_sink_info *i, int is_last, void *userdata) { +pa_cvolume cv; + +if (is_last 0) { +pa_log(_(Failed to get sink information: %s), pa_strerror(pa_context_errno(c))); +quit(1); +return; +} + +if (is_last) +return; + +pa_assert(i); + +cv = i-volume; +volume_relative_adjust(cv); +pa_operation_unref(pa_context_set_sink_volume_by_name(c, sink_name, cv, simple_callback, NULL)); +} + +static void get_source_volume_callback(pa_context *c, const pa_source_info *i, int is_last, void *userdata) { +pa_cvolume cv; + +if (is_last 0) { +pa_log(_(Failed to get source information: %s), pa_strerror(pa_context_errno(c))); +quit(1); +return; +} + +if (is_last) +return; + +pa_assert(i); + +cv = i-volume; +volume_relative_adjust(cv); +pa_operation_unref(pa_context_set_source_volume_by_name(c, source_name, cv, simple_callback, NULL)); +} + +static void get_sink_input_volume_callback(pa_context *c, const pa_sink_input_info *i, int is_last, void *userdata) { +pa_cvolume cv; + +if (is_last 0) { +pa_log(_(Failed to get sink input information: %s), pa_strerror(pa_context_errno(c))); +quit(1); +return; +} + +if (is_last) +return; + +pa_assert(i); + +cv = i-volume; +volume_relative_adjust(cv); +pa_operation_unref(pa_context_set_sink_input_volume(c, sink_input_idx, cv, simple_callback, NULL)); +} + static void stream_state_callback(pa_stream *s, void *userdata) { pa_assert(s); @@ -893,34 +973,40 @@ static void context_state_callback(pa_context *c, void *userdata) { pa_operation_unref(pa_context_set_sink_input_mute(c, sink_input_idx, mute, simple_callback, NULL)); break; -case SET_SINK_VOLUME: { -pa_cvolume v; - -pa_cvolume_set(v, 1, volume); -pa_operation_unref(pa_context_set_sink_volume_by_name(c, sink_name, v, simple_callback, NULL)); +case SET_SINK_VOLUME: +if ((volume_flags VOL_RELATIVE) == VOL_RELATIVE) { +pa_operation_unref(pa_context_get_sink_info_by_name(c, sink_name, get_sink_volume_callback, NULL)); +} else { +pa_cvolume v; +pa_cvolume_set(v, 1, volume); + pa_operation_unref(pa_context_set_sink_volume_by_name(c, sink_name, v, simple_callback, NULL)); +} break; -} - -case SET_SOURCE_VOLUME: { -pa_cvolume v; -pa_cvolume_set(v, 1, volume); -pa_operation_unref(pa_context_set_source_volume_by_name(c, source_name, v, simple_callback, NULL)); +case SET_SOURCE_VOLUME: +if ((volume_flags VOL_RELATIVE) == VOL_RELATIVE) { + pa_operation_unref(pa_context_get_source_info_by_name(c, source_name, get_source_volume_callback, NULL)); +} else { +pa_cvolume v; +pa_cvolume_set(v, 1, volume); + pa_operation_unref(pa_context_set_source_volume_by_name(c, source_name, v, simple_callback, NULL)); +}
[pulseaudio-discuss] [PATCH 2/4] pactl: Add subcommands to the list command
--- src/utils/pactl.c | 67 +--- 1 files changed, 53 insertions(+), 14 deletions(-) diff --git a/src/utils/pactl.c b/src/utils/pactl.c index 9b6050a..e3c2aa2 100644 --- a/src/utils/pactl.c +++ b/src/utils/pactl.c @@ -48,6 +48,7 @@ static pa_context *context = NULL; static pa_mainloop_api *mainloop_api = NULL; static char +*list_type = NULL, *sample_name = NULL, *sink_name = NULL, *source_name = NULL, @@ -908,15 +909,36 @@ static void context_state_callback(pa_context *c, void *userdata) { break; case LIST: -actions = 8; -pa_operation_unref(pa_context_get_module_info_list(c, get_module_info_callback, NULL)); -pa_operation_unref(pa_context_get_sink_info_list(c, get_sink_info_callback, NULL)); -pa_operation_unref(pa_context_get_source_info_list(c, get_source_info_callback, NULL)); -pa_operation_unref(pa_context_get_sink_input_info_list(c, get_sink_input_info_callback, NULL)); - pa_operation_unref(pa_context_get_source_output_info_list(c, get_source_output_info_callback, NULL)); -pa_operation_unref(pa_context_get_client_info_list(c, get_client_info_callback, NULL)); -pa_operation_unref(pa_context_get_sample_info_list(c, get_sample_info_callback, NULL)); -pa_operation_unref(pa_context_get_card_info_list(c, get_card_info_callback, NULL)); +if (list_type) { +if (pa_streq(list_type, modules)) + pa_operation_unref(pa_context_get_module_info_list(c, get_module_info_callback, NULL)); +else if (pa_streq(list_type, sinks)) + pa_operation_unref(pa_context_get_sink_info_list(c, get_sink_info_callback, NULL)); +else if (pa_streq(list_type, sources)) + pa_operation_unref(pa_context_get_source_info_list(c, get_source_info_callback, NULL)); +else if (pa_streq(list_type, sink-inputs)) + pa_operation_unref(pa_context_get_sink_input_info_list(c, get_sink_input_info_callback, NULL)); +else if (pa_streq(list_type, source-outputs)) + pa_operation_unref(pa_context_get_source_output_info_list(c, get_source_output_info_callback, NULL)); +else if (pa_streq(list_type, clients)) + pa_operation_unref(pa_context_get_client_info_list(c, get_client_info_callback, NULL)); +else if (pa_streq(list_type, samples)) + pa_operation_unref(pa_context_get_sample_info_list(c, get_sample_info_callback, NULL)); +else if (pa_streq(list_type, cards)) + pa_operation_unref(pa_context_get_card_info_list(c, get_card_info_callback, NULL)); +else +pa_assert_not_reached(); +} else { +actions = 8; +pa_operation_unref(pa_context_get_module_info_list(c, get_module_info_callback, NULL)); +pa_operation_unref(pa_context_get_sink_info_list(c, get_sink_info_callback, NULL)); +pa_operation_unref(pa_context_get_source_info_list(c, get_source_info_callback, NULL)); + pa_operation_unref(pa_context_get_sink_input_info_list(c, get_sink_input_info_callback, NULL)); + pa_operation_unref(pa_context_get_source_output_info_list(c, get_source_output_info_callback, NULL)); +pa_operation_unref(pa_context_get_client_info_list(c, get_client_info_callback, NULL)); +pa_operation_unref(pa_context_get_sample_info_list(c, get_sample_info_callback, NULL)); +pa_operation_unref(pa_context_get_card_info_list(c, get_card_info_callback, NULL)); +} break; case MOVE_SINK_INPUT: @@ -1100,7 +1122,7 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol, enum volume_flag static void help(const char *argv0) { printf(_(%s [options] stat\n - %s [options] list\n + %s [options] list [TYPE]\n %s [options] exit\n %s [options] upload-sample FILENAME [NAME]\n %s [options] play-sample NAME [SINK]\n @@ -1137,7 +1159,7 @@ enum { }; int main(int argc, char *argv[]) { -pa_mainloop* m = NULL; +pa_mainloop *m = NULL; int ret = 1, c; char *server = NULL, *bn; @@ -1201,11 +1223,26 @@ int main(int argc, char *argv[]) { if (optind argc) { if (pa_streq(argv[optind], stat)) action = STAT; + else
[pulseaudio-discuss] [PATCH 3/4] pactl: Separate stat and info actions
--- src/utils/pactl.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/utils/pactl.c b/src/utils/pactl.c index e3c2aa2..cfa96fe 100644 --- a/src/utils/pactl.c +++ b/src/utils/pactl.c @@ -90,6 +90,7 @@ static enum { NONE, EXIT, STAT, +INFO, UPLOAD_SAMPLE, PLAY_SAMPLE, REMOVE_SAMPLE, @@ -882,8 +883,10 @@ static void context_state_callback(pa_context *c, void *userdata) { case PA_CONTEXT_READY: switch (action) { case STAT: -actions = 2; pa_operation_unref(pa_context_stat(c, stat_callback, NULL)); +break; + +case INFO: pa_operation_unref(pa_context_get_server_info(c, get_server_info_callback, NULL)); break; @@ -1122,6 +1125,7 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol, enum volume_flag static void help(const char *argv0) { printf(_(%s [options] stat\n + %s [options] info\n %s [options] list [TYPE]\n %s [options] exit\n %s [options] upload-sample FILENAME [NAME]\n @@ -1151,7 +1155,7 @@ static void help(const char *argv0) { argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, - argv0, argv0); + argv0, argv0, argv0); } enum { @@ -1224,6 +1228,9 @@ int main(int argc, char *argv[]) { if (pa_streq(argv[optind], stat)) action = STAT; +else if (pa_streq(argv[optind], info)) +action = INFO; + else if (pa_streq(argv[optind], exit)) action = EXIT; -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 4/4] pactl: Add short output format for list action
--- src/utils/pactl.c | 88 +++- 1 files changed, 79 insertions(+), 9 deletions(-) diff --git a/src/utils/pactl.c b/src/utils/pactl.c index cfa96fe..194183d 100644 --- a/src/utils/pactl.c +++ b/src/utils/pactl.c @@ -62,6 +62,7 @@ static uint32_t sink_input_idx = PA_INVALID_INDEX, source_output_idx = PA_INVALID_INDEX; +static pa_bool_t short_list_format = FALSE; static uint32_t module_index; static pa_bool_t suspend; static pa_bool_t mute; @@ -237,10 +238,20 @@ static void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_ pa_assert(i); -if (nl) +if (nl !short_list_format) printf(\n); nl = TRUE; +if (short_list_format) { +printf(%u\t%s\t%s\t%s\t%s\n, + i-index, + i-name, + pa_strnull(i-driver), + pa_sample_spec_snprint(s, sizeof(s), i-sample_spec), + state_table[1+i-state]); +return; +} + printf(_(Sink #%u\n \tState: %s\n \tName: %s\n @@ -329,10 +340,20 @@ static void get_source_info_callback(pa_context *c, const pa_source_info *i, int pa_assert(i); -if (nl) +if (nl !short_list_format) printf(\n); nl = TRUE; +if (short_list_format) { +printf(%u\t%s\t%s\t%s\t%s\n, + i-index, + i-name, + pa_strnull(i-driver), + pa_sample_spec_snprint(s, sizeof(s), i-sample_spec), + state_table[1+i-state]); +return; +} + printf(_(Source #%u\n \tState: %s\n \tName: %s\n @@ -407,12 +428,17 @@ static void get_module_info_callback(pa_context *c, const pa_module_info *i, int pa_assert(i); -if (nl) +if (nl !short_list_format) printf(\n); nl = TRUE; pa_snprintf(t, sizeof(t), %u, i-n_used); +if (short_list_format) { +printf(%u\t%s\t%s\t\n, i-index, i-name, i-argument ? i-argument : ); +return; +} + printf(_(Module #%u\n \tName: %s\n \tArgument: %s\n @@ -444,12 +470,20 @@ static void get_client_info_callback(pa_context *c, const pa_client_info *i, int pa_assert(i); -if (nl) +if (nl !short_list_format) printf(\n); nl = TRUE; pa_snprintf(t, sizeof(t), %u, i-owner_module); +if (short_list_format) { +printf(%u\t%s\t%s\n, + i-index, + pa_strnull(i-driver), + pa_strnull(pa_proplist_gets(i-proplist, PA_PROP_APPLICATION_PROCESS_BINARY))); +return; +} + printf(_(Client #%u\n \tDriver: %s\n \tOwner Module: %s\n @@ -479,12 +513,17 @@ static void get_card_info_callback(pa_context *c, const pa_card_info *i, int is_ pa_assert(i); -if (nl) +if (nl !short_list_format) printf(\n); nl = TRUE; pa_snprintf(t, sizeof(t), %u, i-owner_module); +if (short_list_format) { +printf(%u\t%s\t%s\n, i-index, i-name, pa_strnull(i-driver)); +return; +} + printf(_(Card #%u\n \tName: %s\n \tDriver: %s\n @@ -528,13 +567,23 @@ static void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info pa_assert(i); -if (nl) +if (nl !short_list_format) printf(\n); nl = TRUE; pa_snprintf(t, sizeof(t), %u, i-owner_module); pa_snprintf(k, sizeof(k), %u, i-client); +if (short_list_format) { +printf(%u\t%u\t%s\t%s\t%s\n, + i-index, + i-sink, + i-client != PA_INVALID_INDEX ? k : -, + pa_strnull(i-driver), + pa_sample_spec_snprint(s, sizeof(s), i-sample_spec)); +return; +} + printf(_(Sink Input #%u\n \tDriver: %s\n \tOwner Module: %s\n @@ -586,7 +635,7 @@ static void get_source_output_info_callback(pa_context *c, const pa_source_outpu pa_assert(i); -if (nl) +if (nl !short_list_format) printf(\n); nl = TRUE; @@ -594,6 +643,16 @@ static void get_source_output_info_callback(pa_context *c, const pa_source_outpu pa_snprintf(t, sizeof(t), %u, i-owner_module); pa_snprintf(k, sizeof(k), %u, i-client); +if (short_list_format) { +printf(%u\t%u\t%s\t%s\t%s\n, + i-index, + i-source, + i-client != PA_INVALID_INDEX ? k : -, + pa_strnull(i-driver), + pa_sample_spec_snprint(s, sizeof(s), i-sample_spec)); +return; +} + printf(_(Source Output #%u\n \tDriver: %s\n \tOwner Module: %s\n @@ -637,12 +696,21 @@ static void get_sample_info_callback(pa_context *c, const pa_sample_info *i, int pa_assert(i); -if (nl) +if (nl !short_list_format) printf(\n); nl = TRUE;
Re: [pulseaudio-discuss] [PATCH 2/2] Move compile-time checks around pa_run_from_build_tree to core-util
2011/3/24 Colin Guthrie gm...@colin.guthr.ie: 'Twas brillig, and Colin Guthrie at 24/03/11 09:02 did gyre and gimble: 'Twas brillig, and Maarten Bosmans at 22/03/11 15:06 did gyre and gimble: Is there a better way than #if defined(__linux__) !defined(__OPTIMIZE__) to check for a debug build? By default the CFLAGS contain -g -O2, so __OPTIMIZE__ will not be defined and running uninstalled does not work. Do you mean __OPTIMIZE__ *will* be defined? Yes, of course, __OPTIMIZE__ is defined when compiling with -O2 and the condition *will not* be true and running uninstalled does not work. Also, is there any way we can check to see if the binary being run is in the build tree? Would that be an easier hack? Well the actual check is in the body of that function: pa_bool_t pa_run_from_build_tree(void) { char *rp; pa_bool_t b = FALSE; if ((rp = pa_readlink(/proc/self/exe))) { b = pa_startswith(rp, PA_BUILDDIR); pa_xfree(rp); } return b; } I think only compiling that on developer builds and inlining return FALSE for normal, e.g. distro builds makes sense. However __OPTIMIZE__ is not a good differentiator here. Col Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 1/2] pactl: Accept more volume specification formats
With this you can specify the volume with 6554, 10%, 0.001 or -60dB, all resulting in the same volume change. --- src/utils/pactl.c | 98 +--- 1 files changed, 62 insertions(+), 36 deletions(-) diff --git a/src/utils/pactl.c b/src/utils/pactl.c index ad5c0b8..672bfbb 100644 --- a/src/utils/pactl.c +++ b/src/utils/pactl.c @@ -65,6 +65,12 @@ static uint32_t module_index; static pa_bool_t suspend; static pa_bool_t mute; static pa_volume_t volume; +enum volume_type { +VOL_SW, +VOL_PERCENT, +VOL_LINEAR, +VOL_DECIBEL +}; static pa_proplist *proplist = NULL; @@ -956,6 +962,54 @@ static void exit_signal_callback(pa_mainloop_api *m, pa_signal_event *e, int sig quit(0); } +static int parse_volume(const char *vol_spec, pa_volume_t *vol) { +int volume_type = VOL_SW; +double v; +char *vs; + +pa_assert(vol_spec); +pa_assert(vol); + +vs = pa_xstrdup(vol_spec); + +for (char *c = vs; *c; c++) { + if (*c == '.') +volume_type = VOL_LINEAR; +} +if (pa_endswith(vs, %)) { +volume_type = VOL_PERCENT; +vs[strlen(vs)-1] = 0; +} +if (pa_endswith(vs, db) || pa_endswith(vs, dB)) { +volume_type = VOL_DECIBEL; +vs[strlen(vs)-2] = 0; +} + +if (pa_atod(vs, v) 0) { +pa_log(_(Invalid volume specification)); +pa_xfree(vs); +return -1; +} + +pa_xfree(vs); + +if (volume_type == VOL_PERCENT) +v = v * (double) PA_VOLUME_NORM / 100; +if (volume_type == VOL_LINEAR) +v = pa_sw_volume_from_linear(v); +if (volume_type == VOL_DECIBEL) +v = pa_sw_volume_from_dB(v); + +if (!PA_VOLUME_IS_VALID((pa_volume_t) v)) { +pa_log(_(Volume outside permissible range.\n)); +return -1; +} + +*vol = (pa_volume_t) v; + +return 0; +} + static void help(const char *argv0) { printf(_(%s [options] stat\n @@ -1235,7 +1289,6 @@ int main(int argc, char *argv[]) { port_name = pa_xstrdup(argv[optind+2]); } else if (pa_streq(argv[optind], set-sink-volume)) { -uint32_t v; action = SET_SINK_VOLUME; if (argc != optind+3) { @@ -1243,21 +1296,12 @@ int main(int argc, char *argv[]) { goto quit; } -if (pa_atou(argv[optind+2], v) 0) { -pa_log(_(Invalid volume specification)); -goto quit; -} +sink_name = pa_xstrdup(argv[optind+1]); -if (!PA_VOLUME_IS_VALID(v)) { -pa_log(_(Volume outside permissible range.\n)); +if (parse_volume(argv[optind+2], volume) 0) goto quit; -} - -sink_name = pa_xstrdup(argv[optind+1]); -volume = (pa_volume_t) v; } else if (pa_streq(argv[optind], set-source-volume)) { -uint32_t v; action = SET_SOURCE_VOLUME; if (argc != optind+3) { @@ -1265,21 +1309,12 @@ int main(int argc, char *argv[]) { goto quit; } -if (pa_atou(argv[optind+2], v) 0) { -pa_log(_(Invalid volume specification)); -goto quit; -} +source_name = pa_xstrdup(argv[optind+1]); -if (!PA_VOLUME_IS_VALID(v)) { -pa_log(_(Volume outside permissible range.\n)); +if (parse_volume(argv[optind+2], volume) 0) goto quit; -} - -source_name = pa_xstrdup(argv[optind+1]); -volume = (pa_volume_t) v; } else if (pa_streq(argv[optind], set-sink-input-volume)) { -uint32_t v; action = SET_SINK_INPUT_VOLUME; if (argc != optind+3) { @@ -1292,17 +1327,8 @@ int main(int argc, char *argv[]) { goto quit; } -if (pa_atou(argv[optind+2], v) 0) { -pa_log(_(Invalid volume specification)); -goto quit; -} - -if (!PA_VOLUME_IS_VALID(v)) { -pa_log(_(Volume outside permissible range.\n)); +if (parse_volume(argv[optind+2], volume) 0) goto quit; -} - -volume = (pa_volume_t) v; } else if (pa_streq(argv[optind], set-sink-mute)) { int b; @@ -1314,7 +1340,7 @@ int main(int argc, char *argv[]) { } if ((b = pa_parse_boolean(argv[optind+2])) 0) { -pa_log(_(Invalid volume specification)); +pa_log(_(Invalid mute specification)); goto quit; } @@ -1331,7 +1357,7 @@ int main(int argc, char *argv[]) { } if ((b = pa_parse_boolean(argv[optind+2])) 0) { -pa_log(_(Invalid volume specification)); +pa_log(_(Invalid mute specification)); goto quit; }
[pulseaudio-discuss] [PATCH 2/2] pactl: Add subcommands to the list command
--- src/utils/pactl.c | 62 +++- 1 files changed, 51 insertions(+), 11 deletions(-) diff --git a/src/utils/pactl.c b/src/utils/pactl.c index 672bfbb..11ddcb3 100644 --- a/src/utils/pactl.c +++ b/src/utils/pactl.c @@ -48,6 +48,7 @@ static pa_context *context = NULL; static pa_mainloop_api *mainloop_api = NULL; static char +*list_type = NULL, *sample_name = NULL, *sink_name = NULL, *source_name = NULL, @@ -834,15 +835,37 @@ static void context_state_callback(pa_context *c, void *userdata) { break; case LIST: -actions = 8; -pa_operation_unref(pa_context_get_module_info_list(c, get_module_info_callback, NULL)); -pa_operation_unref(pa_context_get_sink_info_list(c, get_sink_info_callback, NULL)); -pa_operation_unref(pa_context_get_source_info_list(c, get_source_info_callback, NULL)); -pa_operation_unref(pa_context_get_sink_input_info_list(c, get_sink_input_info_callback, NULL)); - pa_operation_unref(pa_context_get_source_output_info_list(c, get_source_output_info_callback, NULL)); -pa_operation_unref(pa_context_get_client_info_list(c, get_client_info_callback, NULL)); -pa_operation_unref(pa_context_get_sample_info_list(c, get_sample_info_callback, NULL)); -pa_operation_unref(pa_context_get_card_info_list(c, get_card_info_callback, NULL)); +if (list_type) { +actions = 1; +if (pa_streq(list_type, modules)) + pa_operation_unref(pa_context_get_module_info_list(c, get_module_info_callback, NULL)); +else if (pa_streq(list_type, sinks)) + pa_operation_unref(pa_context_get_sink_info_list(c, get_sink_info_callback, NULL)); +else if (pa_streq(list_type, sources)) + pa_operation_unref(pa_context_get_source_info_list(c, get_source_info_callback, NULL)); +else if (pa_streq(list_type, sink-inputs)) + pa_operation_unref(pa_context_get_sink_input_info_list(c, get_sink_input_info_callback, NULL)); +else if (pa_streq(list_type, source-outputs)) + pa_operation_unref(pa_context_get_source_output_info_list(c, get_source_output_info_callback, NULL)); +else if (pa_streq(list_type, clients)) + pa_operation_unref(pa_context_get_client_info_list(c, get_client_info_callback, NULL)); +else if (pa_streq(list_type, samples)) + pa_operation_unref(pa_context_get_sample_info_list(c, get_sample_info_callback, NULL)); +else if (pa_streq(list_type, cards)) + pa_operation_unref(pa_context_get_card_info_list(c, get_card_info_callback, NULL)); +else +pa_assert_not_reached(); +} else { +actions = 8; +pa_operation_unref(pa_context_get_module_info_list(c, get_module_info_callback, NULL)); +pa_operation_unref(pa_context_get_sink_info_list(c, get_sink_info_callback, NULL)); +pa_operation_unref(pa_context_get_source_info_list(c, get_source_info_callback, NULL)); + pa_operation_unref(pa_context_get_sink_input_info_list(c, get_sink_input_info_callback, NULL)); + pa_operation_unref(pa_context_get_source_output_info_list(c, get_source_output_info_callback, NULL)); +pa_operation_unref(pa_context_get_client_info_list(c, get_client_info_callback, NULL)); +pa_operation_unref(pa_context_get_sample_info_list(c, get_sample_info_callback, NULL)); +pa_operation_unref(pa_context_get_card_info_list(c, get_card_info_callback, NULL)); +} break; case MOVE_SINK_INPUT: @@ -1013,7 +1036,7 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol) { static void help(const char *argv0) { printf(_(%s [options] stat\n - %s [options] list\n + %s [options] list [TYPE]\n %s [options] exit\n %s [options] upload-sample FILENAME [NAME]\n %s [options] play-sample NAME [SINK]\n @@ -1050,7 +1073,7 @@ enum { }; int main(int argc, char *argv[]) { -pa_mainloop* m = NULL; +pa_mainloop *m = NULL; int ret = 1, c; char *server = NULL, *bn; @@ -1114,10 +1137,25 @@ int main(int argc, char *argv[]) { if (optind argc) { if (pa_streq(argv[optind], stat)) action
Re: [pulseaudio-discuss] [PATCH 1/2] pactl: Accept more volume specification formats
2011/3/24 Maarten Bosmans mkbosm...@gmail.com: With this you can specify the volume with 6554, 10%, 0.001 or -60dB, all resulting in the same volume change. I was also going to add relative volumes, such as +3dB and -5%, by detecting a + or - sign in the volume. But that clashes with the absolute dB scale (insofar a dB can ever be absolute) that can also be negative. Any suggestions for graceful handling of this? Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 1/2] win32: Simplify dl_search_path code
And add #include sys/stat.h, needed by the code introduced in f7acd4bd. --- src/daemon/daemon-conf.c | 19 ++- 1 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 9b530a8..59579d9 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -29,6 +29,7 @@ #include string.h #include unistd.h #include fcntl.h +#include sys/stat.h #ifdef HAVE_SCHED_H #include sched.h @@ -37,6 +38,7 @@ #include pulse/xmalloc.h #include pulse/timeval.h #include pulse/i18n.h +#include pulse/version.h #include pulsecore/core-error.h #include pulsecore/core-util.h @@ -147,6 +149,10 @@ pa_daemon_conf* pa_daemon_conf_new(void) { c = pa_xnewdup(pa_daemon_conf, default_conf, 1); +#ifdef OS_IS_WIN32 +c-dl_search_path = pa_sprintf_malloc(%s PA_PATH_SEP lib PA_PATH_SEP pulse-%d.%d PA_PATH_SEP modules, + pa_win32_get_toplevel(NULL), PA_MAJOR, PA_MINOR); +#else #if defined(__linux__) !defined(__OPTIMIZE__) /* We abuse __OPTIMIZE__ as a check whether we are a debug build @@ -160,19 +166,6 @@ pa_daemon_conf* pa_daemon_conf_new(void) { } else #endif -#ifdef OS_IS_WIN32 -{ -char *t; -char *majorminor = pa_xstrdup(VERSION); -char *toplevel = pa_win32_get_toplevel(NULL); - -if ((t = strchr(majorminor, '-'))) - *t = '\0'; - -c-dl_search_path = pa_sprintf_malloc(%s PA_PATH_SEP lib PA_PATH_SEP pulse-%s PA_PATH_SEP modules, toplevel, majorminor); -pa_xfree(majorminor); -} -#else c-dl_search_path = pa_xstrdup(PA_DLSEARCHPATH); #endif -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 2/2] Move compile-time checks around pa_run_from_build_tree to core-util
To make the code cleaner and have the checks all in one place. --- src/daemon/daemon-conf.c | 11 +-- src/modules/alsa/alsa-mixer.c | 12 src/pulsecore/core-util.c |3 --- src/pulsecore/core-util.h |5 + 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 59579d9..2872c74 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -144,7 +144,7 @@ static const pa_daemon_conf default_conf = { #endif }; -pa_daemon_conf* pa_daemon_conf_new(void) { +pa_daemon_conf *pa_daemon_conf_new(void) { pa_daemon_conf *c; c = pa_xnewdup(pa_daemon_conf, default_conf, 1); @@ -153,19 +153,10 @@ pa_daemon_conf* pa_daemon_conf_new(void) { c-dl_search_path = pa_sprintf_malloc(%s PA_PATH_SEP lib PA_PATH_SEP pulse-%d.%d PA_PATH_SEP modules, pa_win32_get_toplevel(NULL), PA_MAJOR, PA_MINOR); #else -#if defined(__linux__) !defined(__OPTIMIZE__) - -/* We abuse __OPTIMIZE__ as a check whether we are a debug build - * or not. If we are and are run from the build tree then we - * override the search path to point to our build tree */ - if (pa_run_from_build_tree()) { pa_log_notice(Detected that we are run from the build tree, fixing search path.); c-dl_search_path = pa_xstrdup(PA_BUILDDIR /.libs/); - } else - -#endif c-dl_search_path = pa_xstrdup(PA_DLSEARCHPATH); #endif diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index 51a6cd6..286931f 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -85,7 +85,7 @@ struct pa_alsa_fdlist { void *userdata; }; -static void io_cb(pa_mainloop_api*a, pa_io_event* e, int fd, pa_io_event_flags_t events, void *userdata) { +static void io_cb(pa_mainloop_api *a, pa_io_event *e, int fd, pa_io_event_flags_t events, void *userdata) { struct pa_alsa_fdlist *fdl = userdata; int err; @@ -132,7 +132,7 @@ static void io_cb(pa_mainloop_api*a, pa_io_event* e, int fd, pa_io_event_flags_t snd_mixer_handle_events(fdl-mixer); } -static void defer_cb(pa_mainloop_api*a, pa_defer_event* e, void *userdata) { +static void defer_cb(pa_mainloop_api *a, pa_defer_event *e, void *userdata) { struct pa_alsa_fdlist *fdl = userdata; unsigned num_fds, i; int err, n; @@ -230,7 +230,7 @@ void pa_alsa_fdlist_free(struct pa_alsa_fdlist *fdl) { pa_xfree(fdl); } -int pa_alsa_fdlist_set_mixer(struct pa_alsa_fdlist *fdl, snd_mixer_t *mixer_handle, pa_mainloop_api* m) { +int pa_alsa_fdlist_set_mixer(struct pa_alsa_fdlist *fdl, snd_mixer_t *mixer_handle, pa_mainloop_api *m) { pa_assert(fdl); pa_assert(mixer_handle); pa_assert(m); @@ -2229,9 +2229,7 @@ pa_alsa_path* pa_alsa_path_new(const char *fname, pa_alsa_direction_t direction) items[2].data = p-name; fn = pa_maybe_prefix_path(fname, -#if defined(__linux__) !defined(__OPTIMIZE__) pa_run_from_build_tree() ? PA_BUILDDIR /modules/alsa/mixer/paths/ : -#endif PA_ALSA_PATHS_DIR); r = pa_config_parse(fn, NULL, items, p); @@ -2250,7 +2248,7 @@ fail: return NULL; } -pa_alsa_path* pa_alsa_path_synthesize(const char*element, pa_alsa_direction_t direction) { +pa_alsa_path *pa_alsa_path_synthesize(const char *element, pa_alsa_direction_t direction) { pa_alsa_path *p; pa_alsa_element *e; @@ -3744,9 +3742,7 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel fname = default.conf; fn = pa_maybe_prefix_path(fname, -#if defined(__linux__) !defined(__OPTIMIZE__) pa_run_from_build_tree() ? PA_BUILDDIR /modules/alsa/mixer/profile-sets/ : -#endif PA_ALSA_PROFILE_SETS_DIR); r = pa_config_parse(fn, NULL, items, ps); diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 3eb1242..5ef8480 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -2955,9 +2955,6 @@ pa_bool_t pa_run_from_build_tree(void) { char *rp; pa_bool_t b = FALSE; -/* We abuse __OPTIMIZE__ as a check whether we are a debug build - * or not. */ - if ((rp = pa_readlink(/proc/self/exe))) { b = pa_startswith(rp, PA_BUILDDIR); pa_xfree(rp); diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h index 80b4739..32641a3 100644 --- a/src/pulsecore/core-util.h +++ b/src/pulsecore/core-util.h @@ -254,8 +254,13 @@ size_t pa_pipe_buf(int fd); void pa_reset_personality(void); +/* We abuse __OPTIMIZE__ as a check whether we are a debug build + * or not. If we are and are run from the build tree then we + * override the search path to point to our build tree */ #if defined(__linux__) !defined(__OPTIMIZE__) pa_bool_t pa_run_from_build_tree(void); +#else +static
Re: [pulseaudio-discuss] [PATCH 2/2] Move compile-time checks around pa_run_from_build_tree to core-util
Is there a better way than #if defined(__linux__) !defined(__OPTIMIZE__) to check for a debug build? By default the CFLAGS contain -g -O2, so __OPTIMIZE__ will not be defined and running uninstalled does not work. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 3/5] osx: add -headerpad_max_install_names to LDFLAGS
2011/3/21 Daniel Mack dan...@zonque.org: On Sun, Mar 20, 2011 at 7:14 PM, Tanu Kaskinen ta...@iki.fi wrote: On Sun, 2011-03-20 at 18:39 +0100, Daniel Mack wrote: This is needed for sufficient padding of library names in linked binaries. --- src/Makefile.am | 5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index ff98ddb..c182483 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -82,6 +82,11 @@ FOREIGN_CFLAGS = -w MODULE_LDFLAGS = $(AM_LDFLAGS) -module -disable-static -avoid-version $(LDFLAGS_NOUNDEFINED) MODULE_LIBADD = $(AM_LIBADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la +if OS_IS_DARWIN +AM_LDFLAGS+=-headerpad_max_install_names +MODULE_LDFLAGS+=-headerpad_max_install_names +endif If you put this block before MODULE_LDFLAGS is defined, then you don't need to touch MODULE_LDFLAGS, because they include AM_LDFLAGS automatically. Yes, of course. I'll fix this. Just to reiterate: You don't have to do this. Only appending to AM_LDFLAGS (no need to move) adds it to both. So just drop the MODULE_LDFLAGS+= line of that hunk. You can verify by running a build with make V=1, you'll see that it all just works. Cosmetic: spaces around += would be nice (it seems that it wasn't entirely consistent before either...) I'd rather keep it in sync with the other lines. Someone could come up with a patch to fix them all :) Which other lines? It seems that the only lines in the whole file that don't use spaces are in the if OS_IS_WIN32 block (so probably my bad) With spaces clearly is preferred, so please use that. Daniel Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [RFC PATCH] Log PCM samples to files
2011/3/21 Vincent Becker vincentx.bec...@intel.com: Hi, I recently created a new PA module (module-log-pcm) which is able to log PCM samples from any source/sink and its corresponding outputs/inputs. For testing audio quality, checking signal processing or verifying the right implementation of a sound device mixed in PA, application fields are many. What is the use case you are specifically interested in? One just needs to give a parameter list depending on what is wished to be logged. During the process, an audio tree, or parts of it, is probed and logged for post-treatment purposes. I'm sorry if I am being stuped here, but wat can the module do that you can't with parec from a monitor source? For design needs, sources and sinks are designated by ends and source outputs/sink inputs by ports. Why introduce the new terminology here? I think it is confusing for people that know pulse already. Or is there perhaps some subtle difference between the pulse concept and your designation for it? Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/2] Log feature: Add a new log target to a file descriptor
2011/3/21 Becker, VincentX vincentx.bec...@intel.com: 'Twas brillig, and Vincent Becker at 18/03/11 10:23 did gyre and gimble: This patch enables logging of text debug messages (pa_log feature) into a file or a device driver. Example : pulseaudio --log-target=file:./mylog.txt Many thanks for your perseverence here. We were beginning to worry we were annoying you too much with constant tweaks for a relatively simple patch. Hi Col, I actually crashed my Linux environment, this is why it took me some time to recover and get back to you. I did actually make a couple extra tweaks on top of this one which I've attached FYI. One of them was to fix the double close that Arun pointed out before and was still in this version. If I've cocked it up, please feel free to publicly humiliate me in a manner of your choosing. No worries! It's cleaner like that I admit. OOOps! I just noticed a naughty integration error of mine. Unluckily, in the process of redelivering, I did not retest so in daemon-conf.c, it is implemented in the wrong function pa_daemon_conf_set_log_level. It should be in the function just above pa_daemon_conf_set_log_target. Both functions look very similar and are one above each other, so there was still a tiny chance to mess up ! Sorry, sorry.. Should I resent by the way a corrected version ? The first patch is already in git master, so you better send a patch against that. Vincent Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH] Get rid of some warnings
2011/3/20 Colin Guthrie gm...@colin.guthr.ie: 'Twas brillig, and Maarten Bosmans at 19/03/11 15:26 did gyre and gimble: Mostly warnings about unused stuff. Furthermore, the first hunk is a fix for the change in 177948a6. Finally, comment in AEC_dtd was translated and the code simplified slightly. Thanks :) CC module_echo_cancel_la-adrian-aec.lo modules/echo-cancel/adrian-aec.h:360:15: warning: ‘AEC_getambient’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:368:14: warning: ‘AEC_setgain’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:374:14: warning: ‘AEC_setaes’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:377:16: warning: ‘AEC_max_dotp_xf_xf’ declared ‘static’ but never defined [-Wunused-function] Is the Adrian code ours or is it external in some capacity. Arun, if it's external and we will update it periodically, can you do the necessary to push where it needs to go? (Obviously the PA_GCC_UNUSED cannot be pushed anywhere). I checked that there were already a lot of changes in git after the inital import, and Arun seems to confirm. Arun: what is the license of those files?, it doesn't really say in the header. May be a audit of all files/licenses should be done in general? Another thing what bothers me is that is apparantly wasn't clear to both Colin and me which code is maintained externally and periodically imported by us and which code was once imported and now maintained in our tree. Am I right in thinking that only the stuff under src/modules/bluetooth/sbc is external? Colin's download did seem to affect some headers under src/modules/bluetooth though. We should document this somewhere. CC module_echo_cancel_la-module-echo-cancel.lo modules/echo-cancel/module-echo-cancel.c: In function ‘time_callback’: modules/echo-cancel/module-echo-cancel.c:266:12: warning: variable ‘fs’ set but not used [-Wunused-but-set-variable] I made a couple tweaks here to use /* */ rather than // as is Lennart's general desire (doesn't bother me personally but meh!) I used //, because that was already used to comment out the places fs would be used. I think it makes sense to use /* */ exclusively for textual comments on the workings of the code, but to allow // for commenting out stuf (just like #ifdef 0), like it is used in module-echo-cancel there. That way you have the ability to grep for // and find locations of code that need some more work. But of course my viewpoint is 'meh' enough not to care strongly either way. So merged now. Col Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] Get rid of some more warnings
Here are the last (relatively) easy fixes for compiler warnings. [PATCH 1/2] Get rid of some warnings: -Wunused-result [PATCH 2/2] Get rid of some warnings: -Wunsafe-loop-optimizations The war is not over yet, my friends. Prepare for the final battle and we shall be victorious! Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 1/2] Get rid of some warnings: -Wunused-result
modules/module-default-device-restore.c: In function ‘load’: modules/module-default-device-restore.c:67: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] modules/module-default-device-restore.c:88: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] pulsecore/authkey.c: In function ‘generate’: pulsecore/authkey.c:58: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result] pulsecore/core-util.c: In function ‘pa_make_secure_dir’: pulsecore/core-util.c:261: warning: ignoring return value of ‘fchown’, declared with attribute warn_unused_result [-Wunused-result] --- src/modules/module-default-device-restore.c |8 src/pulsecore/authkey.c |5 - src/pulsecore/core-util.c |7 --- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/modules/module-default-device-restore.c b/src/modules/module-default-device-restore.c index 94f589e..90f1149 100644 --- a/src/modules/module-default-device-restore.c +++ b/src/modules/module-default-device-restore.c @@ -64,8 +64,8 @@ static void load(struct userdata *u) { char ln[256] = ; pa_sink *s; -(void) fgets(ln, sizeof(ln)-1, f); -pa_strip_nl(ln); +if(fgets(ln, sizeof(ln)-1, f)) +pa_strip_nl(ln); fclose(f); if (!ln[0]) @@ -85,8 +85,8 @@ static void load(struct userdata *u) { char ln[256] = ; pa_source *s; -(void) fgets(ln, sizeof(ln)-1, f); -pa_strip_nl(ln); +if (fgets(ln, sizeof(ln)-1, f)) +pa_strip_nl(ln); fclose(f); if (!ln[0]) diff --git a/src/pulsecore/authkey.c b/src/pulsecore/authkey.c index 92509d8..a590a65 100644 --- a/src/pulsecore/authkey.c +++ b/src/pulsecore/authkey.c @@ -55,7 +55,10 @@ static int generate(int fd, void *ret_data, size_t length) { pa_random(ret_data, length); lseek(fd, (off_t) 0, SEEK_SET); -(void) ftruncate(fd, (off_t) 0); +if (ftruncate(fd, (off_t) 0) 0) { +pa_log(Failed to truncate cookie file: %s, pa_cstrerror(errno)); +return -1; +} if ((r = pa_loop_write(fd, ret_data, length, NULL)) 0 || (size_t) r != length) { pa_log(Failed to write cookie file: %s, pa_cstrerror(errno)); diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index a713cae..8ff9995 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -254,11 +254,12 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) { } #ifdef HAVE_FCHOWN -if (uid == (uid_t)-1) +if (uid == (uid_t) -1) uid = getuid(); -if (gid == (gid_t)-1) +if (gid == (gid_t) -1) gid = getgid(); -(void) fchown(fd, uid, gid); +if (fchown(fd, uid, gid) 0) +goto fail; #endif #ifdef HAVE_FCHMOD -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 2/2] Get rid of some warnings: -Wunsafe-loop-optimizations
pulsecore/core-util.c: In function ‘pa_hexstr’: pulsecore/core-util.c:1858: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] modules/alsa/alsa-mixer.c: In function ‘pa_alsa_decibel_fix_dump’: modules/alsa/alsa-mixer.c:3678: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations] modules/alsa/alsa-mixer.c: In function ‘pa_alsa_path_set_new’: modules/alsa/alsa-mixer.c:2640: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] --- src/modules/alsa/alsa-mixer.c | 14 +++--- src/pulsecore/core-util.c |2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index 3eef5f9..a0fa865 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -2637,7 +2637,7 @@ pa_alsa_path_set *pa_alsa_path_set_new(pa_alsa_mapping *m, pa_alsa_direction_t d pa_bool_t duplicate = FALSE; char **kn, *fn; -for (kn = pn; kn != in; kn++) +for (kn = pn; kn in; kn++) if (pa_streq(*kn, *in)) { duplicate = TRUE; break; @@ -3669,14 +3669,14 @@ void pa_alsa_decibel_fix_dump(pa_alsa_decibel_fix *db_fix) { if (db_fix-db_values) { pa_strbuf *buf; -long i; -long max_i = db_fix-max_step - db_fix-min_step; +unsigned long i, nsteps; -buf = pa_strbuf_new(); -pa_strbuf_printf(buf, [%li]:%0.2f, db_fix-min_step, db_fix-db_values[0] / 100.0); +pa_assert(db_fix-min_step = db_fix-max_step); +nsteps = db_fix-max_step - db_fix-min_step + 1; -for (i = 1; i = max_i; ++i) -pa_strbuf_printf(buf, [%li]:%0.2f, i + db_fix-min_step, db_fix-db_values[i] / 100.0); +buf = pa_strbuf_new(); +for (i = 0; i nsteps; ++i) +pa_strbuf_printf(buf, [%li]:%0.2f , i + db_fix-min_step, db_fix-db_values[i] / 100.0); db_values = pa_strbuf_tostring_free(buf); } diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 8ff9995..cf04191 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -1856,7 +1856,7 @@ char *pa_hexstr(const uint8_t* d, size_t dlength, char *s, size_t slength) { pa_assert(s); pa_assert(slength 0); -while (i dlength j+3 = slength) { +while (j+2 slength i dlength) { s[j++] = hex[*d 4]; s[j++] = hex[*d 0xF]; -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/2] daemon: Fix missing include - cpu-orc.h
Can this go in fast? as it's annoying to have to patch this every time myself. Maarten 2011/3/19 Arun Raghavan arun.ragha...@collabora.co.uk: --- src/daemon/main.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/daemon/main.c b/src/daemon/main.c index 533c4c3..f7aed51 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -95,6 +95,7 @@ #endif #include pulsecore/cpu-arm.h #include pulsecore/cpu-x86.h +#include pulsecore/cpu-orc.h #include cmdline.h #include cpulimit.h -- 1.7.4.1 ___ 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] [PATCH] Get rid of some warnings
Mostly warnings about unused stuff. Furthermore, the first hunk is a fix for the change in 177948a6. Finally, comment in AEC_dtd was translated and the code simplified slightly. CC module_bluetooth_device_la-module-bluetooth-device.lo modules/bluetooth/module-bluetooth-device.c: In function ‘a2dp_process_render’: modules/bluetooth/module-bluetooth-device.c:1335:30: warning: pointer targets in passing argument 6 of ‘sbc_encode’ differ in signedness [-Wpointer-sign] ../src/modules/bluetooth/sbc/sbc.h:92:9: note: expected ‘ssize_t *’ but argument is of type ‘size_t *’ CC module_rygel_media_server_la-module-rygel-media-server.lo modules/module-rygel-media-server.c:383:13: warning: ‘append_property_dict_entry_object_array’ defined but not used [-Wunused-function] CC module_echo_cancel_la-adrian-aec.lo modules/echo-cancel/adrian-aec.h:360:15: warning: ‘AEC_getambient’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:368:14: warning: ‘AEC_setgain’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:374:14: warning: ‘AEC_setaes’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:377:16: warning: ‘AEC_max_dotp_xf_xf’ declared ‘static’ but never defined [-Wunused-function] CC module_echo_cancel_la-module-echo-cancel.lo modules/echo-cancel/module-echo-cancel.c: In function ‘time_callback’: modules/echo-cancel/module-echo-cancel.c:266:12: warning: variable ‘fs’ set but not used [-Wunused-but-set-variable] CC module-virtual-sink.lo modules/module-virtual-sink.c: In function ‘sink_input_pop_cb’: modules/module-virtual-sink.c:206:15: warning: variable ‘current_latency’ set but not used [-Wunused-but-set-variable] --- src/modules/bluetooth/module-bluetooth-device.c |2 +- src/modules/echo-cancel/adrian-aec.c| 16 ++-- src/modules/echo-cancel/adrian-aec.h|7 +++ src/modules/echo-cancel/module-echo-cancel.c|4 ++-- src/modules/module-rygel-media-server.c |1 + src/modules/module-virtual-sink.c |2 +- src/pulse/gccmacro.h|2 +- 7 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 5561054..ac0f16f 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -1326,7 +1326,7 @@ static int a2dp_process_render(struct userdata *u) { to_write = a2dp-buffer_size - sizeof(*header) - sizeof(*payload); while (PA_LIKELY(to_encode 0 to_write 0)) { -size_t written; +ssize_t written; ssize_t encoded; encoded = sbc_encode(a2dp-sbc, diff --git a/src/modules/echo-cancel/adrian-aec.c b/src/modules/echo-cancel/adrian-aec.c index 6793e59..04b31e9 100644 --- a/src/modules/echo-cancel/adrian-aec.c +++ b/src/modules/echo-cancel/adrian-aec.c @@ -107,8 +107,7 @@ AEC* AEC_init(int RATE, int have_vector) // mapped to 1.0 with a limited linear function. static float AEC_dtd(AEC *a, REAL d, REAL x) { - float stepsize; - float ratio, M; + float ratio, stepsize; // fast near-end and far-end average a-dfast += ALPHAFAST * (fabsf(d) - a-dfast); @@ -129,16 +128,13 @@ static float AEC_dtd(AEC *a, REAL d, REAL x) // ratio of NFRs ratio = (a-dfast * a-xslow) / (a-dslow * a-xfast); - // begrenzte lineare Kennlinie - M = (STEPY2 - STEPY1) / (STEPX2 - STEPX1); - if (ratio STEPX1) { + // Linear interpolation with clamping at the limits + if (ratio STEPX1) stepsize = STEPY1; - } else if (ratio STEPX2) { + else if (ratio STEPX2) stepsize = STEPY2; - } else { -// Punktrichtungsform einer Geraden -stepsize = M * (ratio - STEPX1) + STEPY1; - } + else +stepsize = STEPY1 + (STEPY2 - STEPY1) * (ratio - STEPX1) / (STEPX2 - STEPX1); return stepsize; } diff --git a/src/modules/echo-cancel/adrian-aec.h b/src/modules/echo-cancel/adrian-aec.h index 235984b..9c722b9 100644 --- a/src/modules/echo-cancel/adrian-aec.h +++ b/src/modules/echo-cancel/adrian-aec.h @@ -357,7 +357,7 @@ static REAL AEC_nlms_pw(AEC *a, REAL d, REAL x_, float stepsize); */ int AEC_doAEC(AEC *a, int d_, int x_); -static float AEC_getambient(AEC *a) { +PA_GCC_UNUSED static float AEC_getambient(AEC *a) { return a-dfast; }; static void AEC_setambient(AEC *a, float Min_xf) { @@ -365,16 +365,15 @@ static void AEC_setambient(AEC *a, float Min_xf) { a-delta = (NLMS_LEN-1) * Min_xf * Min_xf; a-dotp_xf_xf += a-delta; // add new delta }; -static void AEC_setgain(AEC *a, float gain_) { +PA_GCC_UNUSED static void AEC_setgain(AEC *a, float gain_) { a-gain = gain_; }; #if 0 void AEC_openwdisplay(AEC *a); #endif -static void AEC_setaes(AEC *a, float aes_y2_) { +PA_GCC_UNUSED static void AEC_setaes(AEC *a, float aes_y2_) { a-aes_y2 = aes_y2_; }; -static
Re: [pulseaudio-discuss] [PATCH] Get rid of some warnings
With this and other patches floating on the list we're down to three warnings: (this is with gcc 4.6.0, with 4.4.4 - which is standard on ubuntu 10.10 - I got more bogus warnings) CC libpulsecommon_1.0_la-ipacl.lo pulsecore/ipacl.c: In function ‘pa_ip_acl_check’: pulsecore/ipacl.c:238:20: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] I have no idea how to do this one. It seems safe to ignore. CC libpulsecommon_1.0_la-memtrap.lo pulsecore/memtrap.c: In function ‘sigsafe_error’: pulsecore/memtrap.c:72:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] We really want to ignore the return value here, because you can't really do anything about a failing write, as it's in a signal handler and we're aborting anyway. That line already casts the result to (void), but that doesn't seem to stop the warning: pulsecore/memtrap.c:72: (void) write(STDERR_FILENO, s, strlen(s)); CC libbluetooth_sbc_la-sbc.lo modules/bluetooth/sbc/sbc.c: In function ‘sbc_decode’: modules/bluetooth/sbc/sbc.c:498:10: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations] Not our code I think I have had enough of this. But if there are others that are interested in fixing warnings: compiling with clang works now in git master and gives plenty of warnings to play with ;-) Maarten 2011/3/19 Maarten Bosmans mkbosm...@gmail.com: Mostly warnings about unused stuff. Furthermore, the first hunk is a fix for the change in 177948a6. Finally, comment in AEC_dtd was translated and the code simplified slightly. CC module_bluetooth_device_la-module-bluetooth-device.lo modules/bluetooth/module-bluetooth-device.c: In function ‘a2dp_process_render’: modules/bluetooth/module-bluetooth-device.c:1335:30: warning: pointer targets in passing argument 6 of ‘sbc_encode’ differ in signedness [-Wpointer-sign] ../src/modules/bluetooth/sbc/sbc.h:92:9: note: expected ‘ssize_t *’ but argument is of type ‘size_t *’ CC module_rygel_media_server_la-module-rygel-media-server.lo modules/module-rygel-media-server.c:383:13: warning: ‘append_property_dict_entry_object_array’ defined but not used [-Wunused-function] CC module_echo_cancel_la-adrian-aec.lo modules/echo-cancel/adrian-aec.h:360:15: warning: ‘AEC_getambient’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:368:14: warning: ‘AEC_setgain’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:374:14: warning: ‘AEC_setaes’ defined but not used [-Wunused-function] modules/echo-cancel/adrian-aec.h:377:16: warning: ‘AEC_max_dotp_xf_xf’ declared ‘static’ but never defined [-Wunused-function] CC module_echo_cancel_la-module-echo-cancel.lo modules/echo-cancel/module-echo-cancel.c: In function ‘time_callback’: modules/echo-cancel/module-echo-cancel.c:266:12: warning: variable ‘fs’ set but not used [-Wunused-but-set-variable] CC module-virtual-sink.lo modules/module-virtual-sink.c: In function ‘sink_input_pop_cb’: modules/module-virtual-sink.c:206:15: warning: variable ‘current_latency’ set but not used [-Wunused-but-set-variable] --- src/modules/bluetooth/module-bluetooth-device.c | 2 +- src/modules/echo-cancel/adrian-aec.c | 16 ++-- src/modules/echo-cancel/adrian-aec.h | 7 +++ src/modules/echo-cancel/module-echo-cancel.c | 4 ++-- src/modules/module-rygel-media-server.c | 1 + src/modules/module-virtual-sink.c | 2 +- src/pulse/gccmacro.h | 2 +- 7 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 5561054..ac0f16f 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -1326,7 +1326,7 @@ static int a2dp_process_render(struct userdata *u) { to_write = a2dp-buffer_size - sizeof(*header) - sizeof(*payload); while (PA_LIKELY(to_encode 0 to_write 0)) { - size_t written; + ssize_t written; ssize_t encoded; encoded = sbc_encode(a2dp-sbc, diff --git a/src/modules/echo-cancel/adrian-aec.c b/src/modules/echo-cancel/adrian-aec.c index 6793e59..04b31e9 100644 --- a/src/modules/echo-cancel/adrian-aec.c +++ b/src/modules/echo-cancel/adrian-aec.c @@ -107,8 +107,7 @@ AEC* AEC_init(int RATE, int have_vector) // mapped to 1.0 with a limited linear function. static float AEC_dtd(AEC *a, REAL d, REAL x) { - float stepsize; - float ratio, M; + float ratio, stepsize; // fast near-end and far-end average a-dfast += ALPHAFAST * (fabsf(d) - a-dfast); @@ -129,16 +128,13 @@ static float AEC_dtd(AEC *a, REAL d, REAL x) // ratio of NFRs ratio = (a-dfast * a-xslow) / (a-dslow * a-xfast); - // begrenzte
[pulseaudio-discuss] Merge of pavucontrol and paprefs
With the approaching switch to freedesktop.org infrastructure, only pulseaudio and and pavucontrol are going to be migrated, if I understand it correctly. Of the other utils, paman and padevchooser were already deprecated for several years. (I have closed all the tickets as wontfix, to emphasize that point) Pavumeter has also seen very little development and is not so interesting. Paprefs however, is used quite a lot. I think Colin proposed merging it with pavucontrol. (and may be even mentioned already working on such a merge?) Putting all the paprefs stuff on a new pavucontrol tab, or with the current configuration tab makes sense, I'd say. Any ideas on that? I think Colin mentioned that he would like the gconf module to go. Can we make a plan for that? After the merge is done, may be it makes sense to rename the tool to pacontrol, as it is about much more than just controlling volumes. If we decide to do this, it makes sense to start with the fd.o git repo already renamed. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH] Update PA_MODULE_USAGE to be in line with actual implementation
--- src/modules/alsa/module-alsa-sink.c|4 +++- src/modules/alsa/module-alsa-source.c |2 ++ src/modules/bluetooth/module-bluetooth-proximity.c |1 - src/modules/module-equalizer-sink.c|4 +++- src/modules/module-hal-detect.c|4 ++-- src/modules/module-pipe-sink.c |2 +- src/modules/module-protocol-stub.c |4 ++-- src/modules/module-suspend-on-idle.c |1 + src/modules/module-waveout.c |6 +++--- 9 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c index 697fab4..465c8b9 100644 --- a/src/modules/alsa/module-alsa-sink.c +++ b/src/modules/alsa/module-alsa-sink.c @@ -40,7 +40,8 @@ PA_MODULE_LOAD_ONCE(FALSE); PA_MODULE_USAGE( name=name of the sink, to be prefixed sink_name=name for the sink -sink_properities=properties for the sink +sink_properties=properties for the sink +namereg_fail=pa_namereg_register() fail parameter value device=ALSA device device_id=ALSA card index format=sample format @@ -64,6 +65,7 @@ static const char* const valid_modargs[] = { name, sink_name, sink_properties, +namereg_fail, device, device_id, format, diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c index 23da418..90ffea5 100644 --- a/src/modules/alsa/module-alsa-source.c +++ b/src/modules/alsa/module-alsa-source.c @@ -65,6 +65,7 @@ PA_MODULE_USAGE( name=name for the source, to be prefixed source_name=name for the source source_properties=properties for the source +namereg_fail=pa_namereg_register() fail parameter value device=ALSA device device_id=ALSA card index format=sample format @@ -84,6 +85,7 @@ static const char* const valid_modargs[] = { name, source_name, source_properties, +namereg_fail, device, device_id, format, diff --git a/src/modules/bluetooth/module-bluetooth-proximity.c b/src/modules/bluetooth/module-bluetooth-proximity.c index 3eed9ce..8c3a5b9 100644 --- a/src/modules/bluetooth/module-bluetooth-proximity.c +++ b/src/modules/bluetooth/module-bluetooth-proximity.c @@ -59,7 +59,6 @@ PA_MODULE_USAGE( static const char* const valid_modargs[] = { sink, -rssi, hci, NULL, }; diff --git a/src/modules/module-equalizer-sink.c b/src/modules/module-equalizer-sink.c index a28405b..bb350c3 100644 --- a/src/modules/module-equalizer-sink.c +++ b/src/modules/module-equalizer-sink.c @@ -77,7 +77,8 @@ PA_MODULE_DESCRIPTION(_(General Purpose Equalizer)); PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_LOAD_ONCE(FALSE); PA_MODULE_USAGE( -_(sink_name=name of the sink +_(sink_name=name of the sink + sink_properties=properties for the sink master=sink to connect to format=sample format rate=sample rate @@ -131,6 +132,7 @@ struct userdata { static const char* const valid_modargs[] = { sink_name, +sink_properties, master, format, rate, diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c index 23d4010..941ac3a 100644 --- a/src/modules/module-hal-detect.c +++ b/src/modules/module-hal-detect.c @@ -57,13 +57,13 @@ PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_LOAD_ONCE(TRUE); #if defined(HAVE_ALSA) defined(HAVE_OSS_OUTPUT) PA_MODULE_USAGE(api=alsa or oss -tsched=enable system timer based scheduling mode? +tsched=enable system timer based scheduling mode? subdevices=init all subdevices); #elif defined(HAVE_ALSA) PA_MODULE_USAGE(api=alsa tsched=enable system timer based scheduling mode?); #elif defined(HAVE_OSS_OUTPUT) -PA_MODULE_USAGE(api=oss +PA_MODULE_USAGE(api=oss subdevices=init all subdevices); #endif PA_MODULE_DEPRECATED(Please use module-udev-detect instead of module-hal-detect!); diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c index b1158d3..6623aef 100644 --- a/src/modules/module-pipe-sink.c +++ b/src/modules/module-pipe-sink.c @@ -61,7 +61,7 @@ PA_MODULE_USAGE( sink_properties=properties for the sink file=path of the FIFO format=sample format -rate=sample rate +rate=sample rate channels=number of channels channel_map=channel map); diff --git a/src/modules/module-protocol-stub.c b/src/modules/module-protocol-stub.c index 7ba5405..1a14596 100644 --- a/src/modules/module-protocol-stub.c +++ b/src/modules/module-protocol-stub.c @@ -137,7 +137,7 @@ PA_MODULE_DESCRIPTION(Native protocol SOCKET_DESCRIPTION); PA_MODULE_USAGE(auth-anonymous=don't check for cookies?
[pulseaudio-discuss] New win32 patch series
The updated branch is online at https://github.com/mkbosmans/pulseaudio/compare/mingw32-build [PATCH 1/9] module-waveout: Add device_name parameter [PATCH 2/9] Find modules and config files relative to the installed libraries. [PATCH 3/9] build: copy instead of link pacat to other utils on win32 [PATCH 4/9] build: Protect some more variables by ifdefs [PATCH 5/9] Use pulsecore/arpa-inet.h to make arpa/inet.h functionality available [PATCH 6/9] Fix pa_rtclock_from_wallclock [PATCH 7/9] module-waveout: Query device for supported samplerate [PATCH 8/9] module-waveout: Move thread creation [PATCH 9/9] module-waveout: Fix record/playback args Please review/pull Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 1/9] module-waveout: Add device_name parameter
Also use the name in the source/sink description. Based on a patch by srirams, from github. --- src/modules/module-waveout.c | 32 ++-- 1 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c index 0dbf7ef..05bc306 100644 --- a/src/modules/module-waveout.c +++ b/src/modules/module-waveout.c @@ -52,6 +52,7 @@ PA_MODULE_USAGE( sink_name=name for the sink source_name=name for the source device=device number +device_name=name of the device record=enable source? playback=enable sink? format=sample format @@ -97,6 +98,7 @@ static const char* const valid_modargs[] = { sink_name, source_name, device, +device_name, record, playback, fragments, @@ -476,12 +478,14 @@ int pa__init(pa_module *m) { HWAVEOUT hwo = INVALID_HANDLE_VALUE; HWAVEIN hwi = INVALID_HANDLE_VALUE; WAVEFORMATEX wf; +WAVEOUTCAPS pwoc; int nfrags, frag_size; pa_bool_t record = TRUE, playback = TRUE; unsigned int device; pa_sample_spec ss; pa_channel_map map; pa_modargs *ma = NULL; +const char *device_name = NULL; unsigned int i; pa_assert(m); @@ -502,11 +506,31 @@ int pa__init(pa_module *m) { goto fail; } +/* Set the device to be opened. If set device_name is used, + * else device if set and lastly WAVE_MAPPER is the default */ device = WAVE_MAPPER; if (pa_modargs_get_value_u32(ma, device, device) 0) { pa_log(failed to parse device argument); goto fail; } +if ((device_name = pa_modargs_get_value(ma, device_name, NULL)) != NULL) { +unsigned int num_devices = waveOutGetNumDevs(); +for (i = 0; i num_devices; i++) { +if (waveOutGetDevCaps(i, pwoc, sizeof(pwoc)) == MMSYSERR_NOERROR) +if (_stricmp(device_name, pwoc.szPname) == 0) +break; +} +if (i num_devices) +device = i; +else { +pa_log(device not found: %s, device_name); +goto fail; +} +} +if (waveOutGetDevCaps(device, pwoc, sizeof(pwoc)) == MMSYSERR_NOERROR) +device_name = pwoc.szPname; +else +device_name = unknown; nfrags = 5; frag_size = 8192; @@ -549,6 +573,7 @@ int pa__init(pa_module *m) { InitializeCriticalSection(u-crit); if (hwi != INVALID_HANDLE_VALUE) { +char *description = pa_sprintf_malloc(WaveIn on %s, device_name); pa_source_new_data data; pa_source_new_data_init(data); data.driver = __FILE__; @@ -561,12 +586,14 @@ int pa__init(pa_module *m) { pa_assert(u-source); u-source-userdata = u; -pa_source_set_description(u-source, Windows waveIn PCM); +pa_source_set_description(u-source, description); u-source-parent.process_msg = process_msg; +pa_xfree(description); } else u-source = NULL; if (hwo != INVALID_HANDLE_VALUE) { +char *description = pa_sprintf_malloc(WaveOut on %s, device_name); pa_sink_new_data data; pa_sink_new_data_init(data); data.driver = __FILE__; @@ -581,8 +608,9 @@ int pa__init(pa_module *m) { u-sink-get_volume = sink_get_volume_cb; u-sink-set_volume = sink_set_volume_cb; u-sink-userdata = u; -pa_sink_set_description(u-sink, Windows waveOut PCM); +pa_sink_set_description(u-sink, description); u-sink-parent.process_msg = process_msg; +pa_xfree(description); } else u-sink = NULL; -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 3/9] build: copy instead of link pacat to other utils on win32
This is necessary as symlinks are not supported on Windows. Also use the $(EXEEXT) variable. As a side effect on POSIX, an absolute symbolic link is now created instead of a relative one. --- src/Makefile.am | 21 + 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b57172b..3736669 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1896,21 +1896,26 @@ daemon.conf: daemon/daemon.conf.in Makefile sed -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ -e 's,@PA_DEFAULT_CONFIG_FILE\@,$(DEFAULT_CONFIG_DIR),g' $ $@ +if OS_IS_WIN32 +LINK_PROGRAM=cp +else +LINK_PROGRAM=ln -sf +endif install-exec-hook: -chown root $(DESTDIR)$(pulselibexecdir)/proximity-helper -chmod u+s $(DESTDIR)$(pulselibexecdir)/proximity-helper - ln -sf pacat $(DESTDIR)$(bindir)/parec - ln -sf pacat $(DESTDIR)$(bindir)/pamon - ln -sf pacat $(DESTDIR)$(bindir)/paplay - ln -sf pacat $(DESTDIR)$(bindir)/parecord + $(LINK_PROGRAM) $(DESTDIR)$(bindir)/pacat$(EXEEXT) $(DESTDIR)$(bindir)/parec$(EXEEXT) + $(LINK_PROGRAM) $(DESTDIR)$(bindir)/pacat$(EXEEXT) $(DESTDIR)$(bindir)/pamon$(EXEEXT) + $(LINK_PROGRAM) $(DESTDIR)$(bindir)/pacat$(EXEEXT) $(DESTDIR)$(bindir)/paplay$(EXEEXT) + $(LINK_PROGRAM) $(DESTDIR)$(bindir)/pacat$(EXEEXT) $(DESTDIR)$(bindir)/parecord$(EXEEXT) rm -f $(DESTDIR)$(libdir)/libpulsedsp.la rm -f $(DESTDIR)$(modlibexecdir)/*.la uninstall-hook: - rm -f $(DESTDIR)$(bindir)/parec - rm -f $(DESTDIR)$(bindir)/pamon - rm -f $(DESTDIR)$(bindir)/paplay - rm -f $(DESTDIR)$(bindir)/parecord + rm -f $(DESTDIR)$(bindir)/parec$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/pamon$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/paplay$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/parecord$(EXEEXT) rm -f $(DESTDIR)$(libdir)/libpulsedsp.* rm -f $(DESTDIR)$(modlibexecdir)/*.so -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 4/9] build: Protect some more variables by ifdefs
This avoids empty directories being created on builds without X11, ALSA, etc. --- src/Makefile.am | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3736669..e0c5d0d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,10 +27,16 @@ pulseincludedir=$(includedir)/pulse pulsecoreincludedir=$(includedir)/pulsecore pulseconfdir=$(sysconfdir)/pulse pulselibexecdir=$(libexecdir)/pulse +if HAVE_X11 xdgautostartdir=$(sysconfdir)/xdg/autostart +endif +if HAVE_ALSA alsaprofilesetsdir=$(datadir)/pulseaudio/alsa-mixer/profile-sets alsapathsdir=$(datadir)/pulseaudio/alsa-mixer/paths +endif +if HAVE_DBUS dbuspolicydir=$(sysconfdir)/dbus-1/system.d +endif ### #Defines # @@ -117,9 +123,9 @@ if HAVE_X11 xdgautostart_in_files = \ daemon/pulseaudio.desktop.in \ daemon/pulseaudio-kde.desktop.in -endif xdgautostart_DATA = $(xdgautostart_in_files:.desktop.in=.desktop) @INTLTOOL_DESKTOP_RULE@ +endif ### @@ -1902,8 +1908,10 @@ else LINK_PROGRAM=ln -sf endif install-exec-hook: +if HAVE_BLUEZ -chown root $(DESTDIR)$(pulselibexecdir)/proximity-helper -chmod u+s $(DESTDIR)$(pulselibexecdir)/proximity-helper +endif $(LINK_PROGRAM) $(DESTDIR)$(bindir)/pacat$(EXEEXT) $(DESTDIR)$(bindir)/parec$(EXEEXT) $(LINK_PROGRAM) $(DESTDIR)$(bindir)/pacat$(EXEEXT) $(DESTDIR)$(bindir)/pamon$(EXEEXT) $(LINK_PROGRAM) $(DESTDIR)$(bindir)/pacat$(EXEEXT) $(DESTDIR)$(bindir)/paplay$(EXEEXT) -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 6/9] Fix pa_rtclock_from_wallclock
The HAVE_CLOCK_GETTIME macro protects timespec and related functions, nothing of which is used in pa_rtclock_from_wallclock. And silently just not converting was not the proper solution anyway. Also add an assert in pulse/mainloop.c to report the integer overflow that was triggered by the wrong pa_rtclock_from_wallclock. Without the assert, debugging was painful. --- src/pulse/mainloop.c | 23 ++- src/pulsecore/core-rtclock.c | 14 -- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index 8c26138..f02d31a 100644 --- a/src/pulse/mainloop.c +++ b/src/pulse/mainloop.c @@ -151,7 +151,7 @@ static pa_io_event_flags_t map_flags_from_libc(short flags) { /* IO events */ static pa_io_event* mainloop_io_new( -pa_mainloop_api*a, +pa_mainloop_api *a, int fd, pa_io_event_flags_t events, pa_io_event_cb_t callback, @@ -244,7 +244,7 @@ static void mainloop_io_set_destroy(pa_io_event *e, pa_io_event_destroy_cb_t cal /* Defer events */ static pa_defer_event* mainloop_defer_new( -pa_mainloop_api*a, +pa_mainloop_api *a, pa_defer_event_cb_t callback, void *userdata) { @@ -331,7 +331,7 @@ static pa_usec_t make_rt(const struct timeval *tv, pa_bool_t *use_rtclock) { } static pa_time_event* mainloop_time_new( -pa_mainloop_api*a, +pa_mainloop_api *a, const struct timeval *tv, pa_time_event_cb_t callback, void *userdata) { @@ -355,7 +355,7 @@ static pa_time_event* mainloop_time_new( if ((e-enabled = (t != PA_USEC_INVALID))) { e-time = t; -e-use_rtclock= use_rtclock; +e-use_rtclock = use_rtclock; m-n_enabled_time_events++; @@ -438,7 +438,7 @@ static void mainloop_time_set_destroy(pa_time_event *e, pa_time_event_destroy_cb /* quit() */ -static void mainloop_quit(pa_mainloop_api*a, int retval) { +static void mainloop_quit(pa_mainloop_api *a, int retval) { pa_mainloop *m; pa_assert(a); @@ -591,7 +591,7 @@ static void cleanup_defer_events(pa_mainloop *m, pa_bool_t force) { } -void pa_mainloop_free(pa_mainloop* m) { +void pa_mainloop_free(pa_mainloop *m) { pa_assert(m); cleanup_io_events(m, TRUE); @@ -848,10 +848,15 @@ quit: } static int usec_to_timeout(pa_usec_t u) { +int timeout; + if (u == PA_USEC_INVALID) return -1; -return (u + PA_USEC_PER_MSEC - 1) / PA_USEC_PER_MSEC; +timeout = (u + PA_USEC_PER_MSEC - 1) / PA_USEC_PER_MSEC; +pa_assert(timeout = 0); + +return timeout; } int pa_mainloop_poll(pa_mainloop *m) { @@ -988,7 +993,7 @@ void pa_mainloop_quit(pa_mainloop *m, int retval) { pa_mainloop_wakeup(m); } -pa_mainloop_api* pa_mainloop_get_api(pa_mainloop*m) { +pa_mainloop_api* pa_mainloop_get_api(pa_mainloop *m) { pa_assert(m); return m-api; @@ -1001,7 +1006,7 @@ void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *use m-poll_func_userdata = userdata; } -pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api*m) { +pa_bool_t pa_mainloop_is_our_api(pa_mainloop_api *m) { pa_assert(m); return m-io_new == mainloop_io_new; diff --git a/src/pulsecore/core-rtclock.c b/src/pulsecore/core-rtclock.c index ac2c097..331ac11 100644 --- a/src/pulsecore/core-rtclock.c +++ b/src/pulsecore/core-rtclock.c @@ -182,15 +182,13 @@ void pa_rtclock_hrtimer_enable(void) { } struct timeval* pa_rtclock_from_wallclock(struct timeval *tv) { - -#ifdef HAVE_CLOCK_GETTIME struct timeval wc_now, rt_now; +pa_assert(tv); + pa_gettimeofday(wc_now); pa_rtclock_get(rt_now); -pa_assert(tv); - /* pa_timeval_sub() saturates on underflow! */ if (pa_timeval_cmp(wc_now, tv) 0) @@ -199,7 +197,6 @@ struct timeval* pa_rtclock_from_wallclock(struct timeval *tv) { pa_timeval_sub(rt_now, pa_timeval_diff(wc_now, tv)); *tv = rt_now; -#endif return tv; } @@ -232,15 +229,13 @@ struct timespec* pa_timespec_store(struct timespec *ts, pa_usec_t v) { #endif static struct timeval* wallclock_from_rtclock(struct timeval *tv) { - -#ifdef HAVE_CLOCK_GETTIME struct timeval wc_now, rt_now; +pa_assert(tv); + pa_gettimeofday(wc_now); pa_rtclock_get(rt_now); -pa_assert(tv); - /* pa_timeval_sub() saturates on underflow! */ if (pa_timeval_cmp(rt_now, tv) 0) @@ -249,7 +244,6 @@ static struct timeval* wallclock_from_rtclock(struct timeval *tv) { pa_timeval_sub(wc_now, pa_timeval_diff(rt_now, tv)); *tv = wc_now; -#endif return tv; } -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 7/9] module-waveout: Query device for supported samplerate
Instead of using a fixed list list of supported rates, ask the wave subsystem whether the rate can be used. --- src/modules/module-waveout.c | 59 + 1 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c index 05bc306..44b15da 100644 --- a/src/modules/module-waveout.c +++ b/src/modules/module-waveout.c @@ -159,12 +159,11 @@ static void do_write(struct userdata *u) { memchunk.memblock = NULL; } -/* Insufficient data in sink buffer? */ +/* Underflow detection */ if (hdr-dwBufferLength == 0) { u-sink_underflow = 1; break; } - u-sink_underflow = 0; res = waveOutPrepareHeader(u-hwo, hdr, sizeof(WAVEHDR)); @@ -292,8 +291,12 @@ finish: } static void CALLBACK chunk_done_cb(HWAVEOUT hwo, UINT msg, DWORD_PTR inst, DWORD param1, DWORD param2) { -struct userdata *u = (struct userdata *)inst; +struct userdata *u = (struct userdata*) inst; +if (msg == WOM_OPEN) +pa_log_debug(WaveOut subsystem opened.); +if (msg == WOM_CLOSE) +pa_log_debug(WaveOut subsystem closed.); if (msg != WOM_DONE) return; @@ -304,8 +307,12 @@ static void CALLBACK chunk_done_cb(HWAVEOUT hwo, UINT msg, DWORD_PTR inst, DWORD } static void CALLBACK chunk_ready_cb(HWAVEIN hwi, UINT msg, DWORD_PTR inst, DWORD param1, DWORD param2) { -struct userdata *u = (struct userdata *)inst; +struct userdata *u = (struct userdata*) inst; +if (msg == WIM_OPEN) +pa_log_debug(WaveIn subsystem opened.); +if (msg == WIM_CLOSE) +pa_log_debug(WaveIn subsystem closed.); if (msg != WIM_DATA) return; @@ -433,17 +440,6 @@ static int ss_to_waveformat(pa_sample_spec *ss, LPWAVEFORMATEX wf) { wf-nChannels = ss-channels; -switch (ss-rate) { -case 8000: -case 11025: -case 22005: -case 44100: -break; -default: -pa_log_error(Unsupported sample rate.); -return -1; -} - wf-nSamplesPerSec = ss-rate; if (ss-format == PA_SAMPLE_U8) @@ -451,7 +447,7 @@ static int ss_to_waveformat(pa_sample_spec *ss, LPWAVEFORMATEX wf) { else if (ss-format == PA_SAMPLE_S16NE) wf-wBitsPerSample = 16; else { -pa_log_error(Unsupported sample format.); +pa_log_error(Unsupported sample format, only u8 and s16 are supported.); return -1; } @@ -467,7 +463,7 @@ int pa__get_n_used(pa_module *m) { struct userdata *u; pa_assert(m); pa_assert(m-userdata); -u = (struct userdata *)m-userdata; +u = (struct userdata*) m-userdata; return (u-sink ? pa_sink_used_by(u-sink) : 0) + (u-source ? pa_source_used_by(u-source) : 0); @@ -479,6 +475,7 @@ int pa__init(pa_module *m) { HWAVEIN hwi = INVALID_HANDLE_VALUE; WAVEFORMATEX wf; WAVEOUTCAPS pwoc; +MMRESULT result; int nfrags, frag_size; pa_bool_t record = TRUE, playback = TRUE; unsigned int device; @@ -551,23 +548,39 @@ int pa__init(pa_module *m) { u = pa_xmalloc(sizeof(struct userdata)); if (record) { -if (waveInOpen(hwi, device, wf, (DWORD_PTR)chunk_ready_cb, (DWORD_PTR)u, CALLBACK_FUNCTION) != MMSYSERR_NOERROR) { -pa_log(failed to open waveIn); +result = waveInOpen(hwi, device, wf, 0, 0, WAVE_FORMAT_DIRECT | WAVE_FORMAT_QUERY); +if (result != MMSYSERR_NOERROR) { +pa_log_warn(Sample spec not supported by WaveIn, falling back to default sample rate.); +ss.rate = wf.nSamplesPerSec = m-core-default_sample_spec.rate; +} +result = waveInOpen(hwi, device, wf, (DWORD_PTR) chunk_ready_cb, (DWORD_PTR) u, CALLBACK_FUNCTION); +if (result != MMSYSERR_NOERROR) { +char errortext[MAXERRORLENGTH]; +pa_log(Failed to open WaveIn.); +if (waveInGetErrorText(result, errortext, sizeof(errortext)) == MMSYSERR_NOERROR) +pa_log(Error: %s, errortext); goto fail; } if (waveInStart(hwi) != MMSYSERR_NOERROR) { pa_log(failed to start waveIn); goto fail; } -pa_log_debug(Opened waveIn subsystem.); } if (playback) { -if (waveOutOpen(hwo, device, wf, (DWORD_PTR)chunk_done_cb, (DWORD_PTR)u, CALLBACK_FUNCTION) != MMSYSERR_NOERROR) { -pa_log(failed to open waveOut); +result = waveOutOpen(hwo, device, wf, 0, 0, WAVE_FORMAT_DIRECT | WAVE_FORMAT_QUERY); +if (result != MMSYSERR_NOERROR) { +pa_log_warn(Sample spec not supported by WaveOut, falling back to default sample rate.); +ss.rate = wf.nSamplesPerSec = m-core-default_sample_spec.rate; +} +result = waveOutOpen(hwo, device, wf, (DWORD_PTR) chunk_done_cb, (DWORD_PTR) u, CALLBACK_FUNCTION); +if (result != MMSYSERR_NOERROR) {
[pulseaudio-discuss] [PATCH 8/9] module-waveout: Move thread creation
--- src/modules/module-waveout.c | 22 +- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c index 44b15da..90d0599 100644 --- a/src/modules/module-waveout.c +++ b/src/modules/module-waveout.c @@ -650,7 +650,7 @@ int pa__init(pa_module *m) { pa_assert(u-ihdrs); u-ohdrs = pa_xmalloc0(sizeof(WAVEHDR) * u-fragments); pa_assert(u-ohdrs); -for (i = 0;i u-fragments;i++) { +for (i = 0; i u-fragments; i++) { u-ihdrs[i].dwBufferLength = u-fragment_size; u-ohdrs[i].dwBufferLength = u-fragment_size; u-ihdrs[i].lpData = pa_xmalloc(u-fragment_size); @@ -668,22 +668,26 @@ int pa__init(pa_module *m) { u-rtpoll = pa_rtpoll_new(); pa_thread_mq_init(u-thread_mq, m-core-mainloop, u-rtpoll); -if (!(u-thread = pa_thread_new(waveout-source, thread_func, u))) { -pa_log(Failed to create thread.); -goto fail; -} if (u-sink) { pa_sink_set_asyncmsgq(u-sink, u-thread_mq.inq); pa_sink_set_rtpoll(u-sink, u-rtpoll); -pa_sink_put(u-sink); } if (u-source) { pa_source_set_asyncmsgq(u-source, u-thread_mq.inq); pa_source_set_rtpoll(u-source, u-rtpoll); -pa_source_put(u-source); } +if (!(u-thread = pa_thread_new(waveout, thread_func, u))) { +pa_log(Failed to create thread.); +goto fail; +} + +if (u-sink) +pa_sink_put(u-sink); +if (u-source) +pa_source_put(u-source); + return 0; fail: @@ -712,7 +716,7 @@ void pa__done(pa_module *m) { pa_asyncmsgq_send(u-thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, NULL, 0, NULL); if (u-thread) - pa_thread_free(u-thread); +pa_thread_free(u-thread); pa_thread_mq_done(u-thread_mq); if (u-sink) @@ -733,7 +737,7 @@ void pa__done(pa_module *m) { waveOutClose(u-hwo); } -for (i = 0;i u-fragments;i++) { +for (i = 0; i u-fragments; i++) { pa_xfree(u-ihdrs[i].lpData); pa_xfree(u-ohdrs[i].lpData); } -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 9/9] module-waveout: Fix record/playback args
--- src/modules/module-waveout.c | 20 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c index 90d0599..6c96921 100644 --- a/src/modules/module-waveout.c +++ b/src/modules/module-waveout.c @@ -256,20 +256,23 @@ static void thread_func(void *userdata) { for (;;) { int ret; +pa_bool_t need_timer = FALSE; -if (PA_SINK_IS_OPENED(u-sink-thread_info.state) || -PA_SOURCE_IS_OPENED(u-source-thread_info.state)) { - +if (u-sink PA_SINK_IS_OPENED(u-sink-thread_info.state)) { if (u-sink-thread_info.rewind_requested) pa_sink_process_rewind(u-sink, 0); -if (PA_SINK_IS_OPENED(u-sink-thread_info.state)) -do_write(u); -if (PA_SOURCE_IS_OPENED(u-source-thread_info.state)) -do_read(u); +do_write(u); +need_timer = TRUE; +} +if (u-source PA_SOURCE_IS_OPENED(u-source-thread_info.state)) { +do_read(u); +need_timer = TRUE; +} +if (need_timer) pa_rtpoll_set_timer_relative(u-rtpoll, u-poll_timeout); -} else +else pa_rtpoll_set_timer_disabled(u-rtpoll); /* Hmm, nothing to do. Let's sleep */ @@ -643,6 +646,7 @@ int pa__init(pa_module *m) { u-sink_underflow = 1; u-poll_timeout = pa_bytes_to_usec(u-fragments * u-fragment_size / 10, ss); +pa_log_debug(Poll timeout = %.1f ms, (double) u-poll_timeout / PA_USEC_PER_MSEC); u-cur_ihdr = 0; u-cur_ohdr = 0; -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] Allow conditionals in config input files
This patch series changes the current use of sed by an awk script, with some enhancements on top. It is portable, or at least I've tested it with both gawk and mawk and it passes make distcheck. [PATCH 1/6] build: Replace sed by awk for processing .in files [PATCH 2/6] build: Get rid of default.pa.win32 [PATCH 3/6] build: Use more conditional inclusions in default.pa [PATCH 4/6] build: Only use relevant portions of daemon.conf.in [PATCH 5/6] Move -Ddefines from AM_CFLAGS to config.h [PATCH 6/6] Make pulse compile with clang The series is online at https://github.com/mkbosmans/pulseaudio/compare/build-system for ease of merging. Note that the last patch in the series is not really related, but is included as a reminder to merge. I'm happy to receive further comments. In particular I'd like to invite Colin to show whether his proposed approach using .include and a /etc/pulse/subdir is a viable alternative to this patch series. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 1/6] build: Replace sed by awk for processing .in files
--- Makefile.am |1 + configure.ac|3 +-- man/Makefile.am |4 +--- process-in.awk | 36 src/Makefile.am | 30 ++ 5 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 process-in.awk diff --git a/Makefile.am b/Makefile.am index a8a9eaa..d69087a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,6 +26,7 @@ EXTRA_DIST = \ doxygen/Makefile.am \ doxygen/Makefile.in \ doxygen/doxygen.conf.in \ + process-in.awk \ README \ todo \ vala/libpulse.vapi diff --git a/configure.ac b/configure.ac index 9b73bc1..4d42b17 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.63) -AC_INIT([pulseaudio],[m4_esyscmd(./git-version-gen .tarball-version)],[mzchyfrnhqvb (at) 0pointer (dot) net]) +AC_INIT([pulseaudio],[m4_esyscmd(./git-version-gen .tarball-version)],[mzchyfrnhqvb (at) 0pointer (dot) net],[pulseaudio],[http://pulseaudio.org/]) AC_CONFIG_SRCDIR([src/daemon/main.c]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) @@ -34,7 +34,6 @@ m4_define(pa_minor, `echo $VERSION | cut -d. -f2 | cut -d- -f1`) AC_SUBST(PA_MAJOR, pa_major) AC_SUBST(PA_MINOR, pa_minor) AC_SUBST(PA_MAJORMINOR, pa_major.pa_minor) -AC_SUBST(PACKAGE_URL, [http://pulseaudio.org/]) AC_SUBST(PA_API_VERSION, 12) AC_SUBST(PA_PROTOCOL_VERSION, 20) diff --git a/man/Makefile.am b/man/Makefile.am index eca1fb9..62278c6 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -36,9 +36,7 @@ noinst_DATA = \ default.pa.5.xml %.xml: %.xml.in Makefile - $(AM_V_GEN) sed -e 's,@pulseconfdir\@,$(pulseconfdir),g' \ - -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \ --e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $ $@ + $(AM_V_GEN) $(AWK) -v configfile=$(top_builddir)/config.h -f $(top_srcdir)/process-in.awk pulseconfdir=$(pulseconfdir) $ $@ xmllint: $(noinst_DATA) for f in $(noinst_DATA) ; do \ diff --git a/process-in.awk b/process-in.awk new file mode 100644 index 000..f73859f --- /dev/null +++ b/process-in.awk @@ -0,0 +1,36 @@ +# This AWK script processes input files by replacing @VAR@ by its value, similar to configure does to files added to +# AC_CONFIG_FILES. On top of that it allows the use of conditionals with @if, @else and @endif. +BEGIN { + # Put variables from config.h into the config dictionary + while ((getline configfile) 0) +if (/^#define/) { + value = substr($0, index($0, $2)+length($2)+1) + if (value ~ /\.*\/) +value = substr(value, 2, length(value)-2) + config[$2] = value +} + # Put variables from the command line into the config dictionary + for (i = 1; i ARGC; i++) +if ((ind = index(ARGV[i], =)) 0) + config[substr(ARGV[i], 0, ind-1)] = substr(ARGV[i], ind+1) +} +{ + # Replace all variables present in the config dictionary + for (define in config) +gsub(@ define @, config[define]) + # Process the conditional statements + if (match($0, /@if /)) +stack[++stacklen] = int(substr($0, RSTART+RLENGTH)) + else if (/@else$/) +stack[stacklen] = !stack[stacklen] + else if (/@endif$/) +delete stack[stacklen--] + else { +printline = 1 +for (bla in stack) + if (!stack[bla]) +printline = 0 +if (printline) + print $0 + } +} diff --git a/src/Makefile.am b/src/Makefile.am index 2ab6355..139234f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1865,24 +1865,27 @@ module_rygel_media_server_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) CLEANFILES += esdcompat client.conf default.pa system.pa daemon.conf start-pulseaudio-x11 start-pulseaudio-kde daemon/pulseaudio.desktop daemon/pulseaudio-kde.desktop +AWK_in=$(AWK) -v configfile=$(top_builddir)/config.h -f $(top_srcdir)/process-in.awk \ + PACTL_BINARY=$(bindir)/pactl \ + PA_BINARY=$(PA_BINARY) \ + PA_DEFAULT_CONFIG_FILE=$(PA_DEFAULT_CONFIG_DIR)/default.pa \ + PA_DLSEARCHPATH=$(modlibexecdir) \ + PA_SOEXT=.so + esdcompat: daemon/esdcompat.in Makefile - $(AM_V_GEN) sed -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ - -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ - -e 's,@PA_BINARY\@,$(PA_BINARY),g' $ $@ + $(AM_V_GEN) $(AWK_in) $ $@ $(AM_V_at) chmod +x esdcompat start-pulseaudio-x11: daemon/start-pulseaudio-x11.in Makefile - $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ - -e 's,@PACTL_BINARY\@,$(bindir)/pactl,g' $ $@ + $(AM_V_GEN) $(AWK_in) $ $@ $(AM_V_at) chmod +x start-pulseaudio-x11 start-pulseaudio-kde: daemon/start-pulseaudio-kde.in Makefile - $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ - -e 's,@PACTL_BINARY\@,$(bindir)/pactl,g' $ $@ + $(AM_V_GEN) $(AWK_in) $ $@ $(AM_V_at) chmod +x start-pulseaudio-kde client.conf: pulse/client.conf.in Makefile - $(AM_V_GEN) sed -e
[pulseaudio-discuss] [PATCH 2/6] build: Get rid of default.pa.win32
--- src/Makefile.am | 15 --- src/daemon/default.pa.in| 15 +++ src/daemon/default.pa.win32 | 43 --- 3 files changed, 19 insertions(+), 54 deletions(-) delete mode 100644 src/daemon/default.pa.win32 diff --git a/src/Makefile.am b/src/Makefile.am index 139234f..e004a65 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -92,7 +92,6 @@ EXTRA_DIST = \ daemon/daemon.conf.in \ daemon/default.pa.in \ daemon/system.pa.in \ - daemon/default.pa.win32 \ depmod.py \ daemon/esdcompat.in \ daemon/start-pulseaudio-x11.in \ @@ -1887,19 +1886,13 @@ start-pulseaudio-kde: daemon/start-pulseaudio-kde.in Makefile client.conf: pulse/client.conf.in Makefile $(AM_V_GEN) $(AWK_in) $ $@ -if OS_IS_WIN32 -default.pa: daemon/default.pa.win32 - cp $ $@ -system.pa: daemon/default.pa.win32 - cp $ $@ -else -default.pa: daemon/default.pa.in Makefile +daemon.conf: daemon/daemon.conf.in Makefile $(AM_V_GEN) $(AWK_in) $ $@ -system.pa: daemon/system.pa.in Makefile + +default.pa: daemon/default.pa.in Makefile $(AM_V_GEN) $(AWK_in) $ $@ -endif -daemon.conf: daemon/daemon.conf.in Makefile +system.pa: daemon/system.pa.in Makefile $(AM_V_GEN) $(AWK_in) $ $@ install-exec-hook: diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in index 32ba582..8ee3bdc 100755 --- a/src/daemon/default.pa.in +++ b/src/daemon/default.pa.in @@ -22,10 +22,15 @@ .nofail ### Load something into the sample cache +@if @OS_IS_WIN32@ +load-sample x11-bell %WINDIR%\Media\ding.wav +load-sample-dir-lazy %WINDIR%\Media\*.wav +@else #load-sample-lazy x11-bell /usr/share/sounds/gtk-events/activate.wav #load-sample-lazy pulse-hotplug /usr/share/sounds/startup3.wav #load-sample-lazy pulse-coldplug /usr/share/sounds/startup3.wav #load-sample-lazy pulse-access /usr/share/sounds/generic.wav +@endif .fail @@ -77,6 +82,15 @@ load-module module-native-protocol-unix #load-module module-native-protocol-tcp #load-module module-zeroconf-publish +@if @OS_IS_WIN32@ +# Load audio drivers statically +load-module module-waveout sink_name=output source_name=input + +# Load audio drivers automatically on access +#add-autoload-sink output module-waveout sink_name=output source_name=input +#add-autoload-source input module-waveout sink_name=output source_name=input + +@else ### Load the RTP reciever module (also configured via paprefs, see above) #load-module module-rtp-recv @@ -137,6 +151,7 @@ load-module module-cork-music-on-phone #.fail #.endif +@endif ### Make some devices default #set-default-sink output #set-default-source input diff --git a/src/daemon/default.pa.win32 b/src/daemon/default.pa.win32 deleted file mode 100644 index d5a1e18..000 --- a/src/daemon/default.pa.win32 +++ /dev/null @@ -1,43 +0,0 @@ -# -# This file is part of PulseAudio. -# -# 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 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. - - -# Load audio drivers statically - -load-module module-waveout sink_name=output source_name=input -load-module module-null-sink - -# Load audio drivers automatically on access - -#add-autoload-sink output module-waveout sink_name=output source_name=input -#add-autoload-source input module-waveout sink_name=output source_name=input - -# Load several protocols -#load-module module-esound-protocol-tcp -#load-module module-native-protocol-tcp -#load-module module-simple-protocol-tcp -#load-module module-cli-protocol-tcp - -# Make some devices default -set-default-sink output -set-default-source input - -.nofail - -# Load something to the sample cache -load-sample x11-bell %WINDIR%\Media\ding.wav -load-sample-dir-lazy %WINDIR%\Media\*.wav -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 3/6] build: Use more conditional inclusions in default.pa
--- src/daemon/default.pa.in | 30 ++ 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in index 8ee3bdc..c0f396e 100755 --- a/src/daemon/default.pa.in +++ b/src/daemon/default.pa.in @@ -46,35 +46,58 @@ load-module module-augment-properties ### Load audio drivers statically (it's probably better to not load ### these drivers manually, but instead use module-udev-detect -- ### see below -- for doing this automatically) +@if @HAVE_ALSA@ #load-module module-alsa-sink #load-module module-alsa-source device=hw:1,0 +@endif +@if @HAVE_OSS_OUTPUT@ #load-module module-oss device=/dev/dsp sink_name=output source_name=input #load-module module-oss-mmap device=/dev/dsp sink_name=output source_name=input +@endif +@if @OS_IS_WIN32@ +load-module module-waveout sink_name=output source_name=input +@endif #load-module module-null-sink #load-module module-pipe-sink ### Automatically load driver modules depending on the hardware available +@if @HAVE_UDEV@ .ifexists module-udev-detect@PA_SOEXT@ load-module module-udev-detect .else +@else +@if @HAVE_HAL +.ifexists module-hal-detect@PA_SOEXT@ +load-module module-hal-detect +.else +@else +.ifexists module-detect@PA_SOEXT@ +@endif +@endif ### Alternatively use the static hardware detection module (for systems that ### lack udev support) load-module module-detect .endif +@if @HAVE_BLUEZ@ ### Automatically load driver modules for Bluetooth hardware .ifexists module-bluetooth-discover@PA_SOEXT@ load-module module-bluetooth-discover .endif +@endif +@if @HAVE_SYS_UN_H@ ### Load several protocols .ifexists module-esound-protocol-unix@PA_SOEXT@ load-module module-esound-protocol-unix .endif +load-module module-native-protocol-unix +@endif +@if @HAVE_DBUS@ .ifexists module-dbus-protocol@PA_SOEXT@ load-module module-dbus-protocol .endif -load-module module-native-protocol-unix +@endif ### Network access (may be configured with paprefs, so leave this commented ### here if you plan to use paprefs) @@ -83,9 +106,6 @@ load-module module-native-protocol-unix #load-module module-zeroconf-publish @if @OS_IS_WIN32@ -# Load audio drivers statically -load-module module-waveout sink_name=output source_name=input - # Load audio drivers automatically on access #add-autoload-sink output module-waveout sink_name=output source_name=input #add-autoload-source input module-waveout sink_name=output source_name=input @@ -135,6 +155,8 @@ load-module module-position-event-sounds ### Cork music streams when a phone stream is active load-module module-cork-music-on-phone +@endif +@if @HAVE_X11@ # X11 modules should not be started from default.pa so that one daemon # can be shared by multiple sessions. -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 4/6] build: Only use relevant portions of daemon.conf.in
--- src/daemon/daemon.conf.in |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in index 9beba85..a21c93c 100644 --- a/src/daemon/daemon.conf.in +++ b/src/daemon/daemon.conf.in @@ -25,7 +25,9 @@ ; allow-exit = yes ; use-pid-file = yes ; system-instance = no +@if @HAVE_DBUS@ ; local-server-type = user +@endif ; enable-shm = yes ; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB ; lock-memory = no @@ -57,6 +59,7 @@ ; flat-volumes = yes +@if @HAVE_SYS_RESOURCE_H@ ; rlimit-fsize = -1 ; rlimit-data = -1 ; rlimit-stack = -1 @@ -72,6 +75,7 @@ ; rlimit-nice = 31 ; rlimit-rtprio = 9 ; rlimit-rttime = 100 +@endif ; default-sample-format = s16le ; default-sample-rate = 44100 -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 5/6] Move -Ddefines from AM_CFLAGS to config.h
This makes the length of the compiler command line a bit shorter. --- configure.ac| 15 +-- m4/ax_define_dir.m4 | 49 + src/Makefile.am |6 -- 3 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 m4/ax_define_dir.m4 diff --git a/configure.ac b/configure.ac index 4d42b17..fd76c6b 100644 --- a/configure.ac +++ b/configure.ac @@ -621,9 +621,10 @@ AC_SUBST(LIBSPEEX_LIBS) AC_MSG_CHECKING([whether we need libatomic_ops]) if test x$need_libatomic_ops = xyes; then AC_MSG_RESULT([yes]) - AC_CHECK_HEADERS([atomic_ops.h], [], [ - AC_MSG_ERROR([*** libatomic-ops headers not found]) - ]) + AC_CHECK_HEADERS([atomic_ops.h], +[CFLAGS=$CFLAGS -DAO_REQUIRE_CAS], +[AC_MSG_ERROR([*** libatomic-ops headers not found])] + ) # Win32 does not need the lib and breaks horribly if we try to include it if test x$os_is_win32 != x1 ; then @@ -1457,11 +1458,11 @@ fi PulseAudio system runtime dir PA_SYSTEM_RUNTIME_PATH=${localstatedir}/run/pulse -AC_SUBST(PA_SYSTEM_RUNTIME_PATH) +AX_DEFINE_DIR(PA_SYSTEM_RUNTIME_PATH, PA_SYSTEM_RUNTIME_PATH, [System runtime dir]) PA_SYSTEM_CONFIG_PATH=${localstatedir}/lib/pulse -AC_SUBST(PA_SYSTEM_CONFIG_PATH) +AX_DEFINE_DIR(PA_SYSTEM_CONFIG_PATH, PA_SYSTEM_CONFIG_PATH, [System config dir]) PA_SYSTEM_STATE_PATH=${localstatedir}/lib/pulse -AC_SUBST(PA_SYSTEM_STATE_PATH) +AX_DEFINE_DIR(PA_SYSTEM_STATE_PATH, PA_SYSTEM_STATE_PATH, [System state dir]) ### #Output # @@ -1499,6 +1500,7 @@ AC_ARG_WITH( [modlibexecdir=$withval], [modlibexecdir=${libdir}/pulse-${PA_MAJORMINOR}/modules]) AC_SUBST(modlibexecdir) +AX_DEFINE_DIR(PA_DLSEARCHPATH, modlibexecdir, [Modules dir]) AC_ARG_WITH( [udev-rules-dir], @@ -1682,6 +1684,7 @@ echo prefix:${prefix} sysconfdir:${sysconfdir} localstatedir: ${localstatedir} +modlibexecdir: ${modlibexecdir} System Runtime Path: ${PA_SYSTEM_RUNTIME_PATH} System State Path: ${PA_SYSTEM_STATE_PATH} System Config Path:${PA_SYSTEM_CONFIG_PATH} diff --git a/m4/ax_define_dir.m4 b/m4/ax_define_dir.m4 new file mode 100644 index 000..b74d155 --- /dev/null +++ b/m4/ax_define_dir.m4 @@ -0,0 +1,49 @@ +# === +# http://www.gnu.org/software/autoconf-archive/ax_define_dir.html +# === +# +# SYNOPSIS +# +# AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) +# +# DESCRIPTION +# +# This macro sets VARNAME to the expansion of the DIR variable, taking +# care of fixing up ${prefix} and such. +# +# VARNAME is then offered as both an output variable and a C preprocessor +# symbol. +# +# Example: +# +# AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) +# +# LICENSE +# +# Copyright (c) 2008 Stepan Kasal ka...@ucw.cz +# Copyright (c) 2008 Andreas Schwab sch...@suse.de +# Copyright (c) 2008 Guido U. Draheim gui...@gmx.de +# Copyright (c) 2008 Alexandre Oliva +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 6 + +AU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) +AC_DEFUN([AX_DEFINE_DIR], [ + prefix_NONE= + exec_prefix_NONE= + test x$prefix = xNONE prefix_NONE=yes prefix=$ac_default_prefix + test x$exec_prefix = xNONE exec_prefix_NONE=yes exec_prefix=$prefix +dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn +dnl refers to ${prefix}. Thus we have to use `eval' twice. + eval ax_define_dir=\[$]$2\ + eval ax_define_dir=\$ax_define_dir\ + AC_SUBST($1, $ax_define_dir) + AC_DEFINE_UNQUOTED($1, $ax_define_dir, [$3]) + test $prefix_NONE prefix=NONE + test $exec_prefix_NONE exec_prefix=NONE +]) diff --git a/src/Makefile.am b/src/Makefile.am index e004a65..a4118fc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,13 +53,8 @@ AM_CFLAGS = \ -I$(top_builddir)/src/modules \ $(PTHREAD_CFLAGS) -D_POSIX_PTHREAD_SEMANTICS \ -DPA_BUILDDIR=\$(abs_builddir)\ \ - -DPA_DLSEARCHPATH=\$(modlibexecdir)\ \ -DPA_DEFAULT_CONFIG_DIR=\$(PA_DEFAULT_CONFIG_DIR)\ \ -DPA_BINARY=\$(PA_BINARY)\ \ - -DPA_SYSTEM_RUNTIME_PATH=\$(PA_SYSTEM_RUNTIME_PATH)\ \ - -DPA_SYSTEM_CONFIG_PATH=\$(PA_SYSTEM_CONFIG_PATH)\ \ - -DPA_SYSTEM_STATE_PATH=\$(PA_SYSTEM_STATE_PATH)\ \ - -DAO_REQUIRE_CAS \ -DPULSE_LOCALEDIR=\$(pulselocaledir)\ \ -DPA_MACHINE_ID=\$(localstatedir)/lib/dbus/machine-id\ \ -DPA_ALSA_PATHS_DIR=\$(alsapathsdir)\ \ @@ -1868,7 +1863,6 @@
[pulseaudio-discuss] [PATCH 6/6] Make pulse compile with clang
This fixes the checking of supported compiler flags and the following error message for svolume_mmx: pulsecore/svolume_mmx.c:157:76: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions : +r (samples), +r (volumes), +r (length), =D ((pa_reg_x86)channel), =r (temp) ^~~ --- configure.ac|6 ++ src/pulsecore/svolume_mmx.c |4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index fd76c6b..70820bc 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,13 @@ if test x$M4 = xno ; then fi dnl Compiler flags + +# Some compilers (e.g. clang) default to a warning on an unkown command line option. +# Change that temporarily to an error, for the CC_CHECK_CFLAGS_APPEND macro to work. +save_CC=$CC +CC=$CC -Werror CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option]) +CC=$save_CC dnl Linker flags. dnl Check whether the linker supports the -version-script option. diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c index 4f10954..421156e 100644 --- a/src/pulsecore/svolume_mmx.c +++ b/src/pulsecore/svolume_mmx.c @@ -154,7 +154,7 @@ static void pa_volume_s16ne_mmx(int16_t *samples, int32_t *volumes, unsigned cha 6: \n\t emms \n\t -: +r (samples), +r (volumes), +r (length), =D ((pa_reg_x86)channel), =r (temp) +: +r (samples), +r (volumes), +r (length), =D (channel), =r (temp) : rm ((pa_reg_x86)channels) : cc ); @@ -229,7 +229,7 @@ static void pa_volume_s16re_mmx(int16_t *samples, int32_t *volumes, unsigned cha 6: \n\t emms \n\t -: +r (samples), +r (volumes), +r (length), =D ((pa_reg_x86)channel), =r (temp) +: +r (samples), +r (volumes), +r (length), =D (channel), =r (temp) : rm ((pa_reg_x86)channels) : cc ); -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH] Fix up some double spaces
This is another whitespace fixup. I promise that it's the last coding style fix I'll send to the list for now ;-) Actually it is not all just coding style, as what got my attention in the first place was an extra space in the log output (the hunk at pulsecore/module.c) As with the previous patch, I tried to be a bit conservative in making changes, but the patch touches quite some files nonetheless. Maarten 0001-Fix-up-some-double-spaces.patch Description: Binary data ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [RFC] allow conditionals in config input files like default.pa.in
2011/3/12 Tanu Kaskinen ta...@iki.fi: Hi Maarten, Did you ever get any feedback? At least there are no replies on the mailing list. The only feedback I got was from Colin, at IRC. He suggested that the .include directive to include a directory (in which files can then be installed conditionally) could also be used for this. On Fri, 2011-03-04 at 00:26 +0100, Maarten Bosmans wrote: It would be nice to have the ability to use @if HAVE_FEATURE@ in the configuration file templates. You could see it either as an extension of the current @VARIABLE@ replacement or as a compile-time variant of .ifexists. Incidentally, does anybody know why these files are currently generated in the Makefile using sed, instead of being included in AC_CONFIG_FILES? At least I don't know. Adding that ability has several advantages: - The default.pa.in and default.pa.win32 files can be merged. - The BSDs still use module-hal-detect, so it can be included in default.pa without littering it with [.ifexists module-hal-detect\n load-module module-hal-detect\n .endif] for Linux users, so they cannot be confused by it. - And thirdly, if sys/resource.h is not found the daemon does not understand the --rlimit-* options, so in that case those lines should be omitted from daemon.conf. Would this be a good change, or are we then preprocessing at too many levels? Sounds useful to me. In case my opinion matters, you have my acceptance :) Thanks for the review/response. I will post a concrete patch series shortly to make my point more clear and have a more defined discussion. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH] Make pulse compile with clang
As discussed on IRC. This is basically a correctly formatted version of the patch attached to http://pulseaudio.org/ticket/883 with a small improvement in configure.ac added. Maarten 0001-Make-pulse-compile-with-clang.patch Description: Binary data ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 1/7] Fixup #include directives according to Coding Style
Use #include header.h if functionality of header.h is implemented and #include header.h if functionality of header.h is used. --- src/pulse/browser.c |2 +- src/pulse/context.c | 13 + src/pulse/ext-device-manager.c |5 ++--- src/pulse/ext-stream-restore.c |5 ++--- src/pulse/introspect.c |3 +-- src/pulse/scache.c |4 ++-- src/pulse/stream.c |4 ++-- src/pulse/subscribe.c |1 - src/pulsecore/asyncq.c |5 +++-- src/pulsecore/protocol-esound.c |3 +-- src/pulsecore/resampler.c |2 +- src/pulsecore/sample-util.c |2 +- src/pulsecore/sconv-s16le.c |3 +-- src/pulsecore/sconv.c |6 +++--- src/pulsecore/sconv_sse.c |3 +-- src/pulsecore/svolume_arm.c |2 +- src/pulsecore/svolume_c.c |2 +- src/pulsecore/svolume_mmx.c |2 +- src/pulsecore/svolume_sse.c |2 +- src/tests/cpulimit-test.c |2 +- src/utils/pax11publish.c|2 +- 21 files changed, 32 insertions(+), 41 deletions(-) diff --git a/src/pulse/browser.c b/src/pulse/browser.c index 4cf5d0c..d059228 100644 --- a/src/pulse/browser.c +++ b/src/pulse/browser.c @@ -20,7 +20,7 @@ ***/ #ifdef HAVE_CONFIG_H -#include config.h +#include config.h #endif #include string.h diff --git a/src/pulse/context.c b/src/pulse/context.c index 8f632b5..1480af5 100644 --- a/src/pulse/context.c +++ b/src/pulse/context.c @@ -53,6 +53,11 @@ #include pulse/i18n.h #include pulse/mainloop.h #include pulse/timeval.h +#include pulse/fork-detect.h +#include pulse/client-conf.h +#ifdef HAVE_X11 +#include pulse/client-conf-x11.h +#endif #include pulsecore/core-error.h #include pulsecore/native-common.h @@ -71,14 +76,6 @@ #include pulsecore/proplist-util.h #include internal.h - -#include client-conf.h -#include fork-detect.h - -#ifdef HAVE_X11 -#include client-conf-x11.h -#endif - #include context.h void pa_command_extension(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata); diff --git a/src/pulse/ext-device-manager.c b/src/pulse/ext-device-manager.c index 57cb57c..7b78c24 100644 --- a/src/pulse/ext-device-manager.c +++ b/src/pulse/ext-device-manager.c @@ -27,14 +27,13 @@ #include pulse/context.h #include pulse/gccmacro.h #include pulse/xmalloc.h +#include pulse/fork-detect.h +#include pulse/operation.h #include pulsecore/macro.h #include pulsecore/pstream-util.h #include internal.h -#include operation.h -#include fork-detect.h - #include ext-device-manager.h enum { diff --git a/src/pulse/ext-stream-restore.c b/src/pulse/ext-stream-restore.c index 10e9fd5..7bc1a61 100644 --- a/src/pulse/ext-stream-restore.c +++ b/src/pulse/ext-stream-restore.c @@ -25,14 +25,13 @@ #include pulse/context.h #include pulse/gccmacro.h +#include pulse/fork-detect.h +#include pulse/operation.h #include pulsecore/macro.h #include pulsecore/pstream-util.h #include internal.h -#include operation.h -#include fork-detect.h - #include ext-stream-restore.h enum { diff --git a/src/pulse/introspect.c b/src/pulse/introspect.c index 2a81788..de91585 100644 --- a/src/pulse/introspect.c +++ b/src/pulse/introspect.c @@ -29,14 +29,13 @@ #include pulse/context.h #include pulse/gccmacro.h #include pulse/xmalloc.h +#include pulse/fork-detect.h #include pulsecore/macro.h #include pulsecore/core-util.h #include pulsecore/pstream-util.h #include internal.h -#include fork-detect.h - #include introspect.h /*** Statistics ***/ diff --git a/src/pulse/scache.c b/src/pulse/scache.c index cb8d7c5..6ed80a6 100644 --- a/src/pulse/scache.c +++ b/src/pulse/scache.c @@ -28,14 +28,14 @@ #include string.h #include pulse/utf8.h -#include pulse/scache.h +#include pulse/fork-detect.h #include pulsecore/pstream-util.h #include pulsecore/macro.h #include pulsecore/proplist-util.h -#include fork-detect.h #include internal.h +#include scache.h int pa_stream_connect_upload(pa_stream *s, size_t length) { pa_tagstruct *t; diff --git a/src/pulse/stream.c b/src/pulse/stream.c index ea468a5..ef27fe5 100644 --- a/src/pulse/stream.c +++ b/src/pulse/stream.c @@ -29,10 +29,10 @@ #include string.h #include pulse/def.h -#include pulse/stream.h #include pulse/timeval.h #include pulse/rtclock.h #include pulse/xmalloc.h +#include pulse/fork-detect.h #include pulsecore/pstream-util.h #include pulsecore/log.h @@ -41,8 +41,8 @@ #include pulsecore/core-rtclock.h #include pulsecore/core-util.h -#include fork-detect.h #include internal.h +#include stream.h #define AUTO_TIMING_INTERVAL_START_USEC (10*PA_USEC_PER_MSEC) #define AUTO_TIMING_INTERVAL_END_USEC (1500*PA_USEC_PER_MSEC) diff --git a/src/pulse/subscribe.c b/src/pulse/subscribe.c index 203bc92..52d0af3 100644 --- a/src/pulse/subscribe.c +++ b/src/pulse/subscribe.c @@ -31,7 +31,6 @@ #include pulsecore/pstream-util.h #include internal.h - #include
[pulseaudio-discuss] [PATCH 2/7] build: Use silent rules for generating files
--- man/Makefile.am |4 ++-- src/Makefile.am | 20 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/man/Makefile.am b/man/Makefile.am index 7793fe7..eca1fb9 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -36,7 +36,7 @@ noinst_DATA = \ default.pa.5.xml %.xml: %.xml.in Makefile - sed -e 's,@pulseconfdir\@,$(pulseconfdir),g' \ + $(AM_V_GEN) sed -e 's,@pulseconfdir\@,$(pulseconfdir),g' \ -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \ -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $ $@ @@ -66,7 +66,7 @@ CLEANFILES += \ $(dist_man_MANS) %: %.xml Makefile - perl $(srcdir)/xmltoman $ $@ || rm -f $@ + $(AM_V_GEN) perl $(srcdir)/xmltoman $ $@ || rm -f $@ endif diff --git a/src/Makefile.am b/src/Makefile.am index 24e2f82..137b8f7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1857,23 +1857,23 @@ module_rygel_media_server_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) CLEANFILES += esdcompat client.conf default.pa system.pa daemon.conf start-pulseaudio-x11 start-pulseaudio-kde daemon/pulseaudio.desktop daemon/pulseaudio-kde.desktop esdcompat: daemon/esdcompat.in Makefile - sed -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ + $(AM_V_GEN) sed -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ -e 's,@PA_BINARY\@,$(PA_BINARY),g' $ $@ - chmod +x esdcompat + $(AM_V_at) chmod +x esdcompat start-pulseaudio-x11: daemon/start-pulseaudio-x11.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ -e 's,@PACTL_BINARY\@,$(bindir)/pactl,g' $ $@ - chmod +x start-pulseaudio-x11 + $(AM_V_at) chmod +x start-pulseaudio-x11 start-pulseaudio-kde: daemon/start-pulseaudio-kde.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ -e 's,@PACTL_BINARY\@,$(bindir)/pactl,g' $ $@ - chmod +x start-pulseaudio-kde + $(AM_V_at) chmod +x start-pulseaudio-kde client.conf: pulse/client.conf.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' $ $@ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' $ $@ if OS_IS_WIN32 default.pa: daemon/default.pa.win32 @@ -1882,17 +1882,17 @@ system.pa: daemon/default.pa.win32 cp $ $@ else default.pa: daemon/default.pa.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ -e 's,@PA_SOEXT\@,.so,g' $ $@ system.pa: daemon/system.pa.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ -e 's,@PA_SOEXT\@,.so,g' $ $@ endif daemon.conf: daemon/daemon.conf.in Makefile - sed -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ + $(AM_V_GEN) sed -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ -e 's,@PA_DEFAULT_CONFIG_FILE\@,$(DEFAULT_CONFIG_DIR),g' $ $@ install-exec-hook: -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 2/7] build: Use silent rules for generating files
There are just 2 patches, the /7 was a mistake. Maarten 2011/3/9 Maarten Bosmans mkbosm...@gmail.com: --- man/Makefile.am | 4 ++-- src/Makefile.am | 20 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/man/Makefile.am b/man/Makefile.am index 7793fe7..eca1fb9 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -36,7 +36,7 @@ noinst_DATA = \ default.pa.5.xml %.xml: %.xml.in Makefile - sed -e 's,@pulseconfdir\@,$(pulseconfdir),g' \ + $(AM_V_GEN) sed -e 's,@pulseconfdir\@,$(pulseconfdir),g' \ -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \ -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $ $@ @@ -66,7 +66,7 @@ CLEANFILES += \ $(dist_man_MANS) %: %.xml Makefile - perl $(srcdir)/xmltoman $ $@ || rm -f $@ + $(AM_V_GEN) perl $(srcdir)/xmltoman $ $@ || rm -f $@ endif diff --git a/src/Makefile.am b/src/Makefile.am index 24e2f82..137b8f7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1857,23 +1857,23 @@ module_rygel_media_server_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) CLEANFILES += esdcompat client.conf default.pa system.pa daemon.conf start-pulseaudio-x11 start-pulseaudio-kde daemon/pulseaudio.desktop daemon/pulseaudio-kde.desktop esdcompat: daemon/esdcompat.in Makefile - sed -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ + $(AM_V_GEN) sed -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \ -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \ -e 's,@PA_BINARY\@,$(PA_BINARY),g' $ $@ - chmod +x esdcompat + $(AM_V_at) chmod +x esdcompat start-pulseaudio-x11: daemon/start-pulseaudio-x11.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ -e 's,@PACTL_BINARY\@,$(bindir)/pactl,g' $ $@ - chmod +x start-pulseaudio-x11 + $(AM_V_at) chmod +x start-pulseaudio-x11 start-pulseaudio-kde: daemon/start-pulseaudio-kde.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ -e 's,@PACTL_BINARY\@,$(bindir)/pactl,g' $ $@ - chmod +x start-pulseaudio-kde + $(AM_V_at) chmod +x start-pulseaudio-kde client.conf: pulse/client.conf.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' $ $@ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' $ $@ if OS_IS_WIN32 default.pa: daemon/default.pa.win32 @@ -1882,17 +1882,17 @@ system.pa: daemon/default.pa.win32 cp $ $@ else default.pa: daemon/default.pa.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ -e 's,@PA_SOEXT\@,.so,g' $ $@ system.pa: daemon/system.pa.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ + $(AM_V_GEN) sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ -e 's,@PA_SOEXT\@,.so,g' $ $@ endif daemon.conf: daemon/daemon.conf.in Makefile - sed -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ + $(AM_V_GEN) sed -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ -e 's,@PA_DEFAULT_CONFIG_FILE\@,$(DEFAULT_CONFIG_DIR),g' $ $@ install-exec-hook: -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/2] Log feature:Add a new log target to a file descriptor
2011/3/9 Vincent Becker vincentx.bec...@intel.com: @@ -185,7 +193,23 @@ int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string) { } else if (!strcmp(string, stderr)) { c-auto_log_target = 0; c-log_target = PA_LOG_STDERR; - } else + } else if (pa_startswith(string, file:)) { + char file_path[512]; + + strncpy(file_path, string+5, sizeof(file_path)); This is potentially unsafe, use pa_strlcpy. + + /* Open target file with user rights */ + if ((log_fd = open(file_path, O_RDWR|O_TRUNC|O_CREAT, S_IRWXU)) = 0) { + c-auto_log_target = 0; + c-log_target = PA_LOG_FD; + pa_log_set_fd(log_fd); + } + else { + printf(Failed to open target file %s, error : %s\n, file_path, pa_cstrerror(errno)); + return -1; + } + } + else return -1; return 0; @@ -399,6 +407,24 @@ void pa_log_levelv_meta( } #endif + case PA_LOG_FD: { + if (log_fd != -1) { + char metadata[256]; + + pa_snprintf(metadata, sizeof(metadata), \n%c %s%s, level_to_char[level], timestamp, location); + + if ((write(log_fd, metadata, strlen(metadata)) 0) || (write(log_fd, t, strlen(t)) 0)) { + saved_errno = errno; + pa_close(log_fd); + log_fd = -1; + } + } + else + fprintf(stderr, %s\n, Invalid file descriptor. Could not write log message.); Wouldn't this result in lots and lots of the same messages to stderr? It seems better to move this message to the case when the write fails, or just print the log message here, or both. + + break; + } + case PA_LOG_NULL: default: break; Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/2] Log feature:Add a new log target to a file descriptor
FWIW, I've tested this patch and it works as advertised. As we already decided in the IRC meeting that the concept of the patch was fine, this is ready to go in git master. (with some minor cosmetic adjustments?) Maarten 2011/3/8 Vincent Becker vincentx.bec...@intel.com: This patch enables logging of text debug messages (pa_log feature) into a file or a device driver. Example : pulseaudio --log-target=file:./mylog.txt Signed-off-by: Vincent Becker vincentx.bec...@intel.com --- src/daemon/cmdline.c | 5 +++-- src/daemon/daemon-conf.c | 34 -- src/pulsecore/log.c | 24 src/pulsecore/log.h | 5 + 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c index f6cdcdc..2c3eb67 100644 --- a/src/daemon/cmdline.c +++ b/src/daemon/cmdline.c @@ -145,7 +145,8 @@ void pa_cmdline_help(const char *argv0) { this time passed\n --log-level[=LEVEL] Increase or set verbosity level\n -v Increase the verbosity level\n - --log-target={auto,syslog,stderr} Specify the log target\n + --log-target={auto,syslog,stderr,\n + file:PATH} Specify the log target\n --log-meta[=BOOL] Include code location in log messages\n --log-time[=BOOL] Include timestamps in log messages\n --log-backtrace=FRAMES Include a backtrace in log messages\n @@ -318,7 +319,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d case ARG_LOG_TARGET: if (pa_daemon_conf_set_log_target(conf, optarg) 0) { - pa_log(_(Invalid log target: use either 'syslog', 'stderr' or 'auto'.)); + pa_log(_(Invalid log target: use either 'syslog', 'stderr', 'auto' or a valid file name 'file:path'.)); goto fail; } break; diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index e38e67a..5696f00 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -28,6 +28,8 @@ #include stdio.h #include string.h #include unistd.h +#include sys/stat.h +#include fcntl.h #ifdef HAVE_SCHED_H #include sched.h @@ -141,6 +143,9 @@ static const pa_daemon_conf default_conf = { #endif }; +static int log_fd = -1; + + pa_daemon_conf* pa_daemon_conf_new(void) { pa_daemon_conf *c; @@ -166,6 +171,9 @@ pa_daemon_conf* pa_daemon_conf_new(void) { void pa_daemon_conf_free(pa_daemon_conf *c) { pa_assert(c); + if (log_fd = 0) + pa_close(log_fd); + pa_xfree(c-script_commands); pa_xfree(c-dl_search_path); pa_xfree(c-default_script_file); @@ -185,8 +193,30 @@ int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string) { } else if (!strcmp(string, stderr)) { c-auto_log_target = 0; c-log_target = PA_LOG_STDERR; - } else - return -1; + } else if (pa_startswith(string, file:)) { + char *file_path; + const char *state = NULL; + unsigned i; + + /* After second pa_split call, file_path will contain the right part of file:path */ + for (i = 0; i 2; i++) + file_path = pa_split(string, :, state); + + /* Check if the file is regular */ + if ((log_fd = open(file_path, O_RDWR|O_TRUNC|O_CREAT, 0777)) = 0) { + c-auto_log_target = 0; + c-log_target = PA_LOG_FD; + pa_log_set_fd(log_fd); + } + else { + printf(Failed to open target file %s, error : %s\n, file_path, pa_cstrerror(errno)); + pa_xfree(file_path); + return -1; + } + pa_xfree(file_path); + } + else + return -1; return 0; } diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c index 2c0e267..a5e26c8 100644 --- a/src/pulsecore/log.c +++ b/src/pulsecore/log.c @@ -71,6 +71,8 @@ static unsigned show_backtrace = 0, show_backtrace_override = 0, skip_backtrace static pa_log_flags_t flags = 0, flags_override = 0; static pa_bool_t no_rate_limit = FALSE; +static int fdlog = -1; + #ifdef HAVE_SYSLOG_H static const int level_to_syslog[] = { [PA_LOG_ERROR] = LOG_ERR, @@ -128,6 +130,12 @@ void pa_log_set_flags(pa_log_flags_t _flags, pa_log_merge_t merge) { flags = _flags; } +void pa_log_set_fd(int fd) { + pa_assert(fd = 0); + + fdlog = fd; +} + void pa_log_set_show_backtrace(unsigned nlevels) { show_backtrace = nlevels; } @@ -399,6 +407,22 @@ void pa_log_levelv_meta( } #endif + case PA_LOG_FD: { + if (fdlog != -1) {
Re: [pulseaudio-discuss] Problem in running locally compiled pulse utility programs
2011/3/4 ssrk ssrk...@gmail.com: Hi, I run Ubuntu 9.10, which by default has pulseaudio and utilities like pactl, pacmd. I downloaded pulseaudio source tarball http://0pointer.de/lennart/projects/pulseaudio/pulseaudio-0.9.22.tar.gz and extracted it, ran configure script, compiled it and tried to run the locally built pactl utility. While running pactl(the one which I built), it gave me Connection failure: Connection refused Error. But the default 'pactl' utility which is already present in /usr/bin/ works fine. $ ./configure --prefix=tmpdir $ make $ make install $ cd tmpdir $ ./bin/pactl stat Connection failure: Connection refused Can someone tell me, what am I missing? Why is the locally built pactl doesn't work? while the default /usr/bin/pactl works fine. Are these utility programs coupled to 'pulseaudio' along with which it is compiled? Right on the money. You can only use that utility against the pulseaudio daemon of the same version. I think it's due to protocol changes in the native protocol. Thanks in advance. -- Regards, ssrk Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] unused check_required function in modules/alsa/alsa-mixer.c
I intended to catch diwic on IRC, but didn't see him the last couple of days, so in order not to forget, here is my question to the list. In this commit some stuff got shuffled around in alsa-mixer http://git.0pointer.de/?p=pulseaudio.git;a=commitdiff;h=b0f72311 With the result that the check_required function is now unused (or more precise: only used by itself). This is probably incorrect. David, can you explain/fix? Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [RFC] allow conditionals in config input files like default.pa.in
It would be nice to have the ability to use @if HAVE_FEATURE@ in the configuration file templates. You could see it either as an extension of the current @VARIABLE@ replacement or as a compile-time variant of .ifexists. Incidentally, does anybody know why these files are currently generated in the Makefile using sed, instead of being included in AC_CONFIG_FILES? Adding that ability has several advantages: - The default.pa.in and default.pa.win32 files can be merged. - The BSDs still use module-hal-detect, so it can be included in default.pa without littering it with [.ifexists module-hal-detect\n load-module module-hal-detect\n .endif] for Linux users, so they cannot be confused by it. - And thirdly, if sys/resource.h is not found the daemon does not understand the --rlimit-* options, so in that case those lines should be omitted from daemon.conf. Would this be a good change, or are we then preprocessing at too many levels? I propose to implement it by using awk, instead of where now sed is used in the Makefiles. Below is a very rude patch, to give an idea. Obviously the variable initialisation in the BEGIN section of the awk script should depend on the results of the configure checks, either by using awk -v VAR=$(VAR) in the Makefile or letting configure do the substitution in the script itself. Maarten diff --git a/src/Makefile.am b/src/Makefile.am index 24e2f82..4c2be0c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1875,21 +1875,10 @@ start-pulseaudio-kde: daemon/start-pulseaudio-kde.in Makefile client.conf: pulse/client.conf.in Makefile sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' $ $@ -if OS_IS_WIN32 -default.pa: daemon/default.pa.win32 - cp $ $@ -system.pa: daemon/default.pa.win32 - cp $ $@ -else default.pa: daemon/default.pa.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ --e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ - -e 's,@PA_SOEXT\@,.so,g' $ $@ + awk -f script.awk $ $@ system.pa: daemon/system.pa.in Makefile - sed -e 's,@PA_BINARY\@,$(PA_BINARY),g' \ --e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ - -e 's,@PA_SOEXT\@,.so,g' $ $@ -endif + awk -f script.awk $ $@ daemon.conf: daemon/daemon.conf.in Makefile sed -e 's,@PA_DLSEARCHPATH\@,$(modlibexecdir),g' \ diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in index ace0f09..8f660d7 100755 --- a/src/daemon/default.pa.in +++ b/src/daemon/default.pa.in @@ -22,10 +22,10 @@ .nofail ### Load something into the sample cache -#load-sample-lazy x11-bell /usr/share/sounds/gtk-events/activate.wav -#load-sample-lazy pulse-hotplug /usr/share/sounds/startup3.wav -#load-sample-lazy pulse-coldplug /usr/share/sounds/startup3.wav -#load-sample-lazy pulse-access /usr/share/sounds/generic.wav +#load-sample-lazy x11-bell @PA_DATA_DIR@/sounds/gtk-events/activate.wav +#load-sample-lazy pulse-hotplug @PA_DATA_DIR@/sounds/startup3.wav +#load-sample-lazy pulse-coldplug @PA_DATA_DIR@/sounds/startup3.wav +#load-sample-lazy pulse-access @PA_DATA_DIR@/sounds/generic.wav .fail @@ -41,6 +41,10 @@ load-module module-augment-properties ### Load audio drivers statically (it's probably better to not load ### these drivers manually, but instead use module-hal-detect -- ### see below -- for doing this automatically) +@if OS_IS_WIN32@ +load-module module-waveout sink_name=output +load-module module-waveout source_name=input +@endif@ #load-module module-alsa-sink #load-module module-alsa-source device=hw:1,0 #load-module module-oss device=/dev/dsp sink_name=output source_name=input @@ -49,6 +53,11 @@ load-module module-augment-properties #load-module module-pipe-sink ### Automatically load driver modules depending on the hardware available +@if HAVE_HAL@ +.ifexists module-hal-detect@PA_SOEXT@ +load-module module-hal-detect +.endif +@endif@ .ifexists module-udev-detect@PA_SOEXT@ load-module module-udev-detect .else diff --git a/src/script.awk b/src/script.awk new file mode 100644 index 000..ed141f1 --- /dev/null +++ b/src/script.awk @@ -0,0 +1,24 @@ +BEGIN { + HAVE_HAL=0 + OS_IS_WIN32=1 + PA_DLSEARCHPATH=/usr/lib/pulse/modules + PA_DATA_DIR=/usr/share + PA_BINARY=pulseaudio + PA_SOEXT=.so + + printline = 1 +} +{ + gsub(/@PA_DLSEARCHPATH@/, PA_DLSEARCHPATH) + gsub(/@PA_DATA_DIR@/, PA_DATA_DIR) + gsub(/@PA_BINARY@/, PA_BINARY) + gsub(/@PA_SOEXT@/, PA_SOEXT) + if (/@if [A-Z0-9_]+@/) { +if (/@if HAVE_HAL@/ !HAVE_HAL) printline = 0 +if (/@if OS_IS_WIN32@/ !OS_IS_WIN32) printline = 0 + } + else if (/@endif@/) +printline = 1 + else if (printline) +print $0 +} ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] MacOS X Support
2011/2/27 Stephen Lee sl33...@gmail.com: I git clone'd master yesterday, successfully compiled, and ran PA on my MacOS X machine. I was pleasantly surprised to see the Coreaudio modules! I successfully tunnelled audio from one of my Linux machines to my MacOS X w/o using esound, but I noticed that iTunes wasn't included as a client when I was playing it and then checking list-clients from the PA cli. That is of course expected, as iTunes and other mac apps are not pulse clients. So you have several applications playing audio connected to the CoreAudio subsystem and PulseAudio is one of them. This is the same situation as on Linux, where pulse connects to ALSA and applications that don't use libpulse but connect directly to ALSA cannot be manipulated by pulse. There is however a way to make PulseAudio your default ALSA device, so that even apps that only use libasound are connected to pulse, all be it in a bit of a roundabout way. Generally, what's the plan for being able to manipulate native MacOS X clients/streams via PA? It'd be great to replace the AirTunes (AirPlay) functionality that Apple offers. If this functionality is still a work in progress, is there a workaround? The workaround would be to use an audio player that output to PulseAudio, like vlc, rhythmbox, banshee, amarok, though I don't have a clue whether these are ported to OSX and are able to use libpulse there. -Stephen ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] Some patches towards the goal of a warning-free build
There is also a branch available: https://github.com/mkbosmans/pulseaudio/compare/warning-free-build The first commit of that branch is already in master, as it solved a nasty bug. [PATCH 1/4] Get rid of some unused-function compiler warnings Nothing to fancy here, I guess. [PATCH 2/4] Various fixes for build warnings The only doubtful thing in here, as far as I'm concerced, is the change in ltdl-helper: -*(void**) f = lt_dlsym(handle, symbol); +f = (pa_void_func_t) lt_dlsym(handle, symbol); The previous line gave a warning about pointer aliasing. This part of the patch is basically a revert of http://git.0pointer.de/?p=pulseaudio.git;a=commitdiff;h=e0fd99 It seems it was done like in the rationale section of this document: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlsym.html where *(void**) f is done to avoid a compiler warning about pointer conversion. For me, there is no such warning though. [PATCH 3/4] configure: Drop some warnings Warnings about reaching inline limits are not so interesting IMHO. Dropping the =2 on -Wstrict-aliasing reduces the number of false positives. [PATCH 4/4] Fix up according to Coding Style This is of course not directly related to compiler warnings. Its a lot of small changes. I tried to be a little conservative, so I let the completely hopeless files alone. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 1/4] Get rid of some unused-function compiler warnings
--- src/daemon/daemon-conf.c |6 ++ src/pulsecore/core-util.c |4 src/pulsecore/memtrap.c |2 +- src/pulsecore/shm.c |2 ++ src/utils/pacat.c |2 ++ 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 3339f3b..e38e67a 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -293,8 +293,8 @@ static int parse_resample_method(const char *filename, unsigned line, const char return 0; } -static int parse_rlimit(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) { #ifdef HAVE_SYS_RESOURCE_H +static int parse_rlimit(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) { struct pa_rlimit *r = data; pa_assert(filename); @@ -315,12 +315,10 @@ static int parse_rlimit(const char *filename, unsigned line, const char *section r-is_set = k = 0; r-value = k = 0 ? (rlim_t) k : 0; } -#else -pa_log_warn(_([%s:%u] rlimit not supported on this platform.), filename, line); -#endif return 0; } +#endif static int parse_sample_format(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) { pa_daemon_conf *c = data; diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 8a377e3..02e9bf6 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -620,6 +620,7 @@ char *pa_strlcpy(char *b, const char *s, size_t l) { return b; } +#ifdef _POSIX_PRIORITY_SCHEDULING static int set_scheduler(int rtprio) { #ifdef HAVE_SCHED_H struct sched_param sp; @@ -677,6 +678,7 @@ static int set_scheduler(int rtprio) { return -1; } +#endif /* Make the current thread a realtime thread, and acquire the highest * rtprio we can get that is less or equal the specified parameter. If @@ -713,6 +715,7 @@ int pa_make_realtime(int rtprio) { return -1; } +#ifdef HAVE_SYS_RESOURCE_H static int set_nice(int nice_level) { #ifdef HAVE_DBUS DBusError error; @@ -757,6 +760,7 @@ static int set_nice(int nice_level) { return -1; } +#endif /* Raise the priority of the current process as much as possible that * is = the specified nice level..*/ diff --git a/src/pulsecore/memtrap.c b/src/pulsecore/memtrap.c index b56d806..4df1fb7 100644 --- a/src/pulsecore/memtrap.c +++ b/src/pulsecore/memtrap.c @@ -67,11 +67,11 @@ pa_bool_t pa_memtrap_is_good(pa_memtrap *m) { return !pa_atomic_load(m-bad); } +#ifdef HAVE_SIGACTION static void sigsafe_error(const char *s) { (void) write(STDERR_FILENO, s, strlen(s)); } -#ifdef HAVE_SIGACTION static void signal_handler(int sig, siginfo_t* si, void *data) { unsigned j; pa_memtrap *m; diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c index 5d5d85a..da8aff7 100644 --- a/src/pulsecore/shm.c +++ b/src/pulsecore/shm.c @@ -90,10 +90,12 @@ struct shm_marker { #define SHM_MARKER_SIZE PA_ALIGN(sizeof(struct shm_marker)) +#ifdef HAVE_SHM_OPEN static char *segment_name(char *fn, size_t l, unsigned id) { pa_snprintf(fn, l, /pulse-shm-%u, id); return fn; } +#endif int pa_shm_create_rw(pa_shm *m, size_t size, pa_bool_t shared, mode_t mode) { char fn[32]; diff --git a/src/utils/pacat.c b/src/utils/pacat.c index 79936fd..6cd01d2 100644 --- a/src/utils/pacat.c +++ b/src/utils/pacat.c @@ -604,6 +604,7 @@ static void stream_update_timing_callback(pa_stream *s, int success, void *userd fprintf(stderr, \r); } +#ifdef SIGUSR1 /* Someone requested that the latency is shown */ static void sigusr1_signal_callback(pa_mainloop_api*m, pa_signal_event *e, int sig, void *userdata) { @@ -612,6 +613,7 @@ static void sigusr1_signal_callback(pa_mainloop_api*m, pa_signal_event *e, int s pa_operation_unref(pa_stream_update_timing_info(stream, stream_update_timing_callback, NULL)); } +#endif static void time_event_callback(pa_mainloop_api *m, pa_time_event *e, const struct timeval *t, void *userdata) { if (stream pa_stream_get_state(stream) == PA_STREAM_READY) { -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 2/4] Various fixes for build warnings
--- src/modules/udev-util.c |2 +- src/pulse/volume.c |2 +- src/pulsecore/ltdl-helper.c |4 ++-- src/tests/mainloop-test.c |2 +- src/tests/mix-test.c| 10 ++ 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/modules/udev-util.c b/src/modules/udev-util.c index 52df103..356f773 100644 --- a/src/modules/udev-util.c +++ b/src/modules/udev-util.c @@ -74,7 +74,7 @@ static int dehex(char x) { static void proplist_sets_unescape(pa_proplist *p, const char *prop, const char *s) { const char *f; char *t, *r; -int c; +int c = 0; enum { TEXT, diff --git a/src/pulse/volume.c b/src/pulse/volume.c index f74d720..e8db3f7 100644 --- a/src/pulse/volume.c +++ b/src/pulse/volume.c @@ -263,7 +263,7 @@ pa_volume_t pa_sw_volume_from_linear(double v) { * same volume value! That's why we need the lround() below! */ -return (pa_volume_t) PA_CLAMP_VOLUME(lround(cbrt(v) * PA_VOLUME_NORM)); +return (pa_volume_t) PA_CLAMP_VOLUME((unsigned) lround(cbrt(v) * PA_VOLUME_NORM)); } double pa_sw_volume_to_linear(pa_volume_t v) { diff --git a/src/pulsecore/ltdl-helper.c b/src/pulsecore/ltdl-helper.c index be200ca..1a0e555 100644 --- a/src/pulsecore/ltdl-helper.c +++ b/src/pulsecore/ltdl-helper.c @@ -42,7 +42,7 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s pa_assert(handle); pa_assert(symbol); -*(void**) f = lt_dlsym(handle, symbol); +f = (pa_void_func_t) lt_dlsym(handle, symbol); if (f) return f; @@ -59,7 +59,7 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s if (!isalnum(*c)) *c = '_'; -*(void**) f = lt_dlsym(handle, sn); +f = (pa_void_func_t) lt_dlsym(handle, sn); pa_xfree(sn); return f; diff --git a/src/tests/mainloop-test.c b/src/tests/mainloop-test.c index 3ec6d11..75b77b5 100644 --- a/src/tests/mainloop-test.c +++ b/src/tests/mainloop-test.c @@ -48,7 +48,7 @@ static pa_defer_event *de; static void iocb(pa_mainloop_api*a, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) { unsigned char c; -(void) read(fd, c, sizeof(c)); +assert(read(fd, c, sizeof(c)) = 0); fprintf(stderr, IO EVENT: %c\n, c 32 ? '.' : c); a-defer_enable(de, 1); } diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c index 457c4ac..55844e7 100644 --- a/src/tests/mix-test.c +++ b/src/tests/mix-test.c @@ -32,12 +32,6 @@ #include pulsecore/memblock.h #include pulsecore/sample-util.h -static float swap_float(float a) { -uint32_t *b = (uint32_t*) a; -*b = PA_UINT32_SWAP(*b); -return a; -} - static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) { void *d; unsigned i; @@ -96,7 +90,7 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) { float *u = d; for (i = 0; i chunk-length / pa_frame_size(ss); i++) { -printf(%1.5f , ss-format == PA_SAMPLE_FLOAT32NE ? *u : swap_float(*u)); +printf(%1.5f , ss-format == PA_SAMPLE_FLOAT32NE ? *u : PA_FLOAT32_SWAP(*u)); u++; } @@ -188,7 +182,7 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) { if (ss-format == PA_SAMPLE_FLOAT32RE) { for (i = 0; i 10; i++) -u[i] = swap_float(float_samples[i]); +u[i] = PA_FLOAT32_SWAP(float_samples[i]); } else memcpy(d, float_samples, sizeof(float_samples)); -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] [PATCH 3/4] configure: Drop some warnings
Drop -Winline and set -Wstrict-aliasing level to its default. --- configure.ac |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 21dae30..77959a2 100644 --- a/configure.ac +++ b/configure.ac @@ -102,7 +102,7 @@ if test x$M4 = xno ; then fi dnl Compiler flags -CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option]) +CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option]) dnl Linker flags. dnl Check whether the linker supports the -version-script option. -- 1.7.1 ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] Some patches towards the goal of a warning-free build
There is also a branch available: https://github.com/mkbosmans/pulseaudio/compare/warning-free-build The first commit of that branch is already in master, as it solved a nasty bug. [PATCH 1/4] Get rid of some unused-function compiler warnings Nothing to fancy here, I guess. [PATCH 2/4] Various fixes for build warnings The only doubtful thing in here, as far as I'm concerced, is the change in ltdl-helper: -*(void**) f = lt_dlsym(handle, symbol); +f = (pa_void_func_t) lt_dlsym(handle, symbol); The previous line gave a warning about pointer aliasing. This part of the patch is basically a revert of http://git.0pointer.de/?p=pulseaudio.git;a=commitdiff;h=e0fd99 It seems it was done like in the rationale section of this document: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlsym.html where *(void**) f is done to avoid a compiler warning about pointer conversion. For me, there is no such warning though. [PATCH 3/4] configure: Drop some warnings Warnings about reaching inline limits are not so interesting IMHO. Dropping the =2 on -Wstrict-aliasing reduces the number of false positives. [PATCH 4/4] Fix up according to Coding Style This is of course not directly related to compiler warnings. Its a lot of small changes. I tried to be a little conservative, so I let the completely hopeless files alone. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 2/4] Various fixes for build warnings
2011/3/2 Colin Guthrie gm...@colin.guthr.ie: 'Twas brillig, and Maarten Bosmans at 02/03/11 11:41 did gyre and gimble: diff --git a/src/tests/mainloop-test.c b/src/tests/mainloop-test.c index 3ec6d11..75b77b5 100644 --- a/src/tests/mainloop-test.c +++ b/src/tests/mainloop-test.c @@ -48,7 +48,7 @@ static pa_defer_event *de; static void iocb(pa_mainloop_api*a, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) { unsigned char c; - (void) read(fd, c, sizeof(c)); + assert(read(fd, c, sizeof(c)) = 0); fprintf(stderr, IO EVENT: %c\n, c 32 ? '.' : c); a-defer_enable(de, 1); } Shouldn't this be pa_assert_se()? Ah, yes of course. I only tested it on a debug build, where there is no difference. That is of course by far the common situation for running the test programs. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] pulseaudio: module.c: module-detect is deprecated: Please use module-udev-detect instead of module-detect!
2011/3/2 Andriy Gapon a...@freebsd.org: on 02/03/2011 17:18 Michal Varga said the following: On Wed, 2011-03-02 at 16:13 +0100, Michal Varga wrote: So instead of fixing things like these in ports, I'd say the issue should be reported/fix submitted to upstream, it's pretty much possible that they don't even know that there are systems that don't run evdev (note that I don't mean it offensively, more like speaking generally from experience, it simply happens). Eh, I meant udev of course, I guess that's enough coffee for me today. That's possible, of course. Another possibility is that they think that everything is Linux, or everything is like Linux, or they don't care about not Linux. Development of pulseaudio is certainly a bit of a linux-focused affair. But we very much want other platforms to be included as well, as can be seen by the OSX, *BSD, Solaris and win32 support currently in the tree. I am all for contacting them, for sure. Just want to point out that the proposed patch would not be against the nature of the ports, because it doesn't affect functionality, but addresses OS differences. There is already some FreeBSD specific code in PulseAudio upstream. Especially considering some changes required to make pulse run on freebsd and netbsd are quite similar, I think it makes sense to submit your patches. -- Andriy Gapon Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [RFC] Allow read-only or non-existing sink input volume.
2011/2/27 Colin Guthrie gm...@colin.guthr.ie: 'Twas brillig, and Tanu Kaskinen at 27/02/11 12:35 did gyre and gimble: I actually have started to feel that volume_readable and volume_writable would be better than has_volume and read_only_volume in pa_sink_input_info. What are others' opinions? One argument for readable/writable is that those terms also cover the write-only case, which will probably never occur in practice, but you never know... I did actually prefer _readable and _writeable when you mentioned them but didn't feel strongly enough to ask you to change them. So if you do prefer them, I'd be happier too if you changed them :) As this is in my tree now and I have merged a few other things, it will be a little tricky to back it out (due to doing merges since then), but I can do that if really needed (don't think Maaten will mind rebasing his win32 stuff if needed which was the merge) or you can just make your change on top of the current one. Let me know what you think. Meh, I don't care either way. I have some further improvements laying around, so they could then be merged together in one go. Rebasing in git is actually kinda fun! Cheers Col Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
[pulseaudio-discuss] Windows binaries
As the patches that make it possible to build pulse on win32 should land in master any moment now, I thought it would be a good time to make the binaries available for download. http://bosmans.ch/pulseaudio/pulseaudio-1.0dev-1090.4.zip This is just a repackaging of the files found at https://build.opensuse.org/project/monitor?package=project=home%3Amkbosmans%3Amingw32%3Apulseaudio , for ease of use on Windows. You can start the daemon with bin\pulseaudio.exe -vvv -p \_ABS_PATH_TO_\pulseaudio-1.0dev-1090.4\lib\pulse-1.0\modules -nF etc\pulse\default.pa The paths need to be provided, because the compiled in defaults are meaningless on windows. This means there is still some work to do on the win32 front. As there were some inquiries about the binaries on irc a couple of days ago, its probably a good idea to also mention the new (unstable) build on the wiki. Is there also a possibility to host the zipfile on some 'official' pulsed server for download, or should I just host them myself, just like Cendia does for the old 0.9.6 binaries? I don't think you can upload files to the wiki. Maarten ___ 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/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
Re: [pulseaudio-discuss] [PATCH 1/2] Add a target to the PA log feature
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] PulseAudio module-rtp-recv
Please use the PulseAudio mailing list for these kind of questions. I'll be reading and answering there. 2011/2/23 ericlesoll ericles...@gmail.com: Hi Maarten, Thanks for your job, I reported some bugs on Launchpad about PulseAudio module-rtp-recv, and I saw that you have commited 6 weeks ago some modification. The bug is that the sound go transforming after 55s. We use this module in association with module-rtp-send to make a chat audio piloting by itALC in our project LLSOLL / LESOLL that is open source digital language laboratory. We don't use loopack module due to the delay to big, we use HAL for loopback. Do you have a link for this bug? It sound like the problem my patches should solve. I download the git://git.0pointer.de/pulseaudio.git on Ubuntu 10.10 and I compiled without error output. I replaced my original module-rtp-recv.so by the fresh one then I run ldconfig. When I launch $ pactl load-module module-rtp-recv, I get a number ID without error but I ear no sound. I replace by the old one it's working until 55s then the sound go transforming. I'm not sure that's the way it's supposed to work. You better do a make install and then run /usr/local/bin/pulseaudio - and then LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/pactl load-module module-rtp-recv, or something similar. In general you can't expect modules compiled for one version of pulse to work in another version. Have ou some idea ? Have to upgrade others modules ? Can I send you log file when I launch module rtp-recv (I don't know how to log it, because -v option is not available) ? Start pulseaudio manually, like I wrote above. You probably mean that the -v options is not available for the /etc/init.d/pulseaudio script. Best regards Eric Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] A2DP - Bluetooth source to alsa sink audio routing
Please keep the conversation on the mailing list. (though it looks like I forgot to do that too) 2011/2/23 Cristina Cristea doina.crist...@gmail.com: No, the glitches are now more rarely and smaller. But, after 31 minutes of playing (with only one small glitch, bearly audible, on min 27), PulseAudio started to display a lot of underrun messages and died. Died, as in crashed? Verbose log output would be interesting here. Most likely the CPU load limiter kicked in and pulse shut itself down. Also, module-loopback causes PulseAudio to be a a very big CPU consumer on my system-like about 80%. That should not be. Can you get this behaviour also without module-loopback? (e.g. by recording from the bluetooth source with parec) For further information on how to debug this, see http://pulseaudio.org/wiki/HowToDebugCPULoadBugs I'll do more testing these days and see if I can improve. Thanks for support and I really appreciate what you guys are doing. Cristina I'll do more testing the Maarten On 02/22/2011 09:36 PM, Maarten Bosmans wrote: 2011/2/22 Cristina Cristeadoina.crist...@gmail.com: Thanks Maarten, that really makes the sample rate adjustment to not be noticed by the listener. Unfortunately, I still get the underrun issues. Here is a log snippet: Do the underruns still occur after a minute of playing? Do they result in audible glitches? As I mentioned in the mail that went with these patches a couple of weeks ago, I have not tested it on any non-trivial module-loopback setup (e.g. bluetooth source to alsa sink), so some underrun problems can indeed still be expected. Maarten ___ 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
Here's my review of that patch. It will be handled in the meeting tomorrow, but I'm sure I've forgotten by then, so I sent it to the list. 2010/11/22 Becker, VincentX vincentx.bec...@intel.com: Hi all, Could you please review this patch ? This is a patch that adds a generic log target for PA log (log.c). This new target can be either a char device or a regular file. For our remote log device needs, it has been necessary to directly log Pulseaudio traces to a file descriptor. Also optimizations in the memory allocations have been done to reuse local pointers to prevent extra memory allocations (on stack or heap), that would happen in case of very big trace buffers, and that could potentially have an impact on audio latency in embedded systems. Modifications : src/daemon/cmdline.c : Update Pulseaudio help and error message for the 'log-target' command argument. The current help message has a width of 80 characters. It would be nice to keep it that way and find another way to fit the new log-target argument in there. src/daemon/daemon-conf.c : Add the condition when the target given is a file name given with relative or absolute path. If the file already exists, it creates a new file that will contain the current date and time inserted in the name. For this purpose, two static utilities functions have been added. The file descriptor is then passed to the PA log in pulsecore. I don't think the renaming with the data appended to the filename is functionality that belongs in pulseaudio. If you want serious logging, use syslog, if you want quick-and-dirty, use the filename. Pulse should just append or overwrite the file, either is fine. Also, as daemon-conf opens the file, it should call pa_close itself too. Then the pa_log_close_fd function can be removed. src/pulsecore/log.c : The function pa_log_levelv_meta formats the text data and sends it to the appropriate target. There are 2 main changes : 1) Add the target PA_LOG_FILED which allows to write the formatted log data to a file descriptor output. Add functions to open and close that file descriptor. This would better be called PA_LOG_FD 2) the algorithms around 'char *t' have been reordered in order to optimize memory use. This could be useful when traces are big. The trace buffer char text has been set to 16*1024Kb which allocates already 16Kb on the stack. This buffer is then copied into t, in the for loop that checks for carriage returns. What needed to be optimized is that extra memory is allocated in case of metadata (location and timestamp) is prepended to t, by creating dynamically a new buffer. The idea is to prepend the data directly into t (and append if it's the case) before we affect the value of 'text'. It avoids one dynamic memory allocation, at least in the case of the new target PA_LOG_FILED. Therefore, a 'metadata' buffer is created and prepended in t whatever the target. One switch/case is actually added to build this metadata buffer and we keep the other one just for write the actual log (text+metadata) in the target. Please separate this change out in another patch. That way it can be reviewed better. P.S. : there are bad indentations due to tabs. I use emacs and tried the indentation Lisp function given here but without success : http://www.pulseaudio.org/wiki/CodingStyle . It keeps putting tabs instead of spaces ! How could I solve that ? Thanks, Vincent Maarten Vincent BECKER Intel - Wireless System Integration Engineer Medfield platform - 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. Ah, to bad you send it to a public list then. I guess we're all criminals now ;-) ___ 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
Re: [pulseaudio-discuss] [PATCH] Add a target to the PA log feature and improve PA log core
Here's my review of that patch. It will be handled in the meeting tomorrow, but I'm sure I've forgotten by then, so I sent it to the list. 2010/11/22 Becker, VincentX vincentx.bec...@intel.com: Hi all, Could you please review this patch ? This is a patch that adds a generic log target for PA log (log.c). This new target can be either a char device or a regular file. For our remote log device needs, it has been necessary to directly log Pulseaudio traces to a file descriptor. Also optimizations in the memory allocations have been done to reuse local pointers to prevent extra memory allocations (on stack or heap), that would happen in case of very big trace buffers, and that could potentially have an impact on audio latency in embedded systems. Modifications : src/daemon/cmdline.c : Update Pulseaudio help and error message for the 'log-target' command argument. The current help message has a width of 80 characters. It would be nice to keep it that way and find another way to fit the new log-target argument in there. src/daemon/daemon-conf.c : Add the condition when the target given is a file name given with relative or absolute path. If the file already exists, it creates a new file that will contain the current date and time inserted in the name. For this purpose, two static utilities functions have been added. The file descriptor is then passed to the PA log in pulsecore. I don't think the renaming with the data appended to the filename is functionality that belongs in pulseaudio. If you want serious logging, use syslog, if you want quick-and-dirty, use the filename. Pulse should just append or overwrite the file, either is fine. Also, as daemon-conf opens the file, it should call pa_close itself too. Then the pa_log_close_fd function can be removed. src/pulsecore/log.c : The function pa_log_levelv_meta formats the text data and sends it to the appropriate target. There are 2 main changes : 1) Add the target PA_LOG_FILED which allows to write the formatted log data to a file descriptor output. Add functions to open and close that file descriptor. This would better be called PA_LOG_FD 2) the algorithms around 'char *t' have been reordered in order to optimize memory use. This could be useful when traces are big. The trace buffer char text has been set to 16*1024Kb which allocates already 16Kb on the stack. This buffer is then copied into t, in the for loop that checks for carriage returns. What needed to be optimized is that extra memory is allocated in case of metadata (location and timestamp) is prepended to t, by creating dynamically a new buffer. The idea is to prepend the data directly into t (and append if it's the case) before we affect the value of 'text'. It avoids one dynamic memory allocation, at least in the case of the new target PA_LOG_FILED. Therefore, a 'metadata' buffer is created and prepended in t whatever the target. One switch/case is actually added to build this metadata buffer and we keep the other one just for write the actual log (text+metadata) in the target. Please separate this change out in another patch. That way it can be reviewed better. P.S. : there are bad indentations due to tabs. I use emacs and tried the indentation Lisp function given here but without success : http://www.pulseaudio.org/wiki/CodingStyle . It keeps putting tabs instead of spaces ! How could I solve that ? Thanks, Vincent Maarten Vincent BECKER Intel - Wireless System Integration Engineer Medfield platform - 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. Ah, to bad you send it to a public list then. I guess we're all criminals now ;-) ___ 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
Re: [pulseaudio-discuss] [PATCH] Add a target to the PA log feature and improve PA log core
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. Sorry for getting this rolling on such a short notice. Maarten Cheers, V. ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH] dbusiface-stream: Send the Device property in the GetAll handler.
2011/2/22 Tanu Kaskinen tanu.kaski...@digia.com: --- src/modules/dbus/iface-stream.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/modules/dbus/iface-stream.c b/src/modules/dbus/iface-stream.c index 681790b..cfba5ad 100644 --- a/src/modules/dbus/iface-stream.c +++ b/src/modules/dbus/iface-stream.c @@ -555,6 +555,7 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat if (client) pa_dbus_append_basic_variant_dict_entry(dict_iter, property_handlers[PROPERTY_HANDLER_CLIENT].property_name, DBUS_TYPE_OBJECT_PATH, client_path); + pa_dbus_append_basic_variant_dict_entry(dict_iter, property_handlers[PROPERTY_HANDLER_DEVICE].property_name, DBUS_TYPE_OBJECT_PATH, device); pa_dbus_append_basic_variant_dict_entry(dict_iter, property_handlers[PROPERTY_HANDLER_SAMPLE_FORMAT].property_name, DBUS_TYPE_UINT32, sample_format); pa_dbus_append_basic_variant_dict_entry(dict_iter, property_handlers[PROPERTY_HANDLER_SAMPLE_RATE].property_name, DBUS_TYPE_UINT32, s-sample_rate); pa_dbus_append_basic_array_variant_dict_entry(dict_iter, property_handlers[PROPERTY_HANDLER_CHANNELS].property_name, DBUS_TYPE_UINT32, channels, channel_map-channels); -- Ah, what a coincidence! Just an hour ago, I put the pulse sources throught the clang static code analyzer. Not much errors, mostly a couple of false positives. The unused device variable in handle_get_all was about the only real problem (together with an unused buffer_size variable in alsa_source/sink) and now you fixed it. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] [PATCH 1/3] configure.ac: Typo. s/Console Kit/ConsoleKit/ [1]
These patches can probably be rolled into one patch, as they all concern spelling in configure.ac. You can alsa correct Jack-JACK and Alsa-ALSA. Maarten 2011/2/18 Paul Menzel paulepan...@users.sourceforge.net: Date: Fri, 18 Feb 2011 23:27:20 +0100 [1] http://www.freedesktop.org/wiki/Software/ConsoleKit --- configure.ac | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 08c947a..b4fa78b 100644 --- a/configure.ac +++ b/configure.ac @@ -1688,7 +1688,7 @@ if test ${ENABLE_DBUS} = no ; then = WARNING WARNING WARNING WARNING WARNING WARNING WARNING = You do not have DBUS support enabled. It is strongly recommended that you enable DBUS support if you platform supports it. -Many parts of PulseAudio use udev, from Console Kit interaction +Many parts of PulseAudio use udev, from ConsoleKit interaction to the Device Reservation Protocol to speak to JACK, Bluetooth support and even a native control protocol for communicating and controling the PulseAudio daemon itself. -- 1.7.4.1 ___ 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
Re: [pulseaudio-discuss] [PATCH] src/Makefile.am: add missing space to fix build using uClibc
2011/2/19 Paul Menzel paulepan...@users.sourceforge.net: From: Henning Heinold hein...@inf.fu-berlin.de Date: Fri Jul 10 12:33:30 2009 +0200 Using uClibc AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS) is not empty because `$(INTLLIBS)` is set to `-lintl`. This uncovered a missing space in commit ef0cc745 which resulted in the following build error. […] CC libbluetooth_ipc_la-ipc.lo modules/bluetooth/ipc.c: In function 'bt_audio_service_open': modules/bluetooth/ipc.c:65:26: warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing] modules/bluetooth/ipc.c: In function 'bt_audio_service_get_data_fd': modules/bluetooth/ipc.c:110:13: warning: cast increases required alignment of target type [-Wcast-align] modules/bluetooth/ipc.c:110:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] make[3]: *** No rule to make target `-lintl', needed by `libbluetooth-ipc.la'. Stop. make[3]: Leaving directory `/oe/build-minimal-uclibc/minimal-uclibc-dev/work/armv7a-oe-linux-uclibceabi/pulseaudio-0.9.22-r11.0+gitr0+051d82133f0ae6a57bf66fd200bc8e3591a7d5ca/git/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/oe/build-minimal-uclibc/minimal-uclibc-dev/work/armv7a-oe-linux-uclibceabi/pulseaudio-0.9.22-r11.0+gitr0+051d82133f0ae6a57bf66fd200bc8e3591a7d5ca/git/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/oe/build-minimal-uclibc/minimal-uclibc-dev/work/armv7a-oe-linux-uclibceabi/pulseaudio-0.9.22-r11.0+gitr0+051d82133f0ae6a57bf66fd200bc8e3591a7d5ca/git' make: *** [all] Error 2 This patch is taken from OpenEmbedded where it has been present since 2009 for PulseAudio 0.9.15 and greater [1]. Hmm, yes indeed. What ever happened to upstreaming patches? Is there any more interesting stuff OpenEmbedded (or any other distro/downstream for that matter) that isn't in git master yet? [1] http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=ef0cc74567b3bb98378c17f6a523bf18ba132ed7 [2] http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=7c33f2e906a20e139d53b4f2d8fbc2773a4725b3 Signed-off-by: Henning Heinold hein...@inf.fu-berlin.de Signed-off-by: Paul Menzel paulepan...@users.sourceforge.net CC: Henning Heinold hein...@inf.fu-berlin.de --- src/Makefile.am | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0687e40..0ee7abc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1804,7 +1804,7 @@ BLUETOOTH_SBC_FILES = $(subst modules/bluetooth/,,$(libbluetooth_sbc_la_SOURCES) libbluetooth_ipc_la_SOURCES = modules/bluetooth/ipc.c modules/bluetooth/ipc.h libbluetooth_ipc_la_LDFLAGS = -avoid-version -libbluetooth_ipc_la_LIBADD = $(AM_LIBADD)libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la +libbluetooth_ipc_la_LIBADD = $(AM_LIBADD) libpulsecore-@PA_MAJORMINOR@.la libpulsecommon-@PA_MAJORMINOR@.la libpulse.la libbluetooth_ipc_la_CFLAGS = $(AM_CFLAGS) BLUETOOTH_IPC_FILES = $(subst modules/bluetooth/,,$(libbluetooth_ipc_la_SOURCES)) rtp.h This does illustrate the risks of all the redundancy in the Makefile.am. I have some (trivial, but large diff) patches lying around replacing all of the common stuff in the _LIBADD, _LDFLAGS with variables. But I thought that there was no good reason for such a large diff (especially since, although the file gets smaller, theres no reduction in line count). May be preventing this kind of stuff is reason enough tough. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] PA Roadmap Planning and LAC Conference
2011/2/17 Colin Guthrie gm...@colin.guthr.ie: There have been a few discussions recently about getting a solid roadmap organised for the next medium term of PA development. While the stable-queue stuff has been bubbling along nicely enough, there are several new features in the 1.x master branch but no real timescales decided. There are quite a few willing people out there these days which is really encouraging, but we need to get a solid focus on when to expect releases and what we hope to achieve in each one. This email is the start of that process. A solid plan for the next releases would indeed be very nice. With regards to IRC meeting, I propose initially that we do this next week sometime (the sooner the better). For the sake of argument, I'll pick a time: 11am UTC Thursday 24th. Other timing suggestions welcome. I'd expect it to take at least 1h but probably less than 2h and it would be good if people involved could be fairly focused during the meeting window. I'll prepare an agenda and ensure that notes/logs are taken (with a meetbot) and made available afterwords. We will likely use a new IRC channel for this but anyone who wants to sit in, lurk or actively particpate would be most welcome. Q: Is this time suitable for everyone (Lennart in particular)? I'll try to be there. I'm not sure if there is space on the agenda, but I'd like to discuss pavucontrol for a little bit. Not so much the current status, but rather what our vision is to what it should be, especially compared to the Gnome/KDE-specific alternatives. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] State of various rate adjustment patches
2011/1/31 Colin Guthrie gm...@colin.guthr.ie: 'Twas brillig, and Maarten Bosmans at 31/01/11 10:36 did gyre and gimble: 2011/1/16 Maarten Bosmans mkbosm...@gmail.com: The branch is up at https://github.com/mkbosmans/pulseaudio/compare/master...rate-adjustment ready for merging, as far a I am concerned. I'm still not entirely sure whether the change of https://github.com/mkbosmans/pulseaudio/commit/72b90ea8ac53e23862284991a2ce355de250f585 is correct, but it seems to avoid unnecessary rewinds for me. I've tested module-loopback by playing to a null-sink and looping its monitor to the real alsa sink. This showed good behaviour, but may be the algorithm I used for module-rtp-recv should also be used here. Does anyone has a better suggestion for a setup to test module-loopback? null-sink and alsa have very stable latencies, so its no good test for module-loopback. There where no objections on the list, so I guess the branch at https://github.com/mkbosmans/pulseaudio/compare/master...rate-adjustment can be merged with master. Cool, thanks Maaren. I'll pull in David's changes and then yours. On the issue of stable-queue: The first commit is definitaly a bugfix which should be included to stable-queue http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=11dbe30bfae09235307115f413fb6172df04a895 The second commit [8b4cb54595baeeb1d9b7d11a842ef7946e43a55a Limit rate adjustments to small, inaudible jumps] has some fairly straightforward logic which solves some bugs. I think this can go into stable, as there is not much that can go wrong. As I have only tested the patches on two different network setups (both wired, one busy and one without other traffic), I can't really vouch for the next commits. I don't really expect any troubles, but some testing by others would probably be warranted. Anyway, if you do decide to include them into stable-queue, I'd lump the next three commits together, ending with 27db0603d6af7d25558af38ed525fc50330a9c32. As I said before, the last commit [72b90ea8ac53e23862284991a2ce355de250f585] is really beyond my understanding of rewinds and would definately not be appropriate for stable-queue without further review. Also, it has not been tested in combination with David's rewind patches, so that needs to be done too. Maarten ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Re: [pulseaudio-discuss] Make discoverable PA network sound devices available locally results in huge network traffic
2011/1/22 Colin Guthrie gm...@colin.guthr.ie: 'Twas brillig, and Maarten Bosmans at 22/01/11 10:11 did gyre and gimble: It turns out that (without pavucontrol loaded) starting an audio stream on the client on the tunnel sink, makes the audio stream over the network and stopping the program that is playing the music stop the network usage again. So far so good, nothing unexpected. When pavucontrol is opened, there is still no network usage. After playing audio and then stopping the playback, the network usage does not stop, however, until alsa pavucontrol is closed. So it seems that the source ouput of pavucontrol on the tunnel sink monitor keeps the sink from suspending. (but only when the sink had been running before, so the transition running - idle is prevented) Very interesting. I wonder if it relates to the use or implementation of the DONT_INHIBIT_AUTO_SUSPEND flag... looking at the pavucontrol code, it seems it doesn't actually even pass PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND, so perhaps the solution is really simple... just add that flag (although perhaps we'd have to deal with it a bit more intelligently). Yup, adding that flag does the trick, see attached patch. Thanks for the pointer. I couldn't resist removing some duplicate code, I hope that's OK. If not, I'll prepare a patch which only adds the flag. I actually wonder if this is the cause of the vumeters sometimes not initialising properly at times... (I presume other people see this occasionally? It's never quite bothered me enough to look into it properly!) Well, I was pleasantly surprised to see that pavucontrol from git master worked a lot better than the version packaged on Ubuntu (0.9.9). I'll use the newest version for a while and look out for little problems like you described. Col Maarten 0001-Add-DONT_INHIBIT_AUTO_SUSPEND-flag-to-monitor-stream.patch Description: Binary data ___ pulseaudio-discuss mailing list pulseaudio-discuss@mail.0pointer.de https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss