Commit graph

1085 commits

Author SHA1 Message Date
Lennart Poettering
dbdc666fb6 various modernizations 2010-02-23 01:23:41 +01:00
Lennart Poettering
028aa734f8 iochannel: remove fd from poll() when we don't care from events
This should make it unlikely that we loop on SIGHUP indefinitely.

Also, this makes it possible for callbacks not to process all events and
still not busy loop.
2010-02-23 01:20:25 +01:00
Lennart Poettering
b5e30764c4 native: improve logging for buffer_attrs 2010-02-22 04:57:21 +01:00
Lennart Poettering
0c7c9653b1 conf-parser: make use of pa_strip() wherever applicable 2010-02-21 22:00:16 +01:00
Lennart Poettering
f1af7a02d1 core-util: introduce generic function pa_strip() 2010-02-21 21:59:53 +01:00
Matthijs Kooijman
f8aceafb13 http: support HTTP HEAD
http://pulseaudio.org/ticket/781
2010-02-21 21:46:06 +01:00
Lennart Poettering
ea29b11097 scache: when playing a sample from the cache make sure not queue them up when the sink is suspended
libcanberra already sets the appropriate flags for uncached sample
streams, we now need to make sure to set them for cached samples too.
2010-02-21 17:48:55 +01:00
Lennart Poettering
3f1c90b9d7 sample-cache: use the sample name as unmodified fallback in the properties when playing a sample from the cache 2010-02-21 17:48:50 +01:00
Lennart Poettering
c2079d792c shm: don't complain about missing SHM segments
If two clients try to cleanup the SHM directory at the same time, they
might want to open and then delete the same segment at the same time, in
which case one client might win, the other one lose. In this case, don't
warn about ENOENT.
2010-02-21 17:48:17 +01:00
Lennart Poettering
b9bcc7c733 fdsem: be more verbose when reading from eventfd fails.
Apperently reading from an eventfd can fail, which results in an assert
to be hit. I am not sure about the reason for the failure, but in
attempt to track down the issue the next time is hit this prints a more
useful log message.

https://bugzilla.redhat.com/attachment.cgi?id=386380
2010-02-21 17:47:40 +01:00
Lennart Poettering
ac76dbde63 dbus: first restart timer, then dispatch it
This makes sure that we don't access the timer after it might have been
destroyed already from the dbus timeout callback.

https://bugzilla.redhat.com/attachment.cgi?id=389952
2010-02-21 17:47:36 +01:00
Lennart Poettering
66cfa72eb4 native: rework handling of seeks that depend on variables the client does not know anything about
All seeks/flushes that depend on the playback buffer read pointer cannot
be accounted for properly in the client since it does not know the
actual read pointer. Due to that the clients do not account for it at
all. We need do the same on the server side. And we did, but a little
bit too extreme. While we properly have not applied the changes to the
"request" counter we still do have to apply it to the "missing" counter.
This patch fixes that.
2010-02-09 22:45:59 +00:00
Lennart Poettering
54025c96a7 cpu: check for CMOV flag before using this intsruction in assembly
http://pulseaudio.org/ticket/776
2010-02-09 22:32:39 +00:00
Lennart Poettering
f732c23d95 log: add an easy way to disable log rate limiting
Should help with debuggin bugs like:

https://bugzilla.redhat.com/show_bug.cgi?id=554405
2010-02-09 22:31:55 +00:00
Lennart Poettering
7f7455b1be once: make once related variables volatile 2010-02-09 22:31:30 +00:00
Lennart Poettering
345547853b core: make sure we always return a valid memblock in sink_input_pop() callbacks
https://bugzilla.redhat.com/show_bug.cgi?id=553607
2010-02-09 22:29:38 +00:00
Lennart Poettering
699233fb47 native: fix request counter miscalculations
Do not subtract bytes the client sends us beyond what we requested from
our missing bytes counter.

This was mostly a thinko that caused servers asking for too little data
when the client initially sent more data than requested, because that
data sent too much was accounted for twice.

This commit fixes this miscalculation.

http://bugzilla.redhat.com/show_bug.cgi?id=534130
2010-02-09 22:29:20 +00:00
Colin Guthrie
cd559553a0 core: Fix macro typo - PA_SINK_IS_LINKED -> PA_SINK_INPUT_IS_LINKED 2010-02-09 21:59:55 +00:00
Lennart Poettering
f250179b4e shm: explicitly mark shm seg for MAP_NORESERVE to request overcommiting no matter what 2010-02-02 09:01:04 +01:00
Lennart Poettering
76089b11eb native: fallback to another port if the default port is taken
Unless the port number is explicitly configured we will now fallback to
a kernel picked port if the one we'd like by default we cannot get.

http://pulseaudio.org/ticket/773
2010-01-14 00:13:13 +01:00
Tanu Kaskinen
25435bf373 sink-input: Replace a tab indentation with spaces. 2010-01-06 11:03:19 +02:00
Tanu Kaskinen
cc82553d7e idxset: Fix _get_by_data() comment. 2010-01-06 10:48:32 +02:00
huan zheng
aa9348441d core: volume ramping fix
Hi,
I found that volume ramping is inside PA now.
there's a minor fix here, it is a bug i found after the patch is submitted:

line 1781 of sink-input.c :
if ((i->thread_info.ramp_info.envelope_dying - nbytes) <= 0) {
need to be changed to
if ((i->thread_info.ramp_info.envelope_dying - (ssize_t) nbytes) <= 0) {

otherwise this argument will never be negative since nbytes is of type
size_t which is unsigned.
Please change it when you have time, sorry if bring any inconvenience.  :)
2010-01-06 00:22:23 +01:00
Lennart Poettering
6dfb1ee27e Merge remote branch 'zonque/topic/osx' 2010-01-05 22:52:57 +01:00
Daniel Mack
937c587e77 fix a number of warnings
most of them were due to missing #ifdefs or wrong printf format type for
[s]size_t.
2010-01-05 22:46:13 +01:00
Mads Kiilerich
6faf38313e headers: Some trivial fixes for some documentation typos
Note also the willneed/will_need inconsistency. I guess it could be nice to ASAP
choose one of them and introduce a backward compatibility hack for the other.

The issues was mostly found with:
for a in $(grep -r '^[ /]\*.*()' $(
	find -name '*.[ch]') |
	sed 's,^.* \([^ ]*\)().*$,\1,g' |
	sort |
	uniq |
	grep ^pa_)
do
	grep -rq "^.[^*].*\<$a(" $(find * -name '*.h') || echo $a
done
2010-01-05 21:27:33 +01:00
Pierre-Louis Bossart
0e47065fe5 Subject: rtpoll: better support for DEBUG_TIMING logs
On all the platforms I tested, PulseAudio is frequently awaken and
doesn't sleep for the duration specified for the poll timeout.
Sometimes wake-ups occur within milliseconds of the poll call for no
good reason; this seems to be related to ALSA issues (see my posts on
the ALSA mailing list on null poll events).
This patch enables a better log of requested sleep times v. actual
sleep times. Enable DEBUG_TIMING to see actual messages. Please let me
know if you see odd behaviors like the one below
- Pierre

E: rtpoll.c: rtpoll_run
E: rtpoll.c: poll timeout: 188 ms
E: rtpoll.c: Process time 0 ms; sleep time 48 ms
E: rtpoll.c: rtpoll_run
E: rtpoll.c: rtpoll finish
E: rtpoll.c: rtpoll_run
E: rtpoll.c: poll timeout: 139 ms
E: rtpoll.c: Process time 0 ms; sleep time 49 ms
E: rtpoll.c: rtpoll_run
E: rtpoll.c: rtpoll finish
E: rtpoll.c: rtpoll_run
E: rtpoll.c: poll timeout: 189 ms
E: rtpoll.c: Process time 0 ms; sleep time 0 ms
E: rtpoll.c: rtpoll_run
E: rtpoll.c: rtpoll finish
E: rtpoll.c: rtpoll_run
E: rtpoll.c: poll timeout: 189 ms
E: rtpoll.c: Process time 0 ms; sleep time 49 ms
2010-01-05 21:27:25 +01:00
Daniel T Chen
a63cf050b0 More src/pulsecore/cpu-arm.c FTBFS fixes
Fix missing argument to pa_read(), and be consistent with declaration of
state variable in pa_cpu_init_arm().

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
2009-12-22 20:38:48 +00:00
Daniel T Chen
e5e432fe0a Fix the following warnings (which now cause buildd failures in Ubuntu 10.04):
pulsecore/cpu-arm.c: In function 'get_cpuinfo':
pulsecore/cpu-arm.c:70: warning: implicit declaration of function 'pa_read' [-Wimplicit-function-declaration]
pulsecore/cpu-arm.c:72: warning: implicit declaration of function 'pa_close' [-Wimplicit-function-declaration]
pulsecore/cpu-arm.c: In function 'pa_cpu_init_arm':
pulsecore/cpu-arm.c:110: warning: implicit declaration of function 'pa_split_spaces' [-Wimplicit-function-declaration]
pulsecore/cpu-arm.c:110: warning: assignment makes pointer from integer without a cast
Function `pa_split_spaces' implicitly converted to pointer at pulsecore/cpu-arm.c:110

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
2009-12-22 20:38:40 +00:00
Daniel Mack
f452c6cdd9 fix a number of warnings
most of them were due to missing #ifdefs or wrong printf format type for
[s]size_t.
2009-12-16 16:11:40 +08:00
Daniel Mack
28a73ad120 hack around another OS X bug: recv() with MSG_PEEK does not work
At least for pipes, recv() with MSG_PEEK does actually eat up data from
file descriptors. Hence, this can't be used for PULLHUP emulation.

Use another ioctl hack for that.
2009-12-16 16:11:38 +08:00
Daniel Mack
17d34462ea poll() is totally broken on Mac OS X
Even on 10.5.8, poll() does not do the right thing. Haven't checked on
newer versions. Hence, wrap all occurences of poll() to pa_poll and
emulate that call with select() on OSX. This is totally embarassing.
2009-12-16 16:11:36 +08:00
Daniel Mack
a46ddfebb5 core-rtclock.c: tweak OS_IS_DARWIN constraints
Move the code for OS_IS_DARWIN to the top as on Darwin,
HAVE_CLOCK_GETTIME is also defined.
2009-12-09 06:31:07 +08:00
Tanu Kaskinen
e785f728a5 dbus: Add a missing break statement in handle_message_cb(). 2009-12-03 21:50:19 +00:00
Tanu Kaskinen
7b1b68ce2c dbus: Handle the cases when a non-existing interface is detected in an incoming message. 2009-12-03 21:50:19 +00:00
Lennart Poettering
675957b9e4 Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio 2009-11-22 21:40:15 +01:00
Diego Elio 'Flameeyes' Pettenò
d963998676 Rename all the signal parameters and variables to something more explicit.
Without this change, on FreeBSD you'll be bothered by tons of warnings
about overshadowing signal(2).
2009-11-21 00:46:46 +01:00
Joe Marcus Clarke
f5d8aef0ac freebsd: fix atomic ops implementations
Stole from

http://www.freebsd.org/cgi/cvsweb.cgi/ports/audio/pulseaudio/files/patch-src_pulsecore_atomic.h?rev=1.6
2009-11-21 00:02:36 +01:00
Lennart Poettering
9708ecd648 Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio 2009-11-20 01:02:01 +01:00
Lennart Poettering
2294642762 core: make cpuid code compile cleanly with 32bit PIC 2009-11-11 04:50:32 +01:00
Lennart Poettering
d9b5bbca01 core: adjust volume only when there is actually a memory block
Fixes an assert that is hit in somne niche cases:

https://bugzilla.redhat.com/show_bug.cgi?id=533482
2009-11-11 04:18:10 +01:00
Wim Taymans
f3866f2635 protocol: use the right sample rate for sources
Use the correct sample rate for reporting about the timing.
2009-11-10 13:21:55 +01:00
Lennart Poettering
f202af17b7 ramping: minor cleanups 2009-11-05 22:58:15 +01:00
Lennart Poettering
4d62f159a7 Merge remote branch 'origin/merge-queue'
Conflicts:
	src/pulsecore/sink-input.c
	src/pulsecore/sink.c
2009-11-05 22:54:42 +01:00
Lennart Poettering
642c69bed8 core-util: add call to detect if we are called from within a VM 2009-11-05 03:22:15 +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
Daniel Mack
542fa468c2 Mac OS X: add semaphore implementation
On Wed, Sep 16, 2009 at 11:57:04PM +0200, Lennart Poettering wrote:
> On Wed, 16.09.09 15:15, Daniel Mack (daniel@caiaq.de) wrote:
>
> > +    s = pa_xnew(pa_semaphore, 1);
> > +    MPCreateSemaphore(UINT_MAX, value, &(s->sema));
> > +    pa_assert(s->sema != 0);
>
> Hmm, I'd prefer if the ret val of MPCreateSemaphore() would be checked
> here.
>
> Also I find it a bit weird checking for s->sema, though not
> initializing it to 0 in the beginning. If the call actually failed,
> then the assert will check uninitialized memory. Also, comparing
> pointers with 0 sucks. That should be NULL.
>
> Given that this can not realisitically fail, only in OOM or OOM-like
> situations in which case we abort anyway it mght be enough just writing:
>
> pa_assert_se(MPCreateSemaphore(UINT_MAX, value, &s->sema) == 0);
>
> (Assuming that success is signalled by retval == 0 on MacOSX)
>
> > +void pa_semaphore_free(pa_semaphore *s) {
> > +    pa_assert(s);
> > +    MPDeleteSemaphore(s->sema);
>
> Same here.
>
> > +    pa_xfree(s);
> > +}
> > +
> > +void pa_semaphore_post(pa_semaphore *s) {
> > +    pa_assert(s);
> > +    MPSignalSemaphore(s->sema);
>
> And here.
>
> > +}
> > +
> > +void pa_semaphore_wait(pa_semaphore *s) {
> > +    pa_assert(s);
> > +    /* should probably check return value (-ve is error), noErr is ok. */
> > +    MPWaitOnSemaphore(s->sema, kDurationForever);
>
> And here.

Ok, done. See the patch below.

Daniel

>From 26df2fbae6d9215a3ae084876fb5f79e4d9cf4f0 Mon Sep 17 00:00:00 2001
From: Kim Lester <kim@dfusion.com.au>
Date: Wed, 16 Sep 2009 09:23:39 +0800
Subject: [PATCH] Mac OS X: add semaphore implementation
2009-10-31 01:34:04 +01:00
Daniel Mack
b04fe9b516 Wrap clock_gettime and friends
On Wed, Sep 16, 2009 at 11:48:58PM +0200, Lennart Poettering wrote:
> On Wed, 16.09.09 15:15, Daniel Mack (daniel@caiaq.de) wrote:
>
> > From: Kim Lester <kim@dfusion.com.au>
> >
> > OS X does not define clockid_t or clock_gettime() and friends.
> > Add a wrapper to fix this.
>
> Hmpf. I am not particularly happy with this. This adds a lot of
> unnecessary compat code. We don't actually need implementations of
> clock_getres(). All we need is some kind of check whether system
> timers are accurate or whether they are rounded up to scheduling
> slices. On Linux we do that check with clock_getres(), but all the
> information it returns is actually not intertesting at all. We just
> check if this is below some trheshold, that's all.
>
> clock_settime() we don't use at all! We shouldn't carry compat code
> for that.
>
> And clock_gettime we don't really need either. We need some kind of
> accurate system timers (preferably monotonic), and on Linux we use
> clock_gettime() for that. But we already have a fallback there for
> gettimeofday().
>
> Or in other words, the current APIs pa_rtclock_get(),
> pa_rtclock_hrtimer() is supposed to be the abstract API that has
> different backends on different systems. I'd very much prefer if any
> MacOS specific code would simply be plugged in there instead of
> creating various new abstraction interfaces!

Ok - what about the version below? I don't particularily like the

Daniel

>From 9f0a051953ec354ccdb8aa44a9845c408b26ae0b Mon Sep 17 00:00:00 2001
From: Kim Lester <kim@dfusion.com.au>
Date: Wed, 16 Sep 2009 14:40:01 +0800
Subject: [PATCH] Implement pa_rtclock_get() and pa_rtclock_hrtimer() for Darwin

OS X does not define clockid_t or clock_gettime() and friends.
Add wrappers to fix this. Based on a patch from Kim Lester
<kim@dfusion.com.au>.
2009-10-31 01:33:13 +01:00
Leszek Koltunski
65e8078a3b X11: attach X11 properties to Screen, not Display 2009-10-30 05:24:41 +01:00
Wim Taymans
056930cbcd svolume: fix MMX error
We need to sign extend the lower part of the multiplication before adding it to
the higher part. Makes -1 * 0xffff work again.
2009-10-30 05:09:15 +01:00