Commit graph

9965 commits

Author SHA1 Message Date
Dmitry Sharshakov
395749fea9 v4l2: cleanup and simplify
Co-authored-by: Barnabás Pőcze <pobrn@protonmail.com>
2023-01-09 12:27:17 +00:00
Dmitry Sharshakov
996f8a5832 v4l2: ignore symlinks in case of openat passthrough 2023-01-09 12:27:17 +00:00
Wim Taymans
ba374a7b47 impl-node: restore running state after reconfigure
Add a reconfigure state on the node that is set when the node was IDLE
or RUNNING when reconfigured.

The node state will be set to the running state as long as the
reconfigure state is active. When the node is running, the reconfigure
state is unset again and the node is allowed to IDLE as usual.

This fixes the case where an IDLE (but not paused node) will be
suspended when a rate change happens but will then not resume
afterwards.

This causes problems with rate changes and nodes that have the suspend
disabled by the session manager. They will be suspened anyway and this
can cause problems for devices that need to keep running to keep the
amplifiers active.

Fixes #2929
2023-01-09 11:49:10 +01:00
Wim Taymans
07633f2146 context: rename a method
Rename suspend_driver -> reconfigure_driver because that is more like
what it does.
2023-01-09 11:49:10 +01:00
Wim Taymans
e099f0598a pw-reserver: improve output a little 2023-01-09 11:49:10 +01:00
Wim Taymans
26496724c6 impl-node: move 2 state variables to private
So that they can be used when making scheduler decisions.
2023-01-09 11:49:10 +01:00
Wim Taymans
0ddf80d470 midifile: error won invalid track size
When the track data would exceed the file size, return an error.
2023-01-09 11:49:10 +01:00
Wim Taymans
6a516b9505 context: fix typo in comment 2023-01-09 11:49:10 +01:00
Robert Mader
602aa7d541 pipewiresrc: Reenable DMABuf support
This was disabled in 15b4c58e as under various circumstances Gstreamer
pipelines would mmap the DMABufs, which can be very slow in various cases.
One typical example of that is screen casting using a dedicated graphics card.

Thus we only want to use DMABufs if the peer element advertises support for
`GST_CAPS_FEATURE_MEMORY_DMABUF`, ensuring no mapping will happen if we
set the format accordingly.

This allows pipewiresrc to be used with DMABufs for fully accelerated
pipelines or in combination with a download element such as `gldownload`[1]
without regressing the commit above. The `gldownload` approach mirrors
what webrtc (Chromium/Firefox) does, but without duplicating the
functionality into pipewiresrc.

While on it, also implement dmabuf negotiation according to
https://docs.pipewire.org/page_dma_buf.html with the modifiers
`DRM_FORMAT_MOD_INVALID` and `DRM_FORMAT_MOD_LINEAR` in order to allow
dmabuf negotiation with more modern clients, including Gnome-Shell.

1: for now use something like `glupload ! glcolorconvert ! gldownload` -
   `gldownload` does not support importing DMABufs yet but `glupload` does.
2023-01-08 09:17:19 +00:00
Dmitry Sharshakov
549e543444 v4l2: report framerate using VIDIOC_G_PARM 2023-01-08 09:12:33 +00:00
Jan Beich
6d58c73937 module-rt: fix warning when xdg-desktop-portal isn't running
$ pipewire
...
[W][1234.001] mod.rt       | [     module-rt.c:  278 pw_rtkit_check_xdg_portal()] Can't find xdg-portal: (null)
...
2023-01-08 07:29:42 +00:00
Wim Taymans
b2f43e7bad pulse-server: fix echo-cancel _master args
The sink_master and source_master should be set on the capture and
playback streams so use the new properties on module-echo-cancel to do
this.
2023-01-07 15:00:40 +01:00
Wim Taymans
feac9f1c70 module-echo-cancel: add capture and playback props
Add a capture.props and playback.props config section to set properties
for the capture and playback stream.

Fixes #2939
2023-01-07 13:58:30 +01:00
Dmitry Sharshakov
6fb543a514 adapter: support node.channel-names
Allow customizing channel names for nodes
2023-01-06 23:17:33 +03:00
Wim Taymans
4f458b5d9a filter-chain: dynamically allocate the params
Dynamically allocate the offsets and params arrays so that it can
support more than 512 params.

Fixes #2933
2023-01-06 12:41:06 +01:00
Robert Mader
be2757c121 gstpipewireformat: Fully handle SPA_CHOICE_Step
The step value was not used.
2023-01-06 11:16:52 +00:00
Robert Mader
0f4fcd63ac filter: Better SPA_CHOICE_Step support
Allow comparing single values with step-ranges. An example where this
can be useful is when trying to encode a screencast with a hardware
encoder.
2023-01-06 11:16:52 +00:00
Thomas Weißschuh
d4db7e1d9b pw-dump: sort dictionaries
Dictionaries are by default printed in their insertion order.
This is unergonimic when comparing properties created by different
clients, as they may insert them in different orders.
2023-01-06 11:15:17 +00:00
Wim Taymans
ed9d3e7320 v4l2: fix some compiler warnings
Compare poiters with NULL and without ordering.
2023-01-06 10:32:25 +01:00
Dmitry Sharshakov
bb23fd787e v4l2: support setting controls 2023-01-03 12:19:14 +00:00
Dmitry Sharshakov
08107f1a02 v4l2: support querying controls 2023-01-03 12:19:14 +00:00
Dmitry Sharshakov
5c96928d12 v4l2: follow symlinks 2023-01-03 12:19:14 +00:00
Wim Taymans
f62c40c205 acp: also add the Pro profile for UCM devices 2023-01-03 13:17:10 +01:00
Wim Taymans
3595e31124 acp: add ports only when there are ucm devices 2023-01-03 13:16:06 +01:00
Wim Taymans
2eaac9b67a acp: mark the Pro profile with a flag 2023-01-03 13:13:03 +01:00
Wim Taymans
6116ef8484 impl-port: clear peer buffers in suspend
When we clear the buffers on an output port when we clear the port
format in suspend, also clear the buffers shared by the peer input
port mixers because else they would reference old stale buffers.

Fixes #2914
2023-01-02 17:24:35 +01:00
Wim Taymans
6b228944f7 impl-port: clear have_buffers when setting 0 buffers 2023-01-02 16:03:36 +01:00
Thomas Weißschuh
ed46324872 alsa: fix memory leak of properties 2023-01-01 02:00:36 +00:00
Bob Ham
a65a58d1a0 README.md: Add "Getting help" section
Fixes #2916
2022-12-29 12:48:07 +00:00
Wim Taymans
860b8fc27f modules: fix rate update
Setting the rate with the PROP_rate would actually result in a rate
adjustment of 1.0f / rate, so do the same here.

See #2891
2022-12-29 12:22:56 +01:00
Barnabás Pőcze
73c5f6e1bf pipewire: module-roc-{sink,source}: port to ROC v0.2.X
Incompatible changes between ROC v0.1.X and v0.2.X require
adjusting the ROC modules' code. The largest change is going
from `roc_address` to `roc_endpoint`. There is also a breaking
change, the removal of `local.ip` parameter from module-roc-sink
as `roc_sender_bind()` has been removed.

The API usage was modelled after https://github.com/roc-streaming/roc-pulse

See #1757
Fixes #2911
2022-12-29 10:13:30 +00:00
Robert Mader
be99aa1eba gst: deviceprodiver: Add fd property / camera portal support
Add a `fd` property to `GstPipeWireDeviceProvider` so it can be used
with fds obtained from e.g. the camera xdg-desktop-portal.

This is needed so apps like Cheese or Camera can easily implement the
camera portal.
2022-12-27 23:43:22 +01:00
Robert Mader
2bc3e0ca10 gst: deviceprodiver: Use GstPipeWireCore and some cleanups
Quoting the commit introducing `GstPipeWireCore`:
```
Make all sources in the same process with the same fd share the
connection to the server. This makes it possible to set the same
fd on multiple sources/sinks and have them all use the same
connection, like when capturing multiple monitors from screencast
with the portal.
```

Do the same for `GstPipeWireDeviceProvider`, so it can share a
connection with device sinks as well. This will be needed for fd based
connections introduced in the next commit.

Further more it allows some cleanups.

1: 70652d1a37
2022-12-27 23:36:36 +01:00
Pauli Virtanen
b0853ad34a bluez5: media-sink: set initial latency after getting transport
The call to set_latency doesn't do anything, before transport has been
set.
2022-12-21 16:42:04 +02:00
Pauli Virtanen
c7b3ef0d9f bluez5: backend-native: fix missing brace in CIND reply
It should look like ...,("battchg,(0-5)) not ...,"battchg",(0-5))
2022-12-21 12:55:20 +02:00
columbarius
9f1311a2e0 examples: only use memfd_create when defined
See #987
2022-12-20 10:42:28 +01:00
Julian Picht
8c0a94c9d8 module/roc-*: fix position of comment 2022-12-19 12:47:47 +01:00
Julian Picht
b47e799c9a module/roc-*: implement audio.rate 2022-12-19 12:25:33 +01:00
Wim Taymans
89ac6b3535 alsa: don´t set -1 as node.target
Leave the target unset when -1, just like what pw-stream does.

See #2893
2022-12-17 18:17:33 +01:00
Wim Taymans
9c2b2a64f0 audioconvert: improve debug output
Print channelmix matrix when there is something to print. Avoids
skipping zero matrix lines in some cases.
2022-12-16 19:50:45 +01:00
Wim Taymans
846dbce7f1 doc: update after PIPEWIRE_DEBUG changes 2022-12-16 18:29:19 +01:00
Wim Taymans
6a69152185 acp: add api.acp.probe-rate option
Add an option to configure the samplerate used for probing because the
default 48KHz might not work for everyone.

See also #1599
2022-12-16 12:57:17 +01:00
Wim Taymans
f4f316b951 filter-chain: move fft to dsp_ops 2022-12-16 11:30:18 +01:00
Wim Taymans
b6b6efff42 convolver: use normal float for complex float array 2022-12-16 10:51:19 +01:00
Wim Taymans
538b6ce35e filter-chain: use dsp sum/copy/clear functions 2022-12-16 10:22:01 +01:00
Wim Taymans
0f2f113bdc filter-chain: add optimized sum function 2022-12-16 10:19:20 +01:00
Wim Taymans
cd38d7b53b filter-chain: move functions to separate struct
So that it's easier to copy them.
2022-12-16 09:37:45 +01:00
Wim Taymans
fa10849139 filter-chain: pass dsp_ops around
Initialize dsp_ops in the filter-chain and pass it around.
2022-12-16 09:28:00 +01:00
Wim Taymans
f7c49bbdde pulse-server: add channel-map in echo-cancel module 2022-12-15 13:12:47 +01:00
Wim Taymans
7758240c79 bluez: fix compilation without ldac_abr
The define for this constant was removed but it was LDACBT_EQMID_MQ
before.
2022-12-15 12:20:40 +01:00