Commit graph

7922 commits

Author SHA1 Message Date
Wim Taymans 62509f23d7 impl-core: pass data to listener user_data
So that we can get to the registry resource.
2021-11-08 12:56:00 +01:00
Wim Taymans 5ed4977b38 destroy proxies when global is removed
When a global is removed, also remove the proxies. We can have multiple
proxies to a global otherwise when a client has a sequence of events
queued from the server like this:

Global 1 added
Global 1 removed
Global 1 added

The proxy we added in the firt event would not be destroyed because the
server did not know about it when global 1 was removed and then a
second one would be made.
2021-11-08 12:55:41 +01:00
Pauli Virtanen 2329a4d323 bluez5: quirks for headset without a2dp duplex codecs
See #1756 (another headset with non-working, probably faststream duplex)
2021-11-08 08:25:55 +00:00
Wim Taymans fc12e5bed0 jack: improve port sort order
Sort ports per node and then per node-specific port_id. This will
keep related ports together and will sort them based on when they
were created.

Fixes #1780
2021-11-08 09:23:20 +01:00
KangJing Huang (Chaserhkj) bb407e8153 Wire up webrtc aec parameters to args 2021-11-06 05:20:33 -04:00
Wim Taymans 743f699193 pulse-server: try to not put pointers in info messages
It's not very helpful, prefer to use human readable strings and move the
more techincal stuff in debug messages.
2021-11-05 16:22:22 +01:00
Wim Taymans 2f3e65c049 pulse-server: leave the draining state
Use pw_stream_set_active() to leave the draining state so that our
process methods are called again and we can resume.
2021-11-05 15:47:49 +01:00
Wim Taymans 90fe579b29 stream: make _set_active(true) leave the draining state
If the stream is drained, make _set_active(true) leave the draining
state so that the process() events are emitted again and buffers will
be pushed().
2021-11-05 15:45:55 +01:00
Wim Taymans 0cccff517b pulse-server: send the drained event only once
Only send the drained command once. pw-stream keeps on emitting drained
events as longs as the stream is drained.
2021-11-05 15:42:33 +01:00
Wim Taymans 6ca297797f pulse-server: ensure latency is multiple of frame_size 2021-11-05 13:31:09 +01:00
Barnabás Pőcze 01de0b966a spa: bluez: simplify and move handling of some AT commands
Simplify the key-value pair parsing for AT+IPHONEACCEV commands,
and move the handling of {key,indicator}-value pairs into
dedicated functions. Furthermore, fix a comment.
2021-11-04 18:42:29 +01:00
Barnabás Pőcze bdd7570c6f spa: bluez: simplify loop
`spa_list_for_each_safe()` is not needed as the list is not
modified during the traversal, so use `spa_list_for_each()`.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze f71910c665 spa: bluez: rename variable
The `optlen` variable holds the size of a socket address,
so rename it to `addrlen`.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze 6410a2dfa4 spa: bluez: fix spelling 2021-11-04 17:16:14 +00:00
Barnabás Pőcze 1f927838e2 spa: bluez: remove unnecessary return 2021-11-04 17:16:14 +00:00
Barnabás Pőcze 4bdf495747 spa: bluez: move profile selection to function
Move the profile selection from `profile_new_connection()`
into a separate function to avoid checking the string more
than necessary.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze dd4587acef spa: bluez: change argument type
Take the `rfcomm` object directly instead of taking a `spa_source`
object and retrieving the `rfcomm` object via its `data` member.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze 4cf889a5f0 spa: bluez: use switch
Use a switch statement instead of an `if` because it is more
suitable in the presence of `#ifdef`s, it avoids potential
unnecessary extra checks.
2021-11-04 17:16:14 +00:00
Barnabás Pőcze 73690d6662 spa: bluez: add missing else 2021-11-04 17:16:14 +00:00
Barnabás Pőcze 57ff7abc68 spa: bluez: use spa_startstartswith() where appropriate 2021-11-04 17:16:14 +00:00
Wim Taymans b96f15d2fe pulse-server: improve latency setup a little
Reorganize the latency setup in one place, return a desired device
latency for use as quantum.

PulseAudio assigns half of the (tlength - minreq) latency to the sink
but we can't do that because our sinks have a max-quantum of latency.
Fix this by clamping our calculated sink latency to the quantum

PulseAudio subtracts the sink latency from the tlength in adjust latency
mode, so we need to do the same.

This makes PULSE_LATENCY_MSEC values bahave more like pulseaudio.

See #1769
2021-11-04 18:07:30 +01:00
Wim Taymans 86ca0f8466 acp: improve debug of channel map
Increase the size of the channel_map debug printf buffer.
Use a safer version of the snprintf that avoids buffer overruns.

See #1781
2021-11-04 16:41:32 +01:00
Wim Taymans efd8ac25e3 pulse-server: don't emit _removed without havine emitted _added
Don't emit _removed for objects that are still being created because
we did not emit an _added signal for them yet.
2021-11-04 12:50:18 +01:00
Wim Taymans abacea5ca0 libcamera: improve debug 2021-11-03 17:49:10 +01:00
Wim Taymans 0fd5e3fdb2 libcamera: implement allocation and dataflow
Keep track of the negotiated parameters and use those to construct
the Buffers param.

Use the FrameAllocator to allocate buffer memory. Keep a request for
each buffer and queue them.

In requestComplete, put the request metadata info into the buffer and
header and write the finished buffer id to a ringbuffer. Then wake up
the data thread to pop the finished buffer_id and push it in the
graph.

Remove some old files.
2021-11-03 17:49:10 +01:00
Wim Taymans b2c38a2b3b libcamera: work on rewrite
Use manager to hotplug devices
Use StreamConfig to enumerate formats
2021-11-03 17:49:10 +01:00
Wim Taymans b0e3e43c42 pw-mon: destroy proxies in global_remove event
Keep track of the proxies and remove them when the global is removed.
Otherwise we might end up in a case where the have 2 proxies when
an add/remove/add sequence of messages was queued.
2021-11-03 17:25:11 +01:00
Wim Taymans f70fdf5605 pulse-server: also remove creating objects
When an object is created, it is marked creating until all roundtrips
complete. If the object is removed in between, we don't remove it
because find_object does not return creating objects.

Make find_object also return the creating objects to fix this.
2021-11-03 16:57:41 +01:00
Wim Taymans 73bf30efa6 module-zeroconf: translate audio format
The audio format in the avahi messages is in pulseaudio format so
translate it to PipeWire format in audio.format.

See #1745
2021-11-03 12:54:58 +01:00
Wim Taymans 84ecebbd4e cpu: only run SSE code when supported
Check if we can run SSE instructions before executing the denormals
SSE code.

Fixes #1775
2021-11-02 20:12:35 +01:00
Thomas Weißschuh 7d9b49293c core: add runtime fallback for nonpresent getrandom() sycall
The current compile-time-check only tests for the getrandom() syscall
wrapper of libc. The presence of this wrapper however does not relate to
the presence of the actual syscall at runtime.
2021-11-02 17:55:24 +01:00
Wim Taymans 25ddf0e3cf alsa-plugin: fix a compiler warnings 2021-11-02 17:18:58 +01:00
Martin Geier 1b96142903 alsa: do not ignore rate change when stream is already created
gstreamer alsasink can change sample while stream is already created.
In that case, gstreamer calls snd_pcm_ioplug_callback_t::stop,
snd_pcm_ioplug_callback_t::hw_params and snd_pcm_ioplug_callback_t::prepare

Add new flag to the snd_pcm_pipewire_t that is set every time
snd_pcm_pipewire_hw_params is called to prevent using stream with old
sample rate

Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
2021-11-02 15:37:07 +00:00
Martin Geier a7d238ed59 alsa: increase precision of delay function
pw->time.delay is delay in number of frames in pw->time.rate domain,
however snd_pcm_pipewire_delay function is suppose to return number of
frames in io->rate domain. Convert pw->time.delay to io->rate domain to
increase precision when the io->rate is not equal to the pw->time.rate

snd_pcm_pipewire_delay should return how many frames are queued in
pipewire, pw_stream_get_time returns numbers of the queued frames before
snd_pcm_pipewire_process is called, however this function inserts (or
removes) some frames from pipewire. Therefore newly inserted (removed)
frames should be added to pw->time.delay to increase precision.

Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
2021-11-02 15:37:07 +00:00
Aleix Pol 925644fbcc spa/meta: Expand the documentation of SPA_META_VideoDamage
A bit of explanation of how it's meant to be used.
2021-11-02 15:53:16 +01:00
Wim Taymans 859e95126b alsa-seq; use port_type to check port type
Don't use the capabilities for checking the port type.
2021-11-02 14:57:36 +01:00
Thomas Weißschuh 4921c5e94b defs: use intptr types where applicaple
Instead of doing pointer arithmetic through actual pointers, cast them
to the proper integer types.
This is functionally equivalent to the previous code but is clearer for
the compiler.

Fixes #1018
2021-11-02 09:54:10 +00:00
Pauli Virtanen bbc2136e89 meson: ensure all examples are included in doc
Move declaration of examples to use same file lists for build and docs.
2021-11-02 09:46:14 +00:00
Wim Taymans 6ebd589659 alsa-plugin: _prepare will clear the draining state
Leave the draining state when _prepare is done.

See #1467
2021-11-02 10:17:31 +01:00
Wim Taymans 9fee88239a pipewire-v4l2: only compile V4L2_BUF_CAP_SUPPORTS* when defined
Fixes #1766
2021-11-02 09:43:59 +01:00
Wim Taymans 3c8a60944f pipewire: handle NULL plugin_dir
We can't load plugins when the plugin directory is unspecified, either
in config.h or with SPA_PLUGING_DIR in the environment.

Fixes #1774
2021-11-02 09:18:42 +01:00
Wim Taymans 9f134ee79d v4l2: add support for ParamBegin/End
To keep the device open while we perform a series of param
enumerations.
2021-10-29 15:41:27 +02:00
Wim Taymans 9facfca45b jack: add option to disable monitor ports
Add a jack.show-monitor option (default true) that makes it possible
to hide the monitor ports.

Monitor ports are not enabled by default on JACK and maybe they also
should not for PipeWire. Or maybe we need some tweaks for some apps.

See #1760
2021-10-29 09:27:46 +02:00
Wim Taymans 0ace131d72 audioconvert: add stereo deinterleave neon asm
This can take some shortcuts and convert twice as many samples in one
iteration as the strided stereo deinterleave one.
2021-10-28 11:30:04 +02:00
Peter Hutterer 6fab8fabca meson: add a libv4l2-path option to match libjack-path
pw-v4l2 uses the gnu ld's ${LIB} features, see meson.build.
Make it possible to work around this by specifying an explicit path,
just like for pw-jac.

Fixes #1751
2021-10-28 07:38:02 +00:00
Wim Taymans f39f9b207b map: don't mix insert_at() and _remove()
You are supposed to allocate with _insert_new()/_remove() or use
someone elses allocated number with _insert_at(), never mix the
two or it will give an error.
2021-10-28 09:36:41 +02:00
Simon McVittie f6b1d65e35 core: Use /dev/urandom for getrandom fallback
Sami Farin pointed out on #833 that on Linux kernels older than 5.6,
/dev/random blocks when entropy estimates are too low, whereas
/dev/urandom does not.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-10-28 07:15:50 +00:00
Wim Taymans 3509962f3a module-session-manager: don't leak the impl structure
We need to remove the listener for the object as well so that we
can safely free the impl memory.
2021-10-27 17:41:32 +02:00
Wim Taymans 2112a7287b tests: add new ABI test for stream 2021-10-27 11:31:39 +02:00
Wim Taymans a84e43e3ee examples: update some examples with RequestProcess
Let video-src unconditionally call _trigger_process() when it is
ready. This will either start the graph when it is the driver or emit
a RequestProcess event to the driver.

Let video-play-pull intercept the RequestProcess command and use it
to do a trigger_process(). Otherwise use a timer to pull in the next
frame.
2021-10-27 11:20:06 +02:00