Commit graph

13610 commits

Author SHA1 Message Date
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
9b52c07871 jack: write midi events to end of buffer
There is no need to keep one extra byte at the end of the buffer,
we can write the event up to the last byte.
2025-05-13 10:49:18 +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
750b88c3ca control: only convert midi/UMP, pass other control types
We should only try to convert MIDI/UMP when the port doesn't support it
but let all the other control types pass through.

Fixes #4692
2025-05-09 12:01:24 +02:00
Wim Taymans
37dbf93cc4 filter-graph: remove useless check 2025-05-09 11:59:31 +02:00
Guido Günther
2d4af3ced5 spa: Add default: statements
This allows to use the library in projects that use `-Wswitch-default`
without any

 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wswitch-default"
 #pragma GCC diagnostic pop

This is useful as as the header is being pulled in via
pipewire/wireplumber headers into projects that might have this warning
enabled and would otherwise fail to build with -Werror.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-09 11:58:55 +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
7d27668fb2 ebur128: fix port name
Fixes #4667
2025-05-09 11:53:37 +02:00
Wim Taymans
0135baa60f alsa-seq: add the source only on success
Otherwise if we have an error with the timerfd, we have the source fd
added and we close the device.
2025-05-09 11:53:07 +02:00
Wim Taymans
49c4c44dce videoconvert: consume input buffer in all cases
Return the input buffer when we get some error so that the other side
can send new data.
2025-05-09 11:52:04 +02:00
Wim Taymans
957bde02cd v4l2: only skip buffer for raw formats
We don't want to skip the first buffer for encoded formats because it
can contain the encoding parameters, in the h264 case, for example.
2025-05-09 11:51:45 +02:00
Wim Taymans
f857a50734 ump: fix program change 2.0 to 1.0 conversion
The program change byte should not be shifted an extra bit, unlike all
the other messages.

Fixes #4664
2025-05-09 11:51:20 +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
Wim Taymans
3abda54d80 pod: use default value of filter
When using a filter, it makes more sense to use the default value
of the filter as a first attempt.

One case is in adapter when we try to find a passthrough format first. The
audioconverter suggests a default rate of the graph rate but the follower
filters this out for another unrelated default value and passthrough is not
possible (altough it would be because the default value of the filter is
in the supported follower range).

Fixes #4619
2025-05-09 11:49:08 +02:00
Wim Taymans
d20a1523b6 1.4.2 2025-04-14 11:46:02 +02:00
Wim Taymans
ac42f55916 ebur128: work around libebur128 bug
Versions 1.2.5 and 1.2.6 don't scale the window in ms correctly, leading
to excessive memory allocation, so work around this here.
See https://github.com/jiixyj/libebur128/pull/132

Fixes #4646
2025-04-14 11:19:44 +02:00
Kenny Levinsen
a0be431c7f audioconvert: Increase param length limit to 4096
Parameter values read into a 512 byte long buffer, which is insufficient
for medium to long filter-graph parameters.

Increase the buffer to 4096 bytes to give some wiggle-room.
2025-04-14 09:41:47 +02:00
fossdd
35591922ce doc: fix typo in pw-link(1) 2025-04-14 09:40:10 +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
1388f16c47 adapter: handle builder overflow 2025-04-02 15:33:54 +02:00
Wim Taymans
ce6d2fce9a audioadapter: init the builder for each param
Or else we keep on adding items until we overflow.
2025-04-02 15:33:54 +02: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
Wim Taymans
a9eba98e8e pod: handle builder overflows
When the builder is overflowed, we might get a NULL pod. This is a valid
situation that we need to handle because it can be used to get the
required builder buffer size.
2025-04-02 15:33:54 +02:00
Wim Taymans
2d26fbcddf v4l2: handle nearest set_format
The set_format function can return 1 when the format was adjusted to the
nearest supported format so return this from the port_set_param
function.

This instructs the adapter to recheck the configured format so that it
can store the adjuted format on the converter.
2025-04-02 15:33:54 +02:00
Wim Taymans
8d7175a1e7 adapter: add Header metadata by default
Firefox needs this but we should eventually check the Meta Params to
decide on this.
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
Pauli Virtanen
4176caca30 alsa: seq: double-check midi client version
Check midi client version after setting it, to see if it was really
successfully set.  Old kernels without UMP don't know about the midi
version fields, so snd_seq_set_client_midi_version() appears to fail
silently there.
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
2eb8cf5dc7 1.4.1 2025-03-14 11:07:06 +01:00
Wim Taymans
fb43eb8ee2 audioconvert: fix the filter-graph samplerate
The filter graph runs before or after the resampler depending on the
direction of the conversion.
2025-03-14 10:16:15 +01:00
Pauli Virtanen
d58d2a2375 spa: acp: indicate ALSA UCM profile errors in UIs
Add "[ALSA UCM error]" to the end of card description, to indicate
something is wrong.
2025-03-14 10:16:08 +01:00
Pauli Virtanen
ba3a36b3d1 spa: acp: allow also too few channels in SplitPCM configs
GoXLR Mini has different numbers of channels actually available (21, 23,
or 25) depending on its firmware/etc, but its UCM profile specifies
always 23. The count can then be bigger or smaller than what is actually
available.

Fail a bit more gracefully in the case of too few channels: create all
the split devices specified by the profile. The channels that aren't
actually available in HW just won't get routed anywhere.

ALSA upstream IIUC is saying that the channel counts should be fixed, so
spew warnings that say the UCM profiles are wrong if they look wrong.
2025-03-14 10:16:05 +01:00
sunyuechi
e16c184228 Add x86 CPU check in meson.build for clang build fix
have_avx = cc.has_argument(avx_args)

gcc generates an error when AVX is unsupported, whereas clang only
produces a warning.

Thus, using Clang on the RISC-V platform incorrectly enables AVX file
compilation, leading to build failures.
2025-03-14 10:15:56 +01:00