Commit graph

2897 commits

Author SHA1 Message Date
Wim Taymans
c4d77d421a audioconver2: process monitor ports immediately 2022-06-16 09:09:27 +02:00
Wim Taymans
f45f1acd82 audioconvert2: use the position rate as resampler rate
For the DSP inputs, use the position rate.
2022-06-16 09:09:27 +02:00
Wim Taymans
58abc1ec15 audioconvert2: Improvements
Suggest 2 buffers by default.
Improve rate match flow.
monitor does not need the out_offset
Update rate match when we know the queued samples.
2022-06-16 09:09:27 +02:00
Wim Taymans
2352ae33c3 audioconvert2: add queueing
Use in and out offset to read/write partial input/output.
2022-06-16 09:09:27 +02:00
Wim Taymans
d728076d33 audioconvert2: handle drain 2022-06-16 09:09:27 +02:00
Wim Taymans
1c4058b947 audioconvert2: clamp offset and size 2022-06-16 09:09:27 +02:00
Wim Taymans
229a7b6019 audioconvert2: fix default settings 2022-06-16 09:09:27 +02:00
Wim Taymans
f2c1fe106d audioconvert2: more fixes 2022-06-16 09:09:27 +02:00
Wim Taymans
3806cdaa6f audioconvert2: more improvements
Use a wildcard rate for DSP ports.
Handle wildcards for rate and channels.
Calculate required in/out samples using quantum
Limit monitor and output number of samples.
2022-06-16 09:09:27 +02:00
Wim Taymans
c0f34e9d9d audioconvert2: set blocks a stride for DSP ports
They might not get connected and negotiated but we still need to
use empty buffers in that case.
2022-06-16 09:09:27 +02:00
Wim Taymans
2d6bf00acc audioconvert2: add options 2022-06-16 09:09:27 +02:00
Wim Taymans
75ebdbdfa0 audioconvert2: start working on monitor ports 2022-06-16 09:09:27 +02:00
Wim Taymans
db2cbdf906 audioconvert2: DSP mode without format gives no ports 2022-06-16 09:09:27 +02:00
Wim Taymans
d53311099f audioconvert2: format is optional for convert mode 2022-06-16 09:09:27 +02:00
Wim Taymans
e78a93d358 audioconvert2: fix audio rate property 2022-06-16 09:09:27 +02:00
Wim Taymans
9babdee6cd audioconvert2: do input and output remapping
We remap the input channels to our cannonical layout and then remap it
to the target layout.
2022-06-16 09:09:27 +02:00
Wim Taymans
922a088129 audioconvert2: handle volume 2022-06-16 09:09:27 +02:00
Wim Taymans
0099b80098 audioconvert2: add properties 2022-06-16 09:09:27 +02:00
Wim Taymans
8cb0d9fd7b audioconvert: add channelmix and resample 2022-06-16 09:09:27 +02:00
Wim Taymans
399f638eb1 audioconvert: more work 2022-06-16 09:09:27 +02:00
Wim Taymans
7f9ddd0f15 Add audioconvert2 2022-06-16 09:09:27 +02:00
Ole Salscheider
3695611b20 channelmix: Assign slev in mixing matrix when generating side/rear from front
This way, PSD upmixing sounds much more natural and is in line with the
original publication.
2022-06-14 10:58:25 +00:00
Peter Oliver
d3597ed149 alsa: Disable IEC958 on Audioengine HD3
As discussed in #2112.
2022-06-14 06:58:41 +00:00
Wim Taymans
8e1f0628f7 channelmix: add 3p1_2 and use this for quad conversions
Simplify some SSE versions
2022-06-13 20:35:00 +02:00
Ole Salscheider
5dc4434dc7 channelmix: Implement PSD upmixing for stereo -> quad
Fixes #2436.
2022-06-13 14:19:23 +00:00
Ole Salscheider
354a04c91d Channel mixer: Remove channelmix_f32_2_4_sse
It does not have PSD upmixing implemented and does not allow to disable
the simple upmixing algorithm either.

Fixes #2438.
2022-06-13 14:19:23 +00:00
Wim Taymans
a1d4b41c34 channelmix: fix control handling
We need to use the control type of the control we're actually going
to use.
2022-06-13 16:17:53 +02:00
Frédéric Danis
8bd1d4c7c9 bluez5: Fix LC3plus plugin build
LC3PLus plugin should not depend on LDAC C args to build
2022-06-10 18:16:49 +02:00
Wim Taymans
b99c71262e alsa: force same clock only for pro audio profile
Assume that capture and playback nodes from a device have different
clocks. This enables the adative resampler to match them. A lot of devices
actually have slightly different rates and would work out of the box
with this fix.

Make an exception when the card is configured in the pro audio profile.
Then we force the same clock on all device nodes and avoid resampling
and rate matching. This can still be changed with a session manager
override.
2022-06-08 17:03:50 +02:00
Pauli Virtanen
5b429607a8 bluez5: disable dummy avrcp player by default
It causes some headsets behave strangely. See pipewire#2391,
pipewire#1853.

The BlueZ issue of AVRCP volume sometimes missing that this worked
around was fixed in recent versions. The issue of some headsets not
sending volume without AVRCP player remains, but it appears this breaks
more headsets than fixes.
2022-06-07 18:13:06 +03:00
Wim Taymans
9493dafe44 vulkan: update example shaders 2022-06-06 12:13:20 +02:00
Wim Taymans
80f317344e vulkan: fix validation errors 2022-06-06 12:13:20 +02:00
Wim Taymans
d40e6aeedd vulkan: use image sampler 2022-06-06 12:13:20 +02:00
Wim Taymans
b02ebec954 vulkan: use images
The filter can now run shadertoy filters.
2022-06-06 12:13:20 +02:00
Wim Taymans
24fc972164 vulkan: add some more error checks 2022-06-06 12:13:20 +02:00
Wim Taymans
6e681fc98d vulkan: more improvements 2022-06-06 12:13:19 +02:00
Wim Taymans
e6f01563ab vulkan: support multiple streams of buffers 2022-06-06 12:13:19 +02:00
Wim Taymans
332e8b7029 vulkan: start of vulkan filters 2022-06-06 12:13:19 +02:00
Pauli Virtanen
8898a6a8f0 bluez5: don't consider profiles the adapter doesn't have
Don't try to reconnect or wait for profiles, which cannot be connected
because the adapter doesn't have the counterpart sink/source profile.

E.g. we should not reconnect/wait for HFP HF on remote device, if
we don't have the corresponding HFP AG.
2022-06-05 18:15:42 +00:00
Pauli Virtanen
8383ee8552 bluez5: a2dp-sink: address A2DP transport acquire failure mode
If A2DP remote does not acquire its pending transport within a timeout,
we won't get a write error in a2dp-sink, but instead the transport
becomes idle.  Currently, we continue writing to the socket as if
everything was fine, even though the data won't be processed at the
remote end.

Handle this by stopping the node and emitting a node error event.
Pipewire may then restart the node to retry.
2022-06-05 18:10:01 +00:00
Pauli Virtanen
fc4f831afa audioconvert: forward follower node errors
If the follower of the adapter emits an error event, the adapter needs
to forward it to upper levels so that they know the node has errored,
and handle the situation.
2022-06-05 18:10:01 +00:00
Pauli Virtanen
8949d45c69 bluez5: check decode/encode capability also at registering
Endpoints without decode/encode capability are skipped in the object
manager, but we should also skip them in the registration calls (even
though in practice this doesn't appear to matter).
2022-06-05 18:03:24 +00:00
Wim Taymans
6e6385e27d acp: don't mix non-AUX and AUX channels
When filling up the channels, either fill up the positions with one
of the know layouts or use AUX channels, never try to mix them.

This avoid cards with a large number channels to show a strange mix
of surround and AUX channels.
2022-06-02 12:54:04 +02:00
Wim Taymans
30d9b743a2 acp: return map on success
We need to return the channelmap when we have successfully filled
it.
2022-06-02 12:44:31 +02:00
Barnabás Pőcze
479896279e spa: support: loop: handle cancellation better
Register a pthread cleanup handler to guarantee
that `spa_source::{priv, rmask}` are cleared even
if the thread is cancelled while the loop is dispatching.

This is necessary, otherwise `spa_source::priv` could point
to the stack of the cancelled thread, which will lead to
problems like this later:

  Program terminated with signal SIGSEGV, Segmentation fault.
  #0  0x00007f846b025be2 in detach_source (source=0x7f845f435f60) at ../spa/plugins/support/loop.c:144
  144      e->data = NULL;
  [Current thread is 1 (LWP 5274)]
  (gdb) p e
  $1 = (struct spa_poll_event *) 0x7f845e297820
  (gdb) bt
  #0  0x00007f846b025be2 in detach_source (source=0x7f845f435f60) at ../spa/plugins/support/loop.c:144
  #1  0x00007f846b0276ad in free_source (s=0x7f845f435f60) at ../spa/plugins/support/loop.c:359
  #2  0x00007f846b02a453 in loop_destroy_source (object=0x7f845f3af478, source=0x7f845f435f60) at ../spa/plugins/support/loop.c:786
  #3  0x00007f846b02a886 in impl_clear (handle=0x7f845f3af478) at ../spa/plugins/support/loop.c:859
  #4  0x00007f846b172f40 in unref_handle (handle=0x7f845f3af450) at ../src/pipewire/pipewire.c:211
  #5  0x00007f846b173579 in pw_unload_spa_handle (handle=0x7f845f3af478) at ../src/pipewire/pipewire.c:346
  #6  0x00007f846b15a761 in pw_loop_destroy (loop=0x7f845f434e30) at ../src/pipewire/loop.c:159
  #7  0x00007f846b135d8e in pw_data_loop_destroy (loop=0x7f845f434cb0) at ../src/pipewire/data-loop.c:166
  #8  0x00007f846b12c31c in pw_context_destroy (context=0x7f845f41c690) at ../src/pipewire/context.c:485
  #9  0x00007f846b3ddf9e in jack_client_close (client=0x7f845f3c1030) at ../pipewire-jack/src/pipewire-jack.c:3481
  ...
2022-06-02 00:24:24 +02:00
Wim Taymans
1245309a7b alsa: sync acp with pulseaudio 2022-06-01 13:11:00 +02:00
Wim Taymans
752643c295 spa: debug memcpy 2022-05-31 10:31:26 +02:00
Wim Taymans
a58d815024 bluez5: implement freewheel in sink
We need to skip all samples.
2022-05-30 09:54:22 +02:00
Wim Taymans
0cdcd04f77 bluez5: use position clock time
Use the position clock time and fall back to the monotonic time.
2022-05-30 09:53:37 +02:00
Pauli Virtanen
ebccd89ae1 bluez5: a2dp-sink: update follower current time
Update follower current time in process, since it is otherwise not
updated. Fixes bitpool control as follower.
2022-05-30 07:40:52 +00:00