Commit graph

12501 commits

Author SHA1 Message Date
Cedric Sodhi 34fd3fe2ad Restructured overview.dotx
Merged the information of the original with the didactic structure and overview by Théo Lebrun/bootlin.com.
2024-05-07 08:57:24 +00:00
Wim Taymans 62aa77d469 alsa: remove racy atomic operations
The atomic operations were used in an attempt to limit the amount of
wakeups done on the eventfd. It's however racy and causes trouble in
some cases.

Remove the atomic operations all together, it's probably not worth
optimizing this too much.
2024-05-07 10:07:30 +02:00
Sanchayan Maity 68ed40570d Add a module for loading Parametric EQ
Websites like squig.link or https://www.autoeq.app/ generate a file for
parametric equalization for a given target, but this is not a format
that can be directly given to filter chain module.

This module translates the file to filter chain module arguments and
then loads the filter chain module with these arguments.
2024-05-07 11:37:48 +05:30
Pauli Virtanen 1717b1bebc doc: document some more audioconvert properties 2024-05-06 18:16:07 +03:00
Wim Taymans 6ab10237cd alsa: use semaphore semantics for the eventfd
Because we write from multiple threads, a thread might write a second
wakeup and a concurrent thread might remove all wakeups before seeing
it's error and retrying, which would leave the eventfd in a wrong state.

With a semaphore, things balance out and the eventfd always ends up in
a consistent state.
2024-05-06 16:26:06 +02:00
Wim Taymans a30c27dce0 pulse-server: add pulse.allow-module-loading option
Add an option to disable loading and unloading of modules with the
native protocol.

Document some more options.
2024-05-06 15:28:43 +02:00
Wim Taymans a3ccbd00b4 pulse-server: implement describe-module with core message
Implement the old pacmd describe-module command with a core message:

pactl send-message /core pipewire-pulse:describe-module
module-echo-cancel
2024-05-06 11:39:52 +02:00
Robert Mader b3ff293263 spa: libcamera: fix RGB mappings
Libcamera formats are generally little-endian, matching DMA DRM
fourccs, while PW ones are big-endian. Thus we have to invert the
order.

Only RGB and BGR where tested, as these are the formats currently
supported by the software ISP. This fixes inverted red and blue in
Snapshot on the Librem5 and Pinephone (OG).

See also gstlibcamera-utils.cpp in libcamera.
2024-05-06 07:41:33 +00:00
Barnabás Pőcze 6d7b0284dd pw-dump: destroy all objects not just those matching the pattern
`registry_event_global()` creates an `object` object for every object,
not just those matching `data::pattern`. However, previously
`registry_event_global_remove()` only destroyed those objects
that matched the given pattern. Fix that by destroying
every object.

Fixes #4001
Fixes 47e1f38f03 ("pw-dump: also dump object removal")
2024-05-05 16:39:42 +02:00
Barnabás Pőcze 0c0d520c32 pw-dump: fix string memory leak on error
`object::type` was not cleared in the error path. Fix that
by calling `object_destroy()`, which takes care of it.
2024-05-05 16:38:40 +02:00
Pauli Virtanen f0bfb5ca84 gitattributes: mark test/data/*.txt as text files
They are text files as far as diff is concerned, although contain
invalid utf-8.
2024-05-05 15:17:39 +03:00
Pauli Virtanen 22ac5f85cc json: fix high surrogate escapes
Surrogate escapes must add not or 0x10000, as the specified bits go up
0xfffff.
2024-05-05 15:15:54 +03:00
Pauli Virtanen eea18a8a8a test: fix loading json test data
Multiline results were not loaded correctly.
2024-05-05 09:32:43 +00:00
Stefan Ursella 9c31cf1271 alsa: read hw synced ring buffer position when caller is not the same pcm
When the caller is a different pcm it is not shure that the
IRQs are synchronised. So read the real ring buffer position.
2024-05-05 09:31:54 +00:00
Wim Taymans 056d826c59 core: handle import errors better
Check for NULL when importing a buffer and log a message instead of
trying to deref the NULL pointer and crash.

Add some more logging to mem when importing a bad fd.

See #3998
2024-05-03 15:56:13 +02:00
Tristan Cacqueray 47a71325d6 pw-mon: Add --print-separator option to help streaming parser
When processing the output of pw-mon in real time, it is presently
difficult to know when an event is completed because the last attribute
or property is different for each type of event.

This change corrects that by terminating each event with an empty new line.
2024-05-03 07:10:03 -04:00
Wim Taymans f73d3e4af9 stream: copy position before going to STREAMING
So that get_time_n will return values as soon as we go to STREAMING.

Fixes #3995
2024-05-03 11:53:15 +02:00
Wim Taymans 88e9f7683c conf: an empty condition should evaluate to true
An empty match rule matches nothing and evaluates to false but an empty
condition should evaluate to true.
2024-05-03 10:57:02 +02:00
Barnabás Pőcze 0b3a27b208 pw-mon: fix type confusion in core event handler
All pw_core event handlers (`on_core_*()`) currently receive a pointer
to `struct data`, not `struct proxy_data`; as can be seen from the
`pw_core_add_listener()` call in `main()`.

Fixes: cacdcc1b62 ("pw-mon: add filter param to hide props and/or params")
Fixes #3997
2024-05-03 07:18:43 +00:00
Barnabás Pőcze da1dbc1120 treewide: fix C++20 compilation error wrt. designated initializers
C++20 introduced designated initializers similar to the ones found
in C99, however, in C++ designated initializers cannot be mixed
with non-designated initializers. GCC rejects mixed initializers
with an error.
2024-05-03 07:16:57 +00:00
Barnabás Pőcze 2bc5d0914d gst: fix stream params memory leak
Both the GPtrArray and its contents are leaked in case of success.
`pw_stream_connect()` copies the params as needed, so use `g_autoptr()`
to free the array and with it, its contents.
2024-05-03 07:15:19 +00:00
Wim Taymans c8efa0fae2 context: use first data-loop class when unset
When a node does not specify a data-loop class, use the class of the
first data loop. This makes the nodes spread out over the first
(default) data-loop class.
2024-05-02 09:33:38 +02:00
Wim Taymans 3e760ea7d7 gst: handle some more errors
The threadloop might fail to create because of missing plugins, so
handle that.

The context might fail to create because of some fatal config error or
missing plugin, handle that too instead of crashing.

See #3994
2024-05-01 20:31:39 +02:00
Pauli Virtanen 44d958d397 pulse-server: show warning about snap kernel features only once
Don't spam the warning about kernel missing features required for snap
on every pulseaudio connection, but instead show it only once, as the
situation is not going to improve.
2024-05-01 13:17:31 +03:00
Barnabás Pőcze d80989ab56 treewide: fix errno assignments
Do not set `errno` to a negative value.
2024-05-01 09:28:17 +00:00
Wim Taymans 7e26fa57e5 impl-node: ensure same data loop inside the node
Make sure the loop used to load the spa plugin matches the loop of the
impl-node and the port mixer loops.
2024-04-30 18:02:59 +02:00
Wim Taymans 8dabf3486e impl-node: optimize invoke usage
When the driver and the node have the same data-loop we can group the
invoke calls together and avoid context switches for the sync
operations.
2024-04-30 16:17:03 +02:00
Wim Taymans bd14e212c7 remove from driver in driver data-loop 2024-04-30 15:51:00 +02:00
Wim Taymans afd9960dc3 jack: pass client to get_mix_buffer instead of port
The port can be null when we try to get a buffer from a port that is not
ours. Just use the client to get to the current cycle.
2024-04-30 15:48:10 +02:00
Wim Taymans ff1f793a63 stream: only overwite node.loop.class when unset 2024-04-30 13:27:42 +02:00
Wim Taymans 44f2ed7579 alsa: add sync.id in acp properties 2024-04-30 10:14:30 +02:00
Lukas Rusak 9e88aafa30 alsa-pcm: don't force quantum for iec958 formats
This fixes an issue introduced in 771f71f622
where the quantum is forced and may break applications the specify their
own quantum.

Signed-off-by: Lukas Rusak <lorusak@gmail.com>
2024-04-30 09:34:19 +02:00
Wim Taymans 8ff40e6252 loop: improve in_thread handling of invoke queue
Because we now have a dedicated queue per thread, we can simply add our
invoke item to the queue and then flush all the queues when we are
running in the thread of the loop.

This simplifies some things and removes potential out-of-order messages
that got queued while flushing.
2024-04-29 15:56:00 +02:00
Wim Taymans de0db48f17 loop: create a per-thread queue
Keep a thread local queue. This makes it possible for multiple threads
to write to the ringbuffer.

There is a lock to protect the list of queues. It can only be contended
when new queues are created in the threads but this can be done at
thread startup.

Fixes #3983
2024-04-29 15:17:45 +02:00
Wim Taymans c76424da36 loop: move invoke queue to separate object
Make an internal queue object that implements the invoke queue.

Because we can not do invokes concurrently from different threads, this
is required to make per-thread invoke queues later.
2024-04-29 12:10:48 +02:00
Pauli Virtanen ac35ecf329 journal: prepend code location to messages at debug log levels
Debug and trace log messages are often written based on the stderr
logging, where code location is always visible.

journalctl does not show the code location without extra tricks,
which makes user-submitted debug logs from journal more cryptic.

Make journal log more similar to stderr logs by prepending the code
location and log level in the log message when the log topic
level is >= DEBUG.
2024-04-28 16:02:28 +03:00
Wim Taymans 3ae2ad59d2 module-rt: fix compiler warning
Fix warning about min/max potentially not being initialized.
2024-04-28 09:59:25 +02:00
Wim Taymans 972ac850b1 filter-chain: fix arguments of calloc 2024-04-28 09:53:08 +02:00
lunks 4706fc8a9b combine-stream tag forward 2024-04-28 07:51:02 +00:00
Pedro Nascimento f1d1162a85 Add album to tag metadata 2024-04-28 07:49:32 +00:00
Barnabás Pőcze d8da15c4ad test: add two minimal tests for pw_strv_parse() 2024-04-27 15:21:05 +02:00
Barnabás Pőcze fa97a5b77c pipewire: utils: pw_strv_parse(): fix freeing in case of error
When iterating a pw_array of `T`, the iterator must be of type `T*`.
Otherwise the wrong pointer will be freed.

Fixes: 4a19a76dc1 ("utils: improve pw_strv_parse")
Reported-by: Coverity Scan <scan-admin@coverity.com>
2024-04-27 15:20:33 +02:00
Wim Taymans 7f4a0ba8cb conf: handle array of arguments in context.exec
We handeled "arg1 arg2 ... " before and used to split between spaces to
get the arguments for execvp but that doesn't work so well when there
are arguments with spaces.

Instead use JSON parsing to get the array of arguments. This make it
possible to use [ arg1 arg2 .. ] and quote each arg separately. You
can still use the old method and even double escape:

"\"arg1\" \"arg2 with spaces\"" or
 [ "arg1" "arg2 with spaces" ]
2024-04-26 17:11:21 +02:00
Wim Taymans 4a19a76dc1 utils: improve pw_strv_parse
Handle arbitrary string lengths in the array.
Handle allocation errors.
Handle and report JSON parsing errors.
2024-04-26 16:58:34 +02:00
Arun Raghavan be97d1f766 doc: Some clarifications in Overview
Correct `context.spa-libs` as being pointing to the right SPA libs
(rather than loading them), and some other minor fixups.
2024-04-25 17:26:22 -04:00
Arun Raghavan 1b6a94db36 doc: Add more details in the Overview section
Cover basic concepts that might be useful while going to subsequent
sections. We might want to split this off into a subpage if it gets any
longer.
2024-04-25 13:04:54 -04:00
Wim Taymans 9844aed31b impl-node: avoid bitfield races
Move the bits that are used in the realtime thread away from the bits
from the main thread to avoid bitfield races. Move some fields in rt
structs to make it explicit that they are only to be modified from the
realtime threads.
2024-04-25 16:18:03 +02:00
Wim Taymans 6fdf09e83e impl-node: remove redundant variable 2024-04-25 15:58:34 +02:00
Wim Taymans 9bb5780cc2 meta: add explicit sync metadata and data type
Change the GenericFd data type to SyncObj. It's probably better to
explicitly state the data type than to make something generic. Otherwise
we would need to transfer the specific fd type somewhere else and there
is no room for that in the buffer and the the metadata is not a good idea
either because it can be modified and corrupted at runtime.

Add the SyncTimeline metadata. This contains 2 points on two timelines
(SyncObj datas in the buffer). The buffer can be accessed when the
acquire_point is signaled on the timeline and when the buffer
can be released, the release_point on the timeline should be signaled.
2024-04-25 09:55:19 +02:00
Wim Taymans 31de44f679 client-node: simplify some things
We don't need to get the supprt just to get the logger.
2024-04-25 09:25:51 +02:00