Commit graph

13742 commits

Author SHA1 Message Date
Pauli Virtanen
7e135a5235 bluez5: fix compilation 2025-06-13 21:06:08 +03:00
Pauli Virtanen
df591638a5 bluez5: indicate codec support status for ofono/hsphfpd
Indicates codecs properly.
2025-06-13 17:51:16 +00:00
Pauli Virtanen
52fc22a76b bluez5: make sure mandatory codecs are always enabled
It should not be possible to disable mandatory codecs: csvd, sbc, lc3
2025-06-13 17:51:16 +00:00
Pauli Virtanen
9f34e962a6 bluez5: backend-native: don't hardcode available HFP codecs
Remove most hardcoding of possible HFP codecs. Instead, get what is
available from codec lists.
2025-06-13 17:51:16 +00:00
Pauli Virtanen
83f6d719b1 bluez5: remove HFP codec id from transports
Make HFP codec id backend/codec internal detail. Remove
spa_bt_transport::codec field which is now unused.
2025-06-13 17:51:16 +00:00
Pauli Virtanen
3f9fb8d664 bluez5: bluez5-device: reduce special casing of HFP codec related things
Get most information items out from media_codec properties, avoid
referring to HFP codec ids.
2025-06-13 17:51:16 +00:00
Pauli Virtanen
defcea02fa bluez5: convert sco-sink to media_codec API
Use codecs via media_codec in sco-sink instead of implementing the
encoding in-place.

In future, media-sink could replace sco-source to reduce code
duplication.
2025-06-13 17:51:16 +00:00
Pauli Virtanen
1c5895f625 bluez5: convert sco-source to use media_codec API
Use codecs via media_codec in sco-source instead of implementing the
decoding in-place.

Also slightly adjust media-source decode semantics.

In future, media-source could replace sco-source to reduce code
duplication.
2025-06-13 17:51:16 +00:00
Pauli Virtanen
123f937701 bluez5: backend-hsphfpd: set media_codec on created transports
Set media_codec on created transports.

Also avoid using the HFP codec id in spa_bt_transport::codec
2025-06-13 17:51:16 +00:00
Pauli Virtanen
61b0ea4589 bluez5: backend-ofono: set media_codec on created transports
Set media_codec on created transports.

Also avoid using the HFP codec id in spa_bt_transport::codec
2025-06-13 17:51:16 +00:00
Pauli Virtanen
13256e9083 bluez5: backend-native: set media_codec on created transports
Set media_codec on created transports.

Also avoid using the HFP codec id in spa_bt_transport::codec
2025-06-13 17:51:16 +00:00
Pauli Virtanen
62bec49c27 bluez5: add spa_bt_get_hfp_codec() / spa_bt_get_media_codecs()
These are for HFP backends to get media codecs.
2025-06-13 17:51:16 +00:00
Pauli Virtanen
e6f5fb12a3 bluez5: add HFP codecs in the media codec API
Add copy of HFP codec implementations in the media codec API.
2025-06-13 17:51:16 +00:00
Pauli Virtanen
4e0d0c5f0b bluez5: replace codec->bap/asha flags with codec->kind enum
Indicate codec type with enum instead of bool flags.  This is in
preparation of moving also HFP to media codecs.
2025-06-13 17:51:16 +00:00
Wim Taymans
83c644fe09 pulse-server: mark empty buffers
This makes it use some more optimal paths in the mixer.
2025-06-13 18:07:55 +02:00
Wim Taymans
3d1c9f1cce modules: update Props and ProcessLatency
When setting Props or ProcessLatency on a stream, it doesn't actually
remember the values that were set so we need to manually update them.

See #4731
2025-06-13 12:46:40 +02:00
Wim Taymans
3d8a19af33 filter-chain: we manage the state from the playback stream 2025-06-13 11:58:42 +02:00
Elliot Chen
72e0fe0479 pipewiresrc: add provide clock property 2025-06-13 08:10:20 +00:00
Christian Glombek
baf0b0b9e1 50-raop.conf.in: Add a condition that allows for disabling module 2025-06-13 08:08:31 +00:00
Wim Taymans
c1b5fb19ea spa: add volume_ramp_scale enum type info
And link it to the SPA_PROP_volumeRampScale property
2025-06-13 10:06:09 +02:00
Wim Taymans
c2eb173fdc spa: make the wave, pattern and ditherType Int
Properties of type Id should have a type of the enum with the possible
values associated with them.

The other types that don't have a fixed enumeration but are usually
mapped to some constant/description with PropInfo should be Int.

Fixes !2399
2025-06-13 10:06:09 +02:00
Frédéric Danis
f6fc307638 bluez5: backend-native: Support legacy audio connection
This allows to connect the SCO link with old HFP AG devices which
doesn't support the codec negotiation.
The audio connection could be done even without an ongoing call.
2025-06-13 07:47:18 +00:00
Wim Taymans
d238fc8199 doc: fix a typo 2025-06-13 09:21:51 +02:00
ZZyVSmOzMz OZaAEBlUIZ
0e8a8e9844 filter-chain: add dolby pro logic ii sink 2025-06-12 17:18:21 +00:00
ZZyVSmOzMz OZaAEBlUIZ
d07a383d6e filter-chain: use only builtin filter for dolby surround sink 2025-06-12 17:18:21 +00:00
Wim Taymans
fa8208eeef tools: make some things configurable
Things like indentation and simplified spa layout are behind an if 0
but wil some option parsing this could be improved.
2025-06-12 17:16:27 +02:00
Wim Taymans
4c1be71773 modules: Propagate the combine latency
When we get latency on the combine stream, forward it to all
streams after setting the per stream compensate latency (if any).

See #4731
2025-06-12 16:36:51 +02:00
Wim Taymans
549f3fc46f module-combine: use a better empty property string
The empty string fails to parse as a properties, use "{}" instead.
2025-06-12 16:35:49 +02:00
Wim Taymans
046fdad4ee modules: improve latency handling
Now that the stream remembers the latency for us, we can only care
about the other latency.

So, if we get (output) latency on an input port/stream, we add our
own latency and then set it on the output port/stream. We do the
same for input ports.
2025-06-12 15:20:18 +02:00
Wim Taymans
92243038c1 stream: handle Latency params better
LOCK the Latency param we get from the peer so that we don't remove it
when we update our own port latency. Also don't remove our port latency
when we get an update from the peer.

This essentially keeps the update/clear of the upstream and downstrem
latencies separate and makes it easier to implement the latency
logic in the pw-stream.

When a filter receives a Latency event on a port, it can simply update
the other port latency and none of the peer latencies are removed.
2025-06-12 15:02:17 +02:00
Wim Taymans
2393be4543 spa: add SPA_LATENCY_INFO_UNSET
Add a initializer for an unset latency info. Use this for combining
latency info.
2025-06-12 12:12:28 +02:00
Wim Taymans
5480a1382f modules: always update latency params
Even if the latency didn't change, the current pw-stream
implementation will have wiped all Latency params away and we want
to put them back in all cases.

See #4731
2025-06-11 16:26:03 +02:00
David Turner
3a0ffe21e6 libcamera: Default to auto-focus & auto-exposure
libcamera says that cameras should default to manual focus mode.  This
means that unless pipewire clients specifically change this control,
users with an autofocus-capable camera are left with an out-of-focus
image.  This patch sets the autofocus mode to continuous and enables
auto-exposure (as the default for this is unspecified).

Testing with an imx708 on Raspberry Pi OS on a Raspberry Pi 4, before
this patch the image was generally out of focus in Firefox/webrtc, after
this patch autofocus works correctly.
2025-06-11 13:56:26 +00:00
Wim Taymans
82229b3d87 modules: make sure we deactivate the graph safely
Use the loop lock to ensure the loop is not using the graph anymore when
the deactivate or reset it.
2025-06-11 15:21:26 +02:00
Wim Taymans
3fdcf0d34c alsa: reset alsa_sync when linked
When a linked node needs to be resynced we actually never clear the
flag or reset the dll. Move the code around so that it still does
the reset of the flag and dll without actually doing the resync in
the ringbuffer when it is a linked node.
2025-06-11 13:06:54 +02:00
Wim Taymans
524da5962d alsa: reset dll in prepare
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.
2025-06-11 13:03:18 +02:00
Wim Taymans
b0462cb5de filter-chain: do graph reconfigure in playback state change
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.
2025-06-11 11:43:13 +02:00
Wim Taymans
c08ef84745 modules: initialize the latency params
Otherwise we get nonsense values for the direction.

See #4731
2025-06-11 10:17:32 +02:00
Wim Taymans
190d49d874 loop: add docs about the locking 2025-06-10 18:00:01 +02:00
Wim Taymans
a2f2bded0b modules: update latency handling in example filter 2025-06-10 16:48:49 +02:00
Wim Taymans
b6b61a956f modules: implement Latency according to docs
Make one function to update the Latencies on all streams. We need to do
this because if one of the process or latency params change, it
influences the latency params on all streams.
2025-06-10 16:48:49 +02:00
Martin Geier
4976ac7ef9 alsa-pcm: add dsd bit order parameter
Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
2025-06-10 16:28:48 +02:00
Martin Geier
9afa0cd270 alsa-pcm: enable interrupts after alsa recovery
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>
2025-06-10 16:28:46 +02:00
Martin Geier
c2e539b780 module-combine-stream: flush data in paused state
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 64d6ff4184 fixing the
same issue in a filter-chain module.

Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
2025-06-10 16:28:43 +02:00
Martin Geier
ff3bc8818f module-combine-stream: update latency right before playback starts
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>
2025-06-10 16:28:40 +02:00
Wim Taymans
88963e9a9c Revert "loop: deprecate the hooks"
This reverts commit 550ec8c2a4.

Before hooks are still useful when integrating other fds in the pipewire
main loop.
2025-06-10 13:08:45 +02:00
Wim Taymans
550ec8c2a4 loop: deprecate the hooks
They were mostly useful for locking and unlocking but since that is
builtin right now, we should remove those eventually.
2025-06-10 12:01:20 +02:00
Wim Taymans
8e32afb863 loop: don't call the hooks around blocking wait
The hooks were previously used to unlock the loop but now that the
lock is handled inside the loop itself and we don't unlock before the
blocking read anymore, we should also not call the hooks.

The blocking invoke function is not meant to be called with any of the
loop context locks acquired in order to avoid a deadlock. Make this (and
other blocking risks) clear in the documentation.

See #4472
2025-06-10 11:57:38 +02:00
Wim Taymans
feba1fd260 meson: fix avfilter dependency 2025-06-10 11:23:15 +02:00
Wim Taymans
a78e97a53b filter-chain: document ffmpeg plugin 2025-06-10 10:55:45 +02:00