Commit graph

12707 commits

Author SHA1 Message Date
Dylan Aïssi
0c5b2f1154 meson: allow fallback to find_library for readline detection
Fixes: 050a51aa (" meson_options: Add readline option")

Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
2024-07-31 15:39:38 +00:00
Wim Taymans
b61765eaf4 pw-cli: support arbitrary large params and commands
Use a memstream to collect the arguments so that it can dynamically
allocate as much memory as necessary.

Use a dynamic pod builder to construct the pods so that they can be of
arbitrary size.

Fixes #4166
2024-07-31 17:36:45 +02:00
Wim Taymans
8fac16a594 module-ffado: add some docs 2024-07-31 16:22:11 +02:00
Wim Taymans
7065023a5f module-ffado: keep the configured rate in sync with params
When we reconfigure rate, make sure we update the EnumFormat and Format
params with the new value.
2024-07-31 16:20:15 +02:00
Wim Taymans
a831a15825 module-ffado: Improve samplerate and periodsize handling
Only set use the graph rate and duration when the ffado.sample-rate
and ffado.period-size properties are set to 0. Othersize use the
configure values.

Without this patch, it would just ignore the settings and always use the
graph rate.
2024-07-31 15:59:21 +02:00
Wim Taymans
f4b2854770 impl-node: include config.h to define HAVE_MALLOC_TRIM
It was previously not used..
2024-07-30 17:50:04 +02:00
Wim Taymans
5cc7e583e2 impl-node: reset pending state when moving driving node
Commit d04a28daef moved the configuration
of the IO_Position after we removed the node from the old driver but
forgot to move the code that updates the pending_state.

See #4094
2024-07-30 14:17:58 +02:00
Wim Taymans
db31586298 development is 1.3.0 2024-07-30 12:07:20 +02:00
Wim Taymans
494600d46a loop: release queue lock before calling invoke function
We don't actually need to hold the lock while calling the invoke
function, we only need the lock to protect the list of queues.
2024-07-30 12:04:42 +02:00
Pauli Virtanen
c8c7295f56 doc: document node/device disabled property 2024-07-30 08:27:10 +00:00
Pauli Virtanen
163044ab1e doc: move configuration index to a separate page
Also add index to pipewire-props
2024-07-30 08:27:10 +00:00
Pauli Virtanen
e057b8d727 doc: document some more device properties
Document some missed ALSA device properties.

Update Bluetooth docs.
2024-07-30 08:27:10 +00:00
Wim Taymans
65f067347d require newer alsa 1.2.10 for UMP support 2024-07-30 10:06:41 +02:00
Wim Taymans
ce89ce304d alsa: fix compilation wirh -UFASTPATH 2024-07-30 09:53:14 +02:00
Wim Taymans
802972f1ae ump: handle f0 .. f0 f7 .. f0 f7 .. f7 packets
Support the RFC 4695 sysex segmentation rules where a sysex packet can
be split into multiple chunks using the f0 and f7 patterns like:

begin      f0 ... f0
continue   f7 ... f0
end        f7 ... f7

Add a unit test for the sysex UMP conversion.
2024-07-30 09:38:40 +02:00
Wim Taymans
e507c03ad3 doc: update some MIDI docs
The current situation is:

 - The ALSA sequencer produces and consumes raw UMP only. Legacy input
   is converted with the control mixer to UMP.
 - All apps and plugins are made to consume and produce UMP.
 - The control mixer can convert between UMP and MIDI when required.
 - Legacy apps (pw-filter) will still receive MIDI1 events (converted by
   the control mixer).
 - Helper functions to convert UMP to and from MIDI can be used to ease
   implementation when legacy MIDI is still required.

Using UMP natively over raw MIDI has some advantages:

 - Transparent support for MIDI2 hardware and the new MIDI2 features
   such as increased resolution for events, microtonal support, etc..
 - Easy to convert between legacy MIDI and UMP
 - Large SysEx can be fragmented properly.
 - Fixed size messages are easier to parse and handle.
2024-07-30 09:38:40 +02:00
Wim Taymans
d057c95b2b midifile: add support for UMP
Add a type to the events, which can be MIDI1 or UMP.

Add debug functions for UMP messages.

midifile only supports saving MIDI1 format files for now. It will convert
to MIDI1 when asked to write an UMP message.

In pw-cat, convert the MIDI1 messages to UMP before sending into the
graph.
2024-07-30 09:38:40 +02:00
Wim Taymans
d9e7a10b0d modules: accept and produce UMP only 2024-07-30 09:38:40 +02:00
Wim Taymans
40cd8535eb audioconvert: only accept UMP on the control port 2024-07-30 09:38:40 +02:00
Wim Taymans
94bb5a2dd2 alsa: add UMP support
Use the new UMP alsa sequencer API to make it produce UMP packets.

Set the alsa sequencer to MIDI2.0, which will make it convert all
messages to MIDI-2.0 UMP automatically. We can copy this straight into
the control buffers.

This also solves some problems with large sysex messages that are now
nicely split into chunks with UMP.
2024-07-30 09:38:40 +02:00
Wim Taymans
7f38653589 filter: Use the stream DSP format to negotiate control types
Add OSC and UMP control types and make sure the mixer converts to the
selected format.

Mostly useful for legacy filters that use the old MIDI format, placing
the Midi control type in the format will make the mixer convert to it.
2024-07-30 09:38:18 +02:00
Wim Taymans
0c4ea83b89 control: add support for mixing to UMP
Check the negotiated control output format and convert to it when
necessary.
2024-07-29 18:15:58 +02:00
Wim Taymans
648ba982d4 jack: Add UMP to MIDI conversions
Add 2 new port format extensions, one for OSC and another for UMP.

Make sure we convert the events from UMP/OSC/MIDI to jack events
depending on the port type.

Try to produce UMP by default.
2024-07-29 18:15:58 +02:00
Wim Taymans
7b03a41e3d spa: add some helpers to convert MIDI to and from UMP 2024-07-29 18:15:57 +02:00
Wim Taymans
3e87aca7a9 spa: Add UMP control type
UMP (universal Midi Packet) is an improved version of transmitting MIDI
messages. It also has support for MIDI 2.0 and is backwards compatible
with MIDI 1.0.
2024-07-29 18:15:57 +02:00
Wim Taymans
bb82b2e493 impl-port: improve IO_Buffers management on ports
Make sure we clear IO_Buffers on the port and mixer before we clear the
buffers or the format. The IO_Buffer is used to check if the port should
be processed or not and its update is synchronized with the data-thread.

Set IO_Buffers on the mixer and node only after we have configured the
buffers on the node.

See #4094
2024-07-29 18:15:09 +02:00
Wim Taymans
61dcd8dede audioconvert: set IO_Buffers only when buffers are negotiated
The IO_Buffers is used in the data thread to check if the port should be
scheduled or not. Make sure it is only set after we set buffers on the
port and cleared before the buffers are cleared.

Make sure we sync the port->io with the data thread.

See #4094
2024-07-29 18:15:06 +02:00
Pauli Virtanen
d7235c1dbd doc: rename pipewire-devices.7 and move stream properties into it
Collect the list of object properties into a single place.

Group properties in the index based on the object type. Consider
"Monitor" as a separate object type, as it's generally configured
separately.

Add something about Port, Link, and Client properties. Just explain some
of these as they're fairly technical, so just link to API docs.
2024-07-28 14:06:34 +00:00
Pauli Virtanen
3d8fb4844c doc: drop the links to configuration wiki pages
The wiki pages mostly just duplicate the content here.
2024-07-28 14:06:34 +00:00
Vlad
308a93bd14 bluez5: Update default sync_factor
Due to the how the kernel part of BlueZ computes the extended
advertising interval for a Broadcast Source, a sync_factor smaller
than 2 will result in an invalid interval value (too small).
2024-07-28 13:45:45 +00:00
Pauli Virtanen
23f02b0d98 CI: build docs also for 1.2 branch, and show them on main page 2024-07-25 21:25:48 +03:00
Wim Taymans
57b495f775 module-netjack2: support local.ifname for manager
Fixes #4141
2024-07-22 13:34:14 +02:00
Wim Taymans
959491966a modules: fix doc
Fixes #4134
2024-07-22 13:21:27 +02:00
Wim Taymans
db710359ad impl-link: make async link when on e of the nodes is async
We simply cannot schedule async nodes properly if we don't have the
async link. This change was done to make sure that driver sources don't
end up with async buffers and cause a unneccesary 1 cycle delay in
async clients. But we can fix this in a better way, like this:

Increment the cycle counter after we copy the output port buffers. This
ensures the async clients immediately pick up the new buffers (or the
output buffers from the previous cycle).

Also remove some old compatibility code that is no longer useful.

Fixes #4138
See #4133
2024-07-22 13:10:33 +02:00
Wim Taymans
2a8a08f303 loop: signal when queue is full
When our queue is full, signal the wakeup event to make sure the thread
will wake up and try to clear the queue before we go to sleep.
2024-07-20 14:05:09 +02:00
Wim Taymans
8a62563d5b module-rtp: fix ptime and target_buffer checks
target_buffer is in samples and ptime in msec so we can't really compare
them. Use psamples instead, which is ptime but then as samples.

See #4095
2024-07-19 13:17:51 +02:00
Wim Taymans
9a313a5d42 link-factory: destroy all links in error
There is no possibility to recover from this so simply destroy the link.
The clients should already have received the link status when we destroy
it.
2024-07-19 12:06:09 +02:00
Wim Taymans
7447dedef4 module-netjack2: implement netjack2.connect
When netjack2.connect is true, make streams and set the autoconnect
property on them. Otherwise, make sink/source as it was before.

Fixes #4125
2024-07-19 11:48:14 +02:00
Wim Taymans
0062d64b3a module-netjack2: stop follower when setup io errors out
Just disable the data socket when it errors out but stop the follower
when the setup socket is in error.

This makes shutdown work properly when the setup socket is stopped,
which is what actually happens eventually.
2024-07-19 11:47:07 +02:00
Wim Taymans
b5a7a1f224 module-netjack2: improve port names
Let the default port logic make the port names. For network nodes this
will be with a send/recv prefix.
2024-07-19 11:42:51 +02:00
Wim Taymans
842e620c1a jack: jack_get_time() returns microseconds
As found by David García Goñi

Fixes #4128
2024-07-19 10:04:44 +02:00
Wim Taymans
398060bc7b jack: don't check timestamps in mixdown
jack_port_get_buffer() can be called with 0 frames, This is to restrict
the available space in the returned midi buffer after mixdown. While we
mixdown, we should not check timestamps so that all midi events are
added to the mixdown buffer.

Fixes qsynth.
2024-07-18 16:49:11 +02:00
Wim Taymans
c73b56db38 fix compilation 2024-07-18 14:24:53 +02:00
Wim Taymans
280bbd88d4 modules: don't unload module on stream error
Unloading the module on stream errors is a bit too much because a
suspend can clear the stream error again (or the error might not be
fatal)

This can happen for example when negotiation fails on some stream ports
(wireplumber tries to link the midi ports to audio ports) and it's
better to not completely fail on that.

Fixes #4121
2024-07-18 14:15:22 +02:00
Wim Taymans
32e4553a05 impl-node: always INACTIVATE when stopping
A remote node is prepared when the Start command sync reply has been
received.

If we however quickly switch from active to inactive, the
pending reply is cancelled but the remote node will have set the
FINISHED status and will be ready to be scheduled.

Make it so that we always set the INACTIVE status when the node is
canceled and unprepared, even if we didn't get the reply and the node
was not prepared.

Fixes #4122
2024-07-18 13:44:36 +02:00
Arun Raghavan
0dc17d8d88 spa: alsa: Fix stale function name in comment 2024-07-17 20:07:57 -04:00
Daniel Lundqvist
8b613e20d9 module-jack-tunnel: Properly propagate error from dlopen()
dlopen() does not set errno on failure, rather you're supposed to call
dlerror() to get the latest error. dlerror() return a string so
instead return -ENOENT from weakjack_load_by_path().

Depending on errno weakjack_load() could think it successfully loaded
the library, and later module-jack-tunnel would crash because it call
a NULL function pointer.
2024-07-17 20:26:56 +02:00
Sven Püschel
0c07c78621 spa: libcamera: uncomment setting integer controls
When using Open Broadcaster Software with Pipewire and a libcamera
camera node, changing the ExposureTime doesn't work.

The commit introducing the camera control setting has commented out the
integer case: ef4b9745b2 ("libcamera: handle canceled requests")
But as it doesn't give a reson for the comment, it looks like an
oversight.

Therefore removing the comment to allow setting the ExposureTime integer.

Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
2024-07-17 16:00:23 +00:00
Sven Püschel
5932963506 spa: match camera property types with libcamera
The Pipewire libcamera spa plugin exposes multiple camera properties.
Unlike v4l2, libcamera usually exposes these as normalized floating
point values. But as the SPA_PROP types are based on v4l2, they are
currently set to integers.

This causes a problem when using pw-cli to change the properties,
as the spa_json_to_pod_part function casts the properties according
to their spa_type_info. Other software that doesn't depend on the
spa_type_info can correctly set the properties, as the values are
encoded in the spa_pod type and therefore also carry a type.

As the limited range from switching integers to floats is likely not a
problem, the affected spa properties were changed to the Float type.
This will cause pw-cli to also generate spa_pod values of type float
when setting v4l2 properties. Therefore the v4l2 spa plugin is also
adapted to allow floating point properties and cast these to integers.

Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
2024-07-17 15:56:53 +00:00
Arun Raghavan
ab5fadec2b pw-profiler: Move clients' legend away from graph data
With a large number of clients, some of them might be obscured by the
graph. Separate out the legend for now. We might be able to do better
formatting, but for now, this should do.
2024-07-17 15:54:34 +00:00