Refactor the IR loading code, Make some generic open/load/close
functions and handle the different filenames in the open call.
This makes it possible to reuse some of the delay and alloc code.
It also makes it easier to add new IRs loading code.
Support /IR:<rate>,<value1>,<value2>,... as an inline IR definition.
The associated cases where IGMP membership is silently dropped may happen
infrequently. But when they do, these log lines can occur at a large
volume. To not spam the logs in such cases, change the log level from
info to debug.
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
Flush errqueue for iso-io also from the media-source handler, to avoid
dropping packet tx reports.
This applies to bidirectional streams. The sink/source handlers poll on
different fd, one being dup'd, and epoll does not trigger them in any
specific interleaved order.
`libusb_free_device_list()` should be passed `true` as its second
argument to unreference every single device in the list.
Fixes: 5e0b63b149 ("bluez5: backend-native: use quirks + usb adapter caps for checking msbc")
`dbus_connection_register_object_path()` does not take ownership of the
path passed to it, so currently the callers `telephony_{ag,call}_register()`
leak a copy of the path string. Fix that by not making an unnecessary copy.
Fixes: b28399ac57 ("bluez5: add telephony D-Bus service implementation")
Add a new thread.reset-on-fork property for the thread creator. when set
to false, it will clear the default SCHED_RESET_ON_FORK flag and new RT
threads will be able to fork and inherit the rt policy and priority.
When creating a thread make sure we set SCHED_RESET_ON_FORK when the
thread.reset-on-fork property is not explicitly false;
module-rt needs to preserve the SCHED_RESET_ON_FORK flag when changing
the policy.
Set thread.reset-on-fork=false explicitly for JACK clients to restore
the JACK behaviour where implementations can fork and inherit the RT
policy and priority by default.
Fixes#4966
No links on the port will result in a NULL tag and >0 links will always
result in a non-NULL tag (that could be empty).
This makes it easier to see when a port is linked or not.
This reverts commit 3eb011c9d1.
Not a good idea, the internal signals are for scheduling peers and so
some peers are simply not signaled when they don't need to be scheduled,
like for async nodes or upstream nodes.
Forward existing impl-node peer_added and peer_removed signals on the
stream.
Because the stream is not on the server, there is no impl_node in the
node target. Add the node id to the peer_added/removed signal and use
that for the stream event argument. Implementations can then look up the
details on the global.
We need at least a default value and the default value as a possible
value.
For enum type in the PropInfo we usually list just the basic type and
then use labels to list alternatives.
SPA_POD_CHOICE_ENUM_Int must always take at least 2 values as first one
is default. (Just 1 value no longer works on current master, and it's
anyway incorrect.)
Replace with just SPA_POD_Int, as there's just one choice.
In the unknown form-factor case (which I saw on a set of headphones
here, Creative Zen Hybrid Pro), let's avoid an apocryphal acronym in
favour of a term that might be more familiar to the user.
When a device profile changes (e.g., Bluetooth headset switching from
a2dp-sink to headset-head-unit), the active port information changes
but PulseAudio compatibility layer clients don't receive the expected
PA_SUBSCRIPTION_EVENT_SOURCE or PA_SUBSCRIPTION_EVENT_SINK change events.
Root cause:
The collect_device_info() function updates the active_port index from
SPA_PARAM_Route parameters, but doesn't update the corresponding
active_port_name field. When update_device_info() uses memcmp() to
detect changes in the device_info structure, it compares the entire
structure including active_port_name. If the pointer value doesn't
change (even though the actual port changed), no change is detected,
and the change_mask flag (PW_MANAGER_OBJECT_FLAG_SOURCE/SINK) is not
set, preventing subscription events from being sent.
Solution:
After setting active_port in collect_device_info(), look up the
corresponding port name from SPA_PARAM_EnumRoute parameters by
matching both the port index and direction. Initialize active_port_name
to NULL at the start to ensure it's always recalculated.
This fix applies to all device types (Bluetooth, USB, PCI sound cards)
and all profile switching scenarios, ensuring applications using the
PulseAudio compatibility layer receive proper device change notifications.
Tested with:
- Bluetooth headset profile switching (a2dp-sink ↔ headset-head-unit)
- Applications subscribing to PA_SUBSCRIPTION_MASK_SOURCE/SINK events
- Verified no regression in audio initialization
Some downstream elements trigger re-negotiations when the stream is
running, e.g. due to output window resizing for the below pipeline.
gst-launch-1.0 pipewiresrc ! videoconvert ! video/x-raw ! gtk4paintablesink
This fails due to a side effect introduced by commit 77143e54 with
handle_format_change() setting `is_video` to `false` when param was
NULL. Fix this by explicitly tracking media type and not just video
using a boolean.
Unknown preprocessor symbols are replaced with 0 in preprocessor
conditionals, so if `__has_attribute()` is not supported, then
the condition will be the following:
if 0 && 0(__cleanup__)
which is syntactically incorrect.
So split the condition and only check `__has_attribute()` if
it exists.
Fixes: 65d949558b ("spa: utils: add scope based resource cleanup")
Fixes#4962
I found no uses of SPA_TYPE_Bitmap outside of the SPA code itself and
the now-removed v0 protocol support. Wim Taymans confirmed that it has
no uses and is not usable. Deprecate it so it can hopefully be removed.
Check if the pod size is at least big enough to hold 1 item when getting
array or choice items.
Check that the number of choice values is at least enough to handle the
given choice type. Remove some redundant checks.
GST_SECOND * t.rate.num can turn into a negative gint, resulting in
assertions like:
_gst_util_uint64_scale_int: assertion 'num >= 0' failed
Just use the 64bit version instead.
Instead of always renegotiating a new format and buffers when the
driver changes, only renegotiate when the converter notifies us
of an EnumFormat change. It's possible that changing the driver does
not actually change the result of EnumFormat and then we would simply
renegotiate to the same format and buffers for nothing.
In the audioconvert, check if the target_rate of the new driver has
changed. We keep the last value in our own clock so that we don't
renegotiate when we are removed from a driver (which sets our own
clock as the position). The target rate influences the result of the
EnumFormat params when we are resampling and so we need to emit a
EnumFormat change.
Makes it possible to define audio channels and position with a
predefined layout string.
It is easier and less error prone to say "5.1" than to spell out
[ FL FR FC LFE RL RR ].
AUX channels have a special syntax. AUX<N> will make <N> AUX
channels. Easier to say AUX128 than to write an array with the
128 AUX channels.