Commit graph

7002 commits

Author SHA1 Message Date
Peter Hutterer
c03fedbac2 doc: reword the Design page 2021-07-29 14:43:40 +10:00
Peter Hutterer
6da0ee6cb5 doc: move the overview page out to its own page
This is a good first (top) page to have in the docs, let's move it out
from the pipewire heading.

This doesn't change any of the links and the renaming isn't required
(subpage controls whether it's a top-level item and the meson.build
 order decides its spot in he list). Still, better to have the filenames
represent the layout.
2021-07-29 14:33:09 +10:00
Peter Hutterer
85435cd525 doc: improve the pipewire-audio page for readability
Typos, some header changes, etc.
2021-07-29 14:26:01 +10:00
Peter Hutterer
7871f33da6 doc: remove the Pipewire prefix from some of the doc pages 2021-07-29 14:26:01 +10:00
Peter Hutterer
f0152b6a0a doc: add the new documentation pages to the docs
And make them a subpage of the Pipewire topic
2021-07-29 14:25:01 +10:00
Peter Hutterer
4e90760155 spa: silence a doxygen warning
warning: documented symbol 'spa_log_error foo' was not declared or defined.
2021-07-29 14:03:00 +10:00
Wim Taymans
44583367db pod: add prop option to avoid fixation
Add a DONT_FIXATE flag to spa_pod_props. The flag avoids fixation
of the property by spa_pod_fixate().

When filtering properties, 'and' the flags together in the filtered
property. This mostly preserves the merged property flags. It also
merges the DONT_FIXATE flags so that when both sides can handle
the non-fixated result, it will be returned.

This can be used to let PipeWire filter out the common property
fields and leave the final selection of fields to the producer. This can
only work when the final selected field can be transported in some
other way than the format param, like on the buffer fields or in
metadata. One use case is negotiation of the DMABUF modifiers.

See #1084
2021-07-28 11:03:26 +02:00
Wim Taymans
4e087caa2b jack: add per client match rules
This makes it possible to configure per client settings such as
latency and later also to lock the quantum for certain clients.

See #1456
2021-07-27 17:57:30 +02:00
Wim Taymans
d2826a5dab jack: emit client unregister event
Because we only remove the client from the list after doing the lookup,
we will always find the removed node and the unregister event is
never called.

Fix this by marking the object as removing so that the lookup function
can skip the nodes being removed.
2021-07-27 12:07:33 +02:00
Wim Taymans
8e8cb34dc2 protocol: don't place sockets in $HOME
No server will put them there and no client will look for it there.
2021-07-27 10:57:31 +02:00
Peter Hutterer
b70a3dca85 protocol-native: don't initialize sockets in $HOME
Leaving sockets in the home directories is bad form, so let's not do
this.

This effectively requires XDG_RUNTIME_DIR to be set for pipewire to
work - it is set correctly on most setups anyway and on custom setups
this needs to be addressed with a custom environment.

Fixes #1443
2021-07-27 08:23:23 +00:00
Peter Hutterer
5c78cbd356 ci: add a build test for buildtype=release 2021-07-27 10:24:44 +10:00
Peter Hutterer
49f3d5842e test: replace all spa_assert() macros with spa_assert_se()
These are tests, we never want those to be optimized away.
2021-07-27 10:24:44 +10:00
Peter Hutterer
63d833dabf spa: use spa_assert_se() for bugs in the util string functions
These are programming bugs that should never happen, so let's always
abort.
2021-07-27 10:24:44 +10:00
Wim Taymans
40f1d2b881 jack: only call callbacks when active
JACK applications expect the callbacks only when activated.

Fixes #1461
2021-07-26 23:03:55 +02:00
Wim Taymans
dd5b460daa client-node: remove custom target signal
The target signal is called when the peer nodes are ready and this
node needs to be scheduled. It is the in-process version of the
signal.

Remove our custom version that, just like the default version, schedules
the node implementation but doesn't do any accounting.

Makes pw-top report driver stats for bluetooth devices.

Fixes #1450
2021-07-26 15:46:21 +02:00
Wim Taymans
9f6890e10e pulse-server: improve stream cleanup
First disconnect the stream this ensures no more process events are
called. Then flush out the pending events, then destroy the stream.

Fixes #1451
2021-07-26 11:48:00 +02:00
Wim Taymans
78f52a7073 loop: avoid corruption of ringbuffer
The ringbuffer can't be written to from multiple threads.

When both the main loop and data thread do _invoke, they both write to
the ringbuffer and cause it to be corrupted because the ringbuffer is
not multi-writer safe.

Doing invoke from the thread itself is usually done to flush things out
so we really only need to flush the ringbuffer and call the callback.

See #1451
2021-07-26 11:39:48 +02:00
Wim Taymans
d1905716e4 impl-node: Split ALWAYS_PROCESS and WANT_DRIVER handling
Make a new PW_KEY_NODE_WANT_DRIVER to assign the node to a running
driver. (does not work yet)
Use a new variable to hold the ALWAYS_PROCESS setting and also
update want_driver.
This makes things it a bit more future proof.
2021-07-26 10:38:06 +02:00
Wim Taymans
62fa0823ec modules: virtual sink/sources need driver
Virtual sinks and sources implemented with streams need to be grouped
with a driver node to be able to schedule. We don't have a way to let it
use a default driver so add it to the pipewire.dummy driver.

This fixes stalled pipe and other streams streams.

Fixes #1407
2021-07-26 10:21:44 +02:00
Wim Taymans
16faacec92 pulse-server: don't compare string pointers
We always want to clear the provided blocklist from the properties. The
logic tries to only clear when there was a blocklist but it checks this
by comparing the string pointer to the fallback, which gives a compiler
warning.
2021-07-26 09:39:55 +02:00
Wim Taymans
ab99f4d027 doc: add general audio configuration 2021-07-26 09:35:05 +02:00
Barnabás Pőcze
b6405b761f pulse-server: use sizeof() instead of hard-coding
Use `sizeof("/pid")` instead of hard-coding 5
in the condition.
2021-07-25 15:17:08 +02:00
Barnabás Pőcze
627ef37a77 pulse-server: use pid_t where appropriate
Instead of `int`, use the `pid_t` type to represent
process identifiers.
2021-07-25 15:17:08 +02:00
Barnabás Pőcze
2d27497045 pulse-server: use S_ISDIR()
Use the `S_ISDIR()` macro instead of `S_IFMT` and bitwise operations
to make the code simpler.
2021-07-25 15:17:08 +02:00
Barnabás Pőcze
e90a70fd49 pulse-server: check if a runtime directory could be found
Print an error message and return an error code if all
options have been exhausted without success.
2021-07-25 15:17:08 +02:00
Barnabás Pőcze
30e3884a75 pulse-server: add another check for the return value of snprintf()
In addition to checking if the resulting string would
be too long, also check whether or not snprintf failed.
2021-07-25 15:17:08 +02:00
Barnabás Pőcze
67b422fa18 pulse-server: fix potential use of dangling pointer
`getpwuid_r()` puts the strings pointed to from the returned
passwd struct into the specified buffer. Previously, that
buffer technically didn't live long enough to be usable
in the `snprintf()` call - although in practice this didn't
appear to be a problem. A particular version of GCC 11 generates
the same machine code for this function regardless whether
this patch is applied or not. Still, fix this by moving
the buffer to an outer scope.
2021-07-25 15:17:08 +02:00
Peter Seiderer
6af1388d66 meson: fix getrandom detection for uclibc
The getrandom() detection from meson.build fails with the following error
message:

  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t'
     27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
        |                                   ^~~~~~
  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?

Fix it by adding stddef.h include to the meson getrandom() detection.

Fixes:

  ../src/pipewire/impl-core.c:54:9: error: conflicting types for ‘getrandom’
     54 | ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) {
        |         ^~~~~~~~~
  In file included from ../src/pipewire/impl-core.c:34:
  .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:12: note: previous declaration of ‘getrandom’ was here
     27 | extern int getrandom(void *__buf, size_t count, unsigned int flags)
        |            ^~~~~~~~~

[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/pipewire/0001-meson-fix-getrandom-detection-for-uclibc.patch]
2021-07-25 11:17:41 +00:00
Philippe Normand
8b5601947c gst: Fix logging in buffer_recycle()
The first argument should be a GObject. GstMiniObjects are not GObject.
2021-07-25 11:17:18 +00:00
Pauli Virtanen
1f0934862a bluez5: add device to blocklist 2021-07-25 11:16:36 +00:00
Pauli Virtanen
777bc89d02 pipewire-pulse: add module-switch-on-connect
module-switch-on-connect sets the configured default sink/source
whenever suitable new sink/sources appear.

This should give the same behavior as Pulseaudio's module.

This module exists mainly to provide a workaround e.g. for desktop
environments such as XFCE, whose mixer applications try to manage the
default devices assuming fully PA-like behavior, breaking default
pipewire output switching.
2021-07-24 18:51:57 +03:00
Pauli Virtanen
606108f409 spa: add spa_strstartswith 2021-07-24 14:36:03 +03:00
Wim Taymans
0346c616e2 doc: add midi doc
Reorganize the docs a little. First a short intro, then list the use
cases, then the responsabilities of the various components, then
the implementation in various places.
2021-07-23 11:05:59 +02:00
Javier Martinez Canillas
76cb5c1169 libcamera: remove unused buffer variable in LibCamera::stop()
To fix build warning about a variable being unused in LibCamera::stop():

[1/2] Compiling C++ object spa/plugins/libcamera/libspa-libcamera.so.p/libcamera_wrapper.cpp.o
../spa/plugins/libcamera/libcamera_wrapper.cpp: In member function ‘void LibCamera::stop()’:
../spa/plugins/libcamera/libcamera_wrapper.cpp:531:58: warning: unused variable ‘buffer’ [-Wunused-variable]
  531 |                 for (const std::unique_ptr<FrameBuffer> &buffer : this->allocator_->buffers(stream)) {
      |                                                          ^~~~~~
2021-07-23 07:59:10 +00:00
Javier Martinez Canillas
5471a0018b libcamera: fix no-longer existent <libcamera/buffer.h> header inclusion
The SPA plugin is including a <libcamera/buffer.h> header file, but this
got renamed to <libcamera/framebuffer.h> to match the defined class name:

../spa/plugins/libcamera/libcamera_wrapper.cpp:52:10: fatal error: libcamera/buffer.h: No such file or directory
   52 | #include <libcamera/buffer.h>
      |          ^~~~~~~~~~~~~~~~~~~~

Fixes #1435
2021-07-23 07:59:10 +00:00
Pauli Virtanen
cb10d87bb8 bluez5: handle no data written to sco socket
If socket write results to EAGAIN/EWOULDBLOCK or rx data starts late,
spa_bt_sco_io_write may return 0, and we should give up and skip ahead
(and not loop in RT thread with very small timeout).
2021-07-23 07:58:39 +00:00
Wim Taymans
762e549027 doc: add portal document 2021-07-23 09:57:45 +02:00
Wim Taymans
79233aee52 doc: document access control
A first stab at the basics of access control documentation and the
use cases solved by the session manager.
2021-07-22 14:52:57 +02:00
Wim Taymans
7071562334 media-session: remove default node from properties
When we remove a default node, remove it from the properties and trigger
a save of the state so that the configured default is also actually
removed from the state file.
2021-07-21 17:06:16 +02:00
Pauli Virtanen
f4b0cf2758 bluez5: blocklist kernel versions that broke mSBC on several adapters
These kernel versions contain a patch ("Bluetooth: btusb: Add support
USB ALT 3 for WBS") that breaks mSBC on several bluetooth adapters.

See https://lore.kernel.org/linux-bluetooth/ca3adcf5fd1e7afa923f445d391aaa00f335c470.camel@iki.fi/
2021-07-21 17:20:12 +03:00
Wim Taymans
a33df863b4 acp: sync with pulseaudio 2021-07-21 13:11:17 +02:00
Wim Taymans
3d372424cc alsa: don't free alsa global info for each node
Don't clear the global config or else we might lose the UCM state.

See #1437
2021-07-21 12:18:43 +02:00
Wim Taymans
08e34a99fd acp: use AUX channels for PRO audio profile
That way we can actually use the channel names to make custom loopback
mappings.
2021-07-21 11:27:09 +02:00
Wim Taymans
1ad54e8a26 spa: add 64 AUX channels
Make 64 AUX channels instead of using the CUSTOM range for them.
2021-07-21 11:25:43 +02:00
Wim Taymans
d03f29eb66 pulse-server: fix channel_map check
We store the spa channel ids in the channel_map so convert them to
pulseaudio ids before comparing them to the max pulseaudio id.
2021-07-21 11:12:37 +02:00
Érico Nogueira
4c166709d0 modules: improve _gettid wrapper
- use meson to check for gettid() function, always use if available
- use syscall fallback on linux, if not
- restrict thr_self() fallback to *only* FreeBSD
- error out if there isn't any gettid impl
2021-07-20 15:51:50 +00:00
Wim Taymans
a4b8bd6d52 rtkit: use _gettid() instead of getpid() in fallback 2021-07-20 17:13:26 +02:00
Érico Nogueira
9160a127b5 modules: fix typo in module-rtkit
Was using the gettid() function directly instead of the _gettid()
wrapper.
2021-07-20 12:01:21 -03:00
Wim Taymans
41ce309275 0.3.32 2021-07-20 13:06:13 +02:00