Commit graph

3213 commits

Author SHA1 Message Date
Wim Taymans
6fb53fc9f1 alsa: round to next power of 2 for max period_size
Prefer to make the period_size bigger rather than smaller because of
rate conversion.
2023-09-01 09:54:58 +02:00
George Kiagiadakis
af020bc425 alsa: report latency in the samplerate domain of the graph 2023-09-01 00:30:14 +03:00
Wim Taymans
21392d898e alsa: improve xrun clock field calculation
We're missing the delay in samples plus all of the extra samples of
silence we use to restart the device. This is in the samplerate of
the device.

Convert this to the time domain of the graph before adding it to xrun.
2023-08-31 14:28:56 +02:00
Wim Taymans
2c2b0f482f bluez: fix port flags
Physical and Terminal should be set for these hardware devices.

Fixes #3418
2023-08-31 13:01:08 +02:00
q66
aa11dbe10c alsa: get rid of non-portable isinf use
The isinf function returns -1 for negative infinity on glibc, but
the standard guarantees no such behavior (e.g. in C++ it always
returns a bool, on musl libc it's a macro that expands to a bool
expression), saying just that it returns a non-zero value.

This was added in pulseaudio around 15 years ago, and was never
fixed; pipewire then got the code from it. However, we can portably
check against -INFINITY instead (from math.h, already included).

Ref 045c1d6
2023-08-31 10:37:22 +00:00
columbarius
8bbc1c1abf vulkan: fix uninitialized writeDescriptor 2023-08-31 10:08:06 +00:00
columbarius
00c475e646 vulkan: download buffer to MemPtr 2023-08-31 10:08:06 +00:00
columbarius
73d6c20225 vulkan: spa_vulkan_use_buffers support datatype MemPtr 2023-08-31 10:08:06 +00:00
columbarius
eea8096b12 vulkan: Track spa_buffers for stream 2023-08-31 10:08:06 +00:00
columbarius
2456d58397 vulkan: Only allocate buffers when DMABUFS are used 2023-08-31 10:08:06 +00:00
columbarius
b8c91f7e54 vulkan: Synchronize in and out buffers 2023-08-31 10:08:06 +00:00
columbarius
412b0c7b49 vulkan: Add dmabuf sync helpers from wlroots
These helpers are obtained from the wlroots project at
https://gitlab.freedesktop.org/wlroots/wlroots/
2023-08-31 10:08:06 +00:00
columbarius
2c65eb6c2c vulkan: vulkan_compute fixate modifier
If the modifier for a format is not fixated yet, we will use vulkan to
fixate a modifier, update the parsed format, change the EnumFormats mask
and exit early. This triggers a new enum_params with EnumFormats and a
new set_param for Format.
2023-08-31 10:08:06 +00:00
columbarius
a673c56eea vulkan: announce SPA_PARAM_BUFFERS wrt. modifiers 2023-08-31 10:08:06 +00:00
columbarius
3274880e8e vulkan: use capability flags to enumerate formats 2023-08-31 10:08:06 +00:00
columbarius
d549d9e595 vulkan: vulkan_compute enumerate format with modifiers 2023-08-31 10:08:06 +00:00
columbarius
06a1d5151b vulkan: vulkan_compute initialize base on plugin creation 2023-08-31 10:08:06 +00:00
columbarius
402ed65a79 vulkan: Add {spa_,}vulkan_fixate_modifier 2023-08-31 10:08:06 +00:00
columbarius
35b080ec61 vulkan: split spa_vulkan_use_buffers into separate allocation and import functions
This commit add helpers to create and to import a DmaBuf via the
external_dmabuf_info struct.
The import path is based on the image creation of wlroots and the create path is
inspired by the wlroots vulkan allocator MR.
2023-08-31 10:08:06 +00:00
columbarius
2068972bb3 vulkan: Add wait functions
vulkan_wait_idle waits until the device is idle and all referenced
objects can be destroyed.
vulkan_wait_fence waits until a fence is triggered by a finished
queueSubmit.

vulkan: wait on fence
2023-08-31 10:08:06 +00:00
columbarius
0bb662f2e7 vulkan: limit supported modifiers with DMABUF_MAX_PLANES 2023-08-31 10:08:06 +00:00
columbarius
58853eb2c7 vulkan: Add function to query format and modifier information 2023-08-31 10:08:06 +00:00
columbarius
cf0e3a35ba vulkan: Add format convertion functions 2023-08-31 10:08:06 +00:00
columbarius
ea2a2c47c7 vulkan: split vulkan-utils into generic and compute part
This commit should just shuffle code around with no functional changes.
The goal is to ease development of simple vulkan nodes by providing
generic helpers.
2023-08-31 10:08:06 +00:00
columbarius
e7b4129944 vulkan: use SPDX tags to specify copyright information 2023-08-31 10:08:06 +00:00
columbarius
e226dccde8 vulkan: log if buffer is added in vulkan-compute-source 2023-08-31 10:08:06 +00:00
Wim Taymans
d2c29760e9 alsa: scale the default period with the rate
The default period is based on the default rate and might be too small
when using high samplerates. Scale the rate with the samplerate and make
sure it's a power of 2 to avoid trouble.

Fixes #3444
2023-08-31 12:01:06 +02:00
Wim Taymans
41dcac0ecd Port: Add tag param
The tag param has a list of arbitrary key/value pairs. Like the Latency
param, it travels up and downstream. Mixers will append the info
dictionaries or do some more fancy merging.

The purpose is to transport arbirary metadata, out-of-band, through the
graph and it's used for stream metadata and other stream properties.
2023-08-29 14:22:13 +02:00
Wim Taymans
6bf42e9bcd alsa: refuse quantum/rate changes when driving irq based 2023-08-29 10:14:43 +02:00
Wim Taymans
e90cab1cde node: add xrun counter in clock io
Add an xrun counter in the clock that accumulated the duration of
xruns. Fill this in in alsa-pcm.

A client could use this to dectect xruns (when it changes) and to align
the position and nsec after an xrun.
2023-08-29 09:22:45 +02:00
Wim Taymans
3685081fd1 alsa: add device.profile.pro property
It is set to true when the node is using a pro audio profile.
2023-08-29 09:22:27 +02:00
Silviu Florian Barbulescu
32084ff3c6 Fix problems found in the review of the broadcast sink support. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
8660066af6 Add suport for braodcast sink 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
c6760105df Fix problems found in the review. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
b07bb4e106 Check if the adapter supports bap broadcast before registering the broadcast endpoint. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
e2fa5537f7 Add support for bluez5.roles for broadcast source. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
decbeed2c4 Create the fake device with the actual adapter DBus path. 2023-08-24 16:31:03 +00:00
Silviu Florian Barbulescu
ef3fac401d bluez5: Add LE Audio BAP broadcast source support
Once Pipewire is started it will try to register a BAP broadcast source media endpoint on UUID 00001852-0000-1000-8000-00805f9b34fb if the media codec that supports BAP and the adapter indicates LE Audio is supported.
When the endpoint is detected (over DBus) by Pipewire and it has a broadcast sink UUID, a new device will be created with the address 00:00:00:00:00:00. This device will be our simulated remote device. This is done because a broadcast source emitting device does not need any connection to start transmitting the audio. This device is set as connected.
When the SetConfiguration DBus method is called and the spa_bt_transport structure with the profile BAP broadcast source is created we switch the device from the one read from DBus to the one created by us. This is done because in BlueZ, when the transport is created, at the Device property, BlueZ sets the adapter as the device that the transport is connected to. Here the device will have the newly created SPA_BT_PROFILE_BAP_BROADCAST_SINK profile connected.
Added code that allows to create a node in the graph for a device connected to the SPA_BT_PROFILE_BAP_BROADCAST_SINK profile.
2023-08-24 16:31:03 +00:00
Wim Taymans
b54f7fe90d audioconvert: fix typo in neon function
Thanks to Shengjiu Wang

fixes #3463
2023-08-24 13:45:11 +02:00
Wim Taymans
d08d05629b alsa: reflow some code
Move common code outside the if branches.
Only do the batch and timer stuff when using timers.
2023-08-23 13:56:20 +02:00
Pauli Virtanen
dbd97020da bluez5: fix BAP profiles showing
Now that we only show codec profiles, the logic that showed codecless
profile for BAP has to be removed.

This fixes BAP only showing off profile.
2023-08-23 10:07:15 +00:00
Roman Lebedev
4694b48b7b alsa-card-profiles: simplify adding custom profiles
It is sometimes useful to add a custom profile-set.
For that, e.g. `default.conf` needs to be modified.
(at least, i have not succeeded in just adding a new file)

But that change gets overridden when the package is updated,
which could be *extremely* dangerous, e.g. if said profile
changed the `volume-limit`.

By shipping an "empty" `9999-custom.conf`,
the update becomes less problematic,
because one can now use e.g. `dpkg-divert` on said file.

Refs. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050293
2023-08-23 10:06:16 +00:00
Wim Taymans
b9d78d5992 audioconvert: add queued input to the delay
The input that we have queued will also add to the resampler delay.

Fixes #3454
2023-08-22 13:06:10 +02:00
Wim Taymans
07b8954dc8 v4l2: handle inotify errors
Handle inotify errors and remove the source.

See #3439
2023-08-21 16:27:00 +02:00
Ashok Sidipotu
cd24fe2fe9 bluez5: A2DP and BAP profiles to enumerate only codec profiles
This avoids the potential confusion when both codecless and codec profiles are
enumerated for A2DP.
Give base name to highest priority profile, so that best codec can be selected
at command line with out knowing which codecs are actually supported.
2023-08-21 08:21:37 +00:00
Pauli Virtanen
8f6d266632 bluez5: reacquire transport always for playing for A2DP
Some A2DP devices don't like reusing the same transport for different
media-sink instances, possibly because encoder is reset in between and
there can be a gap in transmitted audio.

This doesn't matter for SCO/ISO.
2023-08-18 15:07:01 +00:00
Wim Taymans
f5d1d7e683 evl: fix timerfd read
It should read uint64_t now.

Tested: Jorge Ramirez-Ortiz <jorge@foundries.io>
2023-08-09 12:46:20 +02:00
Jorge Ramirez-Ortiz
ea0e92c5d9 meson: change EVL include paths 2023-08-09 12:09:30 +02:00
Wim Taymans
ba7af15cb2 evl: Use complete API to create xbufs
So that we can set nonblock directly.

Tested: Jorge Ramirez-Ortiz <jorge@foundries.io>
2023-08-09 12:06:24 +02:00
Arun Raghavan
86bd0eb708 logger: Add a mechanism to force colourised logging
This is handy if we want to redirect to a file but have colours to make
manual parsing easier (for example with `less -R`).
2023-08-08 17:13:31 +00:00