Commit graph

6974 commits

Author SHA1 Message Date
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
Wim Taymans cea8a95a59 jack: emit more graph_order callbacks
We should actually emit the graphorder callback whenever something
changed, also when a client or port was added/removed.

Also emit the graphorder callback right after a client is activated to
make jackdbus work.
2021-07-20 11:44:35 +02:00
Wim Taymans cb3543e9b4 media-session: don't move nodes to same link-group
Refuse to move a node to a new target when they belong to the same
link-group to avoid loops.

Fixes #1376
2021-07-20 09:52:57 +02:00
Wim Taymans 6e44c081b0 modules: silence some useless warnings
Fixes #1423
2021-07-19 18:30:22 +02:00
Wim Taymans bd98c6771e modules: make a default node.link-group property
When nothing else is specified, add a default node.link-group property
so that all the nodes from this echo-canceler are tagged as being linked
together in some way.

This allows the session manager to follow the relations between the
different streams and avoids linking those related nodes together, which
avoids playing or recording from itself in a loop.

Fixes #1376
2021-07-19 18:21:11 +02:00
Wim Taymans 587e9d5fb1 mem: remove unused global mempools list
The mempools list keeps track of all allocated mempools but is otherwise
not used. Because it is not protected with a lock, concurrent contexts
or thread loops can step on eachother and crash. Remove this for now
until we actually need it and implement it with some sort of lock.

Fixes #1416
2021-07-19 12:13:25 +02:00
Wim Taymans 1531f78965 jack: ensure transport frame_rate is not 0
Try harder to get the transport frame_rate from the position.
If we can't find an activation structure, use the configured frame_rate
instead of 0.

Fixes #1432
2021-07-19 11:50:28 +02:00
Wim Taymans a91502b3e0 loop: improve invoke avail check
First calculate the size of the aligned payload and then check if
we can fit this aligned payload in the remaining space in the
ringbuffer.

Otherwise we might be able to fit the item + payload in the remaining
space but then place the alignment bytes at the begginning, which would
break alignment of the next invoke_item struct.
2021-07-19 10:12:15 +02:00
Wim Taymans 7f4fa64291 loop: Fix crash because of overflow
Also check if there is enough space to write the payload bytes.

We check if there is enough space for the invoke_item structure first.
Then we calculate how much bytes we need to use for the payload but we
fail to check if we can actually write that much data, risking
overwriting existing data from the ringbuffer and causing a crash later
when we try to jump to invalid memory.

Add some more comments.
2021-07-19 09:53:23 +02:00
Peter Hutterer 327ec4306f INSTALL: link to our CI pipeline for distributions-specific dependencies
We know these are up-to-date and they are based off a minimal base
system.
2021-07-14 12:25:17 +00:00
Peter Hutterer 257fd83f65 Replace Pipewire with PipeWire for consistency
And set up a CI job to check for that.
2021-07-14 16:56:54 +10:00
Julian Bouzas 4732aea0c6 spa: clear all devices when udev monitor stops
Otherwise the udev device leaks when restarting the monitor
2021-07-13 17:03:30 +00:00
Julian Bouzas 7bf50fd8ed spa: alsa: acp: free device name in add_pro_profile 2021-07-13 17:03:30 +00:00
Ден Иванов e504ff8605 Update INSTALL.md - added info on Fedora dependencies 2021-07-12 08:10:53 +00:00
Arun Raghavan 3bde823e74 pipewire-pulse: Fix media.class setting on pipe sink/source
Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1407
2021-07-12 01:31:58 -04:00
Pauli Virtanen 0c9f0210ed bluez5: sco-io: start writing only after the packet size is known
The kernel-provided SCO write MTU is currently never the correct packet
size for writing, so don't try to use it. Some adapter firmware (eg.
BCM20702A0 0b05:17cb) appears in practice sensitive to the alignment of
the msbc frames, and writes with wrong packet size break things but only
on certain headsets. For other adapters, this doesn't appear to matter.
2021-07-11 16:14:03 +00:00
lsde 579481ab70 Use correct RTP payload type for aptX, LDAC,SBC
According to the A2DP spec, the payload type should be
set to a number between 96 and 127.
This is fixed for AAC codec, but not the rest.

Original PulseAudio issue: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/591
2021-07-11 16:10:20 +00:00
Julian Bouzas 2dcdc80030 spa: alsa: acp: fix memleak when destroying card profles 2021-07-08 11:08:00 -04:00
Wim Taymans 33e07cc984 pipewire-pulse: don't republish when object changes
Ignore changes to the object. Otherwise, we would remove and publish
the device again for each volume change.

Fixes #1406
2021-07-07 17:38:17 +02:00
Wim Taymans 33f90abfb5 impl-link: use loopvisited variable for loop checking
Don't reuse the visited variable for checking feedback loops because the
scheduler expects it to be false on entry. Use a different variable
instead.
2021-07-07 15:56:39 +02:00
Wim Taymans afb7090ba0 media-session: reevaluate current profile only for its own routes
Only check the current active profile when some routes changed that are
part of the profile. If some other route changed, just ignore it.

Fixes #1403
2021-07-07 15:12:44 +02:00
Peter Hutterer de394866e3 ci: hook up a valgrind run 2021-07-07 11:03:23 +00:00
Peter Hutterer 1bd43e8282 test: skip the endpoint test under valgrind
This test currently prevents us from running the test suite in valgrind but
it's not a straightforward fix. So in the meantime, skip this test when
running under valgrind.
2021-07-07 11:03:23 +00:00
Peter Hutterer 0f5e462909 tests: fix indentation issues in meson.build 2021-07-07 11:03:23 +00:00
Peter Hutterer 731888fcdd test: fix a memleak in the config tests
Fixes bba9edabee
2021-07-07 11:03:23 +00:00
Peter Hutterer 4f49e893c1 test: init the pod test buffer with a fixed value
Works around the valgrind complaints when we call spa_debug_mem() on the
buffer with various sizes.
2021-07-07 11:03:23 +00:00
Peter Hutterer 5ebfbccd16 pwtest: if a test expects a signal, skip it under valgrind
Running under valgrind enforces --no-fork so any signal will cause valgrind
to error out, failing the test abnormally. This prevents us from running
our test suite through valgrind, we'd have to mark every test specifically
whether it should run under valgrind or not.

Easier is just to automatically skip tests expecting signals.
2021-07-07 11:03:23 +00:00
Wim Taymans 6600d93d5d impl-link: improve feedback loop check
Mark peer nodes as visited and only visit them once. Reduces the
complexity a lot.
Limit the number of hops we check to 32 to avoid excessive work.
2021-07-07 12:54:09 +02:00
Jonas Holmberg 298dfa7da4 pipewire: make pw_get_prgname() thread safe
Make sure the string isn't overwritten while another thread is reading
it.

Fixes #1402
2021-07-06 19:29:16 +02:00