Open
Conversation
Add an index offset when enumerating controls. We insert 2 properties before enumerating the controls so the index of the first control needs to have an offset of 2.
When using custom commands, the converter might return -ENOTSUP and we should ignore this.
Just pass all events to the node and only error out when they return an error value. Make sure we pass the result values of the command around.
Only react to the capture stream state change and format changes. The playback and capture streams change state somewhat concurrently and so the graph state might not be consistent. Because only the capture stream will trigger the playback stream and start the processing, we can safely react to capture stream changes only.
Add functions to dynamically start and build a bytes pod.
There is no need to encode the potential format in the format.dsp of control ports, this is just for legacy compatibility with JACK apps. The actual format can be negotiated with the types field. Fixes midi port visibility with apps compiled against 1.2, such as JACK apps in flatpaks.
Don't set the UMP type flag on the format. Use the negotiated types flag to decide what format to output. Add support for output to old style midi. Set the UMP type flag only on the new mixer and JACK when UMP is enabled. This ensures that only new (or explicitly requesting) apps get UMP and old apps receive old midi. This makes JACK running on 1.2 in flatpaks work with midi again.
Since 3abda54 we prefer the format of the filter. This reverses the selection of the default value when negotiating buffers from the target to the follower. If the follower does not select a reasonable value for the buffer size, for example, this then results in wrongly sized buffers. Fix this by reversing the order of allocation from target to follower where we let the target (converter) select a default value, which is more likely to be correct. See #4713, #4619
The change from 1 to 8 was done without justification in the commit message and possibly for debug purposes. Unfortunately it breaks negotiation with the libcamera virtual pipeline, which defaults to 4 buffers. Set the the value to 1 again as successful negotiation - even with an unusually low number of buffers - is usually more desirable than an error. Fixes: 98b7dc7 ("gst: don't do set_caps from the pipewire callback") (cherry picked from commit e81fb77)
When the follower has no buffer suggestion, it can return -ENOENT, which should not generate an error but simply use the converter buffer suggestion instead.
Fixes compiler warning: /usr/include/spa-0.2/spa/pod/builder.h:357:69: error: unused parameter 'offset' [-Werror=unused-parameter]
Before fixating the format, we try to add as many of the PortConfig fields as we can as defaults. However, when we already have a property that intersects, prefer to use the original negotiated one prefered by the follower. This got changed when the default for the pod filter changed to the filter value. The effect is, for example, when the follower asks for FL FR FC LFE SL SR and the sink is using FL FR SL SR FC LFE, the PortConfig (and the default) would then be FL FR SL SR FC LFE. After negotiation, we would get FL FR FC LFE SL SR as the format but then with the filter and the wrong default we would fixate to FL FR SL SR FC LFE, which does not match what the follower wanted and either results in wrong channels or an error of the follower. See #4722
We do this by setting the node as passive. Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4255 Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4726
Also implement the flag for record streams, where it is more usually used, like in pavucontrol to disable starting a network source.
When we set activated=false, signal the thread because it might be waiting in drain. See #4728
When _probe() is called, take a ref to the newly created devices instead if sinking the floating ref, since gst_clear_object() is called when core is disconnected. Otherwise the devices will be freed before the caller gets them. Fixes the following assert in the caller: g_object_is_floating: assertion 'G_IS_OBJECT (object)' failed Or sometimes a segfault with the backtrace: 0 g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0x116c1b0, fundamental_type=fundamental_type@entry=80) at /usr/src/debug/glib-2.0/2.84.0/gobject/gtype.c:3918 1 0xb6d40cc6 in g_object_is_floating (_object=0x116c1b0) at /usr/src/debug/glib-2.0/2.84.0/gobject/gobject.c:3843 2 0xb6bc4c74 in gst_device_provider_get_devices (provider=0x109ba00) at /usr/src/debug/gstreamer1.0/1.24.12/gst/gstdeviceprovider.c:426
It is possible that the port io is set to NULL when the node is negotiating or destroying. Fixes #4734
The blocking invoke function is not meant to be called with any of the loop context locks acquired so that it can actually run the invoke call while blocking. Make this (and other blocking risks) clear in the documentation. Because it is not supposed to be called with any of the locks, we should also not try to call the hooks (that implement the unlock/lock). Fixes #4472
Combine stream selects the biggest latency from all output streams and sent the latency upstream. To select the biggest latency, each stream needs to have the sample rate and the quantum size set. The combine stream recalculates the latency in the latency changed callback or during data processing. Stream sets the sample rate and the quantum size in a copy_position call which is normally called during processing the output data or when state changes to streaming. Before this change, it wasn't guarantee the copy_position was called for each stream already and latency in the combine stream was selected from random stream. Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
When stream is paused, internal delay buffers were cleared, but some data could stay in stream output queue. Without a flush, these data where played in front of a new data. Patch was inspired by 64d6ff4 fixing the same issue in a filter-chain module. Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
Interrupts are disabled in alsa_irq_wakeup_event -> playback_ready method to not produce another wakeups when waiting for a new data. Interrupts are enabled again when a new data arrives in a method spa_alsa_write. In rare cases, when there is multiple streams providing data and one of them is disconnected, a new data fails to be delivered and the spa_alsa_write is not called. Not providing data produces underrun and alsa-pcm invokes recovery process. Recovery process starts a new playback, but without interrupts enabled is graph not triggered and new data are not delivered (to enable interrupts). Recovery process keeps running in loop. Now the interrupts are enabled again after the recovery and the starvation should not occur. Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
Because we do the processing of the graph in the playback process function, only do graph reset and reconfigure from the playback state change so that we don't have process and state change at the same time and crash.
Use a blocking invoke to ensure the loop is not using the graph anymore when we deactivate or reset it. See #4750, #4700
When we do_prepare, always reset the dll. We already set the alsa_sync field but that is only used by followers to resync in some cases. When reseting the dll, we also reset the next_time and base_time values, we however need to do this before calculating the error in update_time when we are the driver in IRQ mode or else we get some crazy error that distorts the rate estimation.
… much for 20ms of buffer.
Author
|
@simongapp @Mister-M-alt Do we agree to use this slightly cleaned up version of the rebase? If yes, should we switch to versioned branches, e.g. milan-avb-dev-1.4.7? |
Member
|
I think introducing versioned branches is a great idea @ntonnaett. |
simongapp
approved these changes
Aug 16, 2025
Author
|
Could you create milan-avb-dev-1.4.7 from this branch? It would be nice to base the split PR on this. Right? Basing it on upstream/1.4 would also make sense to see the difference in the module-avb directory. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've just fixuped and squashed some commits. As we rewrite the whole history at some point, this is enough for now IMO.