Commit graph

5656 commits

Author SHA1 Message Date
Maarten Bosmans
bb12ff8356 Apply #ifdefs around functionality not available on win32
And also the reverse: around some win32 specific functionality
2011-02-17 11:58:22 +01:00
Maarten Bosmans
0ac0479534 Adapt win32 specific code to current API 2011-02-17 11:58:22 +01:00
Maarten Bosmans
4f1d4044f8 Use <pulsecore/socket.h> instead of <sys/socket.h>
The check whether POSIX socket.h or WIN32 winsock2.h must be included can be
made centrally.  The downside is that some functionality of e.g. arpa/inet.h is
also implemented in winsock.h, so that some files that don't use socket
functions, but do use inet.h functions, must also include pulsecore/socket.h.
(as well as arpa/inet.h)
2011-02-17 11:58:21 +01:00
Maarten Bosmans
d6d9fb295d Clean up <poll.h> includes
Instead <pulsecore/poll.h> should be included.  That file includes poll.h on
platform where it is appropriate.  Also remove some unnecessary <ioctl.h>
includes.
2011-02-17 11:58:21 +01:00
Maarten Bosmans
8d12ab9e63 Use setenv instead of putenv
In theory putenv could be used to handle freeing of strings yourself, but this
was not done in PulseAudio.  That leaves no advantages in using putenv.  With
setenv you're at the mercy of the implementation whether the strings leak, but
at least that is better then a certain leak, as it was before.
2011-02-17 11:58:21 +01:00
Pierre-Louis Bossart
051d82133f alsa: disable period wakeups in tsched mode if possible
This patch reflects a new capability that Lennart was wishing
for. Wish granted...

Re-submitting it now that alsa-lib 1.0.24
provides additional entry points to disable period
wakeups in timer-scheduling mode if hardware can
work without it (HDAudio, oxygen and Intel SST).

    Example with standard playback on HDAudio output
    Before change:

    Top causes for wakeups:
       3.8% (  5.4)   [hda_intel] <interrupt>
       2.8% (  4.0)   alsa-sink

    After change:
    Top causes for wakeups:
       2.3% (  3.0)   alsa-sink

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
2011-02-01 09:41:02 +00:00
Arun Raghavan
9498440dc6 echo-cancel: Make Orc file names less silly
The naming was what it was because of the way orc.mak was originally
written. This has changed now.
2011-02-01 11:51:46 +05:30
Arun Raghavan
a9d824925d build: Simplify Orc-related make rules
This greatly simplifies the Orc-related make rules. The old system of
distributing generated files is gone, which means that anyone who wants
to build with Orc support enabled needs to have the orcc compiler
installed (presumably the orc 'devel' package in most distros).
2011-02-01 11:51:46 +05:30
Arun Raghavan
548e1026e3 build: Move orc.mak out of build/
That directory is commonly used by developers for out-of-tree builds, so
don't keep the Makefile in there.
2011-01-31 20:24:59 +05:30
Maarten Bosmans
d766b38e1b build: Remove unnecessary flags in AM_CFLAGS
The CFLAGS and LIBS of libsamplerate, libspeex and libsndfile are added to the pulse libraries depending on those libraries.

Also src/pulse/version.h is generated by configure, so it does not need to go in BUILT_SOURCES.

(Slightly tweaked by Colin Guthrie to fix a merge problem relating to BUILT_SOURCES)
2011-01-31 12:40:43 +00:00
Maarten Bosmans
974af43507 build: Don't include empty Makefile.am in subdirs 2011-01-31 12:40:43 +00:00
Maarten Bosmans
d6cdd80b0d build: Generate module symdefs in src/modules directory
This will make it possible to remove the empty Makefile.am files.
 - module-...-symdef.h files are all generated in src/modules, instead of in the subdir of the module.
 - The default inclusion of src/modules subdirs in AM_CFLAGS can be removed, where necessary (raop) the subdir is
   included in the specific CFLAGS.
 - The src/daemon and src/modules directories are always created on make, to facilitate out of tree builds.
 - AM silent rules are used for the generation of symdef files by m4.
 - For echo-cancel, keep the build dir include for now (and mkdir it) although limit it to just the echo-cancel
   module's CFLAGS (Colin Guthrie)
2011-01-31 12:40:43 +00:00
Colin Guthrie
8534149fbe Merge remote branch 'mkbosmans/rate-adjustment' 2011-01-31 11:45:50 +00:00
David Henningsson
74eb4d8921 Fighting rewinds: Reduce calls to handle_seek
If many small blocks are in queue, handle_seek is being called
for every one of them, sometimes causing a rewind. Delay the
call until all blocks are handled, then call handle_seek only
once.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-01-31 11:38:26 +00:00
David Henningsson
fe7b972487 Fighting rewinds: Seek and write data in the same message
Allow a message in the queue to perform both a seek and a post data.
For clients that do not use PA_SEEK_RELATIVE (e g gstreamer), this
cuts the message count - and sometimes even the rewinds - in half.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-01-31 11:38:17 +00:00
Lennart Poettering
1250b5d735 ratelimit: fix log levels of log suppression messages
When logging a suppression message do so on the same log level as the
suppressed messages.

Cherry picked by Colin Guthrie from ec5a785712
with a couple of additional changes due to extra limiting in master
that was not present in stable-queue.
2011-01-31 11:36:24 +00:00
Scott Reeves
a509f10f95 Core: Fix incorrect check of return value 2011-01-23 14:10:49 +00:00
Maarten Bosmans
98bde37a51 build: Use MODULE_LIBADD in Makefile.am 2011-01-23 13:52:30 +00:00
Colin Guthrie
8c0e3efbf8 Merge commit 'e4979ab5cf' 2011-01-17 22:19:10 +00:00
Colin Guthrie
26c64fb54e tunnel: Fix automatic names when source/sink_name argument is missing.
Spotted by palmerdabbelt via #894
2011-01-16 14:34:11 +00:00
Maarten Bosmans
72b90ea8ac module-rtp-recv: Request proper rewind after underrun 2011-01-16 02:27:25 +01:00
Maarten Bosmans
27db0603d6 module-rtp-recv: Remove smoother from write index
It isn't necessary anymore with the new algorithm.  The slow adjust of the
smoother was even detrimental to the accuracy of the rate estimate.
2011-01-16 02:27:25 +01:00
Maarten Bosmans
e868638768 module-rtp-recv: Average the estimated real sample rate 2011-01-16 02:27:25 +01:00
Maarten Bosmans
d053a25b67 module-rtp-recv: Use new algorithm for adjusting sample rate 2011-01-16 02:27:25 +01:00
Maarten Bosmans
8b4cb54595 Limit rate adjustments to small, inaudible jumps
The same logic is applied to the sample rate adjustments in module-rtp-recv,
module-loopback and module-combine:
 - Each time an adjustment is made, the new rate can differ at most 2‰ from the
   old rate.  Such a step is equal to 3.5 cents (a cent is 1/100th of a
   semitone) and as 5 cents is generally considered the smallest observable
   difference in pitch, this results in inaudible adjustments.
 - The sample rate of the stream can only differ from the rate of the
   corresponding sink by 25%.  As these adjustments are meant to account for
   very small clock drifts, any large deviation from the base rate suggests
   something is seriously wrong.
 - If the calculated rate is within 20Hz of the base rate, set it to the base
   rate.  This saves CPU because no resampling is necessary.
2011-01-16 02:14:41 +01:00
Maarten Bosmans
11dbe30bfa module-loopback: Add adjust_time to valid args 2011-01-16 02:02:55 +01:00
Arun Raghavan
3e552bdf19 client: Don't update smoother while corked
This prevents the smoother attached to the stream clock from being
updated while the stream is corked, which in turn ensures that once
corking is completed, pa_stream_get_time() always returns the same value
until the stream is uncorked - i.e., the clock does not advance when the
client believes that it will not.

The actual call to pa_smoother_put() happens on things like stream
suspend/unsuspend, which trigger timing updates. This changes the
smoother coefficients, which means that a call to pa_smoother_get() for
the same value of 'x' can return different values before and after a
timing update.
2011-01-15 16:08:45 +00:00
Jyri Sarha
aefa94f052 alsa-sink: Don't assume we were able to enable hw-volume or sync-volume (v1.1)
This patch also disables mixer callback code if we do not have neither
HW-volume or HW-mute.
2011-01-15 13:26:21 +00:00
Jyri Sarha
98db3dffb6 alsa-sink: Fix double use of string 2011-01-15 13:26:07 +00:00
Jyri Sarha
3d83a0cf52 core: Use pa_sink_get_latency_within_thread() in sync-volume code 2011-01-15 13:24:40 +00:00
Jyri Sarha
6fd138f669 core: Use volume_change_safety_margin when rewinding sync-volume events
After this patch the volume changes are applied immediately after
sink rewind before processing streams and monitor source.
2011-01-15 13:23:02 +00:00
Jyri Sarha
34d022c16e core: Change sematics of pa_flist_new_with_name() (v1.1)
Name string is copied and added to flist structure. The original is
responsibility of the caller. The name is only used for debug printing.
2011-01-15 13:22:13 +00:00
Colin Guthrie
a37e0963ef build-sys: Make --disable-dbus actually work.
Previously this argument passed to configure only worked if --disable-hal and
--disable-bluez was also passed which wasn't immediately obvious to the
untrained compiler.

This change simply makes --disable-dbus disable the other two as well
and errors out of specific, incompatible --enable/--disable flags
are provided.

The summary table is also adjusted and intended to try and show the
dependency relationship a little.
2011-01-11 11:26:48 +00:00
Colin Guthrie
0fae3ad2f8 build-sys: Put in specific warnings when there is no udev or DBUS support
Users have often come to me when their build doesn't work and typically
this is when they do not have dev headers for DBUS and udev installed
when building. Put in some specific warnings about these optional,
but critical, elements.

This will likely display this message on platforms where they are not
available, so patches welcome to hide them in a semi-intelligent way.
2011-01-11 10:28:06 +00:00
Colin Guthrie
1b545997ad console-kit: Console Kit support is dependent on DBUS and is thus optional.
Therefore, we must reflect this in the default.pa. Several users
have reported an error with consolekit when starting a self-built PA
due to the default config not working properly. This works around the
issue but we should include a warning on configure about the lack of
DBUS and udev support as this is a common mistake.
2011-01-11 10:10:07 +00:00
Michal Schmidt
4bb8a83c62 padsp: wrap __open_2 and __open64_2
These functions are used in OSS programs where the "flags" parameter for
open() is not a build-time constant and the build has _FORTIFY_SOURCE
enabled.
2011-01-10 20:49:40 +00:00
Cai Yuanqing
95ccbf7346 loopback: Add new arguments to disable stream move
The arguments sink_dont_move and source_dont_move have been added to toggle
module automatic unloading when the sink or source were no longer
available, rather than just moving them to the next available
sink/source (via rescue streams).

Reviewed and tweaked by Colin Guthrie.
2011-01-03 09:42:12 +00:00
Colin Guthrie
06875b67e6 Revert "core: make use of dbus_message_iter_append_fixed_array"
This causes problems as outlined in ticket #887.
This reverts commit f564c7d763.
2011-01-03 09:22:33 +00:00
Luiz Augusto von Dentz
e4979ab5cf bluetooth: detect when bitpool has changed on sbc codec
A2DP spec allow bitpool changes midstream which is why sbc configuration
has a range of values for bitpool that the encoder can use and decoder
must support.

Bitpool changes do not affect the state of encoder/decoder so they don't
need to be reinitialize when this happens, so the impact is fairly small,
what it does change is the frame length so encoders may change the
bitpool to use the link more efficiently.
2010-12-23 13:16:43 +02:00
Luiz Augusto von Dentz
96338eec28 bluetooth: fix build for libdbus < 1.3 2010-12-23 13:16:43 +02:00
Luiz Augusto von Dentz
07eea95dc1 bluetooth: fix case of profile UUIDs to match what BlueZ uses 2010-12-23 13:16:43 +02:00
Cai Yuanqing
d28fc0df89 coreaudio: Make coreaudio-detect safer by adding asserts before dereferencing 2010-12-22 15:08:19 +00:00
Chen Rui
fb05059acf fix bug about get source-output status 2010-12-20 11:31:15 +00:00
Zhang Wanming
0c0c285e79 Fix typos 2010-12-20 11:07:30 +00:00
Daniel T Chen
b75b8aaf42 Further clarify src- and speex- references in pulse-daemon.conf
Based on comments from Arun Raghavan, make clear that we're referring
to the libspeex API documentation for the speex- options. Also correct
the quality range (was incorrectly 0..9 but is 0..10 now) and clean up
the line length.

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
2010-12-19 15:29:19 +00:00
Vincent Becker
12c3e97bb4 Fix return value of pa_sndfile_format_from_string
This prevented to use pacat --file-format option correctly
2010-12-18 11:52:24 +00:00
Yang Xichuan
ecd46c05d3 core: Fix variable "has_whined" value bug
In the file src/pulsecore/random.c

I found that the log information "Failed to get proper entropy. Falling
back to seeding with current time." would never be printed.

This change corrects the issue.
2010-12-18 11:20:46 +00:00
Daniel T Chen
62d085fc65 trivial: Mention speex as a resampler reference in pulse-daemon.conf
A Debian user seemed confused that the man page for pulse-daemon.conf
does not refer to the libspeex API Resampler for use in PulseAudio's
*-src. Fix it by explicitly mentioning speex.

(http://bugs.debian.org/541206)

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
2010-12-18 11:12:17 +00:00
Maarten Lankhorst
971bbe04a8 module-loopback: Prevent an infinite loop when rate adjusting is disabled 2010-12-12 20:30:36 +00:00
Maarten Lankhorst
01a853e0c0 bluetooth: Fix a2dp processing 2010-12-12 20:26:10 +00:00