Commit graph

7672 commits

Author SHA1 Message Date
Wim Taymans e1f21ebd0b stream: add spa command include 2021-10-20 11:51:50 +02:00
Wim Taymans 45d9c2c9df pw-cat: use default metadata for default source/sink 2021-10-20 11:40:33 +02:00
Peter Hutterer c2a273b57d gitlab: structure the issue templates 2021-10-20 08:56:43 +00:00
Peter Hutterer 6edbbf6a23 examples: fix NAME for bluez-session 2021-10-20 08:55:27 +00:00
Peter Hutterer 0623c20652 po: remove the media-session service file from POTFILES.skip 2021-10-20 08:55:27 +00:00
KangJing Huang (Chaserhkj) 22aad6eaff Tuning some webrtc parameters 2021-10-19 18:59:07 +00:00
KangJing Huang (Chaserhkj) 2bfc03f43c Allow echo-cancel to select larger buffer sizes 2021-10-19 18:59:07 +00:00
Wim Taymans 002566ae83 test: fix stream ABI test 2021-10-19 17:16:25 +02:00
Wim Taymans 34609389e3 filter: add event to notify command
All commands send to the filter are emited in the command event.
2021-10-19 15:27:14 +02:00
Wim Taymans dfa3f631ec stream: add event to notify commands 2021-10-19 15:23:20 +02:00
Wim Taymans 1cacb64b19 node: make enum for TYPE_EVENT_Node properties 2021-10-19 15:21:10 +02:00
Wim Taymans 100c12460f client-node: handle events, send them to the server part 2021-10-19 12:28:23 +02:00
Wim Taymans b4dc04c777 stream: use sizeof instead of hardcoded value 2021-10-19 12:26:02 +02:00
Wim Taymans b6059fd007 stream: add some debug for commands 2021-10-19 12:25:46 +02:00
Wim Taymans 32c7121e54 impl-node: add method to send a command to a node 2021-10-19 12:24:47 +02:00
Peter Hutterer 6683114e09 po: remove leftover media-session file 2021-10-19 13:27:10 +10:00
Peter Hutterer 98991e7972 doc: fix URL to the media session git repo 2021-10-19 13:25:55 +10:00
Wim Taymans 67209b9ecc resample: add some float math optimization
Multiplying and adding the smaller floats first will reduce the amount
of rounding errors.
2021-10-18 21:19:43 +02:00
Wim Taymans cc996b6292 resample: use blackman with 0.232 alpha
Gives much better results with less aliasing.
2021-10-18 21:09:16 +02:00
Barnabás Pőcze 4c27c3fd43 pulse-server: use for-each loop
Use `SPA_FOR_EACH_ELEMENT` to enumate the elements
in the array instead of an "indexed" loop.
2021-10-18 15:36:22 +02:00
Barnabás Pőcze 3fefb55ef2 pulse-server: return NULL instead of 0
... to be consistent with the vast majority of the
existing source code.
2021-10-18 15:36:22 +02:00
Barnabás Pőcze ee7b82ac9e pulse-server: remove unnecessary NULL check
`spa_streq()` already checks for NULL pointers, so the
pointer does not need to be checked before calling it.
2021-10-18 15:36:22 +02:00
Barnabás Pőcze 80ae688cc6 pulse-server: compile extensions separately
Avoid including other C source files. Compile them separately.
2021-10-18 15:36:17 +02:00
Peter Hutterer b78371f702 tools: update pw-reserve so don't need to include the c file 2021-10-18 20:44:11 +10:00
Peter Hutterer 1bced6b2ef Remove media-session from this tree
It is now available as a separate project in
https://gitlab.freedesktop.org/pipewire/media-session

The code required by pw-reservice has moved to src/tools/reserve.{c|h}
2021-10-18 20:44:07 +10:00
Wim Taymans bd8ec29bb5 link-factory: avoid using 0 for invalid id
Use SPA_ID_INVALID instead of 0 when we fail to parse the port id
so that we don't accidentally match an internal port id.

See #1724
2021-10-18 11:35:25 +02:00
Barnabás Pőcze 0651e12ad8 pipewire-v4l2: actually close file descriptors
Close every file descriptor of a given `struct file` object
in `v4l2_close()` apart from the "main" file descriptor.
2021-10-18 09:03:12 +00:00
Barnabás Pőcze 170f31dedc pipewire-v4l2: increase reference count atomically
The reference count increment in `add_fd_map()` (called from `v4l2_dup()`)
may run at the same time as `unref_file()` (called from `v4l2_close()`).
Atomically increase the refcnt to avoid any problems.
2021-10-18 09:03:12 +00:00
Barnabás Pőcze d21a8caace pipewire-v4l2: only access globals.file_maps while holding globals.lock
`file_map` structures are allocated in a `pw_array`. When inserting into
a full `pw_array`, it is resized to accomodate the new elements. In that case,
all `file_map` pointers may be invalidated. Hence it is only safe to access
`file_map` structs while holding `globals.lock`, which prevents any modifications
to the file map array, thus keeping the references valid.
2021-10-18 09:03:12 +00:00
Barnabás Pőcze 5e1a93d61d pipewire-v4l2: only access globals.fd_maps while holding globals.lock
`fd_map` structures are allocated in a `pw_array`. When inserting into
a full `pw_array`, it is resized to accomodate the new elements. In that case,
all `fd_map` pointers may be invalidated. Hence it is only safe to access
`fd_map` structs while holding `globals.lock`, which prevents any modifications
to the fd map array, thus keeping the references valid.
2021-10-18 09:03:12 +00:00
Wim Taymans e1898812b2 acp: remove duplicate AUX channels in pa channelmap
The pulseaudio channel map can only hold 32 AUX channels and we reuse
them when we need more. When we find a duplicate channel, map it to the
next AUX channels.
2021-10-18 10:53:07 +02:00
Wim Taymans a475926f87 acp: move pro channel init to init_auto 2021-10-18 10:51:48 +02:00
Wim Taymans 9dccd79191 acp: ensure we don't make invalid channels
There are only 32 AUX channels in pulseaudio so wrap around when we
have more.
2021-10-18 10:50:09 +02:00
Wim Taymans 6bb21d6abf acp: fix AUX13 channel mapping
Fixes #1727
2021-10-18 10:01:44 +02:00
Peter Hutterer dfb63d55dd media-session: use the SESSION_PREFIX for any fallback config dir
Regression introduced in 3560f3ba2d

MEDIA_SESSION_CONFIG_PATH expects the actual directory while
PIPEWIRE_CONFIG_PATH and the built-in fallback both expect the files to
reside within the SESSION_PREFIX subdirectory.

Fixes #1725
2021-10-18 07:23:00 +00:00
Peter Hutterer 56f01a293c media-session: fix config load path
config_dir is the new MEDIA_SESSION_CONFIG_DIR environment variable (if
set), impl.config_dir is that or the fallback, whichever applies.

Fixes 00bd3b5b59
Fixes #1725
2021-10-18 07:23:00 +00:00
Peter Hutterer 6f74dc1375 ci: add a build job for the various session managers we build
We allow those jobs to fail so a theoretical issue in the session
managers doesn't prevent our pipeline from completing.
The failure could however be due to our integration of the session
managers, so failures should still be inspected nonetheless.
2021-10-18 09:19:21 +10:00
Peter Hutterer bff243d7f3 ci: clarify a debug message
Where MESON_OPTIONS is empty, the single line "Building with" is not
particularly self-explanatory.
2021-10-18 09:19:21 +10:00
Peter Hutterer 6843d1bffb ci: rebuild the ubuntu container to pick up newer ca-certificates
Otherwise git clone fails for the subprojects.
2021-10-18 08:14:56 +10:00
Wim Taymans c4e1b69df2 doc: add some more links 2021-10-15 19:26:37 +02:00
Wim Taymans e1deecc3cd impl-link: also update node id in properties
The link might have been made using the node name/nick/description but
we always want to place the id in the properties to make it easier for
apps to handle the relations between objects.

See #1723
2021-10-15 17:58:05 +02:00
Wim Taymans 061ab16415 resample: tweak params a little
Gives less aliasing in Sweep-float.wav.
2021-10-15 12:54:49 +02:00
Peter Hutterer a2856c6e0f test: silence coverity warnings about potential tmpdir being NULL 2021-10-15 14:42:26 +10:00
Peter Hutterer 00bd3b5b59 media-session: store the config dir path in our object
The media session modules need to load config files through
sm_media_session_load_conf() and that must be the same config dir as our
main configuration file's directory.
2021-10-15 10:53:32 +10:00
Barnabás Pőcze 5cfdc2620c meson.build: set MEDIA_SESSION_CONFIG_DIR in devenv
Commit 6c156cdbb4 made pw-uninstalled.sh
export the MEDIA_SESSION_CONFIG_DIR environmental variable, its value
being the location of the media-session configuration files in the
build directory.

Export this environtmental variable in the meson devenv as well.

Fixes: 6c156cdbb4 ("media-session: move the media-session config files to here")
2021-10-14 21:54:37 +02:00
Michael Olbrich d2ce51d504 stream: decrement busy counter when releasing dequeued buffers
For buffers on the 'dequeued' list, the busy counter was already
incremented in impl_node_process_input(). So it must be decremented again
when these buffers are removed.
2021-10-14 19:16:56 +00:00
Michael Olbrich 314ff82ff0 pipewiresrc: fix handling outstanding buffers when stopping
The current code has several issues if a pipewiresrc is stopped and deleted
while a buffer is still in use downstream.

 - pw_stream_queue_buffer() is never called for the corresponding
   pw_buffer. As a result, the busy counter is never decremented and
   pw_stream_dequeue_buffer() of the corresponding pipewire output will
   return NULL whenever it encounters this buffer.

 - The pipewiresrc does not own the buffer reference unless the buffer is
   queued in the source, so calling gst_buffer_unref() unconditionally
   causes refcount issues for the buffer.

 - buffer_recycle() can race with on_remove_buffer() and
   gst_pipewire_src_close(). As a result, buffer_recycle() may access pwsrc
   when it was already deleted.

The buffer has its own reference to the pool. So the pool object lock can
be used to ensure that the pwsrc, core and stream remain valid in.
buffer_recycle(). If the 'dispose' function pointer was already cleared,
then on_remove_buffer() has already finished, so abort early.

With the pool lock held, it is save to access the pipewire loop. Now the
loop lock can be used to synchronize with on_remove_buffer(). 'dispose'
must be checked again in case on_remove_buffer() was triggered by something
other than gst_pipewire_src_close().

In on_remove_buffer() unref the buffer if it is queued. Otherwise call
pw_stream_queue_buffer() to ensure that the busy counter is decremented
correctly.
2021-10-14 19:16:56 +00:00
Michael Olbrich 744a8aaeb7 gst: init last_error
Otherwise, it may be used uninitalized.
2021-10-14 19:16:56 +00:00
Wim Taymans d4207d3b0c pw-v4l2: fix script as suggested by shellcheck 2021-10-14 21:14:45 +02:00
columbarius 07d0b14955 spa: specify SPA_FORMAT_VIDEO_MODIFIER as DMA-BUF only
SPA_FORMAT_VIDEO_MODIFIER is only valid with DMA-BUF transport.
For using other types of buffers omit this property.
2021-10-14 20:19:21 +02:00