Commit graph

2907 commits

Author SHA1 Message Date
Christian Glombek
def6514872 module-raop-sink: Set DACP-ID header 2023-09-26 19:11:08 +02:00
Christian Glombek
de329f3a62 module-raop-sink: Uppercase Client-Instance header 2023-09-26 19:11:08 +02:00
Christian Glombek
c4a18d6c5c module-raop-sink: Add Apple-Challenge only if RSA encrypted
Only add Apple-Challenge header once on ANNOUNCE,
and only if RSA encrypted.
2023-09-26 19:11:08 +02:00
Christian Glombek
a8f5d20384 module-raop-sink: Rename a bunch of things 2023-09-26 19:11:08 +02:00
Christian Glombek
7f14e14ab7 module-raop-sink: Use rtp_header for RTP messages 2023-09-25 08:37:56 +02:00
Samuel Thibault
8b807ded35 Add GNU/Hurd support 2023-09-24 15:11:52 +00:00
Samuel Thibault
5aefb1f9f4 module-pipe-tunnel.c: Include <sys/uio.h> to get struct iovec 2023-09-24 15:11:52 +00:00
Wim Taymans
224f1f16f1 pulse-server: emit stream changed after Latency param change
Piggy back on the Latency param change to emit a stream changed event
because we now might have a link between the stream and a device.

We should really watch for new links and emit change events for the
streams that it links to.

Fixes #3522
2023-09-21 16:42:08 +02:00
Wim Taymans
c915f2a6fd modules: add quotes around hw:0
Because of the : it needs to be surrounded with quotes to be parsed
as a string.

Fixes #3515
2023-09-16 19:39:51 +02:00
Barnabás Pőcze
436787d6ba treewide: try to use const char * for string literals 2023-09-16 17:47:35 +02:00
Barnabás Pőcze
3293e6a8ff pipewire: module-profiler: mark event vtable const 2023-09-16 17:15:32 +02:00
Wim Taymans
846e732458 pulse-server: remove pending_streams list
We can simply use the pending flag and merge the handling of the new
stream with the stream move logic.
2023-09-14 12:08:48 +02:00
Wim Taymans
13caae49b5 pulse-server: avoid emitting changes for unused params
Don't emit change events when latency or tag change, for example.
2023-09-14 11:03:39 +02:00
Wim Taymans
3c812f672b pulse-server: add an option to check module arguments
Add a list of valid keys to the module info. When set, check if the
module arguments only contain the allowed keys and give an error
otherwise.
2023-09-13 12:26:57 +02:00
Wim Taymans
b094057b0b handle NULL latency param
Fixes #3504
2023-09-13 11:13:48 +02:00
Wim Taymans
016d15e598 ratelimit: missed -> suppressed
To avoid confusing with missed samples.
2023-09-08 12:18:23 +02:00
Wim Taymans
6eb7eb7df2 modules: fix page ref 2023-09-07 16:30:46 +02:00
Wim Taymans
0da572474f modules: forward tag param 2023-09-07 15:54:28 +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
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
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
dbf1ea0e78 pulse-server: add alsa source and sink module
See #3456
2023-08-23 11:15:59 +02: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
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
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
Wim Taymans
3a8894d2a4 pulse-server: improve device lookup
Make sure don't handle names ending in .monitor as a valid sink (because
it's a monitor on the sink).

Make sure we don't return a sink (monitor) as a source accidentally but
only when explicitly requested by name with the .monitor extension.

Makes

pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -5%
pactl set-source-volume alsa_output.pci-0000_00_1b.0.analog-stereo -5%

fail as expected.
2023-07-28 18:26:41 +02:00
Wim Taymans
3f77c4e25f pulse-server: move the changed counter internally
We don't actually use this counter anywhere.

Change the counter to a mask that will contain object specific changes
to the params. This should make it possible to track what kind of
changes where done to the object and make it easier to emit the right
events later.
2023-07-28 13:31:02 +02:00
Wim Taymans
212fe59530 perm: add permission mask to global
Add a mask of possible permissions for a global.
Make sure the permissions of an object are limited to the global
mask.
2023-07-28 10:22:12 +02:00
Wim Taymans
39a1887a0b pulse-server: improve network and virtual node checks
Tag the sink/source as HARDWARE when it's not virtual, the presence
of a DEVICE_API property is not a good check.

Make a method to check if a node is a NETWORK sink/source to make it
use the same logic everywhere.
2023-07-26 11:51:48 +02:00
Wim Taymans
ce8f2c5d10 modules-vban: add vban sender and receiver
Fixes #3380
2023-07-25 18:36:48 +02:00
Wim Taymans
938bbc3039 protocol-pulse: document 2 other quirks 2023-07-25 12:47:58 +02:00
Wim Taymans
920bb7160e thread-loop: only signal when option is set
Add a thead-loop.start-signal option that will do a signal before
entering the thread loop. Doing the signal in all cases can confuse
apps that don't expect the signal.

Make module-rt use the thread-loop.start-signal.

Fixes #3374
2023-07-23 18:16:00 +02:00
Joan Bruguera Micó
55812195ce module-rt: error out on load if no bus is available
Since the recent changes to the RT module in Pipewire 0.3.75, some
applications such as those using OpenAL-Soft crash on startup if
neither the session nor the system bus is available. For example:

    bwrap --dev-bind / / \
          --bind /dev/null /run/dbus/system_bus_socket \
          --bind /dev/null $XDG_RUNTIME_DIR/bus \
          openal-info

Will result in a crash with the following error message:

    dbus[1626147]: arguments to dbus_message_new_method_call() were
    incorrect, assertion "path != NULL" failed in file dbus-message.c
    line 1373.
    This is normally a bug in some application using the D-Bus library.

The RT module previously failed to load if no bus was available, but
after the recent changes, the init. logic runs in a thread, and failing
to obtain the bus no longer causes the module to fail to load.

Then, functions called later such as `pw_rtkit_make_realtime` assume
the bus is available and try to use it, causing the error above.

Put the logic for obtaining and checking the bus back to `module_init`,
so the module fails to load again if no bus is available.
2023-07-22 02:22:18 +00:00
Wim Taymans
8d1b3f6f48 module-rt: first destroy the loop and then rtkit
Or else we might still try to use the rtkit in the thread.

See #3357
2023-07-20 16:17:14 +02:00
Wim Taymans
163fde0a69 module-rt: fall back to some defaults in case of error 2023-07-20 15:57:31 +02:00
Wim Taymans
7b24b3b687 module-rt: use lock for thread lookup and invoke
We should only call invoke from one thread at a time so fuse the
gettid of the thread and invoke into the lock.

See #3357
2023-07-20 15:43:41 +02:00