1
Fork 0
Commit Graph

11185 Commits

Author SHA1 Message Date
Wim Taymans 31cd694602 0.3.77 2023-08-04 10:25:37 +02:00
columbarius 49bbe1b4e5 doc/dma-buf: Document usage of SPA_VIDEO_FLAG_MODIFIER flags 2023-08-04 01:48:46 +02:00
Wim Taymans 0055cc613d jack: always do graph update when link changes
Don't make a special event but do the graph change callbacks when
a link was notified. Bundle all graph updates together when we can.
2023-08-03 11:43:42 +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 da464853e5 jack: handle port registration events for jack clients
The jack client API expects the ports to unregister when a jack client is
deactivated and to register when it is activated. We use pause/resume
for deactivate/activate and don't really destroy the ports.

Track the state of the node (client) and emit port registration when it
changes state. Also make sure we don't emit a port registration when the
node is deactivated.

Fixes #3260
2023-08-02 17:30:35 +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 71262da6d7 audioconvert: remove requirement for data_loop
We just need to get a timestamp so that we can do the rate limiting, we
don't need anything accurate from the data_loop.
2023-08-01 18:20:04 +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 536129343a audioconvert: rate limit the out-of-buffer logging
See #3384
2023-08-01 15:06:28 +02:00
Wim Taymans 35d932bc8b audioconvert: only dequeue a buffer when queued
Add an extra check to only dequeue a buffer when it's queued. This
should always be the case but let's check again to be safe.

See #3384
2023-08-01 15:04:31 +02:00
Wim Taymans 950c2d2675 v4l2: check for format support 2023-08-01 12:59:35 +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
Nedko Arnaudov 1cb17c05e9 Use 0.3.PWVER for soname versioning, instead of 0.PWVER.0 2023-08-01 11:08:56 +02:00
Wim Taymans 88f0dbd6fc v4l2: don't set inotify on /dev
Doing inotify on /dev is not a good idea because we will be woken up by
a lot of unrelated events.

There is a report of a performance regression on some IO benchmark
because of lock contention within the fsnotify subsystem due to this.

Instead, just watch for attribute changes on the /dev/videoX files
directly. We are only interested in attribute changes, udev should
notify us when the file is added or removed.
2023-07-31 13:16:17 +02:00
Wim Taymans fd585baa88 alsa: don't change avail when unchanged
Only update the avail when we did a snd_pcm_forward(). Otherwise
we might think there is more available than there really is and we
might get xrun.

See #3395
2023-07-31 12:10:36 +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
Barnabás Pőcze 07c574160c spa: bluez: backend-hsphfpd: actually free endpoint
Previously, `endpoint_free()` did not free the `struct hsphfpd_endpoint`
object itself, only its contents. Fix that.
2023-07-30 21:42:49 +02:00
Barnabás Pőcze 486d759fa9 spa: bluez: backend-hsphfpd: remove unnecessary NULL checks
`free()` already does a NULL check; and there is no reason
to have those NULL checks inline.
2023-07-30 21:41:41 +02:00
Barnabás Pőcze 4083502e03 spa: bluez: use some more spa_auto* 2023-07-30 13:45:49 +02:00
Barnabás Pőcze ca85872e83 spa: bluez: use spa_auto for DBusError 2023-07-30 13:45:49 +02:00
Barnabás Pőcze b52d590936 spa: bluez: add `send_with_reply()` dbus helper
This function sends a DBusMessage on a DBusConnection
and sets the reply callback of the resulting DBusPendingCall,
as well as properly cancelling the pending call if anything fails.
2023-07-30 13:45:49 +02:00
Barnabás Pőcze 6e581deb91 spa: bluez: use spa_autoptr for DBusMessage 2023-07-30 13:45:49 +02:00
Sourav Das c6c3259a08 spa: fixes for dereferencing pointer to incomplete type in __typeof__
before gcc 10 its not supporting pointer dereferencing in __typeof__.
    so made changes according to that. Fixes #3375

    clang also defines __GNUC__ and resolves '4' along with __clang__ which
    resolves '1'. On any version of clang, __GNUC__ and resolves '4'.
    anyway clang has this feature since version 3.
2023-07-30 10:31:19 +05:30
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 6e70fe459d pipewire: allow setting metadata on more objects
The wireplumber unit test sets metadata on object 15, which happens to
be a module.

Allow metadata on other objects for now. It would be nice to disallow
this in the future, though.
2023-07-28 11:18:12 +02:00
Wim Taymans 390f6c9cb8 perm: add a new L permissions
When a client has the L permission on the node, it can make links
between the node even if the owner of the node can't see the other node.
2023-07-28 11:01:43 +02:00
Wim Taymans 94385068cb pipewire: document permissions needed for methods 2023-07-28 10:51:20 +02:00
Wim Taymans 83efdf2340 core: X permissions is needed to destroy a global 2023-07-28 10:22:28 +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 9bcc90fdc3 0.3.76 2023-07-27 17:54:12 +02:00
Wim Taymans aca8bced9e man: improve pw-cat man page formats
See #3389
2023-07-27 14:41:29 +02:00
Wim Taymans 0ab6452b7e pw-cat: exit when we are unconnected
We get unconnected when the session manager kills us when it can't
make a link.

See #2731
2023-07-26 16:03:40 +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 ae4042e7a2 stream: flags should not override properties
Only set the properties from the flags when not already set before.

Fixes #3382
2023-07-26 10:44:47 +02:00
Wim Taymans dd78f3d5f7 alsa: disable htimestamp by default
It seems there are drivers that don't return a good values and we end up
with a lot of delay or automatic disable of htimestamp when the values
look too off.
2023-07-26 10:32:53 +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 ad1a36a718 audioconvert: add option to disable volume updates
Add channelmix.lock-volumes. When set to true it will disable volume
updates until set back to false.

See #3361
2023-07-25 12:36:23 +02:00
Pauli Virtanen cd3375f39e meson.build: enable LC3 by default
Enable LE Audio support by default if liblc3 is present, the Pipewire
implementation should be OK. Remove unused HAVE_BLUETOOTH_BAP define,
we don't have any #ifdefs for this.

The feature is still disabled by default in BlueZ, which also now takes
care of necessary hardware feature checks, and should be safe to enable
on Pipewire side.
2023-07-25 07:26:21 +00:00
Tom A. Wagner 193384b26a pipewire: add missing stdbool.h include to version.h.in
The header file only works when included in a file where stdbool.h was already included otherwise.
2023-07-24 12:48:33 +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 a3bd0f7a0a 0.3.75 2023-07-21 11:04:12 +02: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