Commit graph

7165 commits

Author SHA1 Message Date
Tanu Kaskinen
248a77c7fd alsa-mixer: recognize the "Speaker Jack" control
This control has been seen in the wild:
https://lists.freedesktop.org/archives/pulseaudio-discuss/2017-August/028595.html
(The pastebin link in that mail might not work anymore, but the paste
just shows that there's a Speaker Jack control).
2019-10-26 16:21:27 +03:00
Felipe Sateler
64b259c2c9 qpaeq: use python3 instead of python 2
The script was already compatible, so lets just switch interpreter
2019-10-25 08:39:03 -03:00
Felipe Sateler
f3609ee3d0 qpaeq: Drop unused imports
Neither sip nor PyQt5 are used. From PyQt5 we only use the named imports just below
2019-10-25 08:34:59 -03:00
Peter Levine
e4450d8b58 atomic: Explicitly cast void* to unsigned long 2019-09-26 15:05:53 +03:00
Rasmus Thomsen
bff163089c meson: link libintl if it's not provided by libc
This fixes the build on musl with external gettext
2019-09-25 04:42:03 +00:00
Tanu Kaskinen
d72a3a5eca null-sink: allow clients to configure the supported formats
The set_formats() callback is already implemented, so the only thing
missing was the SET_FORMATS flag.
2019-09-24 02:36:56 +00:00
ckdo
0d22558b47 raop: Fix non working tcp mode 2019-09-24 02:29:59 +00:00
Tanu Kaskinen
ba73faa4c0 daemon-conf: disable flat-volumes by default
Almost all distributions patch the configuration to disable
flat-volumes, because users tend to find the concept confusing (and it
also causes nasty surprises when some application pushes the volume to
100%). Let's remove the need for patching and disable the feature by
default.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/691
2019-09-23 07:48:48 +03:00
Tanu Kaskinen
3dff31e19c alsa-mixer-path-test: Hide unused functions when building with Meson
Silences these warnings:

[509/574] Compiling C object 'src/tests/a4ccf2d@@alsa-mixer-path-test@exe/alsa-mixer-path-test.c.o'.
../src/tests/alsa-mixer-path-test.c:24:20: warning: ‘load_makefile’ defined but not used [-Wunused-function]
 static pa_strlist *load_makefile() {
                    ^~~~~~~~~~~~~
../src/tests/alsa-mixer-path-test.c:17:20: warning: ‘get_default_paths_dir’ defined but not used [-Wunused-function]
 static const char *get_default_paths_dir(void) {
                    ^~~~~~~~~~~~~~~~~~~~~
2019-09-20 17:10:57 +03:00
Jan Alexander Steffens (heftig)
7e039c4ff7 meson: Define TUNNEL_SINK for module-tunnel-sink
This was missing, so it was building another tunnel-source instead.

Fixes https://bugs.archlinux.org/task/63755
2019-09-20 12:18:11 +00:00
Jan Alexander Steffens (heftig)
2619ddad57 autotools: Put module-tunnel-source X11_CFLAGS into CFLAGS instead of LDFLAGS
Seems this happened because the order of automake variables for modules
is not consistent.
2019-09-20 15:03:57 +03:00
Nicolas Fella
68f5bf86bc daemon: Drop KDE-specific loading of module-device-manager
Newer versions of Plasma no longer use this module, and the consensus
seems to be that module-switch-on-connect works better for most cases.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/509
2019-08-30 11:07:52 +00:00
Carlos Garnacho
79a8efb45c client-conf: Avoid loading X11 properties unless SSH_CONNECTION is set
Reading properties from the X11 root window is meant to provide 1:1 results
with reading the configuration directly in the local case. This configuration
is essentially different only in remote cases.

Add an extra check for the SSH_CONNECTION envvar, so we don't even need
opening a X11 display connection for IPC in the most usual case.
2019-08-27 08:27:16 +00:00
David Emett
b76f668253 dbus: fix ActiveProfile setting
Just like with handle_set_active_port, we need to look up the profile
corresponding to the provided path rather than doing a name comparison.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/709
2019-08-27 08:51:27 +05:30
Pali Rohár
bdf66c4693 bluetooth: Only perform write-related calculations when we have a sink
This avoids a potential divide-by-zero when we try to decide how much to
write to the sink in the source thread when there is no sink.

Fixes https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/717
2019-08-27 08:44:27 +05:30
Arun Raghavan
a7caa9d393 build-sys: meson: Give ourselves a little more timeout headroom
We're seeing CI failures due to once-test sometimes taking long. Let's
give ourselves a little more space per test (2 min -> 5 min) to avoid
this.
2019-08-17 16:14:45 +05:30
RODRIGUEZ Christophe
2e7c0ee8f8 raop: Fix infinite loop in raop-sink with UDP mode
There are potentially unresolved issues around the EAGAIN logic, but
this should prevent an infinite loop and log flood in the mean time.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/695
2019-08-17 10:43:20 +00:00
Arun Raghavan
0f1920f337 build-sys: meson: Add mkfifo checks for module-pipe-* 2019-08-15 18:57:13 +05:30
Arun Raghavan
1e996445f7 build-sys: meson: Add atomic ops related checks 2019-08-15 18:57:13 +05:30
Lucas Stach
1911ef16e2 meson: allow to build bluez support without libbluetooth
pulseaudio does not link against libbluetooth, as it's only talking to the
bluez daemon over dbus. So the build dependency on libbluetooth is overly
restrictive, as some embedded systems choose to ship without libbluetooth
but still have bluez daemon support.

This syncs the meson to the autotools configuration behavior by changing
the bluez option to a default on boolean.
2019-08-14 10:16:34 +02:00
Lucas Stach
eb70672c56 meson: fix build files list when building with NEON
Sync the meson NEON build files list with the autotools build
sources list. Fixes "ERROR: File svolume_neon.c does not exist."
2019-08-14 10:16:34 +02:00
Jan Alexander Steffens (heftig)
728a4402eb
build-sys: meson: Fix 2 cases of joining paths w/o join_paths
Fixes https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/712
2019-08-13 22:10:44 +02:00
Jan Alexander Steffens (heftig)
493e7f3582
build-sys: meson: Add some missing checks
- Header and function checks from configure.ac
  (some libc, some libpthread, dladdr from libdl)
- Find iconv and check constness
2019-08-09 23:11:24 +02:00
Russell Treleaven
91fb54dab1 add script to collect information for bug reports 2019-08-09 12:31:48 +00:00
Arun Raghavan
6a1addf35c build-sys: Move svolume-*.c to libpulsecore
The various software volume implementations were being built as part of
libpulsecommon for some reason. These should only ever be used in the
daemon, so they should be in libpulsecore.
2019-08-05 14:19:27 +05:30
Arun Raghavan
f52baffeb5 build-sys: meson: Fix minor typo in orc build 2019-08-05 14:09:44 +05:30
Arun Raghavan
0d7e351fba build-sys: meson: Add symbol versioning as in autotools
Adds the -version-script linker argument that we use with autotools to
version symbols in our public API.
2019-08-05 10:40:25 +05:30
Arun Raghavan
34a8c3aa70 build-sys: meson: Fix some defines for default.pa generation
Removes a warning from HAVE_GCONF not being set, and fixes generation of
a large section that depends on OS_IS_WIN32 being explicitly set to 0.

We can't set OS_IS_WIN32 to 0 by default since a bunch of code uses it
via an ifdef rather than by value.
2019-08-05 10:30:50 +05:30
Arun Raghavan
7f44a623e0 build-sys: meson: Correctly set up RPATH
This was being done automatically by autotools, now we need to manually
specify this for each executable/library with a dependency in a
non-standard directory.
2019-08-05 09:52:32 +05:30
Arun Raghavan
f996ad0688 build-sys: meson: Add -Wl,no-delete to relevant libraries
This mirrors the autotools option for all server-side dynamic libraries.
2019-08-05 09:52:32 +05:30
Jan Alexander Steffens (heftig)
9f946d2d11 meson: Fix installation of headers
To match Autotools:
 - internal.h should not be installed
 - Install simple.h and version.h
2019-07-25 16:53:01 +00:00
Jan Alexander Steffens (heftig)
8e98ed9493 meson: Fix library versioning to match Autotools
For ease of maintaining both build systems, use the same version info
sequences as configure.ac. This should be simplified after Autotools has
been dropped.
2019-07-25 16:53:01 +00:00
Jan Alexander Steffens (heftig)
09231eaead meson: Fix build of padsp
- Rename "pulsedspdir" to the same "padsplibdir" that Autotools uses.

 - Add a new option "pulsedsp-location" that is only used for padsp.in,
   just like Autotools' --with-pulsedsp-location.

 - Use 'set' instead of 'set_quoted' to avoid PULSEDSP_LOCATION getting
   quoted twice.
2019-07-25 16:53:01 +00:00
Pali Rohár
9e70d05201 bluetooth: Fix usage of RTP structures in SBC codec
Rename struct rtp_payload to rtp_sbc_payload as it is specific for SBC
codec payload.

Add proper checks for endianity in rtp.h header and use uint8_t type
where appropriated.

Field frame_count is only 4 bit number, so add checks to prevent overflow.

And because is_fragmented field is not parsed by decoder there is no
support for decoding fragmented SBC frames. So throw an error in this case.
2019-07-24 17:29:45 +03:00
Pali Rohár
064277b4ee bluetooth: Change A2DP codec API of reset() method to indicate failure
SBC codec reset() method may fail, so propagate this failure to caller.
2019-07-24 17:29:45 +03:00
Pali Rohár
018b38ec39 bluetooth: Fix usage of MTU, buffer sizes and return values of encode/decode methods
Add explanation why minimal bitpool value is used in SBC codec as initial
bitpool value for A2DP source.

Set buffer size for reading/writing from/to A2DP socket to exact link MTU
value. This would ensure that A2DP codec does not produce larger packet as
maximal possible size which can be sent.

Because A2DP socket is of SOCK_SEQPACKET type, it is guaranteed that
we do not read two packets via one read/recvmsg call.

Properly check for all return values of encode/encode methods of A2DP codec
functions. They may fail at different levels. Also encode or decode API
method may return zero length buffer (e.g. because of algorithmic delay of
codec), so do not fail in this case.
2019-07-24 17:29:45 +03:00
Georg Chini
3929798a53 Commit fd9e3452 removed -ffast-math from the compile flags. Under some
conditions this may lead to massive slowdown of floating point operations
when underflows or denormals are encountered. In particular, this problem
was observed with the soxr resampler after applying
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/120

Therefore this patch adds -ffast-math to the link flags of the pulseaudio
daemon. Linking with -ffast-math adds a procedure set_fast_math() to the
startup code of the daemon. On x86, the procedure sets bit 6 and 15 of the
mxcsr register. When these bits are set, denormals and results of
underflowing operations are truncated to 0.
2019-07-23 20:48:23 +00:00
S Page
6e392ae84f pasuspender: explain program argument in help
Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/706
2019-07-16 06:23:50 +00:00
Arun Raghavan
e8fe04b2f6 svolume: Mark channel parameter as earlyclobber
For all our MMX/SSE code, we use a temporary channel variable, assigned
to the DI register, which is zero'ed as the very first operation in the
inline assembly code, before any other code is run.

With GCC 9.1, while using -O2, the DI register is also used for the
input operand. This is perfectly legal, but causes our code to become
incorrect because the output operand that is assigned to DI is not
explicitly marked as being clobbered before inputs are read.

This change fixes the problem by adding an earlyclobber annotation (&)
to the DI output argument.
2019-07-15 13:50:16 +00:00
Kaleb Ercanbrack
e34dd0fb8f alsa-mixer: Add a missing USB product ID for SteelSeries Arctis 7 2019-07-11 14:09:58 +00:00
Jan Alexander Steffens (heftig)
474e615d20
build-sys: Install cmedia-high-speed-true-hdaudio.conf
This profile set was missing from the installation.
2019-07-11 08:45:19 +02:00
Arun Raghavan
2ed4f388de core-util: Fix detection when running in a VM
The original code that was written was trying to detect what hypervisor
we were running under, rather than testing the presence bit first. We
don't really need the former, so let's use the more comprehensive latter
instead.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/684
2019-07-04 07:13:51 +00:00
Georg Chini
4c6bab4353 sink-input: fix rewriting render memblockq when nothing should be rewound
If process_rewind() is called with nbytes = 0, process_rewind() will
nevertheless request a rewrite of the render memblockq.

This patch fixes the problem by adding the render memblockq length to the
rewrite amount only if nbytes > 0.
2019-07-03 10:52:20 +00:00
Georg Chini
1240afabfa source-output: Fix rewinding bug
Currently the rewind logic for the source output is broken if the output
does not implement a process_rewind() callback. In that case, the read
index of the delay memblockq is rewound. This is wrong, because the data
that is going to be re-written was not yet read. Instead the write index
should be rewound and the read index left untouched. This is the reason
for the rewind glitches of monitor sources.
2019-07-03 10:52:20 +00:00
Frédéric Danis
f89d64b98e bluetooth: Fix crash when disabling Bluetooth adapter
This crash occurs when PA is connected to a phone through the oFono
backend.
When disabling the Bluetooth adapter, pa_bluetooth_device is removed before
hf_audio_card. Both keep refs on pa_bluetooth_transport. Those removal will
call pa_bluetooth_transport_free() from device_free() (bluez5-util.c) and
hf_audio_card_free() (backend-ofono.c).
In the end, the call to pa_bluetooth_transport_free() calls
pa_hasmap_remove() through pa_bluetooth_transport_unlink(), but since
memory has already been freed, the second try results in a segfault.

Triggering hf_audio_card removal during pa_bluetooth_device removal allows
hf_audio_card to be freed at the right time.
2019-07-02 06:06:07 +00:00
Frédéric Danis
661b13d50d bluetooth: Fix crash in setup_stream()
setup_stream() crashes when calling set_nonblock() with an invalid
stream_fd.

On a new call, the ofono backend gets notified of a new connection.
The ofono backend sets the transport state to playing, and that triggers
a profile change, which sets up the stream for the first time.
Then module-bluetooth-policy sets up the loopbacks. The loopbacks get
fully initialized before the crash.

After module-bluetooth-policy has done its things, the execution
continues in the transport state change hook. The next hook user is
module-bluez5-device, whose handle_transport_state_change() function
gets called. It will then set up the stream again even though it's
already set up. I'm not sure if that's a some kind of a bug.
setup_stream() can handle the case where it's unnecessarily called,
though, so this second setup is not a big problem.

The crash happens, because the connection died due to POLLHUP in the IO
thread before the second setup_stream() call.
2019-07-02 08:22:19 +03:00
Alan Coopersmith
4be2625ef8 core-util: Use /proc/fd on Solaris as well in pa_close_all
Gets rid of > 65,000 unnecessary close() syscalls

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-07-01 01:37:04 +00:00
Tanu Kaskinen
6f8bf764a1 main: Log more information when executing default.pa fails
"Failed to initialize daemon" is not as informative message as it could
be. This change was inspired by the discussion in this bug:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/597
2019-06-22 10:13:58 +00:00
Topi Miettinen
279b99e101 daemon: Harden systemd service
Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2019-06-17 11:44:35 +03:00
Tanu Kaskinen
4e08c14cc3 a2dp-codec-sbc: get rid of compiler warnings
The warnings:

modules/bluetooth/a2dp-codec-sbc.c: In function ‘default_bitpool’:
modules/bluetooth/a2dp-codec-sbc.c:161:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             switch (mode) {
             ^~~~~~
modules/bluetooth/a2dp-codec-sbc.c:169:9: note: here
         case SBC_SAMPLING_FREQ_44100:
         ^~~~
modules/bluetooth/a2dp-codec-sbc.c:170:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             switch (mode) {
             ^~~~~~
modules/bluetooth/a2dp-codec-sbc.c:180:9: note: here
         case SBC_SAMPLING_FREQ_48000:
         ^~~~

These were valid warnings in that an invalid channel mode would result
in unintended fallthroughs, but the end result would anyway been a crash
in the pa_assert_not_reached() at the end of the function, so
functionally there's no change.
2019-06-16 12:12:31 +03:00