Commit graph

4479 commits

Author SHA1 Message Date
Pauli Virtanen
cd82c7259b bluez5: don't exit if system DBus goes down
Similarly as in spa_dbus, don't exit if bus goes down.  Neither the
audio or midi Bluetooth backend reconnects to DBus, but they shouldn't
exit the process.
2024-10-16 23:55:17 +03:00
Wim Taymans
2c0ce6afc2 audioconvert: SSE optimize delay and convolver 2024-10-15 16:10:25 +02:00
Wim Taymans
33fb2f04c7 audioconvert: use MAX_TAPS constant 2024-10-15 12:49:16 +02:00
Wim Taymans
ad84c45c0c audioconvert: optimize lr4 handling
Make an SSE optimized LR4 function and one that handles 2 LR4s in
parallel.
2024-10-15 12:20:04 +02:00
Wim Taymans
fec3730489 audioconvert: avoid a memcpy when we can 2024-10-15 12:19:17 +02:00
Wim Taymans
a57f2f25b6 delay: improve delay performance
Use a wrap around delay ringbuffer. We can then avoid some modulo
arithmetic and read more efficiently.

Also handle the delay convolver case better by reversing the taps and
reading the taps and delay buffer without extra overhead.
2024-10-15 12:14:57 +02:00
Pauli Virtanen
34bca4a007 bluez5: add quirk for Phonak hearing aids 2024-10-13 11:50:04 +03:00
Pauli Virtanen
f89d42b8bc bluez5: fix crash with broadcast sinks 2024-10-12 11:03:21 +00:00
Wim Taymans
fa1ec61cf0 profiler: add followerClock block
Add a new followerClock block in the profiler info. This is only set
when the follower could be a driver and it contains the clock info used
for following the driver, mostly the rate difference and delay.

Dump this info in pw-profiler -J

Make sure we always set the info in the clock, especially also when we
are following.
2024-10-09 11:31:54 +02:00
Wim Taymans
8cd3fc6922 adapter: increase max-retry to 64
When the follower doesn't produce enough data for this many attempts,
bail and cause an xrun to avoid an infinite loop.

The limit of 8 cause real-life problems and should be larger. It should
probably depend on the expected size per cycle (node.latency) and the
current quantum but we don't always have this information.

See #4334
2024-10-07 09:28:39 +02:00
Wim Taymans
0db2171cd9 alsa: dynamically adjust the DLL bandwidth
Keep a running average and variance of the error. Use this to
periodically update the DLL bandwidth. When the variance gets smaller,
we update the DLL more slowly to stay closer to the ideal rate.

This seems to improve the rate stability.
2024-10-04 10:47:47 +02:00
Arun Raghavan
e6bcc415fc acp: Trim trailing whitespace in monitor name from HDMI ELD
The ELD ends with a \n and spaces to pad the length, but most drivers
except NVidia trim that out while presenting to userspace. While this is
being tracked upstream [1], let's deal with this locally.

[1] https://github.com/NVIDIA/open-gpu-kernel-modules/pull/715

Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4332
2024-10-02 17:02:11 +00:00
Wim Taymans
5db02df08c spa: fix event pod type 2024-10-02 16:11:02 +02:00
Wim Taymans
dca11e6c41 loop: remove extra allocation
We don't actually need the extra allocation for the tss. We can just
mark the queue as being in the tss. When a queue is destroyed, mark it
as destroyed but when it is still in the tss, don't free the structure
yet. We free the structure when we destroy the tss.

We can also free the overflow queues of a queue when it is destroyed
immediately.
2024-10-02 09:40:54 +02:00
Wim Taymans
5d3aac313d loop: free tss from the thread calling impl::clear
The thread that calls the impl_clear method might be the main thread and
is certainly not going to call the invoke function anymore so free the
tss if there is any.

Fixes a leak in the unit test.
2024-10-02 09:21:00 +02:00
Barnabás Pőcze
1a549c02a5 acp: do not overwrite properties of PCM with that of the card
The properties of the card might overwrite those of the PCM.
For example, the cards's `alsa.id` will be set on the PCM too
since 37a51533e0 ("acp: add more properties for the card").

To avoid that, call `pa_alsa_init_proplist_card()` first
in `pa_alsa_init_proplist_pcm_info()` instead of last.

See #4135
2024-10-01 22:50:12 +02:00
Wim Taymans
82585b7475 loop: improve tss cleanup
Store a pointer to a pointer to a queue in the tss and point to it from
the queue.

When we destroy the queue when we _clear the support, we can clear the
pointer in the tss as well. This way, when the thread is later
destroyed, it will see the NULL pointer and not try to free the queue
again.
2024-10-01 13:25:15 +02:00
Wim Taymans
0ca64277b3 spa: initialize all fields explicitly
Patch by Petar Popovic

Fixes #4325
2024-09-30 10:06:30 +02:00
sunyuechi
245adda985 fmt-ops: add RVV optimizations for s32_to_f32d 2024-09-29 11:17:42 +08:00
sunyuechi
79d41e183e fmt-ops: add RVV optimizations for f32d_to_s32 2024-09-26 00:55:49 +08:00
sunyuechi
74832445ba fmt-ops: add RVV optimizations for s16_to_f32d 2024-09-25 10:50:05 +00:00
sunyuechi
588f2bcb69 RISCV: Improve scalar computation of f32d_to_s16 2024-09-25 10:50:05 +00:00
Wim Taymans
4513aceaad spa: avoid C23 empty initializers in the headers
Patch by Petar Popovic to avoid using empty initializers in headers.

Fixes #4317
2024-09-25 10:58:11 +02:00
Alper Nebi Yasak
d42bfa56b7 acp: sync the mixer after selecting the port
Otherwise we might sync the wrong port and end up muted.

Fixes #4084
2024-09-25 10:02:46 +02:00
Wim Taymans
ed0556e34c jack: Improve transport BBT handling
The bar can start from 0 in JACK.

Add bar_start_tick and ticks_per_beat to the io_segment_bar so that we
can losslesly store the complete jack BBT values.

See #4314
2024-09-24 18:43:33 +02:00
Wim Taymans
99c23d5b0e acp: add api.alsa.disable-mixer-path
Don't use the api.alsa.soft-mixer option to disable the path selection
but make a new api.alsa.disable-mixer-path.

Disabling the path selection might leave cards unusable after suspend,
so a separate option is a better idea.

See #4311
2024-09-24 13:14:17 +02:00
Wim Taymans
322829cb2e acp: disable path_select when using soft-mixer
When using the soft mixer we should not use path_select because that one
will also touch the mixer and try to mute some switches.

Fixes #4311
2024-09-23 15:34:08 +02:00
Wim Taymans
4b9db9492e json-pod: add error checking version of json to pod
Add an error checking version of the json to pod converter and use that
in pw-cli to report about json parsing errors.
2024-09-23 10:12:56 +02:00
sunyuechi
8a8843ba20 fmt-ops: add RVV optimizations for f32d_s16 2024-09-23 08:10:43 +00:00
sunyuechi
852de6c35c fmt-ops: add RVV optimizations for f32d_s16d 2024-09-23 08:10:43 +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
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
sunyuechi
62ec61a3bb benchmark-fmt-ops: Fix test arg for f32_s16 2024-09-20 16:02:22 +08: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
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
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
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