Commit graph

6746 commits

Author SHA1 Message Date
Wim Taymans
a19ab4a20a use builddir everywhere
So that it matches thr INSTALL.md instructions
2021-06-20 12:00:26 +02:00
dreamer
e1036ee0fc set the same builddir as INSTALL.md 2021-06-19 21:19:56 +02:00
Barnabás Pőcze
80e3da9b01 pulse-server: add missing minus sign
Noticed by @QuLogic.

Fixes: 87c00a6f00 ("pulse-server: add missing EWOULDBLOCK check")
2021-06-19 17:28:03 +00:00
George Kiagiadakis
2723b0c6e2 meson: export plugin and data dirs for other projects to find them
SPA_PLUGIN_DIR is exported in pkgconfig as 'plugindir'
PIPEWIRE_MODULE_DIR is exported as 'moduledir'
PIPEWIRE_CONFIG_DIR is exported only in uninstalled environments
as 'confdatadir' (not making this public due to the possible upcoming
configuration changes in pipewire)

All variables are also exported on the meson dependency objects,
so that subprojects can find them.

Wireplumber can then find them like this:

  pipewire_moduledir = pipewire_dep.get_variable(
    pkgconfig: 'moduledir', internal: 'moduledir', default_value: '')

... and this works regardless of whether wireplumber is being
configured as a subproject or using the uninstalled pkgconfig files
or using the system installation of pipewire.

This is required in order to run wireplumber tests in the
uninstalled environment with 'meson test'
2021-06-18 19:24:28 +03:00
George Kiagiadakis
9e0ce7cbd6 ci: install a more recent meson in the ubuntu 20.04 image 2021-06-18 18:06:28 +03:00
George Kiagiadakis
7ee5172ce8 meson: integrate wireplumber as a subproject
This allows building wireplumber as part of the pipewire build
and running it in the uninstalled environment instead of media-session.

Building each session manager is individually contolled by the options:
 -Dmedia-session=auto/enabled/disabled
 -Dwireplumber=auto/enabled/disabled

And controlling which one is used in pipewire.conf is done with:
 -Dsession-manager=media-session/wireplumber

Wireplumber's source tree must be in subprojects/wireplumber/
If this is missing, the .wrap file ensures that the latest git
master is downloaded while meson configures the build.
This git tree will not be automatically updated later, you need
to ensure that it is up-to-date on your own.
2021-06-18 17:54:18 +03:00
George Kiagiadakis
7ab5c35cad meson: declare spa_dep and override_dependency() for spa and pipewire
This allows meson subprojects (or projects using pipewire as a meson
subproject) to be able to use dependency('libpipewire-0.3') and
dependency('libspa-0.2') to find the uninstalled versions of these
libraries directly from the build dir instead of going through pkg-config
2021-06-18 17:54:18 +03:00
George Kiagiadakis
19bcdaebe2 meson: use newer version of pkgconfig.generate()
pkgconfig.generate() takes a positional argument, which
is the library target for which to generate a pkgconfig file

The previous way of adding the libpipewire target in
the libraries list is deprecated in recent meson
2021-06-18 17:54:18 +03:00
George Kiagiadakis
59407d2f08 includes: update all references to extensions to point to pipewire/extensions
This also brings the advantage that all tools, examples, modules, components
can also be compiled standalone out-of-tree using libpipewire from the system
2021-06-18 17:54:18 +03:00
George Kiagiadakis
953dc22f50 src: move extensions into pipewire
This allows having the same directory structure for headers as it
is in $prefix/include when installed, so that we can build other
projects using pipewire uninstalled (via the -uninstalled.pc or
by using meson subprojects). Otherwise, external code that reasonably
includes <pipewire/extensions/foo.h> fails to compile.
2021-06-18 17:54:18 +03:00
Wim Taymans
1f04e911c5 module: handle work queue create errors
Handle NULL when creating a work queue instead of crashing. The
create can fail when we run out of fds.
2021-06-18 16:29:23 +02:00
Wim Taymans
bbbc79647f pulse-server: return INTERNAL error for ENFILE/EMFILE 2021-06-18 15:56:55 +02:00
Wim Taymans
05c633a4f5 profiler: Fix crash with many streams
Write the profiler data to an allocated buffer instead of the stack
so that we can make it a little larger.

Don't try to process the data when the builder had to truncate it
because it didn't fit.
2021-06-18 15:42:14 +02:00
Wim Taymans
4518eded5b context: clean up the settings object as well 2021-06-18 15:26:20 +02:00
Wim Taymans
1662e3834f impl-metadata: don't leak the property 2021-06-18 15:26:20 +02:00
Wim Taymans
fb992c3f2d impl-metadata: use the metadata method
so that we call the method of the actual implementation, not our
own implementation.
2021-06-18 15:26:20 +02:00
Wim Taymans
def0caf281 pulse-server: handle out-of-files better
When we don't have enough files to accept the connection, clear the
_IN flag so that we don't try to accept if over and over again.
When a client disconnects, set the flag again so that we try to
accecpt new connections again.

See #1305
2021-06-18 15:26:20 +02:00
Wim Taymans
22b5b6b120 connection: make sure we don't overrun the fd array
Do some checks on the fd array and error out when we would overrun.
2021-06-18 15:26:20 +02:00
Wim Taymans
adee3d79b9 connection: handle truncated control data
We can't recover from truncated control data so return a fatal error
that should stop the client. Truncated control data can happen when
there are no more fds available, for example.

See #1305
2021-06-18 15:26:20 +02:00
George Kiagiadakis
8cf2f134b7 gstpipewiresink: also break the connection loop when the state is STREAMING
Under some schedulers (observed in a virtualbox VM), the state may
go from PAUSED to STREAMING before this code has a chance to test it
2021-06-18 13:34:35 +03:00
Michal Vasilek
a870af02f0 module-rt: define RLIMIT_RTTIME if not defined
older versions of musl libc (before 1.2) don't define RLIMIT_RTTIME
2021-06-18 09:03:46 +00:00
Arun Raghavan
3272940731 echo-cancel: Don't use application name for stream node name
This is not too useful while looking at pipeline graphs, etc. We will
likely want to expand this to also include the module id or something to
distinguish multiple echo-cancel instances (which we can currently do
via the factory ID).
2021-06-17 17:04:35 -04:00
Arun Raghavan
2d251509db doc: Drop duplicate reference to pw_global 2021-06-17 16:39:06 -04:00
Wim Taymans
3944687a14 module-protocol-simple: limit to 10 connections
Like in pulseaudio.
2021-06-17 18:37:04 +02:00
Wim Taymans
38c721993f pulse-server: limit the amount of connections
Set to 64, like pulseaudio. We might want to configure this.

See #1305
2021-06-17 18:36:28 +02:00
Wim Taymans
4aa80c7a71 splitter: we always produce output
Always set the HAVE_OUTPUT flag because we always consume the
input and produce output, either to a buffer or an error.
This makes sure processing never stalls when something is wrong
on the output side.

See #1305
2021-06-17 18:34:01 +02:00
Wim Taymans
16755cef52 impl-metadata: fix include 2021-06-17 12:38:53 +02:00
Wim Taymans
b167ada994 impl-node: take settings into account for quantum and rate 2021-06-17 11:31:42 +02:00
Wim Taymans
c46cb0645e test: fix test
There is now one more global item.
2021-06-17 11:14:20 +02:00
Wim Taymans
e301048abb settings: use metadata for settings
The settings metadata can be used to modify global context properties
at runtime such as min/max quantum, loglevel and samplerate.

See #1288
2021-06-17 11:13:42 +02:00
Wim Taymans
f6ce23cbe3 metadata: add vargs format method for metadata values 2021-06-17 11:11:46 +02:00
Wim Taymans
beb80a06e8 media-session: use core metadata implementation
Use the core metadata implementation and export that one.
2021-06-17 11:11:45 +02:00
Wim Taymans
80ef77f994 context: add metadata implementation
Add a simple metadata implementation to the core that clients can
use to manage metadata or export.
2021-06-17 11:11:45 +02:00
Wim Taymans
d8ad87fd09 context: improve settings and defaults
Make structure with defaults that holds the defaults as they are loaded
from the config file or initialized with default values.

Copy this structure to a settings version that is used at runtime.

Add a force-quantum and force-rate field in the settings that can be
used to force a quantum and samplerate if != 0.
2021-06-17 11:11:45 +02:00
Wim Taymans
2ad202b8e8 audioconvert: track and compensate for rate changes
Follow the rate of the _io_position area and adjust the resampler
to match. This ensures that we always process at the DSP samplerate
to the target negotiated fixed rate of the device/stream.
2021-06-17 11:11:45 +02:00
Wim Taymans
519bd342be audioconvert: don't use samplerate to negotiate
The merger and splitter use the samplerate from the _io_position
for the DSP formats so set the samplerate to 0 to make sure we
don't use it to negotiate a format with the peer.
2021-06-17 11:11:45 +02:00
Wim Taymans
7ba7179eee audioconvert: use the position rate to negotiate
When we have an io_position, use the rate as the samplerate when
negotiating.
2021-06-17 11:11:45 +02:00
Wim Taymans
ed80d72d51 audioconvert: also set io_position on channelmix
Also make the channelmix node aware of the io_position so that
is can use this later to get the default rate.
2021-06-17 11:11:45 +02:00
Wim Taymans
c726dd887c alsa: refactory _io_position checking
Move the code to check the position duration for changes to one
new method.
Also check for samplerate changes and adjust the resampler state
accordingly.
2021-06-17 11:11:44 +02:00
Wim Taymans
0ec760315e jack: there is no need to lock in get_aliases
See #1313
2021-06-17 10:56:39 +02:00
Wim Taymans
0f9fd45a58 jack: rework locking
Ensure all callbacks are called from the thread_loop and release
the thread lock before calling the callback.

Introduce a new rt_lock that is taken while the callbacks are called.
Only call the process_callback when we can acquire the rt_lock in the
data thread. This ensures the process callback is never called
concurrently with any other callback.

Give a warning when we try to call do_sync from the thread_loop
itself. We would deadlock because the thread that is supposed to do
the sync operation would be blocked in wait().

Fixes #1313
2021-06-17 10:46:04 +02:00
Wim Taymans
3e52c6598b jack: add more port checks
Check if the port id and direction is valid before accessing the
port array.
Handle unknown and invalid ports in many methods.
Free the port item after we removed the item from pipewire because
more methods are being called while removing the port and we don't
want them to fail.
2021-06-17 09:23:11 +02:00
Huang-Huang Bao
4c9ac08310 bluez5: always emit node object info for dynamic node
impl_add_listener() could be called more than one time, ensure that we always emit node info
so that session manager(bluez-monitor) can receives it.

Fixes #1308
2021-06-17 07:22:46 +00:00
Peter Hutterer
62e98aa836 test: move some of the property tests to pwtest
Mostly 1:1 move of the test-properties.c file in src to the one in test, but a
few checks were merged into the existing functions.
2021-06-17 07:08:53 +00:00
Peter Hutterer
7a6fa50575 daemon: drop the obsolete dbus policy file 2021-06-17 07:02:48 +00:00
Peter Hutterer
08525e865d daemon: simplify configuration file generation
We convert from conf.in to conf, let's make this hardcoded so we stick to
the same scheme everywhere.
2021-06-17 07:02:48 +00:00
Barnabás Pőcze
7cecb1567d spa: tests: remove double dot from names of test files
Previously, the configured test file would be named like the following:

  spa-include-test-spa_control_control_h..cpp

fix that by removing one of the dots.

Furthermore, use the already existing `find` object instead of
calling `find_program` one more time.
2021-06-16 19:45:27 +02:00
Barnabás Pőcze
bbbf5724be pipewire: module-zeroconf-discover: free correct pointer
Retrieve the pointer returned by `calloc()` and free that
instead of freeing the pointer to a member. This has worked
so far because as of yet `api` is the first member of the struct.
2021-06-16 17:39:25 +00:00
Barnabás Pőcze
58e254ec63 pulse-server: module-zeroconf-publish: remove unnecessary emit
Since !737 it is not required of modules to emit the "loaded"
event if they can load immediately, therefore remove the
unnecessary `module_emit_loaded()` call.

Furthermore remove redundant log messages as well.
2021-06-16 16:40:57 +02:00
Wim Taymans
61bcd4f988 jack: only use the "default" metadata 2021-06-16 12:17:52 +02:00