Commit graph

6942 commits

Author SHA1 Message Date
Wim Taymans
b9bad88eed netjack2: make function to clear events
Make a separate function to clear events instead of passing NULL as the
midi buffer and segfaulting.
2025-05-13 10:54:25 +02:00
Wim Taymans
85479cf203 netjack2: copy the node.group to streams
Just in case we want them to be scheduled in the same group.
2025-05-13 10:54:19 +02:00
Wim Taymans
c2c255b5f9 netjack2: keep per stream io_position
And handle the trigger failure with a warning and fallback.
2025-05-13 10:54:06 +02:00
Wim Taymans
dc1f73ceaf netjack2: warn when the trigger fails 2025-05-13 10:53:50 +02:00
Wim Taymans
f3cb35dad3 netjack2: keep position io per stream
Keep a position info for the stream it was set and then use the position
info for the stream that is driving the graph. Otherwise we might use a
destroyed position info.
2025-05-13 10:53:41 +02:00
Wim Taymans
5a00232cdf netjack2: implement ifname in the driver
See #4666
2025-05-13 10:53:34 +02:00
Wim Taymans
3a231a807d netjack2: Improve docs
Remove unused option.
Clarify that channels and midi port are chosen by the server.

See #4666
2025-05-13 10:53:25 +02:00
Wim Taymans
3aaf91d9c6 netjack2: fix the large midi events offset
The midi events have their large data offsets relative to the start of
the buffer and the large data is at the end of the buffer. Because we
copied it down, right after the events, but we didn't adjust the
offsets, calculate a correction offset when unpacking the events.
2025-05-13 10:50:01 +02:00
Wim Taymans
d28d195745 netjack2: set correct max midi buffer size
It depends on the negotiated period size, not the graph quantum.
2025-05-13 10:49:48 +02:00
Wim Taymans
28109587fd netjack2: copy large midi events to the end of the buffer
There is no need to keep an extra free byte at the end and it will cause
us to lose a byte when we copy the large midi events down.
2025-05-13 10:49:37 +02:00
Wim Taymans
3d33acce1d netjack: handle overflow in midi buffer append 2025-05-13 10:48:55 +02:00
Wim Taymans
1cbe4e1782 ump: handle sysex from UMP to MIDI1 better
SysEx in UMP can span multiple packets. In MIDI1 we can't split them up
into multiple events so we need to collect the complete sysex and then
write out the event.

Fixes SysEx writes to ALSA seq by running the event encoder until a
valid packet is completed.

Also fixes split MIDI1 packets in the JACK API when going through the
tunnel or via netjack.
2025-05-13 10:48:39 +02:00
Wim Taymans
5d741a2b3c filter-chain: add props only once
Only add the properties offset in the builder after we actually got a
property or else we end up with the same property twice.
2025-05-09 11:54:34 +02:00
Wim Taymans
8c1e1ea17f midifile: unpack the UMP SysRT bytes correctly
They are packed in a native endian uint32_t so read it like that and
then use shifts to get the right bytes.
2025-05-09 11:50:43 +02:00
Simon Ruderich
63bf21d7b8 midifile: decode UMP SysRT messages 2025-05-09 11:50:36 +02:00
Pauli Virtanen
f120b595f0 pw-loopback: add missing --channel-map long option 2025-04-14 09:40:02 +02:00
Wim Taymans
07f49a7559 raop: fix byte array initialization
Initialize the byte array with bytes instead of a string because the 0
byte at the end of the string does not fit in the array and causes a
compiler warning.
2025-04-14 09:39:18 +02:00
Arun Raghavan
cf5db17aa6 gst: sink: Only add VideoCrop meta for video 2025-04-03 06:15:11 -04:00
Wim Taymans
f0a432118a gst: require a buffer size of at least 1
Setting the default size to 0 and outside of the min/max range now means
that there is no suggestion for the size and it should use the
suggestion of the peer.
2025-04-03 06:14:26 -04:00
Sanchayan Maity
f571253ff3 gst: pipewiresrc: Fixate caps if intersect did not return fixated caps
We might end up in a situation where depending on the pipeline,
intersect might not give us fixated caps.

Possible example of such a pipeline can be below.

gst-launch-1.0 -e pipewiresrc target-object=<path> ! audioconvert !
audio/x-raw,format=S16LE,rate=48000,channels=2 ! lamemp3enc !
filesink location=test.mp3

This results in non-fixated caps like below when intersecting caps from
format param and possible_caps which depends on what we have downstream
in the pipeline.

audio/x-raw, layout=(string)interleaved, format=(string)S16LE, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003;
audio/x-raw, layout=(string)interleaved, format=(string)S16LE, rate=(int)48000, channels=(int)2

To fix this, fixate the caps explicitly.
2025-04-03 06:14:02 -04:00
Philippe Normand
99b94015a7 gst: src: Fix buffer pool handling in case of caps renegotiation
In case negotiation is first attempted with unfixed caps, bufferpool support was
unconditionally disabled. Then at a second caps negotiation attempt it wasn't
restored according to the property value.
2025-04-03 06:13:24 -04:00
Sanchayan Maity
48a959bf2e gst: pipewireformat: Do not use RANGE if values are equal
This fixes assertion from the underlying gst_value_collect_int_range
when using gst_caps_set_simple with range types when the values are
equal.
2025-04-03 06:13:13 -04:00
Wim Taymans
98e7ae39c6 impl-link: improve debug log
Log the format after we patch it up and log some context lines.

Move some info log to debug.
2025-04-02 15:33:54 +02:00
Philippe Normand
81408597f4 gst: deviceprovider: Fix a leak and a heap-use-after-free
The device passed to gst_device_provider_device_add() is transfer:floating, so
we need increase its ref, otherwise the pointer we keep internally will be a
dangling ref.

Also gst_device_provider_device_remove() doesn't actually release the device, so
we have to do it ourselves.

Fixes #4616
2025-04-02 15:33:54 +02:00
Wim Taymans
58c412c9dc pw-cat: improve sndfile file format debug info
Print the endianness, container name and the sample format nicely
instead of dumping the hex values.
2025-04-02 15:33:54 +02:00
Wim Taymans
081cb6848e pw-cat: prefer AU format when using stdin/stdout
WAV is actually not usable for streaming output by sndfile.

See #4629
2025-04-02 15:33:54 +02:00
Robert Mader
b87764bd07 systemd: Depend on dbus.service
Solution suggested by Xi Ruoyao.

The dbus user service is required for various features - the summary says:
'dbus (Bluetooth, rt, portal, pw-reserve)'

On session logout the dbus service gets shut down while the Pipewire one
relies on a timeout. If a user logs in again before PW timed out, the
later stays alive but doesn't handle re-connecting to the dbus service
of the new session, breaking the camera portal and potentially other
features.

Thus hard-depend on the dbus service (if enabled at build time) and thus
shut down together with it.

(cherry picked from commit 2625983a23)
2025-03-20 14:05:28 +01:00
Wim Taymans
9696e2c62b loop: remove return from function returning void
Fixes #4603
2025-03-14 10:15:42 +01:00
msizanoen
17eaf83fe8 systemd: Disable pipewire user services for root
The `access(2)` based multi-user mediation mechanism doesn't quite work
for the root user, which may cause it to conflict with a running
foreground user session. Prevent this by not running the user service at
all for the root user, which nobody should be doing anyway.
2025-03-11 12:27:14 +01:00
Jan Grulich
8d55213288 stream: don't emit process when disconnecting
Commit b160a72018 introduced this change
before, but it was omitted in e1e0a886d5.

This makes again sure we don't call process callback while disconnecting
stream.

Fixes #3314
2025-03-11 12:27:05 +01:00
Jan Palus
901401e6f1 module-roc: require roc >= 0.4.0
3270bd4 introduced changes reyling on features from roc 0.4.0
(upstream commit: d18d342)
2025-03-10 09:24:20 +01:00
Taruntej Kanakamalla
a4a9d3540d gst: sink: copy frames if video buffer from other pool
In case of the video, if the buffer to be rendered is from upstream and
not from the pipewirepool, map the memory into video frames and copy the
frames instead of doing a buffer copy.

Avoid splitting of buffers in the case of video, because that might break
the frame layout, especially planar formats, for the applications which
use pipewiresink as a camera source to capture video.
2025-03-04 22:54:47 +05:30
Wim Taymans
0b5d669679 jack: add option and disable MIDI2 port flags by default
Add an option to add the MIDI2 flag on ports. This is disabled by
default because most JACK apps don't know about the flag and then
refuse to show the MIDI ports.

Fixes #4584
2025-03-04 15:51:39 +01:00
Wim Taymans
3905e3b3d3 stream: set errno to the current error
Make the state_changed event and _get_state() function set errno with
the current error value if the state is in error, so that application
can use this to give more detailed error reporting.

Use this in alsa, v4l2 and pulse to give some other error codes than
EIO.

Fixes #4574
2025-03-04 13:22:51 +01:00
Nicolas Fella
398914e609 Add missing includes to metadata.h
Fixes https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4575
2025-02-25 12:49:46 +00:00
Philippe Normand
9296d1645f gst: deviceprovider: Notify default devices changes
This allows GStreamer apps using GstDeviceMonitor to be notified when the user
changes the default input/output devices.
2025-02-25 12:48:21 +00:00
Wim Taymans
fb4475b5da adapter: evaluate node rules before loading the follower
So that the right node.rules are applied to the follower.

See #4562
2025-02-20 17:06:24 +01:00
Wim Taymans
e825a6ae6c modules: reduce some errors from warn to info
Some of the more common errors (caused by packet loss, network jitter, ...)
should be reported with INFO unless there is some indication about how
to fix the problem.

Fixes #4559
2025-02-18 16:24:52 +01:00
Wim Taymans
3270bd4552 module-roc: add some more options
To configure the resampler backend and latency-tuner. This is mostly
to work around potential bugs in the ROC resampler backend.

See #4516
2025-02-18 15:51:39 +01:00
Wim Taymans
62035963a3 protocol-native: support abstract socket addresses
They start with @ and do not create a file in the file system.
2025-02-17 16:50:16 +01:00
Wim Taymans
cfc8d414a9 module-rtp: fix SSRC warnings
Fix indentation and also suppress the SSRC warning for other formats
than audio.
2025-02-17 10:21:17 +01:00
Arun Raghavan
5e295815bf module-rtp-sap: Add a couple of SDP parsing validations 2025-02-15 22:42:46 -05:00
Arun Raghavan
25e58995f5 module-rtp-sap: Silently ignore other SSRCs if we know the receiver SSRC
If we know the receiver SSRC from the SAP, we can happily ignore packets
on other SSRCs.
2025-02-15 22:32:12 -05:00
Arun Raghavan
13e3918f81 module-rtp-sap: Publish sender SSRC if we have it
Can be handy on the receiver side.
2025-02-15 17:58:34 -05:00
Arun Raghavan
dbf0442c7e module-rtp-sap: Fix sending first session SDP
We don't initially have the SAP socket open, so we can't generate an SDP
(because we don't have the interface address). So in addition to the
regular flow, also trigger SDP creation after opening the SAP socket, so
we can have a valid SDP for the announcement.

The sending was broken in commit a44afd84. We delay the SAP fd openeing
for reasons explained in commit f2f204d6).
2025-02-15 17:58:34 -05:00
Wim Taymans
f8272c767f profiler: scale quantum with rate
When we have a forced or suggested rate, adjust the latency with the
new denominator.

Fixes #4555
2025-02-15 14:09:25 +01:00
Wim Taymans
1c9b5fd258 link: deprectate using port.id in link-factory
It is ambiguous when the port.id also matches a port object.id.
2025-02-14 11:19:54 +01:00
Wim Taymans
152acf69c2 link-factory: check that the port belongs to the node
When both node and port are given, check that the port belongs to the
node. If it doesn't, it could be that we found a Port using the
object.id but we should have used the port.id of the node.
2025-02-14 10:58:11 +01:00
Wim Taymans
cfddbb033a doc: clarify the port id
It might be confused with port.id to state explicitly that this is
actually the object.id of a port.
2025-02-13 21:11:06 +01:00
Wim Taymans
27e0338f24 pulse-server: clarify pulse.rules properties 2025-02-12 15:19:29 +01:00