Commit graph

8351 commits

Author SHA1 Message Date
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
Wim Taymans
877dc77645 conf: move rule matching to config
And remove duplicated code. This is generally useful and sufficiently
generic API to include.
2022-02-04 10:43:31 +01:00
Barnabás Pőcze
cc73053512 treewide: meson.build: use feature.allowed()
Since meson 0.59.0, a feature object has an `allowed()`
method which returns true when the feature is set to
'enabled' or 'auto'.

Utilize that instead of the previously used

  not feature.disabled()
2022-02-04 00:15:59 +01:00
Barnabás Pőcze
15e7a61aa7 treewide: only define feature macros when the feature is available
Most feature checks already use #ifdef, and do not care about
the value of the macro. Convert all feature checks to do that,
and simplify the meson build scripts by replacing

  if cond
    cdata.set('X', 1)
  endif

with

  cdata.set('X', cond)
2022-02-04 00:15:59 +01:00
Barnabás Pőcze
140378efd6 meson.build: remove unused config macro 2022-02-04 00:15:59 +01:00
Barnabás Pőcze
9afffc1815 meson.build: only set HAVE_DBUS once
HAVE_DBUS is already set in the top-level meson.build file.
2022-02-04 00:15:59 +01:00
Barnabás Pőcze
7b0f22636f meson.build: remove unused feature macros 2022-02-04 00:15:59 +01:00
Pauli Virtanen
97a5fe80c1 spa/alsa-udev: fix /proc/asound handling without CONFIG_SND_VERBOSE_PROCFS
For kernels compiled with CONFIG_SND_VERBOSE_PROCFS=n, the pcmXX
/proc/asound entries do not exist.  In that case, the "device busy"
check cannot be done, but we should still check existence of PCM devices
correctly.

Count the number of PCM devices from /dev/snd, which should work also
without /proc/asound or /sysfs/class/sound.
2022-02-03 18:28:25 +00:00
Wim Taymans
ae077a4967 doc: update with config overrides info 2022-02-03 17:31:01 +01:00
Wim Taymans
7ac809618e pw-link: improve help and error messages
See #2089
2022-02-03 16:39:52 +01:00
Wim Taymans
a947faeaa0 pw-link: clarify -L option
-L is enabled by default, unless -m is specified.
2022-02-03 16:30:06 +01:00
Wim Taymans
b5cd6d02fd pw-link: fix -L comment 2022-02-03 16:22:21 +01:00
Wim Taymans
76417fd2a6 alsa: use MONOTONIC clock for tstamp 2022-02-03 16:22:09 +01:00
Wim Taymans
7480d09589 alsa: update test-timer
Remove the bandwidth reduce, we don't do that.
Clamp large errors.
Add htimestamp mode, which seems more stable.
2022-02-03 16:22:09 +01:00
George Kiagiadakis
ee2e6412d3 pipewiresink: set a default channel map if the number of channels is fixed
This allows remaping streams using pipewiresink to match the channel layout
of the target device
2022-02-03 15:10:25 +02:00
Wim Taymans
bdd407fe66 0.3.45 2022-02-03 12:24:24 +01:00
Wim Taymans
3a5c2ec623 jack: exit do_sync when in error
When we are already in error, return the error right away.
2022-02-03 12:01:30 +01:00
Wim Taymans
7506d12b07 examples: filter can return NULL buffers 2022-02-03 11:15:46 +01:00
Wim Taymans
0659f090fc filter-chain: add FL to FL-FR duplication 2022-02-03 11:03:24 +01:00
Wim Taymans
92e58eeb4f link-factory: allow usage without a client
So that it can be used in the config files.

Fixes #2095
2022-02-02 21:34:23 +01:00
Wim Taymans
1a911a9ccd resource: allow NULL resource in error
And then log en error instead.
We can remove some awkward patterns in modules.
2022-02-02 21:33:33 +01:00
Wim Taymans
8aea38e81a resource: fix log topic 2022-02-02 21:32:28 +01:00
Wim Taymans
336bc0eee5 log: add pw_logtv macro 2022-02-02 21:31:49 +01:00
Pauli Virtanen
b369401c8e spa/alsa-udev: retry busy devices on inotify close event, not timeout
Alsa device acp probe results to missing profiles if some PCM devices
are busy. Currently, we retry based on a timeout and give up after some
retries. However, exposing cards with missing profiles is never
useful.

Never expose cards if some PCM devices are busy. Instead, retry adding
device on inotify fd close events, which arrive when some process has
closed a PCM device.

When probing for devices in alsa-udev, check via /proc to avoid inotify
busy loop.
2022-02-02 16:43:54 +00:00
Wim Taymans
4341d27c2c pulse-server: don't make fake channels for iec958
Just leave the channels as they were.

See #1442
2022-02-02 17:41:23 +01:00
Wim Taymans
33607f769c pulse-server: don't update channels when unset 2022-02-02 17:40:57 +01:00
Barnabás Pőcze
e63dee6075 pulse-server: check reference count of sample when freeing it
When the pulse server context is being freed, only a single reference
should be alive to each sample because the pending samples
are all destroyed beforehand.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
f181210b29 pulse-server: properly unload modules
Instead of simply calling `module_free()`, actually unload
the modules when the pulse server context is being freed.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
a79bb60754 pulse-server: clean up everything when the context is destroyed
Clean everything up when the context is destroyed to avoid
problems stemming from the destruction order of objects
in the context.

Furthermore, free messages after all clients have been freed
because `client_free()` may very well call `message_free()`
which would lead to memory leaks if `impl->free_messages` were
processed first.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
1bf00720e3 pulse-server: do not manage client lifetime during stream cleanup
A stream's lifetime is tied to that of the client, it cannot outlive
the client object. Streams also do not increase the client's reference
count. It is not possible for a stream to exist after the corresponding
client has been destroyed.

Hence it is not necessary to manage the client's reference count
or lifetime in `do_destroy_stream()`. All works related to a particular
stream are cancelled in `stream_free()`, which is called
before the client is destroyed.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
194c0f9c99 pulse-server: stream: remove done flag
When the `done` flag was first added in
9f9be7d7f2, it was
actually needed because cleanup was implemented
using a per-client eventfd which was signalled when
something related to the particular client needed
to be freed. The function that ran, then, checked
each stream's `done` flag, and freed them as necessary.

However, since c70a5de526,
the stream cleanup is done using a work queue, and as
a consequence, the `done` flag is no longer needed.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
4426da6a62 pulse-server: client: remove disconnecting flag
When the `disconnecting` flag was first added in
d44fdabea1, a client's
streams were not explicitly destroyed when it was freed,
instead, only the client's pw_core was disconnected,
which then caused all related streams to be destroyed.

Thus there needed to be a way to determine why the stream's
state changed to PW_STREAM_STATE_UNCONNECTED as it may have
been because the client is disconnecting or because the
stream has been "killed" in some other way.

The `COMMAND_{PLAYBACK,RECORD}_STREAM_KILLED` command
only needed to be sent to the client in the second case.

However, at the moment, all streams of a client are explicitly
destroyed before it's pw_core is disconnected. This makes the
`disconnecting` flag unnecessary, thus it can be removed.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
f5e561c2fe pulse-server: module: remove unused client argument
None of the modules use the `client` argument in their
unload callbacks. Remove it.
2022-02-02 15:40:43 +00:00