Commit graph

6266 commits

Author SHA1 Message Date
Wim Taymans
d7f7fd258d pw-cat: set default properties after setup
So that we can still set the MEDIA_NAME from the artist/title.
2023-09-07 10:05:15 +02:00
Jonas Holmberg
be943ca9db context: scan peers in both directions
Don't stop scanning peers after trying one direction. Try the other
direction too, just like with link groups.

See a821027fb8.
2023-09-06 09:29:33 +00:00
Michael Tretter
9b29bcd4e8 conf: set description for test nodes
`wpctl status` shows the description of device nodes. Therefore, the
videotestsrc and audiotestsrc are listed as "(null)" if the example
configuration of the sources is used.

Set the description in the example for how to configure the audiotestsrc
and the videotestsrc.
2023-09-04 15:46:05 +02:00
Dmitry Sharshakov
18b0fe1e05 module-filter-chain: don't use i for single filename
While this shouldn't be broken, it's illogical
2023-09-01 19:30:07 +00:00
columbarius
33f98489d6 pipewire-vulkan: Start vulkan nodes via pipewire proxy server 2023-08-31 10:08:06 +00: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
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
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
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
f134abdac0 impl-node: improve debug 2023-08-29 09:22:34 +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
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
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
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
George Kiagiadakis
150c1cc05d audio-src: test stream timings 2023-08-22 12:53:58 +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
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
Wim Taymans
820ca90705 pulse-server: set all change_mask flags when removing
So that the logic to emit events will select sink and source objects.

Fixes #3414
2023-08-08 13:01:30 +02:00
Wim Taymans
fc68fd2d4a module-vban: tweak rate adaption a little
Adapt quicker by increasing the bandwidth.

See #3380
2023-08-07 17:57:28 +02:00
Wim Taymans
d2c35e6bc7 module-vban: read the right amount of samples
format_nbs contains the number of samples in the packet minus one.

See #3380
2023-08-07 17:37:46 +02:00
Wim Taymans
c53d8ec3db module-profiler: handle undefined max_align_t 2023-08-07 17:37:46 +02:00
Wim Taymans
9f23b2b860 module-rtp-sap: don't use deprecated inet_aton 2023-08-07 10:36:19 +02:00
Wim Taymans
1daae4c369 context: Don't stop setting runnable when meeting the driving node
Start scanning from a non-driving runnable node in one direction and set
all linked intermedia nodes runnable as well.

This ensure that play -> driving_sink -> effect -> sink also sets the
effect and sink nodes to running.

Fixes  #3405
2023-08-04 17:45:39 +02:00
Philippe Normand
140374d207 gst: Prevent a crash when stopping device provider
The provider might fail to connect to the PipeWire core when starting up, so
when stopping we need to check the core is valid before attempting to acquire a
mutex on its loop.
2023-08-04 10:01:07 +01:00
Wim Taymans
893b46c0d0 module-x11-bell: protect libcanberra calls with a mutex
The libcanberra calls use libtool, which can not be called from multiple
threads at the same time. Use a global lock to serialize these calls in
the x11-bell module.

This is only a problem when multiple libcanberra calls are made in the
same process, such when you load the x11-bell module twice. There is no
guarantee that other libcanberra calls will not interfere but for now
we only use libcanberra here.

Fixes #2834
2023-08-03 10:08:11 +02:00
Wim Taymans
fac2556404 impl-node: add client.api to global properties 2023-08-02 17:06:42 +02:00
Wim Taymans
c28a148c26 conf: check for valid config name
It needs to be "null" or ending in .conf
2023-08-02 11:05:00 +02:00
Wim Taymans
121228bde8 module-profiler: make sure we don't overrun the flush buffer
Check that the node profiler data fits in the flush buffer.
2023-08-01 18:14:53 +02:00
Barnabás Pőcze
0cbcf88eaa pipewire: module-profiler: fix misaligned access
Fix the following misaligned access that happens when `pw-top` is started:

  ../src/modules/module-profiler.c:144:5: runtime error: member access within misaligned address 0x7f7fa11fe8d9 for type 'struct spa_pod_struct', which requires 4 byte alignment
  0x7f7fa11fe8d9: note: pointer points here
   60 00 00  01 00 00 00 00 00 00 00  00 88 02 00 00 0f 00 00  00 0a 00 04 00 00 00 00  00 01 00 01 00
                ^
      #0 0x7f7fa64a65e1 in do_flush_event ../src/modules/module-profiler.c:144
      #1 0x7f7fa36d658e in source_event_func ../spa/plugins/support/loop.c:650
      #2 0x7f7fa36cfbab in loop_iterate ../spa/plugins/support/loop.c:483
      #3 0x7f7fa80a71cd in pw_main_loop_run ../src/pipewire/main-loop.c:128
      #4 0x55af46ff4722 in main ../src/daemon/pipewire.c:111
      #5 0x7f7fa8a3984f  (/usr/lib/libc.so.6+0x2384f) (BuildId: 2f005a79cd1a8e385972f5a102f16adba414d75e)
      #6 0x7f7fa8a39909 in __libc_start_main (/usr/lib/libc.so.6+0x23909) (BuildId: 2f005a79cd1a8e385972f5a102f16adba414d75e)
      #7 0x55af46ff32a4 in _start (src/daemon/pipewire+0x42a4) (BuildId: 2d6250e405f52fb86992fef8584ccfdfdb85569f)

  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/modules/module-profiler.c:144:5 in
2023-08-01 17:58:49 +02:00
Wim Taymans
2410660299 modules: add vban midi support 2023-08-01 12:54:19 +02:00
Wim Taymans
8a72310f0b modules: make sure we increment the n_frames correctly 2023-08-01 12:53:35 +02:00
Wim Taymans
c9b7367f8f pulse-server: keep track of sink/monitor changes
For sink nodes, keep a separate device_info around for the sink and
the monitor source part of the node. Only emit changes for the sink
and monitor source part when it changed.

See #3388
2023-07-31 11:23:47 +02:00