Commit graph

7448 commits

Author SHA1 Message Date
Wim Taymans
e5886b7bc6 alsa: pass POD_Long as (long) varargs 2021-09-02 15:17:36 +02:00
Wim Taymans
99e6c77525 alsa: improve device name construction
Get the ucm prefix only once, when we open the UCM card and then
use it for all devices using the card.

Construct the device name right before we open it with the ucm prefix
and possibly the AES flags instead of messing with the property.
2021-09-02 12:35:58 +02:00
Wim Taymans
9052b1be33 media-session: add option to restore bluetooth profile
Add default-profile.restore-bluetooth option to restore the BT
profile.

See #1567
2021-09-02 11:39:17 +02:00
Wim Taymans
f277487887 media-session: save and restore IEC958 Codecs 2021-09-02 10:27:59 +02:00
Wim Taymans
80628f38e7 alsa: move codec config to acp-device
Just like the latency, move the codecs to the device Route param.
This way, it is easier for the session manager to save and restore
the codecs as part of the Route settings.
2021-09-02 10:27:59 +02:00
Julian Bouzas
1a93165e84 impl-port: use audiomixer for RAW media subtype when setting up mixer 2021-09-01 17:35:47 -04:00
Julian Bouzas
c65ae2f2e6 audiomixer: refactor and add support for more formats
The audiomixer processing logic is now based on mixer-dsp.
2021-09-01 17:35:43 -04:00
Julian Bouzas
dddbe289fb audiomixer: add support for more formats in the mix table
The S8, S16, S24 and S32 formats are now supported. The mixing process also
takes into account the number of channels.
2021-09-01 17:08:36 -04:00
Jonas Holmberg
28cf342bb8 media-session: Change some warnings to info
If a program using pipewire-alsa calls snd_pcm_close() immediately after
snd_pcm_prepare() without reading or writing any data the client node
may be removed before the session manager can link it, which would
result in the following log warnings:

can't link 35:40 -> 43:48: link-factory: unknown input port 48
error id:25 seq:11467 res:-22 (Invalid argument): link-factory: unknown input port 48
can't link 35:41 -> 43:46: link-factory: unknown input port 46
error id:16 seq:11468 res:-22 (Invalid argument): link-factory: unknown input port 46
2021-09-01 15:15:51 +00:00
Wim Taymans
eafef40430 pulse-server: remove pod debug 2021-09-01 13:25:52 +02:00
Wim Taymans
ea7a731106 pulse-server: set the SINK_SET_FORMATS flag
When we have an iec958Codecs property on the node, we can use it to
configure the codecs on the sink.
2021-09-01 13:24:50 +02:00
Wim Taymans
49eb31f670 pulse-server: add device-restore extension
This is mostly to read and set the supported formats of a sink.
2021-09-01 13:23:10 +02:00
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