Commit graph

8383 commits

Author SHA1 Message Date
Wim Taymans
9855e2b303 alsa: tweak capture follower
If the follower does not have enough data to capture, skip a cycle
instead of trying to capture and get an XRUN.

Tweak some limits a little.
2022-02-11 18:07:44 +01:00
Wim Taymans
db6b7f6848 profiler: add force rate and quantum to latency
Overrite the node.latency with their forced values when available.

This will show the forced values in pw-top
2022-02-11 12:24:16 +01:00
Wim Taymans
d3f879e4ed jack: only set force-latency property
There is no point in setting a node.latency property when we also set a
force-quantum.
2022-02-11 12:22:02 +01:00
Barnabás Pőcze
2c71282f16 spa: bluez: remove unused function
The `add_dict` function has not been used since
9785d99821. Remove it.
2022-02-10 23:20:47 +01:00
Julian Bouzas
e34d9d209a alsa: try to resume after suspend before recovering
Fixes no audio after suspending with some audio drivers.

See #2001
2022-02-10 16:57:58 -05:00
Wim Taymans
f123b58f1f jack: release lock when doing do_sync from data thread
If we do_sync from the data thread, release the rt_lock so that any
callbacks that may happen while waiting can grab the rt_lock.

We could also temporarily disable the rt_lock grabbing before the
callbacks.

In any case the callbacks will need to be called while we execute
the blocking function in the process callback.
2022-02-10 17:13:48 +01:00
Wim Taymans
f636603844 alsa: pass current_time around in get_status()
Pass the current time around in various functions.
Make a higher precission htimestamp based get_delay() function. Seems to
work fine for playback but not for capturee.
2022-02-10 15:31:29 +01:00
Luis Correia
3cba294b65 Update texas-instruments-pcm2902.conf, add info about Behringer U-Phoria UM2 2022-02-09 20:58:20 +00:00
Wim Taymans
613c0a2558 proxy: emit a warning when listener was not removed
Emit a warning when the listener was not removed now that most places
are fixed. Not removing a listener might fail to call the removed
callback and leave things in a broken state.
2022-02-09 16:34:06 +01:00
Wim Taymans
e82f775fb3 tools: remove listeners 2022-02-09 16:30:13 +01:00
Wim Taymans
cd361cb1b3 client-node: remove MAX_MIX limit
There is no limit anymore
2022-02-09 16:12:17 +01:00
Wim Taymans
f1788d0552 filter: remove unused define for MAX_PORTS 2022-02-09 16:10:32 +01:00
Wim Taymans
4e1e9aa8e7 filter: remove port limit
Use a map to allocate and keep track of port numbers.
2022-02-09 16:04:57 +01:00
Wim Taymans
104f0c766a jack: remove some listeners 2022-02-09 15:52:14 +01:00
Wim Taymans
78a7370bc6 jack: remove some more limits
Remove limit on max results from _get_ports() and _get_all_connections()
by using a dynamic array.
Keep the limit on the max number of midi inputs we can mix.
2022-02-09 15:40:45 +01:00
Wim Taymans
4353fa83d6 pipewire-jack: there is no port max anymore 2022-02-09 15:21:49 +01:00
Wim Taymans
f743aecd23 map: scale extend with the item size as well 2022-02-09 15:17:37 +01:00
Wim Taymans
9bebad6ed3 client-node: remove limit on ports
Use a pw_map to keep track of the ports by index so that we don't
have an upper limit on the node ports anymore.
2022-02-09 15:11:47 +01:00
Wim Taymans
d0d924c33c client-node: improve port handling
Index the ports by using the direction and port id instead of doing
conditional lookups in 2 arrays.
2022-02-09 12:41:49 +01:00
Wim Taymans
3db14600b2 remove some listeners 2022-02-09 12:33:52 +01:00
Wim Taymans
50c5485efc proxy: don't remove the hooks, but report them leaking
When a client forgets to remove a hook, report them leaked in
the debug log. This is not a problem because we don't usually
add our own removed hook for proxies.

The problem is that we can't forcibly remove them with _clean()
from _destroy() because the hooks might be emitting the removed event
or the object listener. We could try to remove them in the final
unref but it seems some apps free their data before that and then
we unref invalid memory.
2022-02-09 12:22:14 +01:00
Wim Taymans
5fd427b86a client-node: remove preallocated mix entries
Just allocate the dynamically, which allows us to remove the limit.
2022-02-09 09:23:52 +01:00
Wim Taymans
a868122c40 client-node: don't remove mix twice
The mix is added to a list in pw_impl_port_init_mix() and removed
again in pw_impl_port_release_mix().
2022-02-09 09:21:46 +01:00
Wim Taymans
231cc88cad test: don't leak the two objects 2022-02-08 19:04:08 +01:00
Wim Taymans
fae7a1f592 jack: use node.lock-quantum by default
As soon as a JACK app is started, the automatic quantum change is
disabled. This means no pulse/alsa app can change the quantum.

The only way to change the quantum is with node.force-quantum or
with the settings metadata.

This means only a JACK buffersize change (usually controlled from the
JACK app, such as in ardour) or a metadata change (from the command
line) can modify things. Both of those are usually caused by a user
action.

For JACK apps where the quantum is allowed to change automatically,
explicit rules need to be placed in the config.
2022-02-08 18:35:12 +01:00
Wim Taymans
14d252ec9d alsa: try to resync on commit error
When we get a commit error, try to resync our pointers. This fixes a
problem of endless commit errors after a quantum change because it never
manages to resync properly.
2022-02-08 18:31:42 +01:00
Barnabás Pőcze
bf886ba209 support: also protect against recursive invocations
Add an extra private field to the source to store the pollevent of
the current iteration. This changes ABI but it seems an embedded source
is not used outside of our own plugins and the unit test doesn't test
this ABI case.

Whenever a source is removed, we can set the data field of the
pollevent to NULL so that it won't be handled in any iteration anymore.

Avoid dispatching the same event multiple times when doing recursive
iterations.

Add some more unit tests for this.

Fixes #2114
2022-02-08 17:21:10 +01:00
Wim Taymans
9acae229ab context: when force-quantum, remove lock-quantum
If a node (or metadata) forces a quantum, remove any nodes that
requested a lock-quantum so that we can change the quantum to the new
forced one.

This makes it possible to run jack clients with node.lock-quantum while
still allowing them to change the quantum qith node.force-quantum.
2022-02-08 15:36:54 +01:00
Alexandre BIQUE
0b637c3291 support: loop_enter/leave hardening
This commit adds a counter for loop_enter/leave and checks:

 - consecutive enter are used on the same thread
 - leave is used on the same thread as enter
 - at destruction, the enter_count must be 0
2022-02-08 12:02:50 +01:00
Wim Taymans
834ecd733d test: call pw_deinit() at end of test 2022-02-08 11:34:08 +01:00
Wim Taymans
d28af43689 test: fix dll unload
Call spa_handle_clear() on the handle before freeing.
Actually store the loaded dll in the right array.
First clear the handle, then close the dll.
Fix iteration of the dlls.
2022-02-08 11:31:38 +01:00
Wim Taymans
c346ee5e90 support: close log file when we opened it 2022-02-08 11:30:39 +01:00
Wim Taymans
5ac5ebfe19 test: add test for the loop 2022-02-08 11:08:16 +01:00
Wim Taymans
c474846c42 loop: remove destroy list
Now that sources can't be dispatched anymore after a _remove, we don't
need to keep the destroy_list anymore and we can free the source
immediately.

See #2114
2022-02-08 10:18:02 +01:00
Wim Taymans
45d911641b loop: handle remove while dispatching better
Keep the array of dispatched sources around in the loop. When a source
is removed while dispatching, set the data to NULL so that we don't try
to deref the source again or call its function.

Fixes #2114
2022-02-08 10:17:13 +01:00
Wim Taymans
afc88a12e5 tools: cleanup up printf
Make all tools output to stdout (pw-mon mostly) so that we can pipe the
output around.
Send errors to stderr.
fprintf(stdout, ...)  -> printf(...)
setlinebuf for stdout so that pipe works better.

See #2110
2022-02-07 17:03:46 +01:00
Wim Taymans
a16cd95593 spa: move debug log defines to one place
Use spa_debug to debug formats.
Make debug go to stdout by default.
2022-02-07 17:00:38 +01:00
Wim Taymans
136989eaa6 pulse-server: Make node.description
If no node.description is given in the Properties, use the node.name to
make a nicer name.

Fixes #2086
2022-02-06 18:57:44 +01:00
Wim Taymans
cec420478a modules: fix ladpsa source properties
Put the properties on the right stream.

See #2086
2022-02-06 18:57:44 +01:00
Wim Taymans
9ec782630c module: fix argument parsing
Skip spaces before the key. When the previous key ends with a ' or when
there are 2 spaces between keys, the key includes the whitespace
otherwise.

See #2086
2022-02-06 18:57:44 +01:00
Barnabás Pőcze
60b110ff93 pulse-server: rename facility argument to type
The `facility` argument is actually used for
the type of the event, not its facility.
2022-02-06 01:25:02 +01:00
Barnabás Pőcze
3bd40f976f pulse-server: validate subscription mask 2022-02-06 01:12:31 +01:00
Barnabás Pőcze
514f138ec3 pulse-server: client: drop unused argument 2022-02-06 00:49:12 +01:00
Sergiu Bivol
d1784cfd86 Fix style for some Romanian strings 2022-02-05 16:03:59 +00:00
Sergiu Bivol
8457f8eeee Add Romanian translation 2022-02-05 11:02:23 +00:00
Wim Taymans
31159f418f pulse-server: fix compilation... 2022-02-04 17:58:27 +01:00
Wim Taymans
27a8c4ad13 pulse-server: improve module id in instrospect
For the modules that we load internally, place a pulse.module.id
property on the nodes.

If there is no module.id property on nodes, try to use the
pulse.module.id when introspecting. We should not remap those to
serial numbers.

Fixes #2101
2022-02-04 17:47:53 +01:00
Wim Taymans
3b26af32d0 jack: add an option to display default device as system: 2022-02-04 17:06:54 +01:00
Wim Taymans
143fadf68e pulse-server: also remap module property keys and values
When loading a module, remap the pulseaudio properties to pipewire ones
for consistency.

move the media-roles to remap, because it's more about remapping between
pa and pw.

Fixes #2076
2022-02-04 15:15:42 +01:00
Wim Taymans
8c10080324 pulse-server: make sure we don't exceed maxlength
Make sure the various buffer attributes don't exceed maxlength.
Add some SPA_ROUND_UP and SPA_ROUND_DOWN macros.

Fixes #2100
2022-02-04 11:59:57 +01:00