Commit graph

8141 commits

Author SHA1 Message Date
Arun Raghavan
2dbd6c0fe3 build: Move to using Travis trusty images 2015-12-21 11:21:17 +05:30
Tanu Kaskinen
e8d5a6af1e always-sink: simplify hook management with pa_module_hook_connect() 2015-12-21 05:37:28 +02:00
Yuri Chornoivan
22e5683bac i18n: Update Ukrainian translation 2015-12-20 14:27:13 +02:00
David Henningsson
613784d8ff gitignore: Add .orig and .rej to gitignore
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-12-18 13:34:46 +01:00
Pierre Ossman
04eb815753 context: continue without srbchannel if it fails
We might be compiled without eventfd support, or something else
might go wrong. And it's fully possible to continue using the old
channel rather than just disconnecting.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
2015-12-18 13:33:19 +01:00
Georg Chini
fc803b4883 loopback: Validate the rate parameter 2015-12-18 07:35:15 +02:00
Arun Raghavan
12b5e7c873 echo-cancel: Don't skip canceller when sink is inactive
This forces the canceller engine to be invoked even if playback is not
currently active. We need to do this for cases where the engine provides
additional processing that is independent of playback, such as noise
suppression and AGC.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=83557
2015-12-15 17:09:31 +05:30
Felipe Sateler
2c2c2676ee build-sys: Make pulsecore a private library
It is not meant to be used by third parties, so do not install in a public dir
2015-12-14 13:53:44 +01:00
Tanu Kaskinen
7b9fcc01f6 client-conf, daemon-conf: enable .d directories
I want to enable client.conf.d, because in OpenEmbedded-core we have
a graphical environment called Sato that runs as root. Sato needs to
set allow-autospawn-for-root=true in client.conf, but the default
configuration in OpenEmbedded-core should not set that option. With
this patch, I can create a Sato-specific package that simply installs
50-sato.conf in /etc/pulse/client.conf.d without conflicting with the
main client.conf coming from a different package.

daemon.conf.d is enabled just because it would be strange to not
support it while client.conf.d is supported.
2015-12-14 13:47:04 +01:00
Tanu Kaskinen
1d7ce90139 conf-parser: add support for .d directories
This allows a configuration scheme where after loading configuration
from "somefile", the parser loads configuration from files in
directory "somefile.d". This feature needs to be enabled on a per-file
basis, though, and this patch doesn't yet enable the feature for any
files.
2015-12-14 13:45:39 +01:00
David Henningsson
d97460045c typedefs.h: Move some typedefs to a separate file
The relationship between sinks, sources, cards, profiles, and ports
is becoming ever more intertwined, to the point that if you try to
include one file from the other, you're likely to end up with some
weird error somewhere else.

Work around this by creating a new typedefs.h, which does not depend
on anything else, and just creates a few typedefs.

(Can be expanded with more typedefs in the future if the need arises.)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-12-14 05:01:53 +02:00
Juho Hämäläinen
f61a16b8b1 alsa-mixer: Have valid proplist for synthesized path as well.
When synthesized alsa path is freed there is an assert from NULL
proplist. Create empty proplist for the path to fix.

Signed-off-by: Juho Hämäläinen <juho.hamalainen@nomovok.com>
2015-12-11 10:05:41 +01:00
Kamil Rytarowski
7f4acbd1c0 netbsd: Revamp NetBSD platform checks 2015-12-08 08:56:47 +05:30
Kamil Rytarowski
93cccdee8d core, pulse, modules: Fix undefined behavior with array subscript of invalid type
From the NetBSD manual:

     The first argument of these functions is of type int, but only a very
     restricted subset of values are actually valid.  The argument must either
     be the value of the macro EOF (which has a negative value), or must be a
     non-negative value within the range representable as unsigned char.
     Passing invalid values leads to undefined behavior.

     --  ctype(3)
2015-12-08 08:56:07 +05:30
Kamil Rytarowski
9dd77827ad core-rtclock: Add missing declaration of struct timespec 2015-12-08 08:50:10 +05:30
Tanu Kaskinen
74c9c41031 build-sys: fix PULSE_LOCALEDIR definition
On some systems (at least Arch) DATADIRNAME is not defined. This
caused PULSE_LOCALEDIR to point to a wrong directory. This seemed like
an issue introduced in 7.0, but probably something else was updated in
Arch at the same time, causing DATADIRNAME to become undefined,
because there were no changes between 6.0 and 7.0 that could have
caused this.

After noticing that localedir is a standard variable, my first idea
was to use pulselocaledir='${localedir}' in configure.ac, but Jan
Steffens pointed out that it causes the final PULSE_LOCALEDIR to
become "${prefix}/share/locale", that is, the variables weren't fully
expanded. I then found a FAQ item in Autoconf's manual[1], which
recommends not to define any absolute installation directories in
configure.ac, because the installation directories should be possible
to change when running make. The recommended solution is to define the
constant in AM_CPPFLAGS instead, so that's what this patch does.

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Defining-Directories.html
2015-12-07 10:41:37 +01:00
Tanu Kaskinen
96f4b4ffe3 core-util: improve comments in pa_machine_id() 2015-12-07 10:18:48 +01:00
Kiran Krishnappa
96b368b960 module: Remove redundant core argument from pa_module_unload()
pa_module_unload() takes two pointers: pa_module and pa_core.
The pa_core pointer is also available via the pa_module object,
so the pa_core argument is redundant

[David Henningsson: Rebased to git HEAD]
2015-12-07 09:31:58 +01:00
Kamil Rytarowski
cda1a5e897 netbsd: Fix unportable test(1) construct 2015-12-07 09:09:32 +01:00
Kamil Rytarowski
2d555ba15c netbsd: Improve handling of <locale> and <xlocale.h> headers
NetBSD ships with strtod_l(3) in <stdlib.h>.
Having strtol_l(3) doesn't imply to have <xlocale.h>.
Generalize inclusion of <locale.h> and <xlocale.h>.
2015-12-07 09:01:21 +01:00
Alexander E. Patrakov
04737989ec alsa-sink: Don't pretend to support passthrough on HDMI surround sinks
It doesn't work currently (fails and falls back to PCM), due to channel
count mismatch between the sink sample spec and the sample spec required
by IEC61937.

To be reverted when someone implements changing channel count without
switching profiles. This would also be required for HBR passthrough over
HDMI.

Reported-by: Xamindar <junkxamindar@gmail.com>
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
2015-12-04 17:40:24 +05:30
Tanu Kaskinen
d6b892efdc man: remove a reference to pacmd from default.pa.5
I don't want to have unnecessary advertising for pacmd, because I
think pacmd should be deprecated.
2015-12-04 08:00:24 +02:00
Tanu Kaskinen
8203423bdc man: document when system.pa is used instead of default.pa 2015-12-04 08:00:21 +02:00
David Henningsson
cd46a4ef06 card: Only update port's preferred profile if profile is saved
In case pa_card_set_profile is called with save=false, then probably
it makes more sense not to update the port's preferred profile as well.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-27 14:27:26 +01:00
Mingye Wang (Arthur2e5)
55f065301a i18n: Updated zh_CN translation
This patch updates zh_CN translation to 518 complete, 0 fuzzy and 3
untranslated.
2015-11-27 13:16:08 +02:00
Kamil Rytarowski
3753f50755 netbsd: NetBSD ships with paccept(2) a superset of Linux-specific accept4()
[diwic: Moved paccept to #bsd line in configure.ac]
2015-11-27 09:52:10 +01:00
Nazar Mokrynskyi
30a9523b75 alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-21, add Linux 4.3+ support
In 2.1 mode LFE is not actually working at all, so it is removed.
With Linux 4.3-rc1+ Mic/Line are hw:%f,0,0 as it should be: https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/usb?id=5ee20bc792467d7d612157e0a9962765aa943b08
So now we support both Linux 4.2.x- and 4.3-rc1+ setups.
Also in Linux 4.3-rc1 S/PDIF input was detected incorrectly (there is no such hardware input), so it is not present in config.
2015-11-26 18:31:48 +01:00
David Henningsson
bea37613ce module-card-restore: Remove "version" from internal entry struct
If we always write entries of the latest version, we can simplify
code a little by only handling old versions in the "entry_read"
function and assume we have the latest version everywhere else.

Suggested-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:32 +02:00
David Henningsson
e87100d41e module-switch-on-port-available: Route to preferred profile
This makes the routing slightly more aggressive:

 * It will try to route to another profile, if such a profile
   is preferred by the port.

 * It will allow changing profiles on transitions both to
   PA_AVAILABLE_YES and PA_AVAILABLE_NO

To accommodate there is also some refactoring.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:30 +02:00
David Henningsson
063a1d350f module-switch-on-port-available: Use input and output names
In case input or output names are filled in, we can use this to
get a better match in the profile_good_for_input/output functions
instead of guessing based on number of sources and channels.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:29 +02:00
David Henningsson
9059fb3b4e card-restore: Save and restore "preferred profile" of port
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:27 +02:00
David Henningsson
5c545ba38b card: Update preferred_profile for ports when profile changes
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:25 +02:00
David Henningsson
b1d9b4f62c device-port: Add preferred_profile field to pa_device_port
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:23 +02:00
David Henningsson
2a71fd7597 alsa-mixer: Fill in input and output names
Fill in input_name and output_name to make routing easier for
routing modules.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:21 +02:00
David Henningsson
b9818b016f card: Add variables for splitting up a profile
It can be useful for routing modules to know a profile's input
and output parts, in order to e g change output profile
while keeping the input profile unchanged.

For now filling in these fields is optional and a routing module
must be able to handle NULL in these fields.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-22 04:59:19 +02:00
Arun Raghavan
a01354db00 tests: Make echo-cancel-test not crash
Adding AGC broke this test, so we hard-disable the volume code in test
mode. This is probably okay for now, since at least with analog AGC, the
source volume changes and the data we get is going to be with AGC
applied, but digital gain won't be encapsulated here.

Long term, we might need to figure out how to deal with this properly.
2015-11-20 19:24:50 +05:30
Arun Raghavan
d084cf144a alsa: Use helper function for byte conversion across sample specs 2015-11-20 17:34:38 +05:30
Arun Raghavan
f5f6772364 source: Deal with filter having more channels than the master
Without this, we hit an assert because the channel count in
new_reference (which was inherited from the master) is lower than the
channel count of the filter.
2015-11-20 17:34:38 +05:30
Thomas Petazzoni
1c5005ef77 pulsecore/packet: avoid redefinition of pa_packet structure
packet.h defines:

  typedef struct pa_packet pa_packet;

and packet.c defines:

  typedef struct pa_packet {
    ...
  } pa_packet;

With old versions of gcc (such as gcc 4.5) this causes a redefinition
error at compile time:

pulsecore/packet.c:43:3: error: redefinition of typedef 'pa_packet'
pulsecore/packet.h:26:26: note: previous declaration of 'pa_packet' was here

In order to fix this, this commit changes the definition in packet.c
to just:

  struct pa_packet {
    ...
  };

This way, the contents of the structure remain opaque to users of
pa_packet outside packet.c, and the 'pa_packet' type remains usable.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91334

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-11-17 14:27:53 +01:00
Arun Raghavan
5504b26e1e sink: Make early drain reporting propagate down to filters
The drain reporting improvements that were added to alsa-sink were only
being applied to directly connected sink inputs. This patch makes the
same logic also recurse down the filter hierarchy, so drains are
acknowledged more accurately (and not late) even if there is a filter
sink in between.

Also does some minor reorganisation of the code and sprinkles in some
comments as documentation.
2015-11-17 16:13:25 +05:30
David Henningsson
107dfa8e01 alsa-mixer: Return early in case of no mixer poll descriptors
We encountered an alsa plugin a while ago (not sure if the source
can be shared) which had mixer controls, but no descriptors to
poll for changes.

Quit early to avoid latter assertion failures.

BugLink: https://bugs.launchpad.net/bugs/1092377
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-17 09:30:58 +01:00
Zbigniew Kempczyński
f621aa5e2c alsa-sink: Avoid unloading alsa-sink module before calling try_recover()
This fixes rare condition when pulseaudio client tries to rewind,
but a device previously reached underrun and was changed to XRUN state.
2015-11-14 09:50:34 +05:30
David Henningsson
a6bc996dc1 alsa-mixer: Add "Front Headphone" to headset mic path
The combination "Front Headphone" + "Headset Mic Phantom"
was found on one the machines we enable. Without this patch,
the headset mic appeared plugged in when nothing was plugged
into the jack.

BugLink: https://bugs.launchpad.net/bugs/1513384
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-11-06 15:30:30 +01:00
Arun Raghavan
3033fec287 build: Add IRC notifications to Travis 2015-11-06 19:50:08 +05:30
Arun Raghavan
3e0c30622b tests: Set appropriate timeouts for a couple of tests
sync-playback just had a much longer timeout than it should have, and
extended-test was using the default. We set the expected amount of time,
so the test is more correct (if it takes longer than this, something
probably actually broke).
2015-11-06 17:58:50 +05:30
Arun Raghavan
daf326a9e4 resampler: Don't expose soxr methods if they are not supported
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92780
2015-11-06 17:40:29 +05:30
Lev Melnikovsky
9d2b763e29 rtp: fix non null terminated string / non portable sscanf
In rtp.c:

if (sscanf(t+9, "%i %64c", &_payload, c) == 2)

the string c seems to be non-null terminated. It is later used as
following:

c[strcspn(c, "\n")] = 0;

The same piece of code is responsible for the inability of pulseaudio
on OpenWRT to handle RTP stream at the rate 48000 from another
machine:

[pulseaudio] sdp.c: Failed to parse SDP data: missing data.

It turns out that uClibc does not agree with glibc about "%64c", see
http://git.uclibc.org/uClibc/tree/docs/Glibc_vs_uClibc_Differences.txt

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=92568
2015-11-04 12:45:21 +02:00
Andrey Semashev
8fe9847706 soxr: Use soxr_clear() if libsoxr version is 0.1.2 or later.
The 0.1.2 version of libsoxr fixes soxr_process() crash after soxr_clear() is used, so check the library version at compile time and use soxr_clear() if possible.
2015-11-03 06:39:50 +01:00
Ahmed S. Darwish
4bda712ee1 scripts: Plot memory benchmarks using gnuplot
Now that we have memory usage benchmarks collected at our disposal,
introduce a gnuplot script to plot the newest version.

To avoid scaling issues, memory is plotted in a "double y axis" form,
with VM usage on the left, and dirty RSS memory usage on the right.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
2015-10-31 15:29:48 +02:00
Ahmed S. Darwish
c0f2e7d36a scripts: Introduce benchmark_memory_usage.sh
Add shell script to sample PulseAudio memory usage while increasing
the number of connected 'paplay' clients over time.

Linux kernel /proc/$PID/smaps Private and Shared_Dirty fields are used
to accurately measure the total size of used dirty pages over time.
This shall be useful for benchmarking the PA daemon's memory while
introducing new features like per-client SHM access and memfds.

Also add an empty benchmarks-collection directory 'benchmarks/'. All
output from the benchmarking tools shall be saved in this place, with
timestamps and symbolic links to the newest versions.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
2015-10-31 15:29:48 +02:00