Commit graph

8115 commits

Author SHA1 Message Date
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
Peter Mattern
01aec46fb4 pacmd: Fix typo in set-default-* help
which was causing faulty output when running 'pacmd --help' on the shell
2015-10-30 18:47:16 +05:30
David Henningsson
9fecb6eb32 volume: Add LFE balance API
The gnome/unity-control-center UIs have a master volume slider, and
three sub-sliders: balance, fade, and subwoofer. Balance and fade
use PA's set_balance and set_fade APIs accordingly, but the subwoofer
slider sometimes does unintuitive things.

In order to make that slider behave better, let's add a LFE balance
API that these volume control UIs can use instead. With this API,
the UI can balance between "no subwoofer" and "only subwoofer" with
"equal balance" in the middle, which would make it more consistent
with the behaviour of the other sliders.

BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=753847

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-30 09:13:10 +02:00
David Henningsson
387a244cd9 volume: Refactor get/set balance/fade
get/set balance and fade use very similar code, so refactor out
common parts.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-30 09:13:07 +02:00
Tanu Kaskinen
69af1a713d alsa-ucm: fix pa_device_port.profiles leak
pa_device_port.profiles is initialized in pa_device_port_new(), so no
need to do that in alsa-ucm.c.
2015-10-26 10:14:57 +01:00
Georg Chini
2902cdc4ca null-sink: correct update of timestamp when state changes to RUNNING or IDLE
u->timestamp should be reset to "now" when the sink state changes from
INIT or SUSPENDED to IDLE or RUNNING.
Thanks to Olivier Delbeke for reporting the bug and testing the patch.
Bug report is here:
http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024553.html
2015-10-25 16:36:51 +02:00
David Henningsson
fcbbe34e00 alsa-mixer: Ignore volume with unexpected number of channels
We currently only support one and two channels for volumes, and
bail out otherwise. This makes Xonar users unhappy because they
have a volume with eight channels, and bailing out means they
don't have a path/port at all.

This way they will at least have a port, which will in turn make
the gnome/unity UI behave better.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=84983
BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=745017
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-23 14:40:55 +03:00
Julien Isorce
9817f396d5 thread-mainloop: keep SIGSYS unblocked if currently trapped
Seccomp-BPF uses SIGSYS signal to trigger
the trap handler attached to sys_open.
If the signal is blocked then the kernel kills
the process whenever pulse audio calls 'open'.
The result backtrace is terminating in sys_open.

That's why it is required to keep SIGSYS unblocked
if it is currently unblocked and trapped.

This patch allows to have pulse audio working
in the Chromium sandbox.

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Signed-off-by: Arun Raghavan <git@arunraghavan.net>
2015-10-21 09:45:26 +05:30
Ross Burton
c25b06577c git-version-gen: Avoid further processing when tarball-version is present
In case a tarball-version file is present, use that and quit.

Otherwise git will continue looking for directories, potentially
finding .git directories which are dirty and mark the version as such.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90936
2015-10-20 16:55:23 +02:00
David Henningsson
f277f2c509 pstream: Fix use-after-free in srb_callback
We need to guard the pstream with an extra ref to ensure
it is not destroyed at the time we check whether or not the
srbchannel is destroyed.

Reported-by: Takashi Iwai <tiwai@suse.de>
BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=950487
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-20 16:53:32 +02:00
David Henningsson
91313e60a8 module-alsa-card: Report available ports before unavailable ones
In case the same jack causes one port to become available and another
one unavailable, the available should be reported first.

This is to avoid unnecessary changes: e g, consider a 'Headphone Jack'
making 'Headphone' available and 'Speaker' unavailable. In case the
unavailable change triggers first, and there is also a currently available
third port (e g 'Digital out'), the routing system might choose to route
to this port because neither of the 'Speaker' and 'Headphone' ports are
available.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-20 13:13:03 +03:00
John Horan
f8cd444de0 make availability of ports visible over dbus 2015-10-19 11:02:44 +02:00
Juho Hämäläinen
2261567758 dbus: Add card profile availability info to API
[diwic: Profile availability to boolean bug fixed]
2015-10-19 10:57:35 +02:00
Julien Isorce
c021bfc6e0 core-util: avoid calling fchmod if already right mode
fchmod is denied in chromium sandbox.
2015-10-19 08:53:40 +05:30
David Henningsson
336a2cc6f0 card: Use pa_xmalloc0 when creating card profiles
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-10-16 22:05:55 +03:00
David Henningsson
12a93495b9 shm: Warn on not being able to open shm files
With the exception of when trying to clean up shm files,
it's useful to warn if opening them fails, regardless of reason.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-09-28 15:41:15 +02:00
David Henningsson
586ea6fcba card: Use pa_xnew0 when creating a card
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-09-28 14:37:49 +02:00
David Henningsson
0284363aa1 client: Use pa_xnew0 when creating a client
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-09-28 14:36:23 +02:00
Tanu Kaskinen
772d655de6 build-sys: fix the default bash completion directory
If bashcompletiondir was empty, the check didn't catch that. As
a result, the symlinks that were supposed to be generated in the
completion directory were created in the root directory.
2015-09-27 17:02:17 +03:00
Ahmed S. Darwish
08959f83d0 build-sys: bootstrap.sh: Do a make only if configure has succeeded
Otherwise the important configure script error messages get buried
by the "make clean" output.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
2015-09-25 15:05:43 +03:00
Tanu Kaskinen
e061f9afd2 alsa-mixer: Add "Dock Line Out" jack handling to analog-output-speaker-always
The jack is already in analog-output-speaker, so let's have the same
handling in analog-output-speaker-always too.
2015-09-25 15:05:43 +03:00
Takashi Iwai
4a9916ba15 alsa-mixer: Recognize "Dock Line Out" jack
Some machines provide "Dock Line Out Jack" control that should be
handled like a normal line out.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-09-25 15:05:43 +03:00
Manish Sogi
ff24ea7695 bluetooth: bluez4: Remove the unused "auto_connect" parameter as it is not used in bluez4
<EP-F69A421D31544C56BDE97C590307C014>
Signed-off-by: Manish Sogi <manish.sogi@samsung.com>
2015-09-25 15:05:43 +03:00
David Henningsson
4a8bf9ab30 alsa-mixer: Add "Mic Boost" and "Line Boost" to analog-input.conf
I'm not sure how much they are needed nowadays with the latest
changes to the subset elimination (I found this while
researching a bug on an older PA version), but I guess they could
be added for consistency at least.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-09-25 15:05:43 +03:00
Ahmed S. Darwish
5d4905ec31 log: Fix compilation error on non-systemd systems
Commit 262bdae0330e used symbols which are only available if systemd
support was compiled in. Fix by using the appropriate #ifdef guards.

Also document the resulting PULSE_LOG_JOURNAL environment variable
behavior if systemd journal support was not compiled in.

[Diwic: changed wording slightly.]

Reported-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
2015-09-25 15:05:43 +03:00
Ahmed S. Darwish
ac5b7b8d5c log: Introduce PULSE_LOG_JOURNAL environment variable
By introducing such an environment variable, applications using the
PA client libraries can configure these libraries to send their logs
directly to the journal.

While client libraries journal logging can be indirectly achieved
using PULSE_LOG_SYSLOG, this pollutes the journal. Meta data gets
replicated twice: once in the journal meta fields and once in the
syslog(3) plain-text message itself.

For attaching any backtraces, also introduce the PA-specific journal
meta field PULSE_BACKTRACE. This is the recommend journal practice
instead of appending any furuther data to the logging message itself.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
2015-09-25 17:29:03 +05:30
Felipe Sateler
c93903d99a pulseaudio.1: document that systemd notification only works without daemonization 2015-09-25 17:29:03 +05:30