Commit graph

4139 commits

Author SHA1 Message Date
columbarius
3f80bc2e70 vulkan: Support MemPtr as import for compute 2024-01-29 08:44:25 +00:00
columbarius
7ffd8ff4de vulkan: Add function to upload data to a staging buffer 2024-01-29 08:44:25 +00:00
columbarius
36aa413cd7 vulkan: Add functions to create staging buffers 2024-01-29 08:44:25 +00:00
Wim Taymans
ad6e2ce480 param: clarify the internal latency 2024-01-29 09:41:11 +01:00
Pauli Virtanen
97db4a68a7 doc: explain clock/latency more
Update SPA_IO_Clock/Position documentation.

Explain some IOs are currently unused in PW.

Explain meaning of latency.
2024-01-29 08:36:15 +00:00
Pauli Virtanen
21392d327f bluez5: lowball fallback delay values
Reduce fallback delay values used when BT device doesn't provide the
information itself.

It may be better to have audio late than early, so use values that are
probably close to or below the delays of majority of headsets.
2024-01-28 18:00:04 +02:00
Pauli Virtanen
2ed0cddc57 bluez5: sco-sink: more accurate latency values
Use audio packet size for the latency, support for latencyOffsetNsec.
2024-01-28 18:00:04 +02:00
Pauli Virtanen
c0eb634156 bluez5: media-sink: more accurate latency
Don't include the quantum in latency: the latency relative to graph
cycle start doesn't depend on the quantum.  Instead, the audio packet
size determines it.
2024-01-28 18:00:04 +02:00
Pauli Virtanen
95b13391eb bluez5: media-sink: fix wrong clock
Should use position for graph clock rate.
2024-01-27 18:04:57 +02:00
Pauli Virtanen
84c5ba09dc bluez5: support api.bluez5.internal flag also for sco
Enable the /Internal media class hack also for SCO.

Session manager can use this to adjust SCO sink/source media.class when
it is going to emit front-end nodes hiding the hardware ones.
2024-01-26 11:58:30 +00:00
Pauli Virtanen
05402284c1 bluez5: backend-native: fix all rfcomm lookups to check profile
The rfcomm list may contain various AG & HF ones, so the profile must be
checked everywhere they are looked up.

Fix the rfcomm lookups everywhere to do it.

Fixes Pipewire<->Pipewire HFP connections, and sending HFP HF commands
to HSP or AG.
2024-01-26 11:57:30 +00:00
Wim Taymans
803c82abb9 alsa: use chmap by default when using UCM
Fixes #2648
2024-01-25 10:26:11 +01:00
Pauli Virtanen
65f594c6a1 bluez5: further HFP cleanups
Fix naming issues.
2024-01-25 08:43:45 +00:00
Pauli Virtanen
ebde25fe58 bluez5: clean up SCO code a bit
Minor cleanup in variable naming etc.
2024-01-25 08:43:45 +00:00
Pauli Virtanen
45ff965f33 bluez5: support LC3-SWB in SCO sink/source
Add support for LC3-SWB encoding/decoding.

Tested on Pixel Buds Pro.
2024-01-25 08:43:45 +00:00
Pauli Virtanen
fe412784a4 bluez5: support LC3-SWB in HFP RFCOMM & add codec id for it
HFP 1.9 adds LC3 as a possible codec in addition to CVSD & mSBC.
E.g. Pixel Buds Pro latest firmware supports it.

Add the RFCOMM side and codec selection for it.
2024-01-25 08:43:45 +00:00
Dmitry Sharshakov
ca25066874 node-driver: allow fractional resync-ms 2024-01-24 20:52:08 +03:00
Wim Taymans
e7888d4ccc support: add resync.ms option to node.driver
Move some of the tracking code for the DLL to where it is used.

Add resync.ms (default 10) option at which we give up rate adjusting
and instead do a hard resync. This results in a jump in the position
of the graph clock.
2024-01-24 17:53:15 +01:00
Pauli Virtanen
89077d16ec bluez5: prefer 16khz input for LE Audio duplex configurations
Devices may advertise other values, but not certain they will work well
in duplex configuration.

E.g. my Samsung Galaxy Buds2 Pro emits buzzing sound with 48kHz duplex
input.
2024-01-23 08:40:46 +00:00
Pauli Virtanen
cde8f9261c bluez5: lc3: pick qos values from BAP spec tables
Don't believe QoS values recommended by the device, which may be
suboptimal.  Instead, pick the values from the BAP v1.0.1 Table 5.2.

Link: https://github.com/bluez/bluez/issues/713
2024-01-23 08:40:46 +00:00
Pauli Virtanen
08819e3d17 bluez5: indicate to LC3 plugin whether endpoint is sink/duplex
The codec can make use of information on whether the endpoint is sink,
and whether there will be both sink and source configured.
2024-01-23 08:40:46 +00:00
Pauli Virtanen
9474030582 bluez5: determine available BAP profiles from remote endpoints
The PAC profile UUIDs do not appear in the UUID list, but are still
useful to know before SelectProperties.

Set them ahead of time based on the visible remote endpoints.
2024-01-23 08:40:46 +00:00
Pauli Virtanen
8eb1f5aa35 bluez5: pick right codec when multiple ones share the endpoint
The "default" codec is the one with fill_caps != NULL, and should be
picked if we don't know which one we are using.

Fixes showing AAC-ELD as supported when it's not, which happened because
it's ordered before the default AAC in the codec list unlike the other
"shared endpoint" codecs.
2024-01-22 22:38:45 +02:00
Wim Taymans
2f46ee2793 bluez: fix compilation some more 2024-01-22 15:39:17 +01:00
Wim Taymans
b2c8bd9311 bluez5: fix compilation 2024-01-22 15:20:53 +01:00
Adam Marcus
560b26a5b5 bluez5: add ELD support check 2024-01-22 14:04:16 +00:00
Adam Marcus
99b180f838 bluez5: correct endpoint name 2024-01-22 14:04:16 +00:00
Adam Marcus
e04fbb9f2a bluez5: avoid adding new codec endpoint 2024-01-22 14:04:16 +00:00
Adam Marcus
abf9725be1 bluez5: refactor ELD check 2024-01-22 14:04:16 +00:00
Adam Marcus
79ee1eaff0 bluez5: add AAC-ELD codec 2024-01-22 14:04:16 +00:00
columbarius
c3327742cc vulkan: Add pixel-formats to query format properties
We need a database of pixel format properties to remove hardcoded magic
numbers. This commit creates a simple function to query the bytes per
pixel for common RGBA formats.

This should be promoted to or superseeded by a common spa namespaced
version.
2024-01-22 14:00:41 +00:00
columbarius
49b67742c6 vulkan: move format enumeration into utils functions
This splots the format enumeration into a helper for dsp and raw pod
creation and a common function for the compute filters.

Counting formats with modifiers will be usefull to announce dsp and
raw formats from the same node.

No functional changes.
2024-01-22 14:00:41 +00:00
columbarius
02779fe28b vulkan: create validation function for dmabuf properties
Validation of properties is moved from the import and allocation
functions into a separate function. This allows later separation of
modifier informations from the base struct.
2024-01-22 14:00:41 +00:00
columbarius
08216be3b1 vulkan: use extension VK_EXT_QUEUE_FAMILY_FOREIGN
This extension is required for the aquire and release barriers
to transfer the buffer ownership from and two an external queue.
This removes a warning from the validation layers.
2024-01-22 14:00:41 +00:00
columbarius
1cad9ebb0d vulkan: Move vulkan_stream into vulkan-compute-utils
vulkan_stream will store compute specific properties.

No functional changes.
2024-01-22 14:00:41 +00:00
columbarius
e5f89e09d1 vulkan: Move vulkan_fence_create to vulkan-utils
This function is independent from compute.

No functional changes.
2024-01-22 14:00:41 +00:00
columbarius
51b7d49cff vulkan: namespace functions in compute-utils to spa_vulkan_compute
Rename compute functions to allow for shared common functions for
non oppinionated vulkan helpers.

No functional changes.
2024-01-22 14:00:41 +00:00
columbarius
7d97e47e28 videoconvert: Enable loading external converter plugins
Load the converter from the video.adapt.converter property.
2024-01-22 13:59:16 +00:00
columbarius
d6c1b6470a videoconvert: apply changes from audioadapter
Update the videoadapter to the structure of the audioadapter.
2024-01-22 13:59:16 +00:00
Wim Taymans
846f994ac8 alsa: increase buffers when using small buffer
We can increase the MAX_LATENCY again if we increase the amount of
buffers when we are using a small buffer.

Normally we ask for 4 * quantum-limit as the buffer. This should be good
to use 1 buffer and quantum-limit as the quantum with enough headroom
to not run out of buffers.

If we are however using less buffer-frames we need to be careful and
allocate an extra buffer. Imagine using a buffer of 4096 frames, we can
support a quantum of up to 2048 frames if we use 2 buffers.

See #3744
2024-01-22 12:10:51 +01:00
Wim Taymans
c5b845bc90 alsa: improve max-latency property
Half of the buffersize is not enough to support as a max-quantum, we
need to divide by (4 * frame_scale) to allow some headroom and account
for the DSD scaling. We do the same calculation to suggest a buffer size
using the quantum-limit.

See #3744
2024-01-22 10:20:24 +01:00
Thomas Weißschuh
4034e8f3c5 spa: mark constant parameters as such
The info parameter is never modified, communicate this to users.
This align format-utils.h with latency-utils.h.
2024-01-20 19:12:03 +01:00
Wim Taymans
490558f3de v4l2: improve filter with missing format
When the filter has no format property, just enumerate all possible
framerates. Handle error case where the filter has the wrong type.

Makes gst-launch gstpipewiresrc ! video/x-raw ! fakesink work.

See #1793
2024-01-17 10:11:29 +01:00
Wim Taymans
14b265f646 v4l2: fix format enum with unsupported framerate
Actually count the number of frame fractions we add. If we added 0, we
don't have any supported framerate that intersects with the filter and we
try the next frame size.

See #1793
2024-01-17 09:55:47 +01:00
Pauli Virtanen
cee92e08a9 bluez5: lc3: fix wrong enum_config
The rate is not a bitmask.
2024-01-16 23:48:34 +02:00
Wim Taymans
b029a2ce05 pod: don't iterate 0 sized children
That will just create and endless loop and because the child has no
size, there is not really anything to iterate.
2024-01-16 16:34:37 +01:00
Wim Taymans
dd8e2def4f audioconvert: remove unnecessary casts 2024-01-16 15:33:13 +01:00
Pauli Virtanen
89cdf4f6eb bluez5: move no-HFP fast connect checks to better place
Not waiting for HFP when no HFP backend should be checked via
adapter_connectable_profiles in spa_bt_device_check_profiles where the
relevant logic is.

Cleanup by moving the checks there.
2024-01-16 14:29:01 +00:00
Dmitry Sharshakov
e2844e4421 audioconvert: fix rare unaligned load exceptions
Supposed causes described in the issue. Also improve float semantics.

Fixes #3790
2024-01-16 14:22:52 +00:00
Wim Taymans
627f148665 audioconvert: also place resample output in rate_io
We can also place the estimated size that the resampler will produce in
the rate_io for output streams.

See #3750
2024-01-16 13:29:57 +01:00