Commit graph

11252 commits

Author SHA1 Message Date
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
Wim Taymans
414026bd36 conf: add example empty stream.rules template 2023-08-25 11:54:01 +02:00
Wim Taymans
8dd294bf44 conf: support ! to negate the match
So that you can do "application.name" = "!pw-cat" to match anything
that is not pw-cat and "application.name" = "!~pw-cat$".

Fixes #3460
2023-08-25 11:39:28 +02:00
Wim Taymans
0bfc02581f conf: handle regcomp errors and warn
Instead of silently ignoring the problem.

See #3460
2023-08-25 11:08:18 +02:00
Wim Taymans
c41c812325 jack: make sure we can always find our own ports
find_port_by_name() is used to find our own ports before they become
visible so make sure we can always find them.

Fixes #3485
2023-08-24 19:28:57 +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
3b052eaa99 impl-node: improve suspend
Make sure we can only suspend when the node is (going to) IDLE. We don't
really want to allow applications to suspend a node that is running or
starting up.

This might fix a race when a node is suspended at the same time it is
started and cause silence. It also fixes the issue of total silence when
doing "pactl suspend <node> 1" on a running node.

See #3378
2023-08-24 09:50:28 +02:00
Wim Taymans
6ad0eb533d Revert "impl-node: improve suspend"
This reverts commit 3c47fa894b.

suspend_node is called from other places where the node might not be
IDLE.

Fixes #3378
2023-08-24 09:43:36 +02:00
Wim Taymans
88e4a69765 jack: emit latency notify when buffer_frames changes
When the buffer frames change, make sure we emit a latency recalculation
even if we don't have a buffer_size callback.

Remove the unused GRAPH notify.

Protect ringbuffer writes to the notify queue with a lock because we
can't know what thread they execute in.

Make a new TOTAL_LATENCY notify type to trigger a complete latency
recalculation.
2023-08-23 17:28:24 +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
Stefan Ursella
71653e04d2 pw-top: add 'batch-mode' and iterations known from top 2023-08-23 09:53:51 +00:00
Stefan Ursella
7f30621b86 pw-top: format 'show_help' and sort options 2023-08-23 09:53:51 +00:00
Wim Taymans
dbf1ea0e78 pulse-server: add alsa source and sink module
See #3456
2023-08-23 11:15:59 +02:00
Wim Taymans
293e1f85e6 conf: 0 is no longer the default
Fill the actual defaults as the param values.
2023-08-22 22:03:28 +02:00
Wim Taymans
c9c91024af client-rt: add some examples for alsa properties 2023-08-22 15:41:38 +02:00
Wim Taymans
f9c21789dc stream: improve docs a little more 2023-08-22 13:21:16 +02:00
Wim Taymans
2c2cb9117d stream: add some \code markers around code blocks 2023-08-22 13:11:45 +02: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
George Kiagiadakis
150c1cc05d audio-src: test stream timings 2023-08-22 12:53:58 +02:00
Wim Taymans
ee05daea53 alsa: improve property handling
Add support for setting lists and min/max values for the alsa params.

list:    alsa.rate = [ 32000 44100 ]
min/max: alsa.rate = { min=32000 max=44100 }
value:   alsa.rate = 32000

See #3451
2023-08-22 12:44:51 +02:00
Wim Taymans
188f784430 0.3.78 2023-08-22 11:12:24 +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
Wim Taymans
3c47fa894b impl-node: improve suspend
Make sure we can only suspend when the node is (going to) IDLE. We don't
really want to suspend a node that is running or starting up.

Deactivate the node while we suspend so that graph recalc because of the
unprepared links will not try to prepare the links again.

This might fix a race when a node is suspended at the same time it is
started and cause silence. It also fixes the issue of total silence when
doing "pactl suspend <node> 1" on a running node.
2023-08-21 15:28:36 +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
Anders Jonsson
ee41c29de5 po: Update Swedish translation 2023-08-16 10:44:30 +02:00
Tom A. Wagner
7b40ca4f27 pod: Fix spa_pod_builder_control() return type
Fixes the return type of spa_pod_builder_control() from uint32_t to int.

Since the function returns the int returned by spa_pod_builder_raw,
the return type of the function should also be an int.
2023-08-09 12:59:09 +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