Commit graph

7541 commits

Author SHA1 Message Date
Wim Taymans
3348fd9885 alsa-plugin: make sure we don't deref NULL
Also fixes a warning.
2021-10-01 15:33:51 +02:00
Wim Taymans
9a76feb913 libcamera: handle MemFd buffers
Use EXPBUF when requesting MemFd buffers because it is mostly correct
for v4l2.
2021-10-01 13:19:14 +02:00
Wim Taymans
487792941d libcamera: remove \n in log lines 2021-10-01 12:28:53 +02:00
Wim Taymans
7cf0afe299 jack: fix port check
We need to actually use the port object to check if it's ours.
2021-10-01 09:53:35 +02:00
Wim Taymans
512e4e4b83 jack: wait with emiting connect_callback
For our own ports, wait with emiting the connect_callback until we have
negotiated buffers on them (and have the peer_id). Some applications
use the connect_callback to decide when to start processing so we need
those buffers before we can do that.

Fixes startup issues with jack_midi_latency_test.
2021-10-01 09:33:19 +02:00
Wim Taymans
a559b96d61 jack: improve _is_mine() check
Also check the client, in case someone uses a port from another
client.
2021-10-01 09:33:19 +02:00
Wim Taymans
3dde9fef9c client-node: send the right peer_id
Output ports share the same buffers on all mix outputs and the buffers
are stored in a special mix area with id SPA_ID_INVALID.

The special mix area does not have the peer_id of the link, we need to
get that from the non-shared mix area.

This fixes some invalid peer port-id values in the set_mix_info event.
2021-10-01 09:33:19 +02:00
Joshua Strobl
ddfbd684e7 Fix readline detection by allowing fallback to cc find_library 2021-09-30 21:27:47 +00:00
Pauli Virtanen
d6509a243d bluez5: fix device.profile setting
Only keys with names starting with "bluez" are passed on to device
settings dict. Rename device.profile to match this.

Also add some debug.
2021-09-30 22:39:34 +03:00
Pauli Virtanen
e84f1c6eed bluez5: update bluez-hardware.conf
Closes #1592
2021-09-30 20:01:06 +03:00
Wim Taymans
d90799c14e doc: add link to wiki 2021-09-30 13:31:08 +02:00
Wim Taymans
d71a10b7fa libcamera: handle failure gracefully
Don't try to access NULL pointers
2021-09-30 12:54:29 +02:00
Wim Taymans
f8817b4394 cpu: fix compilation on ARM 2021-09-30 11:12:27 +02:00
Wim Taymans
47a294c5bf 0.3.38 2021-09-30 10:42:30 +02:00
Peter Hutterer
8352e47878 media-session: warn if WirePlumber is running on startup
Matches WirePlumber commit 2bc999594 but here we merely print an error
messages instead of failing to start.
2021-09-30 08:30:55 +00:00
Peter Hutterer
0aa09ec801 media-session: rename mod_topic to ms_topic for clarity 2021-09-30 08:29:06 +00:00
Peter Hutterer
bb99f9c71e media-session: exit with status 1, not -1
The EXIT_FAILURE define is 1 and besides, it's more common anyway.
2021-09-30 08:29:06 +00:00
Wim Taymans
5026645e93 pulse-server: add latency_msec parameter 2021-09-30 09:49:09 +02:00
Wim Taymans
696dbf7cd6 pulse-tunnel: pass latency as msec 2021-09-30 09:49:00 +02:00
Peter Hutterer
abd5f9fbe8 Remove remaining tabs from meson.build files
No changes, just tab-to-space replacement and a little bit of manual
twiddling.
2021-09-30 00:08:27 +00:00
Peter Hutterer
fe79e684b7 spa: remove #define SPA_WEAK
This is a leftover from an earlier version of 0e60e9c063. The
attribute is not supported by clang at this time, so let's remove
the #define until we have a use-case that requires it.
2021-09-30 09:38:57 +10:00
Wim Taymans
013567524a support: res might be used uninitialized 2021-09-29 17:08:46 +02:00
Barnabás Pőcze
184e80d753 spa: support: use spa_list_consume()
Use `spa_list_consume()` when freeing entities in the pattern
list instead of `spa_list_for_each_safe()`.
2021-09-29 15:07:36 +00:00
Barnabás Pőcze
25a0e3beb4 spa: support: do not include C source file
Previously, `log-patterns.c` was included in two other source files
(`journal.c` and `logger.c`). It was also specified in the sources
list for the libspa-support library, which resulted in the unnecessary
independent compilation of the file, generating "defined but not used"
warnings.

Extract the function definitions into `log-patterns.h` and
use that in `journal.c` and `logger.c`, and remove the inclusion
of `log-patterns.c` from both.
2021-09-29 15:07:36 +00:00
Barnabás Pőcze
b292a71220 spa: support: use flexible array member
Use a flexible array member directly to store the pattern.
2021-09-29 15:07:36 +00:00
Wim Taymans
33787ffe1c tests: fix log test 2021-09-29 17:06:35 +02:00
Wim Taymans
a9c64e1609 fix versions of the log interface 2021-09-29 17:03:26 +02:00
Wim Taymans
b45d906dc4 support: increment methods version
Using the version of the .h files is always the latest.
2021-09-29 16:59:49 +02:00
Wim Taymans
d6469e5437 filter-chain: make it possible to suggest a samplerate
Make it possible to let a plugin suggest a samplerate for the filter.
Make the convolver suggest the samplerate of the IR file anf use that
if nothing else is specified in the config.

Fixes #1659
2021-09-29 16:53:18 +02:00
Wim Taymans
275dfed92a filter-chain: handle unaligned sum_simd
Fall back to slow path if the input is not aligned, which can happen
after resampling.

Fixes #1659
2021-09-29 16:30:59 +02:00
Barnabás Pőcze
d2f0573369 pipewire: module-zeroconf-discover: handle module destroy events
module-zeroconf-discover loads module-pulse-tunnel for each entity
exposed on the network. Previously, however, the destroy event
of the loaded pulse-tunnel modules were not handled.

This resulted in a use-after-free because both `pw_context_destroy()`
and `module-zeroconf-discover.c:impl_free()` tried to destroy
the pulse-tunnel modules. The reason for that is that since
1de16afc40 the modules
are prepended to the module list of the context, not appended,
therefore modules are destroyed in LIFO order, thus the pulse-tunnel
modules were destroyed before the zeroconf-discover module that
loaded them.

Fix that by handling the destroy event of the loaded pulse-tunnel
modules.

Fixes #1653
2021-09-29 10:35:16 +02:00
Wim Taymans
88d7ea3d88 spa-resample: add some verbose info messages 2021-09-29 10:16:25 +02:00
Peter Hutterer
4ea8fa8180 systemd: make pipewire-pulse require one of the session managers
Where pipewire and friends are started via socket activation,
a PA client connection to the pulse socket triggers
pipewire-pulse.service. That in turn triggers pipewire.service through
Wants/After and once that is started up, pipewire-pulse actually
starts up.

At the same time, pipewire-media-session or wireplumber are started
through WantedBy/after in the respective service files.

Depending on which leg the race condition got out of bed with today,
pipewire-pulse may be finished before the session manager has set up the
graph and the PA client doesn't see any devices.

Fix this by adding a dependency on the session manager in
pipewire-pulse, installed via an Alias so media-session and wireplumber
can install the same alias. Wants is a light dependency, so for the case
where it doesn't exist we fall back to the current behavior anyway.

This doesn't remove the race condition since systemd may deem the
session manager to have started before the graph is set up, but it
should reduce the occurances.

The disadvantage here: only one Alias will be installed by systemd, so
first-come, first-serve in the case of both media-session and
wireplumber being installed.

See #1553
2021-09-29 07:18:13 +00:00
Peter Hutterer
90cbcb6c05 systemd: add PipeWire to the systemd service file descriptions
Without this, a journal entry merely looks like this:
 Stopping Multimedia Service ...

Which is obviously terrible from a branding perspective but also makes
it harder for users to figure out what process was responsible for this
entry.
2021-09-29 07:17:35 +00:00
Peter Hutterer
7c28b0d7af meson: add a summary for the readline dependency 2021-09-29 13:21:08 +10:00
Wim Taymans
4d85e6aead resample: fix off-by-one
Don't use the previously skipped sample to calculate the remaining
amount of samples or else we remove one sample too much in some cases
and cause distortion, mostly when downsampling.

Fixes #1646
2021-09-28 15:31:07 +02:00
Peter Hutterer
b3646743c1 spa: sprinkle more log topics into spa 2021-09-28 09:35:39 +02:00
Peter Hutterer
e3b216c026 media-session: add log topics to all modules
Media-session itself uses ms.core, there are only two files that could
have a sub-topic but right now they don't use it (match-rules and
metadata).

The modules use the ms.mod.* namespace, so it's trivial to filter on
those.
2021-09-28 09:35:39 +02:00
Peter Hutterer
52a96bb602 modules: add log topics to module-protocol-pulse
This ends up using a nested namespace: mod.protocol-pulse for the module
itself, mod.protocol-pulse.foo for the various submodules and
extensions.
2021-09-28 09:35:39 +02:00
Peter Hutterer
96f8a7597e modules: switch protocol-native to the new logging system
This is more complicated than a normal module because we have two
logging topics: mod.protocol-native and conn.protocol-native for wire
messages. Because the latter use spa_debug (through spa_debug_pod) we
need to #define our way around so those too use the right topics.

Note that this removes the previous "connection" category, it is now
"conn.protocol-native" instead.
2021-09-28 09:35:39 +02:00
Peter Hutterer
14112fd168 modules: use the new topic-based logging from various pipewire modules 2021-09-28 09:35:39 +02:00
Peter Hutterer
e9d869b46f spa: implement a log topic for alsa 2021-09-28 09:35:39 +02:00
Peter Hutterer
a6e66d9180 pipewire: use the internal log topics 2021-09-28 09:35:38 +02:00
Peter Hutterer
52bd80aaa4 log: add topic loggers and a default topic
pw_log_log/logv now go through the topic-based logger using the
"default" topic. Log topics themselves can be allocated by the call
sites. The simplest way to use a topic from e.g. a module:

    PW_LOG_TOPIC_STATIC(mod_topic, "mod.foo");
    #define PW_LOG_TOPIC_DEFAULT mod_topic
    ...
    void pipewire__module_init() {
  	  PW_LOG_TOPIC_INIT(mod_topic);
  	  ...
    }

With the #define all pw_log_foo() are now routed through the custom
topic. For the cases where the log topic must be specified, a
pw_logt_foo() set of macros is available.

Log topics are enabled through the PIPEWIRE_DEBUG environment variable
which now supports globs, e.g. PIPEWIRE_DEBUG="*:I;mod.access:D"
to enable global INFO but DEBUG for the access module.

Namespaces documented are "pw", "mod" and "conn", for pipewire-internal
stuff, modules and connection dumping. The latter is special-cased to
avoid spamming the log files, it requires an expcit "conn.<glob>"
pattern to enable.

The "default" topic always exists and is the fallback for any
pw_log_foo() invocation that does not use a topic.
2021-09-28 09:35:38 +02:00
Peter Hutterer
b58282353b pipewire: pass the PIPEWIRE_DEBUG config down to the logger
Convert the PIPEWIRE_DEBUG environment variable to the json format
specified by the log interface and pass it on.
2021-09-28 09:35:38 +02:00
Peter Hutterer
59a5791d41 spa: implement the new topic logging for the provided loggers
Both simple log implementation now support the new topic-based
functions, and so does the journal logger too.
2021-09-28 09:35:38 +02:00
Peter Hutterer
0e60e9c063 spa: add topic-based logging
Add a struct spa_log_topic that allows for logical grouping of messages.
The new macros spa_log_logt() and spa_log_logtv() take a topic as
argument, the topic's level acts as filter.
A new macro spa_log_topic_init() initializes a topic. By default a topic
inherits its logger's debug level but a logger implementation may set
that topic to a specific fixed log level.

The various spa_log_*() macros transparently wrap new and old
implementations:
- if the implementation is version 0, the new logt() calls drop the
  topic and get routed into the old log() calls
- if the implementation is version 1, the old log() calls use a NULL
  topic and get routed into the new logt() calls

All spa_log_* macros use the SPA_LOG_DEFAULT_TOPIC topic (NULL), it is
up to the caller to redefine that. Alternatively, use spa_logt_* to pass
an explicit topic.

There is one crucial flaw in this implementation: log topics are
initialized to their target level by the current logger. Where a topic
is initialized but the logger is switched later, the topic is not
automatically re-initialized. Ultimately this shouldn't matter for
real-world use-cases.
2021-09-28 09:35:38 +02:00
Peter Hutterer
26cfdc95cc pipewire: use the spa_log_logv macro instead of a direct interface call
This checks the log level of global_log.level again which is always the
same as the global pw_log_level.
2021-09-28 09:35:38 +02:00
Peter Hutterer
9eda834417 spa: use the spa_log_logv macro to chain the log calls
No need to use the interface call directly here, let's just use the
macro.
2021-09-28 09:35:38 +02:00
Peter Hutterer
cbcf62f341 spa: add a macro to check for a callback version
spa_interface_call() and friends will quietly do nothing if the version
doesn't match so we need an extra macro to know whether we can
spa_interface_call() for any given version.

This allows us to implement things like:
   if (spa_interface_callback_version_min(1)
        spa_interface_call(..., 1, func_v1)
   else
        spa_interface_call(..., 0, func_v0)
2021-09-28 09:35:38 +02:00