Commit graph

156 commits

Author SHA1 Message Date
Maarten Bosmans
dd9265ac78 Remove unnecessary #includes 2011-06-22 23:12:20 +01:00
Colin Guthrie
7aa8a3fa80 daemon: Fix regression introduced in f1d1447e.
With Tanu's patch, the server no longer starts when a server is configured.
While this is sensible in most circumstances there is a corner case where
we still want to start.

In a typical X11 login, module-x11-publish will be loaded and will thus
set the PULSE_SERVER X11 property on the root window. This then hits the
check introduced in f1d1447e and exits. If PA had previously crashed
(thus leaving behind it's X11 properties) then this means that we will not
autospawn nor even allow ourselves to be started manually until
pax11publish -r is run to clear out the X11 properties. This is obviously
not desirable.

This patch introduces a more in-depth check of the server. If it looks like
a local unix domain socket, then we do not exit straight away and instead
probe further. This should not pose any problems with e.g. remote SSH
usage as the DBus Machine ID is used in the server string.
2011-03-25 23:14:28 +00:00
Colin Guthrie
34ddc5b9c5 daemon: Fix some more error paths in the double forking.
As spotted by Tanu Kaskinen:

The first process: daemon_pipe is not closed if the first fork() call
fails. Even if it doesn't fail, the first process never closes
daemon_pipe[0].

The second process: daemon_pipe[1] is not closed if anything fails
between the first and the second fork() call. Also, if the second fork
fails, then the finish section writes to daemon_pipe2[1], even though
only the third process should do that. Also, if anything fails between
the first and the second fork, then the second process never writes
anything to daemon_pipe[1]. I don't know what happens in the first
process in this case - does it get an error or does pa_loop_read() get
stuck.

The third process: No problems :)
2011-03-25 21:35:40 +00:00
Colin Guthrie
d47a33775b daemon: Fix regression with --start introduced with the double fork in 8e94f653
The previous commit intoduced a double fork which caused a more or less immediate
successful return prior to the hard work of actually starting a daemon.

This patch simply used pipe() to only signal our father when the daemon really
has finished starting.
2011-03-24 21:27:55 +00:00
Arun Raghavan
b759aff806 daemon: Fix missing include - cpu-orc.h 2011-03-20 11:31:15 +00:00
Arun Raghavan
4cd90d9e32 volume: Add Orc-based optimised volume scaling
This adds volume scaling for 1- and 2-channel software volume scaling
using Orc. While testing the MMX and SSE backends on a Core2, I see an
~2x performance benefit over the hand-rolled MMX and SSE code. Since I
haven't been able to test on other architectures, the Orc code is only
used when MMX/SSE* is present. This can be changed in the future after
testing on AMD and ARM machines.
2011-03-05 14:38:28 +05:30
Maarten Bosmans
d6d4336705 Implement some functions for win32
And disable building binaries for win32 that make no sense there
2011-02-17 12:02:30 +01:00
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
Zhang Wanming
0c0c285e79 Fix typos 2010-12-20 11:07:30 +00:00
Jyri Sarha
3e53e3bba3 daemon-conf: Add sync volume parameters to daemon-conf
Signed-off-by: Jyri Sarha <jyri.sarha@nokia.com>
Reviewed-by: Tanu Kaskinen <tanu.kaskinen@digia.com>
Reviewd-by: Colin Guthrie <cguthrie@mandriva.org>
2010-10-16 11:53:39 +01:00
Arun Raghavan
ab4223e9cf cpu: Add CPU information to pa_core
This retains CPU information (processor type and supported features) in
pa_core, so that this information can be used by modules at init time to
figure out what optimisations may be used.
2010-09-23 17:17:03 +05:30
Lennart Poettering
83eb8afc5f daemon: first take name on the bus, then return in starter process
http://pulseaudio.org/ticket/748
2010-02-21 17:53:24 +01:00
Tanu Kaskinen
f1d1447e10 daemon: Don't autospawn if a server address is explicitly configured. 2010-01-09 12:43:05 +02:00
Lennart Poettering
b8acf5586f daemon: complain if user passes too many arguments 2009-11-20 17:48:04 +01:00
Lennart Poettering
c079ceeba0 daemon: during startup say whether we run in a VM 2009-11-05 03:22:48 +01:00
Lennart Poettering
8e94f65348 daemon: make sure pa has its own session and process group, but is not its leader so that we cannot acquire a tty ever 2009-10-31 02:43:47 +01:00
David Yoder
5c57650769 daemon: realpath segfault fix
Lennart,

Apparently I was debugging this at the same time as you. I can't figure out
why my Fedora 11 install with glibc-2.10 has a glibc realpath that doesn't
match the gnu documentation and returns null. But it does.

Your commit aa8ce5bb9b almost fixed my
problem, but it needs a tweak.

Thanks,
David Yoder
2009-10-31 01:56:59 +01:00
Lennart Poettering
aa8ce5bb9b daemon: don't crash if pa_realpath() fails 2009-10-30 05:08:48 +01:00
Tanu Kaskinen
019331d25b Merge branch 'master' into dbus-work
Conflicts:
	src/daemon/daemon-conf.c
2009-10-02 17:24:44 +03:00
Nix
eac566226e Don't refuse to start on systems using GNU stow, graft, STORE et al
There are multiple package management systems out there which implement
packages using symlinks. The recent (otherwise useful) check to ensure that
a re-executed pulseaudio is actually reexecuting itself unfortunately breaks
in the presence of all these packaging systems, because PA_BINARY refers
to its installed location (e.g. /usr/local/bin/pulseaudio), which is a
symlink to the binary (e.g. /usr/local/stow/pulseaudio-0.9.18/bin/pulseaudio),
because /proc/self/exe always contains the canonical path of the executable,
with all symlinks resolved.

(At least one distribution uses a symlink-based packaging system, so
will be forced to apply this locally in any case.)

The fix is simple: canonicalize PA_BINARY before equality-testing. (This
should be completely safe, because the OS does just that when PA_BINARY
is executed.)

The patch is against 0.9.18, but applies without fuzz to current master.
2009-09-29 19:32:25 +02:00
Lennart Poettering
d088c8f05a daemon: make use of SIMD optional via config variable to ease debugging 2009-09-03 00:19:03 +02:00
Lennart Poettering
a8c0f65fae daemon: clean up environment when forking off children 2009-09-02 00:42:54 +02:00
Lennart Poettering
dfe3f90b37 daemon: don't override path env vars if they are already set 2009-09-01 00:53:49 +02:00
Tanu Kaskinen
2f3fc2f1d6 Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
	src/Makefile.am
2009-08-24 14:43:11 +03:00
Lennart Poettering
ab5ac06ac7 Merge commit 'wtay/optimize' 2009-08-23 00:06:35 +02:00
Lennart Poettering
8a2a6b2004 adjust various data/library paths automatically if we are run from a build tree 2009-08-21 03:43:53 +02:00
Wim Taymans
951bf1b28d svolume: add ARM optimized volume scaling 2009-08-20 11:31:03 +02:00
Wim Taymans
25724cdd40 Get rid of liboil
Get rid of the liboil dependency and reimplement the liboil functions with an
equivalent C implementation. Note that most of these functions are deprecated in
liboil and that none of them had  any optimisations. We can further specialize
our handrolled versions for some extra speedups.
2009-08-20 11:31:03 +02:00
Wim Taymans
563cb2dea9 main: hook up cpu detection code
Add CPU detection code to activate the various optimisations.
Move some method definitions around.
Use compatibility macros when we can.
2009-08-20 11:31:03 +02:00
Wim Taymans
7086784573 volume_sse: add sse optimisations 2009-08-20 11:31:02 +02:00
Wim Taymans
3a0b012ee0 volume: add first mmx optimized function
Add code for an mmx optimized version of s16ne volume scaling. Install the
custom function.
2009-08-20 11:31:02 +02:00
Tanu Kaskinen
bcaba0b1b4 Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
	src/Makefile.am
	src/daemon/daemon-conf.c
	src/daemon/daemon.conf.in
	src/modules/module-stream-restore.c
	src/pulse/client-conf.c
	src/pulsecore/namereg.c
2009-08-16 21:25:48 +03:00
Lennart Poettering
27b8cd783c daemon: reset scheduling priority on startup, too 2009-08-12 21:37:40 +02:00
Lennart Poettering
ef176ecb62 core-util: move personality resetting into core-util 2009-08-12 21:36:52 +02:00
Diego Elio 'Flameeyes' Pettenò
4c15115007 Split OSS support in output and wrapper.
Since Fedora does not enable OSS output support at all, but still uses
padsp, and in Gentoo we could also make use of padsp without OSS output
support, split the two things in two parameters, although they both check
for sys/soundcard.h once.
2009-08-08 01:53:15 +02:00
Lennart Poettering
88d5749f6a Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio
Conflicts:
	src/daemon/main.c
2009-07-23 15:18:06 +02:00
Lennart Poettering
41ad33dfe7 Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio 2009-07-22 22:49:06 +02:00
Lennart Poettering
2f54b5df18 daemon: reset personality, to make the autospawn env cleaup complete 2009-07-22 22:47:51 +02:00
Lennart Poettering
a2b207e38a daemon: before exec'ing ourselves, make sure nobody plays games with /proc/self/exe 2009-07-20 15:48:36 +01:00
Diego Elio 'Flameeyes' Pettenò
84200b423e Remove exploitable LD_BIND_NOW hack (CVE-2009-1894).
Instead of trying to re-execute pulseaudio itself with LD_BIND_NOW set,
just find the correct flag for the linker to request immediate bindings
(all ELF files support that option), and use that when linking the daemon.

Reduce the amount of compiled and executed code as well.
2009-07-16 15:57:41 +02:00
Tanu Kaskinen
5c7952e4fa dbus: Implement the Name property of the core object. 2009-07-03 02:49:07 +03:00
Tanu Kaskinen
6e2fec05dd server-lookup: Update the D-Bus identifiers to be versioned. 2009-06-30 15:21:20 +03:00
Tanu Kaskinen
c266595058 Merge branch 'master' into dbus-work 2009-06-29 18:55:12 +03:00
Diego Elio 'Flameeyes' Pettenò
2f7bce9375 Add a missing sys/stat.h include for FreeBSD to declare umask(). 2009-06-29 17:40:56 +02:00
Tanu Kaskinen
0bc538b08c Merge branch 'master' into dbus-work
Conflicts:
	src/daemon/daemon-conf.c
	src/daemon/daemon-conf.h
	src/daemon/main.c
	src/pulsecore/dbus-util.h
2009-06-29 18:35:06 +03:00
Lennart Poettering
3ee29004a9 rtclock: fix build after merge 2009-06-22 23:15:01 +02:00
Lennart Poettering
fc33f7ee97 Merge most of elmarco/rtclock2
Merge commit 'e4d914c945'
2009-06-22 23:09:46 +02:00