Commit graph

29 commits

Author SHA1 Message Date
Arun Raghavan
d9624e0382 build-sys: Stop using symdef headers for modules
This removes the symdef header generation m4 magic in favour of a
simpler macro method, allowing us to skip one unnecessary build step
while moving to meson, and removing an 11 year old todo!
2017-12-12 12:58:52 +05:30
Colin Leroy
d8a2cef360 RAOP: Announce real latency
Use predefined values depending on the server, and make it configurable.
AirPlay is supposed to have 2s of latency. With my hardware, this is
more 2.352 seconds after numerous tests.
Switch from pausing/resuming the smoother to resetting it because the
smoother got stuck returning the same value after an idle/running cycle,
making latency calculation wrong.
2017-09-21 16:47:43 +03:00
Martin Blanchard
8022e56581 raop: Merge TCP and UDP code paths + refactoring
TCP and UDP implementation are following two diffrent code path while code
logic is quite the same. This patch merges both code path into a unique one
and, thus, leads to a big refactoring. Major changes include:
  - moving sink implementation to a separate file (raop-sink.c)
  - move raop-sink.c protocol specific code to raop-client.c
  - modernise RTSP session handling in TCP mode
  - reduce code duplications between TCP and UDP modes
  - introduce authentication support
  - TCP mode does not constantly send silent audio anymore

About authentication: OPTIONS is now issued when the sink is preliminary
loaded. Client authentication appends at that time and credential is kept
for the whole sink lifetime. Later RTSP connection will thus look like this:
ANNOUNCE > 200 OK > SETUP > 200 OK > RECORD > 200 OK (no more OPTIONS). This
behaviour is similar to iTunes one.

Also this patch includes file name changes to match Pulseaudio naming
rules, as most of pulseaudio source code files seem to be using '-'
instead of '_' as a word separator.
2017-01-19 03:10:19 +02:00
Martin Blanchard
31e2bc2fcf raop: Better playback resume handling
When playback stops, a FLUSH command is send to the server and the sink
goes to IDLE. If playback resumes quickly, sink goes back to RUNNING
(without being SUSPENDED) and the sink should just start streaming again.
This patch implements this behaviour.
2017-01-19 03:00:45 +02:00
Martin Blanchard
604bf450dc raop: Do not send audio before RECORD response
This patch prevents audio packets to be sent before the server
respond to the RECORD command.
2017-01-19 03:00:45 +02:00
Hajime Fujita
1e51282621 raop: Add UDP protocol handling
There are two versions in the RAOP protocol; one uses TCP and the
other uses UDP. Current raop implementation only supports TCP
version.

This patch adds an initial UDP protocol support for RAOP.
It is based on Martin Blanchard's work
(http://repo.or.cz/w/pulseaudio-raopUDP.git/shortlog/refs/heads/raop)
which is inspired by Christophe Fergeau's work
(https://github.com/zx2c4/pulseaudio-raop2).

Matrin's modifications were edited by Hajime Fujita, so that it
would support both TCP and UDP protocol in a single module.

Also this patch includes a fix that was found thanks to Matthias,
who reported that his ALAC
codec support fixed the issue.
https://bugs.freedesktop.org/show_bug.cgi?id=42804#c30
2017-01-19 03:00:45 +02:00
Martin Blanchard
6665acac56 raop: Cosmetic fixes / Match coding style
Reviewed-by: Anton Lundin <glance@acc.umu.se>
2017-01-19 02:56:53 +02:00
Tanu Kaskinen
60695e3d84 don't assume that pa_asyncq_new() always succeeds
Bug 96741 shows a case where an assertion is hit, because
pa_asyncq_new() failed due to running out of file descriptors.
pa_asyncq_new() is used in only one place (not counting the call in
asyncq-test): pa_asyncmsgq_new(). Now pa_asyncmsgq_new() can fail too,
which requires error handling in many places. One of those places is
pa_thread_mq_init(), which can now fail too, and that needs additional
error handling in many more places. Luckily there weren't any places
where adding better error handling wouldn't have been easy, so there are
many changes in this patch, but they are not complicated.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=96741
2016-12-20 01:19:06 +02:00
Ondrej Holecek
5effc83479 update FSF addresses to FSF web page
FSF addresses used in PA sources are no longer valid and rpmlint
generates numerous warnings during packaging because of this.
This patch changes all FSF addresses to FSF web page according to
the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html

Done automatically by sed-ing through sources.
2015-01-14 22:20:40 +02:00
Peter Meerwald
fa092af59c rtpoll: Drop extra wait_op argument to pa_rtpoll_run()
is always true, not used

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-09 22:53:06 +01:00
Tanu Kaskinen
b1c4e7bf6b raop: Don't use incompatible default sample spec parameters
Since the RAOP sink supports only some formats and channel counts, we
shouldn't blindly use pa_core.default_sample_spec. This patch changes
things so that we default to PA_SAMPLE_S16NE and 2 channels, and only
take the sample rate from pa_core.default_sample_spec.
2014-08-24 12:08:12 +03:00
Tanu Kaskinen
ee5e245afa Use pa_(c)volume_snprint_verbose() everywhere
All pa_cvolume_snprint(), pa_volume_snprint(),
pa_sw_cvolume_snprint_dB() and pa_sw_volume_snprint_dB() calls have
been replaced with pa_cvolume_snprint_verbose() and
pa_volume_snprint_verbose() calls, making the log output more
informative and the code sometimes simpler.
2013-07-09 17:37:04 +03:00
poljar (Damir Jelić)
d806b19714 Remove pa_bool_t and replace it with bool.
commands used for this (executed from the pulseaudio/src directory):
    find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
        -a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
        -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
        -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
        -a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
        -a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
        -exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
        -e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;

and:
    sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
        -e '181,194!s/\bTRUE\b/true/' -e \
        '181,194!s/\bFALSE\b/false/' pulsecore/macro.h
2013-07-04 12:25:30 +03:00
Arun Raghavan
e5953fb0dd modules: Micro-optimisation for rewind_requested paths
Since some devices can be chatty with regards to how often they return
from poll(), this adds a PA_UNLIKELY() to all the the rewind_requested
checks in our sink modules to make the general case (no rewind was
requested) the fast path.
2012-11-16 23:16:05 +05:30
Tanu Kaskinen
29f064aa3d sink: Process rewind requests also when suspended.
When a rewind is requested on a sink input, the request parameters are
stored in the pa_sink_input struct. The parameters are reset during
rewind processing, and if the sink decides to ignore the rewind
request due to being suspended, stale parameters are left in
pa_sink_input. It's particularly problematic if the rewrite_bytes
parameter is left at -1, because that will prevent all future rewind
processing on that sink input. So, in order to avoid stale parameters,
every rewind request needs to be processed, even if the sink is
suspended.

Reported-by: Uoti Urpala
2012-11-16 23:16:05 +05:30
David Henningsson
f0ad6fd413 raop: Don't crash if fd is not open when trying to close it
BugLink: http://bugs.launchpad.net/bugs/845286
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-09-14 09:23:38 +01:00
Maarten Bosmans
c5dca7cf2b More spelling fixes 2011-08-25 11:27:47 +01:00
Colin Guthrie
a9cf320bc1 devices: Set certain sink/source flags automatically.
Some sink flags are really just a product of what callbacks
are set on the device. We still enforce a degree of sanity
that the flags match the callbacks set, but we also set the
flags automatically in our callback setter functions to
help ensure that a) people use them and b) flags & callbacks
are kept in sync.
2011-07-20 22:20:37 +01:00
Colin Guthrie
ded07a5898 devices: Use wrapper functions to set the *_volume and *_mute callbacks.
This is not currently useful but future commits will make further
changes concerning automatic setting of flags and event delivery
that makes this structure necessary.
2011-07-19 19:50:43 +01:00
Maarten Bosmans
f0eab391df Remove obsolete description property from modules 2011-06-24 00:29:24 +01:00
Maarten Bosmans
dd9265ac78 Remove unnecessary #includes 2011-06-22 23:12:20 +01:00
Lennart Poettering
cdc2769162 thread: name all threads so that the names appear in /proc/$PID/task/$TID/comm 2010-05-07 23:58:59 +02: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
Lennart Poettering
8c31974f56 sink: volume handling rework, new flat volume logic
- We now implement a logic where the sink maintains two distinct
  volumes: the 'reference' volume which is shown to the users, and the
  'real' volume, which is configured to the hardware. The latter is
  configured to the max of all streams. Volume changes on sinks are
  propagated back to the streams proportional to the reference volume
  change. Volume changes on sink inputs are forwarded to the sink by
  'pushing' the volume if necessary.

  This renames the old 'virtual_volume' to 'real_volume'. The
  'reference_volume' is now the one exposed to users.

  By this logic the sink volume visible to the user, will always be the
  "upper" boundary for everything that is played. Saved/restored stream
  volumes are measured relative to this boundary, the factor here is
  always < 1.0.

- introduce accuracy for sink volumes, similar to the accuracy we
  already have for source volumes.

- other cleanups.
2009-08-19 02:55:02 +02:00
Lennart Poettering
fc33f7ee97 Merge most of elmarco/rtclock2
Merge commit 'e4d914c945'
2009-06-22 23:09:46 +02:00
Marc-André Lureau
125c528896 pulse: move pa_rtclock_now in pulsecommon 2009-06-20 17:29:08 +03:00
Lennart Poettering
32e2cd6d32 core: get rid of rt sig/timer handling since modern Linux' ppooll() is finally fixed for granularity 2009-06-19 21:00:06 +02:00
Marc-André Lureau
5dcdd5e358 perl -p -i -e 's/pa_rtclock_usec/pa_rtclock_now/g' find . -name '*.[ch]' 2009-06-19 19:04:04 +03:00
Lennart Poettering
c65ebeec1e raop: move all raop files to subdir 2009-06-17 15:09:28 +02:00
Renamed from src/modules/module-raop-sink.c (Browse further)