Commit graph

6005 commits

Author SHA1 Message Date
Wim Taymans
86cf4ad5a5 audioconvert: keep better track of changed params
Keep all the children param flags around and use those to decide
if something changed. Also don't change the param flag serial when
we are simply adding a listener.

This should reduce the number of param updates, most notably the
PropInfo that was updated along with the Props on volume changes.
2021-03-12 11:10:43 +01:00
Wim Taymans
6562a2ab79 channelmix: clean up param handling
Use defines to access the different params.
Fix the name of the function to emit properties.
2021-03-12 10:36:08 +01:00
Wim Taymans
f41de50b28 json: escape and unescape invalid unicode chars 2021-03-12 09:23:33 +01:00
Thibault Saunier
22f6e8e36d meson: Fixed remaining issues from the port to feature options 2021-03-11 18:29:11 +00:00
Wim Taymans
9cd9339c2a alsa-pcm: only disable IRQ when not batch
For batch devices we want to keep the IRQ so that the pointers are
updated with the period-size. Brings my UMC404HD to 4.8ms roundtrip
times with IRQ at 6 sample and batch enabled.
2021-03-11 18:37:13 +01:00
Wim Taymans
b4cf78b5a6 alsa-pcm: improve debug 2021-03-11 18:34:55 +01:00
Wim Taymans
a5922a9c0a pulse-server: use async reply for set_default_sink/source
Because we set the default sink/source before calling the metadata,
we don't send out updates about the new sink and this confuses
pavucontrol.

Instead, use the new async reply to reply once the new metadata has
been configured and the defaults have been updated.
2021-03-11 15:39:19 +01:00
Wim Taymans
fdcbe67941 context: add info log about parsed config sections
So that we can see what's being parsed or not.
2021-03-11 15:23:53 +01:00
Wim Taymans
bdea557fb1 module-portal: improve error message
Pass some error messages and errno around to give a better error
message (instead of ENOMEM) when the connection with dbus fails.
2021-03-11 15:18:28 +01:00
Wim Taymans
d63f4234ae channelmix: remap volumes
The volumes set with the properties need to be reordered to match
the volumes of our internal layout.
2021-03-11 11:26:26 +01:00
Wim Taymans
38d36f1921 media-session: improve saved profile restore
We only want to restore the saved profile when it is available, when
it is not available and there was no change in best profile, leave
the profile as it is.
2021-03-11 10:22:33 +01:00
Wim Taymans
d295d97160 media-session: only restore best profile when something changed
Keep track of the best profile. Only try to switch away from the
saved profile when something changed and the saved profile is not
available.

This makes it possible to select an unavailable profile but when
something is changed, it will switch away from it.
2021-03-11 09:32:17 +01:00
Thibault Saunier
485bae5eb0 meson: Use feature options everywhere it makes sense 2021-03-10 20:18:34 +00:00
Pauli Virtanen
98bedb3895 bluez5: don't set a2dp codec for source device initial profiles
Source devices don't have the a2dp codec profiles, so don't set a codec
profile as the initial one.
2021-03-10 21:32:01 +02:00
FeRD (Frank Dana)
2931522d2c pw-cli: Make 'dump' type arg case-insensitive 2021-03-10 11:41:32 -05:00
Wim Taymans
e334c5862e pulse-server: fill in the format info 2021-03-10 17:27:11 +01:00
Wim Taymans
d5fc67cf06 pulse-server: Prefer the formats of the extended format API
Fix enumerate the formats from the extended API and then append
the old API formats.

See #876
2021-03-10 16:55:01 +01:00
Wim Taymans
ef4b3c403e media-session: -1 as node.target is default
A node.target property of -1 also means to follow the default
sink/source. The ALSA plugin might use this to select the
target node and would otherwise not move to the new default sink.
2021-03-10 15:27:06 +01:00
Wim Taymans
78e9e5958e impl-node: delay starting the driver node
Only start the driver node after we have added ourselves to the
driver node or else we might start too soon, before there is anything
to schedule and we cause driver underruns.
2021-03-10 13:28:56 +01:00
Wim Taymans
62def0399f impl-node: rework link activation
Only activate the links when the node is added to a driver. Otherwise
the driver will expect us to decrement the activation counters for the
links but that won't happen because the node will not be processed
yet.

Instead we activate the links that were not activated yet when the
node is activated.

This improves scheduling for newly added links and nodes.
2021-03-10 13:06:02 +01:00
Wim Taymans
cc26ef9614 impl-node: update the io position from the data-loop
So that the update is synchronized with the data processing and
we don't accidentally process an old driver activation.
2021-03-10 13:03:34 +01:00
Wim Taymans
4f816c1fb0 loop: never try to block in the thread
When we are calling invoke from the thread, the call will be completed
in the thread and there is no need to block for completion.
2021-03-10 13:01:19 +01:00
Wim Taymans
0881d5b881 context: restart graph recalculation when something changed
When we were busy with the graph recalculation and something changed,
restart the graph state change to get the new change applied.

For example, when we start a node and it has a max-quantum set, we
need to restart our calculation with the new quantum limits.
2021-03-09 15:48:47 +01:00
Wim Taymans
63a34f4f84 alsa: after XRun, fill with previous threshold
It is possible that the quantum has changed before the xrun and
then we will assume the previous quantum was in the device.
2021-03-09 15:46:44 +01:00
Wim Taymans
aa0e0043d3 alsa: only recompute threshold when quantum changes 2021-03-09 13:21:50 +01:00
Wim Taymans
dd0342167f policy-node: move variable up in scope
We are using it outside of the scope it is defined in.
2021-03-09 12:48:48 +01:00
Wim Taymans
fc044a37af resample: don't copy too much
When we are in passthrough mode, copy only the min of input and
output size or else we might overread/overwrite.

See #875
2021-03-09 12:47:38 +01:00
Wim Taymans
c0ab4b1b8d bluez5: fix compiler warning 2021-03-09 12:25:20 +01:00
Wim Taymans
c237ccfbda pulse-server: use the manager sync method for async replies
Use the manager sync method to wait until all pending queries are
finished. It is the manager that will query the new parameters so
we need to wait until that completes.

See #868
2021-03-09 12:09:05 +01:00
Wim Taymans
82c452a93d pulse-server: expose sync method 2021-03-09 12:08:45 +01:00
Wim Taymans
d29bdf64ee pulse-server: reply async to some requests
Trigger a roundtrip before we send the reply to the client for many
methods like set_volume/set_mute etc.

this ensure that we get the updated information from the server before
we reply so that a subsequent query returns the up-to-data information.

Fixes #868
2021-03-09 09:55:48 +01:00
Pauli Virtanen
808b54bc19 bluez5: sco-io: fallback packet size when read size unknown should be even
Reported write MTU is odd for some adapters, which will misalign CVSD
frames, so round fallback value to even.
2021-03-09 08:03:21 +00:00
Wim Taymans
e095105e57 resample: fix passthrough check
Only in passthrough we need to just copy input to output. Otherwise
we need to ask the resampler for the conversion size.
2021-03-09 08:52:43 +01:00
Pauli Virtanen
511bafb436 bluez5: release transports on profile change
SCO transports have timer-delayed release, but they need to be released
immediately when changing profiles to close connections before switching
to A2DP.
2021-03-08 23:42:08 +02:00
Wim Taymans
6fd870a5f0 alsa: pass the right direction to ucm_set_port()
The function requires true for playback ports and false otherwise.

See #867
2021-03-08 17:40:32 +01:00
Wim Taymans
cab5cf3ccb alsa: add resampler delay in clock delay reporting 2021-03-08 17:12:00 +01:00
Wim Taymans
99b2973c31 resample: disable when not used. 2021-03-08 16:55:56 +01:00
Wim Taymans
2c1f8af2e6 alsa: correct dll error after quantum change
When the quantum is changed, the error between the current and
expected buffer levels needs to be corrected with the quantum
difference.

For example, say we are running with a 1024 quantum and the quantum
is changed to 8192, when we wake up the filled level might be
1016 vs expected 8192, 1024 - 8192 = -7168. The real error for the
timeout was 1016 - 8192 - (-7168) = -8.
2021-03-08 16:29:53 +01:00
Wim Taymans
ffeb2e0f0e alsa: fill with right amount of silence when starting
When we start or after an xrun, we need fill the buffer with one
period + headroom of samples, not period*2. This is because after
start we set our timeout immediately and expect there to be
period + headroom samples in the buffer.

With period*2 we take one period longer to start and we also feed
one period of error in the dll, which causes it to wobble for no
good reason.
2021-03-08 15:36:58 +01:00
Wim Taymans
1b6060ef5f media-session: schedule more rescan for pending changes
Trigger/delay a rescan until the profiles, routes and stream
volume are restored.

See #789
2021-03-08 15:14:40 +01:00
Wim Taymans
d603c1086a media-session: (re)schedule rescan after new pending operation
Every time a new operation is started, schedule a rescan. This
ensures that there are no more pending actions before the policy
module scans the nodes.

This has the effect that all devices and nodes are up to data and
ready to be used by policy-node.

Fixes #789
2021-03-08 13:20:02 +01:00
Wim Taymans
59f86df9f3 media-session: move profile switch to default-profile
Move the profile switching from default-route to the default-profile
module. This makes more sense and it also allows us to restore the
saved profile when it becomes available.

Make default-profile always check if the saved profile can be restored
before attempting to switch to the best profile.

Default-route now just monitors profile changes and restores the
routes associated with it.

See #466
2021-03-08 11:52:38 +01:00
Wim Taymans
3e2d897f97 jack: improve debug 2021-03-07 10:46:08 +01:00
Wim Taymans
6c8c58ab4e jack: also match system ports in get_ports
Fixes #850
2021-03-07 09:44:40 +01:00
Wim Taymans
ffab69f651 jack: move some debug to info
Use info to lay out the general app flow
2021-03-07 09:44:04 +01:00
Wim Taymans
2aa261659d pulse-server: handle NULL default_sink/source
Don't crash when default_sink/source is NULL

See #676
2021-03-07 08:18:11 +01:00
Pauli Virtanen
a99f3a90ef bluez5: correct EnumRoute availability
Mark bluez5 routes always available in EnumRoute, because there's always
a device connected.

Fixes default-route resetting profiles back, when they are manually
changed.
2021-03-07 01:37:57 +02:00
Wim Taymans
6324298bc5 channelmix: add more generic upmixing
Add options to enable lfe filtering and upmix.
Enable upmix by default, lfe is disabled because we don't actually
do a lowpass filter yet.
2021-03-06 21:31:18 +01:00
Wim Taymans
c7309f0248 channelmix: small cleanups
Fix indent
Rename DUAL/QUAD to REAR and SIDE and use it for checking availability
of stereo pairs.
2021-03-06 21:29:36 +01:00
fdev31
4d21b5f8bd Simple upmix of stereo inputs up to 7.1 output 2021-03-06 20:22:09 +00:00