Commit graph

12843 commits

Author SHA1 Message Date
Gleb Popov
ac279fc774 Fix test-loop on FreeBSD by linking to epoll-shim 2024-09-23 08:09:45 +00:00
Gleb Popov
44d92c21e5 Use if_indextoname() instead of less portable ioctl(SIOCGIFNAME) 2024-09-23 08:09:45 +00:00
Gleb Popov
aafe815556 Move the ifr_ifindex FreeBSD definition into a header file to reduce code duplication 2024-09-23 08:09:45 +00:00
Gleb Popov
3f31935cac Include <pthread_np.h> on FreeBSD to access pthread_setaffinity 2024-09-23 08:09:45 +00:00
Gleb Popov
50dab6dda6 meson: Search for and link to stdthreads 2024-09-23 08:09:45 +00:00
Gleb Popov
67ddfc3053 Use the 'thrd_success' constant when checking for tss_create result 2024-09-23 08:09:45 +00:00
Wim Taymans
437be0af75 json-pod: return errors from spa_json_next()
Instead of silently ignoring the error and continuing.

See #4313
2024-09-23 09:36:31 +02:00
psykose
6fe0bd75be ci: add elogind to alpine CI
this should now be picked up, so add it to make sure elogind is checked in CI
2024-09-21 21:56:34 +00:00
psykose
2d071d658f spa: use a separate logind dependency separate from systemd
non-systemd systems also have logind, in the form of elogind, which works to
resolve the v4l2 video source race just as well. permit finding elogind, by
using a separate dep object.
2024-09-21 21:56:34 +00:00
Wim Taymans
bdd4d3a8fc examples: free the event source 2024-09-20 17:24:00 +02:00
Wim Taymans
e54cd0ef5c examples: add audio source with ringbuffer
Add an example of a stream that plays data from a ringbuffer that is
filled from some other thread.
2024-09-20 17:20:25 +02:00
Wim Taymans
44a1d93b7d stream: improve the docs 2024-09-20 15:52:26 +02:00
sunyuechi
62ec61a3bb benchmark-fmt-ops: Fix test arg for f32_s16 2024-09-20 16:02:22 +08:00
Wim Taymans
faf2a13a27 po: Update Slovenian (sl) translation
Fixes #4296
2024-09-20 09:18:18 +02:00
Wim Taymans
c07663b236 impl-node: only process RequestProcess after state change
Wait until we are in the RUNNING state before sending
RequestProcess.
2024-09-19 19:12:54 +02:00
Wim Taymans
cd68819feb stream: update state based on node
Follow the state of the node and update the stream state accordingly.

The most important part is that Start is async and so it's better to
wait for completion from the node before emiting the STREAMING state.
2024-09-19 19:12:31 +02:00
Wim Taymans
2301d3000b impl-link: improve debug, add the node async state 2024-09-19 19:01:43 +02:00
Wim Taymans
d36171f7df modules: don't assume network addresses are numeric
There is no reason to disallow hostnames.

Fixes #4292
2024-09-19 09:38:08 +02:00
Barnabás Pőcze
86004ba3f1 spa: support: use feature macro from config.h
Fixes 8166b9c580 ("spa/support: implement RISCV V CPU detection")
2024-09-18 22:29:11 +02:00
Barnabás Pőcze
ab2907c699 spa: alsa: avoid potential uninitialized variable use
In both funtions `ctl_hndl` could be passed to `snd_ctl_close()`
while being unitialized if `this->device_info.change_mask` is zero.
2024-09-18 19:54:13 +00:00
Barnabás Pőcze
27b76ae686 pulse-server: calculate event mask from facility and type
Make `client_queue_subscribe_event()` take the facility and type
separately, and calculate the mask itself, so that the caller
does not need to be concerned with that.
2024-09-18 19:35:08 +02:00
Wim Taymans
e3a7035e8f spa: make helper to init spa_audio_info_raw from dict
Make a function that can initialize raw audio info from a dict and fill
in the defaults. We can use this in many of the modules when the audio
format is parsed.
2024-09-18 15:48:27 +02:00
sunyuechi
d932e52d5b fmt-ops: add R-V V optimizations for f32_s16 2024-09-18 10:40:48 +00:00
sunyuechi
8166b9c580 spa/support: implement RISCV V CPU detection 2024-09-18 10:40:48 +00:00
Wim Taymans
e2991f6398 json: add helper function to parse channel positions
Use the helper instead of duplicating the same code.

Also add some helpers to parse a json array of uint32_t

Move some functions to convert between type name and id.
2024-09-18 09:54:34 +02:00
Wim Taymans
911a601b95 impl-node: only let the server send RequestProcess commands
When we emit the RequestProcess event from an exported node, don't
send the RequestProcess command to ourselves but let the server
decide where to send it to.
2024-09-17 09:25:58 +02:00
Hans de Goede
0e63bd902f spa: v4l2: Fix v4l2 SPA not working on camera with relative controls
Some V4L2 controls like focus, pan or tilt can be relative (change
the lens / angle relative to previous positions) these return EACCES
when calling VIDIOC_G_CTRL on them.

Fix the v4l2 SPA not working on cameras with relative controls,
such as e.g. the Logitech QuickCam Orbit MP.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2024-09-16 19:31:32 +02:00
Pauli Virtanen
ec5684302c doc: in user-facing config examples, indicate which file it goes into
Add suggestions for config fragments in config file examples, as
applicable.
2024-09-16 15:51:59 +00:00
Robert Mader
97719948a5 gst: Stop trying to use DMA_DRM with MOD_INVALID
GSTs DMA_DRM API does explicitely not support implicit modifiers and
trying to use it would result in assertions like
```
gst_video_dma_drm_fourcc_to_string: assertion 'modifier != DRM_FORMAT_MOD_INVALID' failed
```

Fixes: f1b75fc6f ("gst: Add support for DMA_DRM / explicit modifiers")
2024-09-16 15:44:21 +00:00
Wim Taymans
563186eff6 adapter: also forward the RequestProcess events 2024-09-16 17:01:50 +02:00
Wim Taymans
41f9abc733 types: add function to convert audio channel short name to type
Move some functions around for this
2024-09-16 17:00:44 +02:00
Wim Taymans
b5cccdb382 json: add and use spa_json_str_object_find()
Parse a string as a json object and copy the value with key as a string.
2024-09-16 13:12:05 +02:00
Wim Taymans
1fb13fd0be json: rename json files
Rename json.h to json-core.h and json-utils.h to json.h to keep
compatibility.
2024-09-16 12:43:39 +02:00
Wim Taymans
a05b8b0f7b json: move utils to separate file
The core json functions are in json.h and the more highlevel functions
building on them are in json-utils.h
2024-09-16 12:37:03 +02:00
Wim Taymans
ce390d5b22 spa: add spa_json_object_next
This gets the next key and value from an object. This function is better
because it will skip key/value pairs that don't fit in the array to hold
the key.

The previous code patter would stop parsing the object as soon as a key
larger than the available space was found.
2024-09-16 09:50:36 +02:00
Wim Taymans
cd81b5f39a spa: add spa_json_begin_array/object and relaxed versions
Add spa_json_begin_array/object to replace
spa_json_init+spa_json_begin_array/object

This function is better because it does not waste a useless spa_json
structure as an iterator. The relaxed versions also error out when the
container is mismatched because parsing a mismatched container is not
going to give any results anyway.
2024-09-16 09:50:33 +02:00
Wim Taymans
feccb882b6 spa: add spa_json_begin
That combines spa_json_init() and spa_json_next, a common thing to do.
2024-09-16 09:50:31 +02:00
Philippe Normand
08057e0328 gst: deviceprovider: Signal default devices
By setting a "is-default" boolean property on the discovered GstDevice(s) the
application now gets a good hint of which device to select and use.

Fixes #4268
2024-09-11 13:14:26 +00:00
Philippe Normand
5ed170f6c4 meson: Fix typo in GStreamer dependencies mapping
Without this the device provider cannot be enabled when building PipeWire as a
GStreamer subproject.
2024-09-11 13:14:26 +00:00
Hans de Goede
2a6ba61264 spa: v4l2: Use systemd-logind to listen for access changes
There is a race between logind applying ACLs to allow the active session
of a locally present user access to devices with a udev uaccess tag
(like /dev/video# nodes) getting applied vs wireplumber/pipewire starting.

Wireplumber/pipewire are part of the (user) default.target, which gets
started as soon as a user logs in and systemd --user is started for that
user, where as logind only starts applying the ACLs after the gnome-shell
associated logind session has been created.

This race may cause pipewire to not see v4l2 video sources at login,
this can be reproduced with these steps:

1. sudo setfacl --remove-all /dev/video*
2. systemctl --user restart pipewire
3. Now wp-ctl status will not show any video devices
   (like if pipewire was started before the udev uaccess ACLs got applied)
4. Do a switch to another (test) user without logging out, e.g. in GNOME
   go to the top right system menu press the power on/off icon and select
   "Switch User..."
5. Switch back to your normal user. Run getfacl /dev/video0 this will show
   your user has access now.
6. wp-ctl status should show the camera now, but it does not.

Fix pipewire not seeing v4l2 sources in this case by making v4l2-udev
monitor systemd-logind session changes and redoing the access() checks
on /dev/video# nodes when the session changes.

Closes: #3539
Closes: #3960
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2024-09-11 07:26:41 +00:00
Hans de Goede
ab245947e5 spa: v4l2: Remove start_inotify() call from impl_on_fd_events()
The spa_loop_add_source() call for udev event monitoring which uses
impl_on_fd_events() is done from start_monitor() which also unconditionally
calls start_inotify().

Since start_monitor() already always calls start_inotify() there is no
scenario where start_inotify() has not been called yet when
impl_on_fd_events() gets called. So the start_inotify() call in
impl_on_fd_events() is redundant, remove it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2024-09-11 07:26:41 +00:00
Piotr Drąg
b1e8e218d6 Update Polish translation 2024-09-11 07:24:31 +00:00
Wim Taymans
f7110fbc77 module-raop: add ProcessLatency support
Intercept the Output Latency paran and parse it for later.

Use the computed latency as the ProcessLatency and expose this
as the ProcessLatency param and the updated Input latency.

Accept updates to ProcessLatency to modify the latency, which then also
updates the Input Latency param.

See #4270
2024-09-10 17:29:52 +02:00
Wim Taymans
e15244b1e1 params: add function to compare process_latency_info 2024-09-10 17:28:37 +02:00
Wim Taymans
1e5c86e1dc module-loopback: add ProcessLatency support
Improve the Latency reporting, we always report Input and Output latency
pairs.

Keep ProcessLatency on the capture and playback streams. The capture
stream process latency is reported as input latency and the playback
process latency as output latency.

Setting ProcessLatency on the capture stream (Sink), for example, will
propagate the added latency upstream. This would then instruct players
to send the audio earlier to compensate for the delay.

See #4270
2024-09-10 15:32:00 +02:00
Wim Taymans
b8c6bfae1a stream: Add support for setting ProcessLatency
Pass the ProcessLatency set on the stream to the implementor.
2024-09-10 15:32:00 +02:00
Arun Raghavan
d79b995e51 module-rtp-sap: Make sure we don't publish a null refclk
If the PTP refclk is not readable, we fallback to the stored ts_refclk,
which might be NULL. Make sure we check for this case.
2024-09-09 14:05:45 -04:00
Wim Taymans
5c2b5fa552 audioadapter: clear the handle as well to avoid leaks 2024-09-09 13:42:44 +02:00
Wim Taymans
ffed9763fd audioadapter: improve convert plugin loader
Use the converter in the current plugin when no plugin loader was given
to make the unit tests work.
2024-09-09 13:26:45 +02:00
Wim Taymans
ef40bb1d48 jack: emit buffer_size during jack_activate()
JACK emits the bufsize callback from the processing thread while
jack_activate() is called. Do the same with a blocking invoke.

The GStreamer plugin relies on this and when it reives the bufsize
callback later, it will error out.

Fixes #4260
2024-09-09 12:56:22 +02:00