Commit graph

4758 commits

Author SHA1 Message Date
George Kiagiadakis
e02eedb5a7 bluez5: README-Telephony: document ofono service compatibility 2025-02-05 08:50:24 +00:00
Frédéric Danis
613021137c bluez: native-backend: Handle AT commands replies for HFP HF 2025-02-05 08:50:24 +00:00
Frédéric Danis
18c447b0a4 bluez: native-backend: Add three-way call handling support in HFP HF 2025-02-05 08:50:24 +00:00
Frédéric Danis
224f6a10f5 bluez: native-backend: Add call support in HFP HF
This commit implements the dial, answer and hangup callbacks to manage
call when connected to HFP AG device.
This adds +CLIP support to be able to get remote party phone number.
2025-02-05 08:50:24 +00:00
George Kiagiadakis
5dacd77866 bluez5: telephony: make the call list public 2025-02-05 08:50:24 +00:00
George Kiagiadakis
a501c887ea bluez5: telephony: ensure NULL strings are converted to "" on D-Bus properties 2025-02-05 08:50:24 +00:00
George Kiagiadakis
6534b58d3b bluez5: telephony: add user_data space on the AG & Call structures
This is mostly useful to store the spa_hook for the event listener
2025-02-05 08:50:24 +00:00
George Kiagiadakis
a7f7e65b92 bluez5: initialize telephony service in backend-native 2025-02-05 08:50:24 +00:00
George Kiagiadakis
b28399ac57 bluez5: add telephony D-Bus service implementation 2025-02-05 08:50:24 +00:00
George Kiagiadakis
16c4cd05a9 bluez5: initial telephony service API documentation 2025-02-05 08:50:24 +00:00
Barnabás Pőcze
1e09827953 spa: libcamera: don't use fixed size buffers for properties
Use `std::string` and `std::ostringstream` when processing the
camera properties, in order to avoid truncation.

See !2095
See !2268
2025-02-03 17:20:25 +00:00
Barnabás Pőcze
41045c5e61 spa: libcamera: use references when getting camera properties
The argument is not nullable, so use a const lvalue reference
to express that clearly.
2025-02-03 17:20:25 +00:00
Wim Taymans
5e6b77cf1e spa-resample: improve output format selection
Setting a format does not automatically mean making a wav file.

Instead, check for the extension on the output file name and when we
can't find any good containet, use the same as the input file.

This makes more sense than doing `spa-resample test.flac -r 44100 test.wav`
and ending up with a FLAC file named test.wav. Or
`spa-resample test.flac -r 44100 -f s16 test2.flac` and ending up with a
wav file named test2.flac.
2025-01-31 09:24:08 +01:00
Wim Taymans
110d8572c0 audioadapter: fix EnumPortConfig without converter
If we don't have a converter, we always work in passthrough mode and
EnumPortConfig can use the same code as PortConfig in all cases.

See !2265
2025-01-28 12:39:31 +01:00
Michael Tretter
0814bafef1 videoadapter: fix EnumPortConfig for adapter without converter
The videoadapter always exposes the EnumPortConfig parameter. If no
converter is loaded, the EnumPortConfig parameter doesn't return a
parameter.

In this case, the client-node in the PipeWire server returns -ENOENT for
the EnumPortConfig, which in turn causes WirePlumber to fail the object
activation and it won't be able to create a link for the object.

This happens since Commit b57375ba85 ("stream: enable videoadapter in
all cases"), since now the videoadapter is always added. Before that,
the EnumPortConfig parameter was just not exposed and linking worked.

Running another client that ignores the error codes for missing
parameters (e.g., pw-dump) hides the issue, as the EnumPortConfig result
is cached as successful with 0 parameters and accessing the cache
doesn't return an error code.

Return the same PortConfig for EnumPortConfig as for PortConfig to fix
this.
2025-01-28 11:38:08 +00:00
Sanchayan Maity
ab5f81b9a4 bluez5: g722: Make sequence number handling consistent with other codecs 2025-01-27 18:43:24 +05:30
Sanchayan Maity
23ae55015d bluez5-dbus: Do not setup ASHA profile for unconnected devices
Do not add/connect the profile for unconnected devices.

This fixes the issue where a previously paired ASHA device
would show up in the pavucontrol output device list even
when not connected.
2025-01-27 09:22:41 +00:00
Wim Taymans
ce31e66fb7 audioadapter: only add/remove port when passthrough changed
We only need to switch between the converter ports and the follower port
when we switch between passthrough. Avoid emiting remove of the (non
existing) follower ports when the mode changes from none to DSP at startup.
2025-01-27 10:20:55 +01:00
Arun Raghavan
43f148677e spa: audioadapter: Enum follower formats first in convert mode 2025-01-26 18:58:36 -05:00
Arun Raghavan
beb81e8f4e spa: audioadapter: Explicitly track port mode
Will be useful for convert-mode-specific EnumFormats.
2025-01-26 18:52:51 -05:00
Pauli Virtanen
50437fb4eb bluez5: set device.routes on device set nodes
Device set node props are controlled by a Route, so set device.routes=1
to avoid Wireplumber restoring node props on it.
2025-01-26 21:04:49 +02:00
Pauli Virtanen
de0f54c324 bluez5: support BAP hardware volume on device sets
Enable hardware volume for device sets, when all devices in the set
support HW volume.
2025-01-25 15:37:52 +00:00
Pauli Virtanen
34ac0d8256 bluez5: support BAP hardware volume
Support BAP HW volume now that it's implemented in BlueZ, with the
volume range 0-255 per spec.
2025-01-25 15:37:52 +00:00
Wim Taymans
b72eed8f03 audioadapter: don't emit result events for internal param enums
All of the _sync param enum calls are internal end should not result in
a result event externally.

See !2260
2025-01-25 16:34:35 +01:00
Wim Taymans
fa15af376f context: avoid some scaling overflows
Make a macro to scale without overflows and use this in the context.
2025-01-24 16:23:01 +01:00
Wim Taymans
0c8f803d59 audioconvert: optimise f32d to/from s16s conversions
They are mostly used for sending and receiving RTP so it might be worth
to make them a bit faster.
2025-01-24 10:37:02 +01:00
Sanchayan Maity
6e67b3a2d7 bluez5: media-sink: Use correct profile name for ASHA 2025-01-23 10:13:48 +05:30
George Kiagiadakis
d0b3c00d29 bluez: enable delay reporting for a2dp-source
This allows our a2dp-source (sink endpoint) to report delay to the
remote source endpoint. Setting the "Delay" property is already
implemented, but by failing to configure DelayReporting, bluez rejects
the property change.
2025-01-21 16:11:08 +00:00
Arun Raghavan
980d37fb80 audioadapter: Trivial whitespace fix
Makes an annoying clang warning about mismatched indents.
2025-01-21 10:47:14 -05:00
Arun Raghavan
e57a01594e audioconvert: Only use rate_scale when working at DSP rate
In convert mode, we will be resampling directly to the output rate, so
don't try to scale to driver rate.
2025-01-21 08:50:43 -05:00
Andrew Sayers
db972b5bc1 Downgrade snd_pcm_mmap_commit error to warning 2025-01-21 11:20:23 +00:00
Wim Taymans
d2c2276088 adapter: pass follower direction to converter
Partially revert 86af9de739

The PortParam does not give enough information to derive the direction
of the converter. If the converter is configured in convert/convert
there is just no way to know when to output a quantum or not.

Fix this by doing a quick probe of the follower and then pass the
direction to the converter.

See !2227
2025-01-21 11:43:11 +01:00
Wim Taymans
b97dd00f26 loop: add some more docs about loop_control
Add a gmainloop integration example.

See #4467
2025-01-20 11:48:07 +01:00
Wim Taymans
b4c9135799 filter-graph: also support float fequency
Parse the frequency as string and then try to convert it to float so
that it also supports float frequencies.

See #4418
2025-01-20 09:55:42 +01:00
Pauli Virtanen
29a6552cc9 bluez5: take fractional resampler delay into account for reference time
Improve sample reference time accuracy by including the fractional part
of the resampler delay.
2025-01-19 17:11:13 +02:00
Pauli Virtanen
5f21ee8669 audioconvert: add delay_frac to spa_io_rate_match
Report the "fractional" part of the resampler delay in
spa_io_rate_match::delay_frac, in nanosamples (1/1e9 sample) at node
rate.

The delay values are best reported in units where it is clear what the
clock domain is, so report the value in fractional samples instead of
nanoseconds. Conversion to ns is also just dividision by the appropriate
rate.
2025-01-19 17:11:13 +02:00
Pauli Virtanen
f3a9ebd569 audioconvert: resampler: change resample_phase() unit to input samples
Report fractional delay in input samples instead of nsec at the nominal
input rate, as that is closer to what the value actually means.
2025-01-19 17:11:13 +02:00
Wim Taymans
9889d1ce0a alsa: close the sequence on error. 2025-01-19 15:56:01 +01:00
Wim Taymans
e4fc8d43bb alsa: handle error from _set_client_midi_version()
See #4507
2025-01-19 15:52:48 +01:00
Pauli Virtanen
eb91f097d9 audioconvert: resampler: fix off-by-one issues
Resampler without prefill was sometime outputting with different delay
than with prefill. Adjust initial history by 1 which seems to bring it
more in line.

The resampler phase also appears to depend on how many samples remain in
history which leads to possibly unexpected +-1 variation. Take this into
account in reported phase.

These changes make the resampler delay tests pass.

Both changes are sort of empirical --- I don't fully understand why
these would fix things but they seem to be needed to make the delay
calculations agree with what the resampler outputs.
2025-01-17 19:10:43 +02:00
Pauli Virtanen
79384530b5 audioconvert: resampler: add more resampler delay tests
Test also conversions between different rates, and with and without
prefill.
2025-01-17 19:10:43 +02:00
Pauli Virtanen
07f6dde3dd audioconvert: add function to get phase to resampler API
Support getting any fractional phase part of the resampler delay in its
API.
2025-01-17 19:10:43 +02:00
Wim Taymans
85c5d65c97 audioconvert: only consume from input what the resampler used
Keep track of the consumed samples from the input and use that to update
the in_offset. The resampler can tell us how much samples were used.
2025-01-17 12:20:06 +01:00
Wim Taymans
f914cf9327 audioconvert: the delay of the resampler is in input rate
The resampler needs ntaps/2-1 (delay) input samples to produce 1 output
sample so the delay is measured in input rate.
2025-01-15 17:02:39 +01:00
Wim Taymans
0913b3ef7b audioconvert: report delay in input rate
The delay is always expressed in samples at the output rate of the
resampler. For input streams we need to convert this to the expected
input rate.

Make the delay reporting in playback streams more accurate.
2025-01-15 15:25:49 +01:00
Pauli Virtanen
b952cfbe38 bluez5: remove resampler delay fudge factor
The resampler delay was off by one sample, so remove the corresponding
fudge factor here.  This matters for BAP output synchronization.

The resampler has also some fractional delay, so there can still be
sub-sample offset between the original and resampled timelines.  This is
not currently taken into account.
2025-01-13 19:05:58 +02:00
Pauli Virtanen
2c2bed2aeb audioconvert: fix resampler delay value and add test
Resampler delay for N taps is N/2-1 input samples.

Add test that checks this.

When input rate is varying, the resampler also accumulates additional
sub-sample delay. The resampler does not currently have API to report
the instantaneous sub-sample delay.  Add knownfail test for it.
2025-01-13 19:05:58 +02:00
Wim Taymans
049ab37a6d audioconvert: only deactive old filter when new filter loaded
When we fail to load the new filter, keep the old filter active or else
we will cause a crash when we clean up the old graph.
2025-01-13 16:58:28 +01:00
Wim Taymans
0868ff1ada math: improve denormal check
Use isnormal() when we can
2025-01-13 16:10:34 +01:00
Wim Taymans
73e11eea46 audioconvert: add wav stage only when needed 2025-01-13 15:39:32 +01:00