Commit graph

7436 commits

Author SHA1 Message Date
Wim Taymans a25396c1eb pulse-server: filter out iec958 PCM formats
Convert the iec958 PCM formats differently when enumerating the sink
formats. This way we can still convert the param to a format_info.
2021-09-01 13:23:05 +02:00
Wim Taymans 93e9efc1e4 audioconvert: handle NULL param 2021-09-01 13:23:00 +02:00
Wim Taymans 6c3c88f9d3 audioconvert: handle follower EnumFormat changes as well 2021-09-01 13:22:57 +02:00
Wim Taymans 774db99d12 alsa: emit params using the user flags
Use the user field to tag changes in params, toggle the serial flag when
emiting the port or node info.
2021-09-01 13:22:52 +02:00
Wim Taymans ab3e265b2c alsa: emit param changes correctly
Use the param user field to tag changes in the params.
codec changes emits an EnumFormat and Props change.
Accumulate various param changes and emit them together.
2021-09-01 13:22:47 +02:00
Wim Taymans 01f640709e alsa: always list PCM as iec958 codec
Always put PCM as the supported format for iec958.
Only accept iec958codecs for iec958 capable nodes.
2021-09-01 13:22:39 +02:00
Wim Taymans 592163fb0a stream: rename a variable 2021-08-31 16:04:34 +02:00
Wim Taymans e7a43f6d91 filter-chain: add 7.1 virtual sink example 2021-08-31 13:52:52 +02:00
Wim Taymans dce6f30954 filter-chain: rename sink-convolver
Rename to what it actually does.
2021-08-31 13:46:36 +02:00
Wim Taymans 71055dce73 alsa: handle excessive delay values gracefully
When we read an excessively large delay value, clamp it to twice the
delay so that we don't set our timeout to something too far in the
future.
2021-08-31 12:38:18 +02:00
Wim Taymans 3300f5ddc4 context: activate loopback to drivers
We start with setting the visitied flag on the driver. Still follow the
links to other visited nodes because it might make them active. for
example, adding a link between two midi ports should make the midi
driver running so that data flows between the ports.

See #1559
2021-08-31 11:45:14 +02:00
Konstantin Kharlamov a4f3a23095 tools/pw-dump: add support for --color-always 2021-08-31 08:42:15 +00:00
Konstantin Kharlamov e7db65b133 media-session: remove unused props from struct profile 2021-08-31 08:42:15 +00:00
Wim Taymans d34c4facc0 module-roc: fix properties
Actually set the right properties on the source and sink.

Not quite right because the pulseaudio ROC has a sink-input or a
playback stream in pipewire.

See #1538
2021-08-30 23:27:51 +02:00
Wim Taymans 9f57341699 module-pulse-tunnel: set the bufferattr right
tlength for playack and fragsize for capture.

See #1434
2021-08-30 21:26:33 +02:00
Wim Taymans 09ee977141 alsa: cache UCM config
ALSA has problems with creating more than 8 configs per card so cache
the config per card and reuse it.

Fixes problems with no devices after logging out and in again because
ALSA can't create UCM profiles anymore.

See #1553
2021-08-30 17:36:11 +02:00
Wim Taymans cff9dbf9dd echo-cancel: improve properties
Make the streams passive so that things can suspend.
Use a differend node.name for the input and output streams so that
autoconnect can actually remember the right target.
Make the media.name and description nicer.

See #1557
2021-08-30 10:50:03 +02:00
Julian Bouzas d4b06431ff pulse-server: calculate buffer size based on the frame size
Audio with big frame sizes (especially audio with multiple channels) needs more
buffer size than the one calculated with the current formula. This patch uses
the frame size to calculate the buffer size, fixing playback issues for clients
configured in passthrough mode.
2021-08-30 08:01:52 +00:00
Julian Bouzas b136bb8ca5 pipewire-pulse: delay create stream reply if the peer is not found
When the client adapter is configured in passthrough mode, the stream param
changed event in pipewire-pulse is emitted before the session manager creates
the link, and not after. Therfore, the peer can never be found when replying
create stream, and the pulseaudio application receives a stream error.

This patch delays the create stream reply until the link is added if the peer
cannot be found, fixing the above race conditon to allow passthrough mode to
work with pulseaudio applications.
2021-08-30 08:01:52 +00:00
Konstantin Kharlamov 60480f422e media-session: simplify save_profile 2021-08-30 01:12:14 +03:00
Konstantin Kharlamov 2c7cdcfa41 media-session: constify various params 2021-08-30 01:12:09 +03:00
Pauli Virtanen b057c9166d bluez5: don't try to autoconnect same device via multiple adapters
If you use multiple BT adapters, it's annoying that PW tries to
autoconnect to the device via all available adapters, and you end up
with multiple connections to the same device (which does not necessarily
work).

Avoid this by autoconnecting with only the first adapter that sees the
device.
2021-08-29 16:34:41 +03:00
Wim Taymans e90c436f3a filter-chain: remove another copy 2021-08-27 21:05:32 +02:00
Wim Taymans 4677cc348c stream: clear the draining/drained state when inactive
When we inactivate the stream, clear the draining/drained state.
Otherwise, the stream stays in the drained state and won't call the
process function anymore when we activate it again.

This used to work before because we called the process function from the
Start command, which would queue a buffer and unset the drained flag.
Calling the process function from Start was however not right when the
process function needed to be called from the RT thread or when the
stream is a driver.

Fixes the issue where speaker-test would only play one channel.
2021-08-27 17:12:03 +02:00
Wim Taymans 994630cb3a filter-chain: optimize convolver some more
Add function to convolve without accumulate and use that when possible
to avoid some memset and memcpy.
2021-08-27 17:11:45 +02:00
zayar lwin 1fe54e5f17 Update LINGUAS now conclude [my] 2021-08-27 11:44:19 +00:00
zayar lwin 979239355e po: ADD burmese [my] translation 2021-08-26 15:33:54 +00:00
Wim Taymans 73854e9ec9 filter-chain: improve convolver
Make the input buffer a little larger and leave the top blockSize
samples zero. That way we can fill up the lower part, leave the upper
part zero padded and feed this to the fft directly. Also only clear
the lower part when we can't fill it completely.

This removes some memcpy and memset operations.
2021-08-26 17:19:48 +02:00
Wim Taymans 1924c2c298 0.3.34 2021-08-26 13:05:12 +02:00
Julian Bouzas 34b1ecc244 pw-cat: calculate number of samples properly with io_rate_match
Fixes wrong buffer sizes when adapter is configured in passthrough mode.
2021-08-25 19:23:23 +00:00
Wim Taymans a701a500af filter-chain: add hilbert function
Can be used to perform a 90 degree phase shift.
2021-08-25 21:20:42 +02:00
Wim Taymans 09a0fdcc0f protocol-simple: avoid freeing client multiple times
Ensure we only queue one cleanup operation and cancel all pending
operations when we destroy the client.

Fixes #1550
2021-08-25 21:19:25 +02:00
Pauli Virtanen 63ba9f98ba bluez5: don't create aptx-ll/faststream sink endpoints
We don't currently implement encoding for the duplex channel
for these codecs, so they are not fully functional as A2DP sinks,
and their main use is anyway with headphones.

Also, the number of endpoints in BlueZ appears to be limited, and
appears to be counted across all adapters.  Unclear whether this comes
from AVDTP limitation, but currently plugging in a second BT adapter
causes the second media application registration to fail.  This change
reduces the number of endpoints enough so that registration succeeds for
two adapters.
2021-08-25 20:58:15 +03:00
jakobrs d1f521af40 Add missing > in link factory usage string 2021-08-25 15:39:06 +00:00
Wim Taymans a9169cf491 pulse-server: Handle formats of virtual devices better
Virtual devices tend to start with partial fields set in the EnumFormat
param (usually rate is missing). This causes virtual devices to be
invisible until they are used in some way.

Fix this by relaxing the parsing of EnumFormat and by falling back to
the server defaults for the unspecified fields.

Fixes #1413
2021-08-25 17:33:22 +02:00
Wim Taymans 3526e33fe1 impl-node: send Pause when a Play reply is pending
When we send a Play request to the client but it deactivates before
sending the reply, make sure we send a Pause request as well so that
Play/Pause is always matched up.

Fixes #1548
2021-08-25 16:29:59 +02:00
Wim Taymans 743aaa3dbd audioconvert: don't just copy the converter flags
We need to manage our own flags based on the direction of the follower.

We also need to make sure we only clear the NEED_CONFIGURE flag
after we are actually configured, not just when we configured our
internal converter.

See #1548
2021-08-25 15:11:54 +02:00
Wim Taymans 67965d60be stream: fix debug message 2021-08-25 13:08:49 +02:00
Wim Taymans 762f45c5a0 jack: move the free object list to globals
Move the free object list as a global so that we can even access old
objects after client_closed.
Move the objects from a client to the global free list when we close
the client.

Ardour wants to access objects even after calling client_close() so
we need to keep them around a little longer.

See #1546
2021-08-25 11:56:19 +02:00
Wim Taymans 999083105c jack: protect against bad ports and buffers 2021-08-25 11:54:41 +02:00
Wim Taymans 11cb77c577 context: fall back to default rate in case of errors
When the allowed rates does not contain the default rate, also
fall back to only the default rate.
See the configured rates in the properties so it can be inspected.
2021-08-25 09:28:23 +02:00
Wim Taymans df92c09ff5 filter-chain: fix loop index 2021-08-24 16:45:11 +02:00
Wim Taymans 1e4e83d305 filter-chain: add more mixer ports
Add option to set NULL data as the port data so that plugins can
skip processing.
Add 8 mixer ports and skip NULL data.
Move silence and discard samples to static area.
Improve the virtual sink examples. use the correct mixing for the HRIR
channels.
2021-08-24 16:26:06 +02:00
Wim Taymans 123fe3d1c5 filter-chain: improve pffft compilation and CPU support
Compile different pffft versions per CPU.
Plug the right version depending on the runtime CPU.

See #1543
2021-08-24 12:07:37 +02:00
Wim Taymans 0f5face73f filter-chain: use pffft for the convolver
It is faster.
2021-08-23 21:00:45 +02:00
Wim Taymans 9dbfa63193 audioconvert: silence an info debug message 2021-08-23 17:44:56 +02:00
Wim Taymans 34e53113e2 pulse-server: handle the case where rate-match returns 0
Still feed the minreq amount of data into the converter.
2021-08-23 17:27:45 +02:00
Wim Taymans b0a9945ed0 alsa: only enable PCM iec958 codec when configured
Rework the codec enumeration a little and don't automatically enable PCM
as the code unless requested by the user.
2021-08-23 17:07:17 +02:00
Wim Taymans 454a9bd55f media-session: detect passthrough and passthrough only nodes 2021-08-23 13:28:02 +02:00
Wim Taymans 44d575ba70 stream: enable adapter for all audio streams
This way, we can support streams with normal and passthrough
formats by switching the adapter mode.
2021-08-23 13:06:06 +02:00