Commit graph

11963 commits

Author SHA1 Message Date
Wim Taymans
acf9b67067 buffer: add MAPPABLE data flag
Add a MAPPABLE data flag that hints that the fd in the data is mappable
with a simple mmap/munmap. Normally, DmaBuf is not mappable like that
unless explicitly indicated with this flag.

Set the MAPPABLE flag on the DmaBuf from v4l2 and libcamera fd.

When asked, mmap the buffer memory in all cases when the MAPPABLE
flag is set.

This solves the case where v4l2 has exported DmaBuf and is streaming to
node A and then node B links but doesn't get automatically mmaped
memory.

Fixes #3840
2024-02-12 10:49:56 +01:00
Dimitrios Katsaros
3d5b9ce3e8 Jack: Added missing lock to jack API call 2024-02-12 10:48:58 +01:00
Wim Taymans
51e0720113 protocol-native: set error when add_event fails 2024-02-12 10:48:43 +01:00
Dimitrios Katsaros
9cb234dda9 Jack: Fix jack_remove_property(ies) to use proxy id
These functions were using the object serial as the object id
2024-02-12 10:48:08 +01:00
Wim Taymans
0bc42d71e0 pw-cli: set quit flag on -EPIPE
When the server closes the connection in non-interactive mode, we need
to set the quit flag to avoid going into second mainloop_run() that will
just block forever.

See #3837
2024-02-12 10:43:31 +01:00
Stefan Ursella
97777f173a module-protocol-simple: do not cleanup client when send returns EAGAIN or EWOULDBLOCK 2024-02-12 10:42:13 +01:00
Pauli Virtanen
fc6f8e3448 client-node: clear buffers always when freeing mix
Avoid leaking buffers when freeing mix, in case the port was not cleared
properly.

These leaks don't seem to be occurring currently, but better be sure.
2024-02-12 10:41:39 +01:00
Pauli Virtanen
0a1afa698e client-node: handle releasing mix for destroyed port
The remote end may destroy the port via client_node_port_update(),
before corresponding pw_impl_port_mix are released.

clear_port() removes all struct mix, but this prevents the
pw_impl_port_mix from being removed from io_map, which causes stale mix
ids be left in io_map, so we end up continuously allocating new io
areas.

Make lifecycle of io_map entries match port_init_mix/release_mix
exactly, separately from the lifecycle of the port and struct mix.

When freeing struct mix in port_release_mix(), make sure it corresponds
to the mix being released.
2024-02-12 10:41:30 +01:00
Wim Taymans
15a4d9a9df stream: fix param emission for Props
Props set on the node directly should also result in emission of changed
notify when required, just like we do for params set on the port.

This accidentally used to be done because stream_update_params()
unconditionally used to emit this for us. But commit
94cde3090e changed that.

Fixes #3833
2024-02-12 10:40:43 +01:00
Pauli Virtanen
f1d2d40748 mem: track fd invalidation of imported memblocks
When a memblock closes its fd, have it emit signal to other memblocks
possibly sharing the fd, so they know it is now invalid.

When a memblock has an invalidated fd, it'll not allow mapping more
memory, nor match against fd searches.

This avoids bugs where kernel fd reuse causes already invalid memblocks
to be used.  Generally, higher level code should make sure memblocks get
freed in right order so that this situation does not occur, but try to
keep mempool in consistent state regardless.
2024-02-12 10:39:51 +01:00
Wim Taymans
6ab86209f2 1.0.3 2024-02-02 14:09:07 +01:00
Wim Taymans
0b6d763ed5 module-pipe: warn underrun only once 2024-02-02 14:06:45 +01:00
Wim Taymans
b147753554 alsa: always reevaluate matching when driver changed
Always reevaluate the rate matching even when we did not change the
follower state.

It is possible that we were a follower from some node with the same
clock and now become a follower of a node with a different clock. The
follower state doesn't change but we need to activate the rate matching
logic in that case.

Fixes rate matching in pro audio (playback) when capture and playback
are moved to another driver.
2024-02-02 14:06:45 +01:00
Michael Tretter
9996dfb791 conf: escape @DEFAULT_SINK@
Variables enclosed with @ are replaced with the value of the variable.
The sink.name should remain @DEFAULT_SINK@.

Escape the enclosing @ to prevent substitution of DEFAULT_SINK with an
empty string while generating pipewire.conf.
2024-02-02 14:06:45 +01:00
Wim Taymans
1e763b928f alsa: fix version check
See #3711
2024-02-01 21:43:39 +01:00
Wim Taymans
9ba18c15ae 1.0.2 2024-01-31 10:37:35 +01:00
Wim Taymans
1c9c3e3553 jack: fix version check 2024-01-31 10:37:09 +01:00
Wim Taymans
bf87fdbd70 filter-chain: connect atom ports to an empty atom
Or else the lv2 plugin might crash.

Fixes #3815
2024-01-30 18:43:34 +01:00
Wim Taymans
565f560722 module-raop: don't start record in state change
We first need to do the setup, which we start when setting the Format
param.

This causes the module to unload when starting pavucontrol because it
tries to start the record in the wrong state.

See #3778
2024-01-30 18:43:30 +01:00
Arun Raghavan
1f40695b69 node-driver: Log when we resync 2024-01-30 18:43:08 +01:00
Wim Taymans
c690aedc89 v4l2: probe EXPBUF and disable alloc_buffer flag
After we set the format, probe if we can do EXPBUF and enable/disable
the ALLOC_BUFFERS flag on the port.

This should gracefully handle the case where EXPBUF is not available.

Fixes #3821
2024-01-30 18:42:58 +01:00
Wim Taymans
18b112bcfe v4l2: clear support for alloc_buffers on failure
When we try to alloc buffers but EXPBUF is not supported, make sure to
clear the alloc_buffers flag so that the caller can try again with
allocated buffers instead.

See #3821
2024-01-30 18:42:53 +01:00
Wim Taymans
3e49e056ef module-netjack2: improve channel positions
If the manager gave us a different channel count than we had by
default or configured, assume everything is AUX channels.

Also handle the case where the manager is sending more than our
MAX_CHANNELS channels.
2024-01-30 18:42:07 +01:00
Dmitry Sharshakov
31a08028ee pipewire-aes67: resync when offset is more than 1.5 ms
2 ms is typically considered to be late for most AES67 implementations
2024-01-25 12:08:05 +01:00
Dmitry Sharshakov
73cda0c152 node-driver: allow fractional resync-ms 2024-01-25 12:07:11 +01:00
Wim Taymans
c28311fc97 support: add resync.ms option to node.driver
Move some of the tracking code for the DLL to where it is used.

Add resync.ms (default 10) option at which we give up rate adjusting
and instead do a hard resync. This results in a jump in the position
of the graph clock.
2024-01-25 12:06:50 +01:00
Mersad Jelacic
5f531e7fe6 thread: Change warning to info
Change warning to info in impl_acquire_rt() and impl_drop_rt().
2024-01-25 12:03:36 +01:00
Wim Taymans
13511e9295 jack: improve running check
When we get a node info about our own state, we can use the active state
of the node to decide if we are running or not.

Otherwise, we will try to hide ports from JACK clients that suspend
(while still active).

See #3794
2024-01-25 12:02:01 +01:00
Wim Taymans
c298d7faef pulse-server: the device changed when EnumRoute changes
We use EnumRoute of the card to fill in the ports of the device so when
EnumRoute changes, the associated devices also needs a change event.
2024-01-25 12:00:35 +01:00
Wim Taymans
6ee48f0562 alsa: increase buffers when using small buffer
We can increase the MAX_LATENCY again if we increase the amount of
buffers when we are using a small buffer.

Normally we ask for 4 * quantum-limit as the buffer. This should be good
to use 1 buffer and quantum-limit as the quantum with enough headroom
to not run out of buffers.

If we are however using less buffer-frames we need to be careful and
allocate an extra buffer. Imagine using a buffer of 4096 frames, we can
support a quantum of up to 2048 frames if we use 2 buffers.

See #3744
2024-01-22 16:05:52 +01:00
Wim Taymans
7e1e05f0da alsa: improve max-latency property
Half of the buffersize is not enough to support as a max-quantum, we
need to divide by (4 * frame_scale) to allow some headroom and account
for the DSD scaling. We do the same calculation to suggest a buffer size
using the quantum-limit.

See #3744
2024-01-22 16:04:38 +01:00
Wim Taymans
7775363d8e v4l2: improve filter with missing format
When the filter has no format property, just enumerate all possible
framerates. Handle error case where the filter has the wrong type.

Makes gst-launch gstpipewiresrc ! video/x-raw ! fakesink work.

See #1793
2024-01-22 16:00:37 +01:00
Wim Taymans
ef0674751f v4l2: fix format enum with unsupported framerate
Actually count the number of frame fractions we add. If we added 0, we
don't have any supported framerate that intersects with the filter and we
try the next frame size.

See #1793
2024-01-22 16:00:30 +01:00
Pauli Virtanen
0feb68fc07 bluez5: lc3: fix wrong enum_config
The rate is not a bitmask.
2024-01-22 16:00:05 +01:00
Wim Taymans
0a11281834 stream: delay emit param changes when inside emit_param_changed
When we are notifying the application of changed params, don't emit any
changes applied to the params from within the callback with
pw_stream_update_params(). This will be done after we complete the
callback.

This also avoids reseting the change counter so that we don't
accidentally think we updated the formats param when we simply changed
some other params.
2024-01-22 15:56:34 +01:00
Wim Taymans
b63230f805 impl-port: res > 0 means the param was modified
Only log the error when the res < 0, otherwise the param was accepted bu
modified.
2024-01-22 15:56:10 +01:00
Wim Taymans
9a9be2c2ed audioconvert: remove unnecessary casts 2024-01-22 15:54:19 +01:00
Dmitry Sharshakov
524edba9dd audioconvert: fix rare unaligned load exceptions
Supposed causes described in the issue. Also improve float semantics.

Fixes #3790
2024-01-22 15:54:07 +01:00
Pauli Virtanen
bae75e0d0b bluez5: add quirk for SoundCore mini2
AVRCP volume doesn't work properly with this device.

Closes #2927
2024-01-22 15:53:52 +01:00
Pauli Virtanen
46eb11051a bluez5: more informative warning with unknown transports
Unknown transports visible in DBus usually belong to a different
sound server instance that is talking to BlueZ.

Explain this in the warning message that we log, so that people can more
easily understand why things are not working.
2024-01-22 15:53:44 +01:00
Pauli Virtanen
c0716675e8 bluez5: add quirk for Rockbox Brick 2024-01-22 15:53:25 +01:00
Wim Taymans
469b7b0148 spa: small cleanups
Initialize result variable.
Use strncpy to avoid warnings about using non-NULL terminaded strings.
2024-01-12 12:14:06 +01:00
Barnabás Pőcze
01cb3fa862 spa: libcamera: bump minimum supported version to 0.2.0 2024-01-11 13:09:40 +01:00
Barnabás Pőcze
fd33d2d3bb spa: libcamera: use CameraConfiguration::orientation
libcamera commit cc65629b68d49d ("libcamera: camera: Introduce Orientation") [0]
introduced to the `CameraConfiguration::orientation` member to describe the
orientation of the image in the received memory buffers.

Then c65e40b8480ffb ("libcamera: Use CameraConfiguration::orientation") [1]
removed `CameraConfiguration::transform`, which broke the libcamera plugin.

Fix that by using the new `orientation` member.

[0]: https://git.linuxtv.org/libcamera.git/commit/?id=cc65629b68d49d5f2a4d61537584c56ba510a335
[1]: https://git.linuxtv.org/libcamera.git/commit/?id=c65e40b8480ffb5f50e01a4e6713164c7194a937
2024-01-11 13:09:32 +01:00
Wim Taymans
79b98884af 1.0.1 2024-01-10 13:30:27 +01:00
Wim Taymans
1733cc7fea support: fix freewheel timeout in node-driver
When freewheeling we will immediately schedule a new graph cycle when we
get a process call because the graph completed.

When the process call is not done, because of some xrun or
because some node was removed that causes the graph to fail completion,
The next cycle will happen after a timeout.

This timeout was calculated as the ideal wakeup time (after a quantum of
time) and would accumulate for each timeout. The result is that the
timeout ended up far in the future and would stall the freewheel driver
for a long time.

Fix this by always setting the next timeout to wakeup time + freewheel.timeout
seconds. Also add a config property for the timeout (10 seconds, like
jack2 by default).
2024-01-10 13:25:41 +01:00
Wim Taymans
5a596edd53 spa: small cleanups
Use snprint to ensure null terminated strings.
Initialize res, it would be uninitialized when setting a NULL Latency
param.
2024-01-10 13:25:35 +01:00
Wim Taymans
50096e2c76 doc: clarify rlimits conf file
Fixes #3760
2024-01-09 09:20:40 +01:00
Wim Taymans
2b7fa2ff5a spa: remove some references to unimplemented items
Fixes #3763
2024-01-09 09:20:16 +01:00
Barnabás Pőcze
beee7d1ce2 meson_options: pass proper boolean values to boolean options
Passing strings has been deprecated:
https://mesonbuild.com/Release-notes-for-1-1-0.html#coercing-values-in-the-option-function-is-deprecated
2024-01-09 09:19:58 +01:00