Commit graph

11963 commits

Author SHA1 Message Date
Ashok Sidipotu
7728586601 spa: v4l2: encode device id into a json array 2024-04-23 11:16:40 +02:00
Ashok Sidipotu
4c19da1127 spa: libcamera: encode device ids into a json array 2024-04-23 11:16:40 +02:00
Wim Taymans
aefe407d79 impl-port: avoid doing work when the port is destroyed 2024-04-23 11:16:40 +02:00
Wim Taymans
f65dd4e515 impl-port: use 0 size when clearing IO 2024-04-23 11:16:40 +02:00
Wim Taymans
edc4c856b7 stream: log a warning when media.class and direction mismatch
Fixes #2493
2024-04-23 11:16:40 +02:00
Wim Taymans
e9f0638a70 module-loopback: only enable delay with valid rate and channels
Or else we can't calculate the required delay buffer size and we might
even end up with a double free.

Fixes #3748
2024-04-23 11:16:36 +02:00
Wim Taymans
98f9529147 alsa: fix race when updating the eventfd
The eventfd is read/written from/to the data thread and the main thread
concurrently with the update_active() function.

Use an atomic compare and swap to make this update atomic and avoid an
inconsistency between the active boolean and the eventfd. This could
result in the eventfd being unsignaled while the active flag was true
and the application receiving a timeout and XRun in its poll loop.

Fixes #3711
2024-04-16 09:57:12 +02:00
Wim Taymans
17a2c21573 audioconvert: also clamp monitor volume to min/max
When we set a min/max value, also clamp the monitor volume to it.

Fixes #3962
2024-04-16 09:56:48 +02:00
Pauli Virtanen
bf148d59cd combine-stream: actually make use of resample.disable
resample.disable was made to default to true, but copying it to stream
properties was forgotten so it didn't have any effect. Make sure to copy
it.

This will also prevent different input/output streams from negotiating
to different rates, which would result to broken audio since we are just
passing sample data through.
2024-04-16 09:55:38 +02:00
Wim Taymans
a2287be601 1.0.5 2024-04-15 09:33:15 +02:00
Wim Taymans
b72ead1dea spa: handle empty values better
Make sure the properties are not empty before trying to access them.
2024-04-10 13:19:23 +02:00
Wim Taymans
b5284791fc v4l2: handle empty properties gracefully
When a property is not found or is empty, go on to the next format
instead of failing.

See #3959
2024-04-10 11:10:20 +02:00
Wim Taymans
28ab18ddd4 client-node: pass the right object to functions
These functions are not really used so not currently a problem.
2024-04-10 11:10:10 +02:00
Wim Taymans
822b8114b5 stream: only unmap data that was mapped and mappable. 2024-04-02 13:30:36 +02:00
Wim Taymans
ecb35b976f stream: handle node.name fallback better
If we don't have extra properties, set the node.name to the stream
name if it was not otherwise present.
2024-04-02 13:30:20 +02:00
Adam Gensler
582dcf773d Update 90-pipewire-alsa.rules with support for Astro Mixamp Pro TR. 2024-04-02 13:30:02 +02:00
Pauli Virtanen
85ed6eb2b5 CI: put docs from both 1.0 and master on pages 2024-04-01 14:27:23 +03:00
Robert Mader
f9bac4889c v4l2: Drop the first frame after camera startup
A quite big number of UVC cameras - due to firmware or kernel driver
issues - have bad timestamps of the first frame, confusing clients
like pipewiresrc.
Drop the first frame, as this seems to be the most reliable workaround
for the time being.

Closes https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3910
2024-03-31 13:15:20 +02:00
Pauli Virtanen
88db0a9103 client-node: free port io memmap also if port gone
clear_port() clears all struct mix and removes the port, and can occur
before port io is set to NULL.  In this case the port memmaps are not
freed, and are leaked until client pool closes.

Fix by freeing the old io memmap when setting io to NULL, also when the
port was already cleared, so that the memmap lifecycle is the same as
that of the IO.
2024-03-31 12:50:54 +02:00
Wim Taymans
3ea4193bf6 spa: improve null-audio-sink channels
We can just update the channels in the props, we don't need an extra
property that can go out of sync with the channels.

See #3931
2024-03-31 12:50:19 +02:00
Wim Taymans
6279d79339 context: add context.modules.allow-empty property
false by default, when true, no warning will be logged when the
context.modules in the config is empty. This can be useful when the
application wants to load all the modules itself.
2024-03-31 12:48:31 +02:00
Wim Taymans
8d0f738882 conf: only count modules, objects and exec when added
We don't actually do anything when the name, factory or path is NULL so
don't count this as an action.

Commenting out these keys is a usual way for commenting out complete
sections.
2024-03-31 12:48:22 +02:00
Wim Taymans
5cb7d4c019 conf: add more error checks
Fail when something goes wrong when adding spa-libs instead of silently
ignoring it.
2024-03-31 12:48:15 +02:00
Jonas Holmberg
64cc53cc38 module-echo-cancel: Don't call _run() when inactive
Call _activate() in the aec spa plugin before both capture and sink
streams are started and call _deactivate() after both capture and sink
streams are stopped, to make sure _run() is not called while the spa
plugin is inactive.
2024-03-31 12:38:48 +02:00
George Kiagiadakis
a66aa7ae84 bluez: print a nicer warning when the bluez service is not available 2024-03-31 12:38:39 +02:00
Samuel Thibault
048285af7f spa plugins: Include Linux headers on Linux only 2024-03-31 12:38:27 +02:00
Wim Taymans
3bab51ca73 conf: add some warnings when keys are invalid and ignored 2024-03-31 12:38:10 +02:00
Wim Taymans
cee9f740e4 filter-chain: improve json parsing error reporting
Warn when an invalid key is parsed instead of silently ignoring it.
2024-03-31 12:37:51 +02:00
Wim Taymans
dcc32c3be1 client-node: small cleanups 2024-03-30 18:27:23 +01:00
Wim Taymans
cc8b88cb51 alsa: add option to skip the busy check
Makes the card exposed even if some of the pcms are busy.

Fixes #3914
2024-03-30 18:27:06 +01:00
Wim Taymans
30f01b117e v4l2: set latency on port
Use the duration of one frame as the latency.

See #3910
2024-03-30 18:26:24 +01:00
Wim Taymans
3ddd171567 log: init topic_init function
Fixes #3916
2024-03-30 18:26:07 +01:00
Wim Taymans
201aaeef5d tools: print ??? when the quantum is unknown 2024-03-30 18:25:57 +01:00
Wim Taymans
7ae18c5098 spa: a quick fix for compiling with -Werror=shadow
spa_exchange() is used in spa_clear_ptr() and spa_clear_fd() which
already use the _old_value variable. So make it use a slightly different
local variable name to avoid shadow warnings.

Fixes #3915
2024-03-30 18:25:37 +01:00
Wim Taymans
31c437b9d6 module-ffado: add some more debug
Add some code to dyanmically switch period_size but it seems to keep
crashing ffado no matter what I try.
2024-03-30 18:25:28 +01:00
Wim Taymans
85dd429858 module-ffado: make sure we close and open when suspend
Rework some things so that we can actually completely close and reopen
the driver when suspending. Leaving the device opened but not streaming
causes trouble when ffado-mixer changes the settings in between.

Do this by first doing a probe to get the ports and streams and then
link those to the actual buffers when we start streaming.

Follow the graph rate and quantum so that we open with the right
settings, this makes pw-metadata work on the quantum and rate. It
requires a driver reopen so it might be slower.

Try to handle some errors better.

See #3558
2024-03-30 18:25:22 +01:00
Wim Taymans
653be2dbde utils: use memmove when src and dst can overlap
spa_json_parse_stringn() can be used when the strings source and
destination are overlapping so use memmove instead of strncpy to
avoid corruption of the strings.
2024-03-30 18:25:07 +01:00
Wim Taymans
cc841a7667 acp: add more properties for the card
Use snd_ctl_card_info to set some more card properties such as the
alsa.id, alsa.mixer_name and alsa.components.

alsa.id is interesting because it is possible to use udev rules to set a
custom id, which is handy when you have two identical cards in the
system and want to assign unique ids to them.

See #3912
2024-03-30 18:24:29 +01:00
Charlie Li
99795cb8c1 module-raop-sink: explicitly include <openssl/evp.h>
As part of LibreSSL's cleanup of removed ENGINE support, <openssl/x509.h> is no longer included in <openssl/engine.h>. <openssl/evp.h> was transiently included in <openssl/x509.h>, compared to <openssl/rand.h> for OpenSSL.
2024-03-30 18:24:09 +01:00
Steve Langasek
e995a20679 v4l2: unset _TIME_BITS in addition to _FILE_OFFSET_BITS
The v4l2 build unsets _FILE_OFFSET_BITS, which is not allowed when setting
_TIME_BITS=64.  Having verified that nothing in this module is sensitive to
64-bit time_t (none of the functions it intercepts handle time), we also
unset _TIME_BITS to allow this to build as before.

Signed-off-by: Steve Langasek <steve.langasek@canonical.com>
Reviewed-by: Dylan Aïssi <dylan.aissi@collabora.com>
2024-03-30 18:23:57 +01:00
Wim Taymans
03b76b6755 gst: fall back to buffer time when no header
This at least sets some form of timestamp on the buffers.
2024-03-30 18:19:16 +01:00
Wim Taymans
e52a56bf68 tests: update unit test for added field 2024-03-30 18:19:16 +01:00
Wim Taymans
cb7ca883df stream: add time field to pw_buffer
For capture streams, place the time of the cycle when we received this
buffer in the new buffer time field.

Without this (and without timestamps in an optional header metadata)
it's impossible to determine when a buffer was created. With this field
and the pw_stream_get_time_n() and pw_stream_get_nsec() we can derive
the mapping to ticks and delay in the graph.
2024-03-30 18:19:16 +01:00
Wim Taymans
945a4e9336 stream: improve the timing info
Always copy the timing info when capturing, not only when there is a
buffer to dequeue.

We can update the rate_queued and rate_size with defaults when we don't
have rate matching. We can then also directly use the rate_size field
to update the buffer requested size.
2024-03-30 18:19:16 +01:00
Wim Taymans
1d365592c3 stream: update some docs 2024-03-30 18:19:16 +01:00
Wim Taymans
d0aca52681 stream: rename requested to size in pw_time
Now that both the expected input and output of the resampler is placed
in the rate_match, rename the 'requested' field in pw_time to 'size'
and update the docs.

See #3750
2024-03-30 18:19:16 +01:00
Wim Taymans
0ede521384 stream: add resample size to pw_time
Now that the resampler input size is set in the io_rate field when we
start we can add it to the pw_time struct as well.

This way we can know the required resampler input without having
to dequeue a buffer. This can be handy when the stream is a driver
and needs to know how much data to accumulate before starting the graph.

See #3750
2024-03-30 18:19:16 +01:00
Wim Taymans
010c9f1b93 audioconvert: also place resample output in rate_io
We can also place the estimated size that the resampler will produce in
the rate_io for output streams.

See #3750
2024-03-30 18:19:16 +01:00
Wim Taymans
13d4bb4b42 audioconvert: implement resample_out_len() 2024-03-30 18:19:16 +01:00
Pauli Virtanen
9419d458d1 doc: sync with master branch
Pick relevant doc updates.

doc: minor documentation improvements
doc: add options to change what /usr and /etc paths are shown
2024-03-17 14:44:47 +02:00