Commit graph

11339 commits

Author SHA1 Message Date
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
q66
9f7d960c66 meson: better check for module dlopen dir
The ${LIB} token is a glibc extension, so it is incorrect to
use it on all Linux. Doing so will break e.g. with musl libc.
2023-08-31 10:29:32 +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
columbarius
33f98489d6 pipewire-vulkan: Start vulkan nodes via pipewire proxy server 2023-08-31 10:08:06 +00:00
Felix Yan
feb21a25f0 Correct a typo in pipewire.conf.5.rst.in 2023-08-31 10:04:25 +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
9f30e58ef2 pipe-tunnel: support pipe-source as a driver
Use a timer to periodically schedule the pipe-source when configured
as a driver. Adjust the timeout period based on buffer fill levels.

Fixes #3478
2023-08-31 11:41:00 +02:00
Wim Taymans
f25da522a4 pulse-tunnel: fix index after overrun
First advance the index, then fix the avail value or else we don't end
up changing the index at all.
2023-08-31 11:39:54 +02:00
Wim Taymans
9f66c42d1f pipe-tunnel: rework the source
Let the source write into a ringbuffer when there is data available.

We then read from the ringbuffer when scheduled and use a dll to keep
the delay constant. We can later make this a driver and use the rate
correction to tweak the timeouts instead of resampling.

See #3478
2023-08-30 18:41:19 +02:00
Wim Taymans
bc15d0c766 pulse-server: support use_system_clock_for_timing
Move the pipe-sink to the dummy driver when instructed to use the system
clock.
2023-08-30 18:36:01 +02:00
Wim Taymans
20fdafb7f1 pulse-server: rename a variable to avoid confusion 2023-08-30 18:32:34 +02:00
Wim Taymans
3d0b662c5e pulse-tunnel: Make sure we send available data
Round down the size and avail to the frame size to make sure we always
send aligned frames.

When we don't have the required size, set the buffer to 0 but still send
whatever we have in the ringbuffer or else it stays there until some
unknown time when it gets flushed out again with new data.
2023-08-30 18:27:19 +02:00
Wim Taymans
f404168739 jack: mark object registered when emit is suppressed
When we don't manage to emit the notify, still mark the object as
registered. Otherwise we might not emit the unregistered
notify later on.

This usually happens when a client connects and the notifies are
suppressed for all the objects in the graph. When they later disappear
we do want to emit the unregistered notify.
2023-08-30 18:23:07 +02:00
Wim Taymans
89fab13c77 pulse-server: allow monitors when selecting source by index
Fixes #3476
2023-08-30 09:59:37 +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
4e1c64df19 context: take current target when not updated
When we don't have a pending target duration/rate update, take the
currently configured clock target duration/rate as the target rate.

This needs to be done when the driver refuses to update the duration and
rate for some reason and places its own values in clock target duration/rate.
Otherwise we would think the driver is using some other duration than
what it is really using.

Try:
  - set alsa to irq based playback that refuses to change the quantum
  - paplay with some file that sets the quantum to 1024
  - pw-metadata -n settings 0 clock.force-quantum 256
  - the target duration will be set to 256 but alsa doesn't change it
  - stop playback
  - start playback again, the quantum is still 1024 and not 256
2023-08-29 10:14:38 +02:00
Wim Taymans
b5c3f21792 0.3.79 2023-08-29 09:45:26 +02:00
Wim Taymans
b62675b39d Revert "impl-node: improve suspend"
This reverts commit 3b052eaa99.

This causes problems because the session manager wants to suspend the
running nodes before changing the port-config.
2023-08-29 09:43:55 +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
f134abdac0 impl-node: improve debug 2023-08-29 09:22:34 +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
Wim Taymans
289661b663 impl-node: suspend before clearing format
First suspend and then clean the format. Otherwise we might clear the
format while running and potentially crash.
2023-08-29 09:22:06 +02:00
Peter Hutterer
26ecde20b9 pw-mon: check stdout, not stderr for tty
Commit afc88a12e5 changed pw-mon to use printf so we now need to check
stdout to know whether we need to print with colors.
2023-08-25 13:32:41 +00:00
Wim Taymans
001c6e1cc1 jack: support jack_port_tie
We can't really do zero copy because our downstream peer does not have
access to the memfd of our upstream peer. Instead, just memcpy the
data for now.
2023-08-25 14:28:38 +02:00
Wim Taymans
a821027fb8 context: scan link groups in both directions
Don't just stop scanning the link groups after we tried one direction,
also try the other direction.

Otherwise:

source -> loopback1_in|loopback1_out -> loopback2_in|loopback2_out -> record

will first scan from loopback2_out downstream and finds loopback2_in in the same
group but without downstream links. Then when upstream scan is done,
loopback2_out is already scanned and will be skipped and so loopback1
stays IDLE.

We fix this by keeping track of the direction that we scanned a node in
and only stop when we scanned it in the same direction twice.
2023-08-25 12:56:17 +02:00
Wim Taymans
d416ac9f18 Revert "audio-src: test stream timings"
This reverts commit 150c1cc05d.

This was just a test.
2023-08-25 11:58:53 +02:00