Commit graph

6902 commits

Author SHA1 Message Date
Wim Taymans
4abcfcdfb9 improve some debug 2021-07-05 16:06:22 +02:00
Wim Taymans
c0b002689b impl-link: don't recalc latency on feedback links
Or else we might keep updating the latency in a loop.
2021-07-05 16:00:27 +02:00
Wim Taymans
dc5ed8f327 thread: add methods to get rt priority range 2021-07-05 11:35:27 +02:00
Peter Hutterer
488150fac6 modules: document roc ports to be TCP/UDP ports
Let's make this really obvious that we're not talking about a pipewire port
here.
2021-07-05 08:57:41 +00:00
Peter Hutterer
765bd417de doc: link the most recent modules as subpages
This sorts them correctly in the navigation bar
2021-07-05 08:57:41 +00:00
Peter Hutterer
d6bb69f2bd doc: add the configuration file format to the online documentation
Mostly copied from the man page but with a more applicable example.
2021-07-05 08:57:41 +00:00
Peter Hutterer
d51634a2f1 man: add --config to the pipewire man page 2021-07-05 08:57:41 +00:00
Evgeniy Khramtsov
91988acb6b utils: fix public API with consumers using _POSIX_C_SOURCE on FreeBSD
cb6dbd165a made public API incompatible with consumers using
_POSIX_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE: <sys/mount.h>
isn't standalone but depends on BSD-specific types in <sys/types.h>
which are hidden when POSIX compliance is requested.

xdg-desktop-portal-wlr passes -D_POSIX_C_SOURCE=200809L via meson.build
which works for its own code and all other dependencies.

In file included from ../src/core/main.c:7:
In file included from /usr/local/include/pipewire-0.3/pipewire/pipewire.h:35:
In file included from /usr/local/include/pipewire-0.3/pipewire/client.h:35:
In file included from /usr/local/include/pipewire-0.3/pipewire/proxy.h:108:
In file included from /usr/local/include/pipewire-0.3/pipewire/protocol.h:48:
In file included from /usr/local/include/pipewire-0.3/pipewire/utils.h:34:
In file included from /usr/include/sys/mount.h:38:
/usr/include/sys/ucred.h:99:2: error: unknown type name 'u_int'
        u_int   cr_version;             /* structure layout version */
        ^
In file included from ../src/core/main.c:7:
In file included from /usr/local/include/pipewire-0.3/pipewire/pipewire.h:35:
In file included from /usr/local/include/pipewire-0.3/pipewire/client.h:35:
In file included from /usr/local/include/pipewire-0.3/pipewire/proxy.h:108:
In file included from /usr/local/include/pipewire-0.3/pipewire/protocol.h:48:
In file included from /usr/local/include/pipewire-0.3/pipewire/utils.h:34:

Reported by: Jan Beich <jbeich@FreeBSD.org>
2021-07-05 08:49:14 +00:00
Wim Taymans
5e0c9199bd context: drop RT when freewheeling
When we are freewheeling, drop the RT priority so that we don't
lock up the system too much.
2021-07-05 10:41:57 +02:00
Wim Taymans
9ceb728dec jack: use the pw_thread_utils interface
Use the pw_thread_utils interface to create/join and acquire/drop
RT priority. This allows JACK apps to also use the configured module to
handle RT priorities.
2021-07-05 10:40:25 +02:00
Wim Taymans
1de16afc40 modules: use pw_thread_utils interface for module-rt*
Let the module-rt and module-rtkit provide a new pw_thread_utils
implementation.

The pw_thread_utils interface has many advantages over the old way
of boosting the thread:

1. Does not require to add a source to the loop and do priority
   boost in-thread.
2. Works on simple threads without data-loop interface.
3. Allows dropping RT priority as well.

The rtkit implementation requires a bit more work because there is
currently no pthread API to map an pthread to a tid. We make a small
wrapper thread to capture the tid with getpid() to do the mapping
ourselves. This should go when the new API arrives. See also:
(https://sourceware.org/bugzilla/show_bug.cgi?id=27880)
2021-07-05 10:26:56 +02:00
Wim Taymans
6b73d49780 data-loop: use new thread interface 2021-07-05 10:10:36 +02:00
Wim Taymans
bfa3c6c137 thread: add interface to manage threads
Add an interface to create and join threads as well as change the
priority on the threads.
2021-07-05 10:05:37 +02:00
Wim Taymans
5088ebacc5 jack: drop/acquire RT when enter/exit freewheel
Freewheel can use a lot of CPU and we don't want our realtime threads to
take up all resources while freewheeling.
2021-07-05 09:56:14 +02:00
Wim Taymans
e2d6545e77 jack: client_thread_id should return the data thread
Add a function in data-loop to get the natvive thread and use that
in client_thread_id() so that it returns the pthread of the
data thread instead of the caller thread.
2021-07-05 09:56:14 +02:00
Wim Taymans
4b9b97841d increase rt.limit from 200ms to 2seconds
200ms seems a little small, some plugins initialize themselves from the
RT thread and get killed. 2 seconds seem to be a better default.

The important part is that there is a limit so that runaway processes
are killed and don't lock up the system.

Fixes #1344
2021-07-04 21:57:54 +02:00
Haochen Tong
77318477bc keys: fix PW_KEY_AUDIO_RATE key name 2021-07-03 19:32:36 +00:00
Wim Taymans
d14c383811 pulse-server: silence UNDERFLOW warning to info
Creating underflows is standard behaviour for many clients. PulseAudio
does not warn about this so we should not either.

Fixes #910
2021-07-03 21:14:48 +02:00
Hector Martin
1c6326439f jack: make cycle_wait() loop until a valid cycle
pw_data_loop_wait() can return due to activity on another socket, so
keep looping until cycle_run() gets a valid command.

Fixes #1386
2021-07-03 16:58:20 +09:00
George Kiagiadakis
df8bd85277 alsa-ctl: filter for and use only the "default" metadata object
Fixes #1384
2021-07-02 17:44:35 +03:00
Gleb Popov
43e4625bbe Use real pthread_setname_np implementation on old FreeBSD.
pthread_setname_np differs from pthread_set_name_np in the return value, so
it is not correct to just #define one to another.
2021-07-01 17:33:45 +00:00
Wim Taymans
797e9b3e0b jack: use RESET_ON_FORK when dropping rt priority
Once we set the RESET_ON_FORK flag we might not have permission to
reset again in drop_rt so simply also set it when dropping.
2021-07-01 15:34:19 +02:00
Wim Taymans
35194d6de0 node-driver: remove timers when not a driver 2021-07-01 12:28:18 +02:00
George Kiagiadakis
45c045382e check_missing_headers.sh: stop looking in the old src/extensions dir 2021-07-01 09:58:47 +00:00
Wim Taymans
620b34cd6b null-audio-sink: only start timers when driving
Check if we are driving or following and only start the timers when we
are the driver of the graph.

Ready events from non-drivers are not really a problem because they are
ignored. They only cause unnecessary wakeups in the graph.
2021-07-01 11:33:21 +02:00
George Kiagiadakis
36c7e820d8 test nodes: make the timerfd non-blocking
Relates to #1377
2021-07-01 11:52:35 +03:00
George Kiagiadakis
5aa9c95390 node-driver: make the timerfd non-blocking
Relates to #1377
2021-07-01 11:52:28 +03:00
George Kiagiadakis
c633004bf3 null-sink: make the timerfd non-blocking
Fixes #1377
2021-07-01 11:37:01 +03:00
Wim Taymans
64a25110dc pulse-server: move quirks to a json blob
Make the quirks table as a json blob so that we can move it
out when we need to.
2021-06-30 18:10:41 +02:00
Wim Taymans
900cb596d3 pipewire-pulse: implement simple quirk database
Add a simple quirks table.

Forces S16 formats for teams sink and source info.

Forces removal of the DONT_MOVE flag for capture streams for firefox.

See #838 and #1363
2021-06-30 17:17:36 +02:00
Barnabás Pőcze
f5d51162c4 treewide: mark things static and const
Mark some structures, arrays static/const at various places.
In some cases this prevents unnecessary initialization
when a function is entered.

All in all, the text segments across all shared
libraries are reduced by about 2 KiB. However,
the total size increases by about 2 KiB as well.
2021-06-30 14:44:08 +02:00
Barnabás Pőcze
48dbb4da3c spa: bluez: native: do not use spa_aprintf()
Instead of spa_aprintf(), convert `rfcomm_send_{cmd,query}`
to take a printf-style format string.

Furthermore, handle overflows and return errors from
`rfcomm_send_{cmd,reply}`. And make those functions
take an rfcomm as argument instead of any spa_source.
And match conversion specifiers to the actual types
in format strings.
2021-06-30 14:44:08 +02:00
Barnabás Pőcze
c0e158aa0c pipewire: global: take const argument
The elements of the array are never modified,
so change the argument to be `const`.
2021-06-30 14:44:08 +02:00
Barnabás Pőcze
9aacd36f37 pipewire: properties: take const argument
Since these particular methods never modify the
lists they receive, make the arguments `const`.
2021-06-30 14:44:08 +02:00
Barnabás Pőcze
73ea24a356 pulse-server: module-pipe-source: don't queue partial samples
If the number of bytes read is not a multiple of the stride,
then partial samples may be queued. Avoid that by storing the
last partial sample (if any) in a separate buffer,
and only queue full samples.
2021-06-30 14:44:08 +02:00
Barnabás Pőcze
8a61374592 pulse-server: module-pipe-source: set error code when entity is not pipe
Previously, the code did not set any error code, leaving res = 0,
when the file existed but it wasn't a pipe. This resulted in no
status code being returned to the client.
2021-06-30 14:44:08 +02:00
Barnabás Pőcze
9076e3e80b pulse-server: module-pipe-source: do not unlink fifo if it was there
If the module did not create the FIFO, then it should not remove it.
2021-06-30 14:44:08 +02:00
Barnabás Pőcze
7cb7d8b15b pulse-server: module-zeroconf-publish: handle uname() failure gracefully
Only add the "uname=..." entry to the Avahi string list
if `uname()` succeeds.
2021-06-30 14:44:08 +02:00
Barnabás Pőcze
9994a763d6 pulse-server: module-zeroconf-publish: remove static
`sysname` need not be static since `avahi_string_list_add_pair()`
creates a copy, and no other parts of the code have reference to
`sysname` that would require static lifetime.

Furthermore, do not hardcode the size of the array.
2021-06-30 14:44:08 +02:00
Wim Taymans
324894e605 keys: add object.register property
Add a new object.register boolean property.

Make adapter and remote-note only register when object.register
is true.

Make stream and filter not register themselves. They are always
exported to a remote server and thus don't need local
registration.

Fixes #1309
2021-06-30 13:49:34 +02:00
Wim Taymans
2c5d89ff19 pw-cli: allow '-' for port/node in create-link
Passing a '-' as the port or node for create-link will omit sending
the property to create-link so we can check if the link factory handles
missing properties too.

See #1365
2021-06-30 11:52:57 +02:00
Wim Taymans
27b9f469b5 impl-port: avoid recalculating latency on destroying port
Fixes a crash.

Fixes #1371
2021-06-30 09:36:36 +02:00
Niklāvs Koļesņikovs
0436793299 doc/meson.build: pruning of unused find_program() 2021-06-29 17:23:37 +00:00
Niklāvs Koļesņikovs
e062c4d8de meson.build: adds summary() to optional programs 2021-06-29 17:23:37 +00:00
Wim Taymans
ae89ae093e acp: strip UCM alibpref from mapping
Strip the alibpref from the device string in the mapping name. This
name is used to generate the node name eventually and we don't want
this random identifier in it.

Fixes #1362
2021-06-29 17:43:00 +02:00
Wim Taymans
d1c6114423 media-session: don't try to link to the same link-group
Avoid linking streams to a node of the same link-group because that
would be a circular link.

Fixes #1360
2021-06-29 14:02:23 +02:00
Wim Taymans
c4971d17c4 keys: add node.link-group property
The node.link-group property marks streams that are internally linked
together in some way. It is used to relate the input and output streams
of some of the module streams.
2021-06-29 13:49:55 +02:00
Wim Taymans
6a0cf77985 NEWS: fix some spelling mistakes 2021-06-29 13:19:53 +02:00
Wim Taymans
5497d2d907 pw-cat: fix format string 2021-06-28 17:21:28 +02:00
Wim Taymans
82f2e85a0f fmt-ops: fix neon stereo resample 2021-06-28 17:20:50 +02:00