Commit graph

5456 commits

Author SHA1 Message Date
Pauli Virtanen
0c74b90f0e bluez5: helper functions for querying codecs on device 2021-02-02 09:56:29 +00:00
Pauli Virtanen
b642c7f209 bluez5: support device capability checks beyond A2DP caps + split sbc-xq to separate codec
We would like to have BT device codec capability checks beyond what's
possible based on A2DP caps.

Split SBC-XQ to a separate codec, and enable it in the device-dependent
check (although currently it just uses the config option).
2021-02-02 09:56:29 +00:00
Pauli Virtanen
e860f2bb4e bluez5: basic codec-switching framework 2021-02-02 09:56:29 +00:00
Pauli Virtanen
0908588d0c bluez5: add codec check_caps + check vendor codec id for ldac & aptx 2021-02-02 09:56:29 +00:00
Pauli Virtanen
ce335b6d88 bluez5: keep track of remote endpoints 2021-02-02 09:56:29 +00:00
Wim Taymans
748e205453 pulse-server: hand out silence when corked
In the corked state we simply hand out silence and don't try to
consume data from our ringbuffer.
Also set the corked state before syncing this with the data thread.

Fixes #662
2021-02-02 10:42:34 +01:00
Wim Taymans
a18a8c9e32 media-session: save and restore profile ports
Save the last explicitly set ports per profile.
When a profile change happens, restore the saved ports or select
the best port when nothing was saved.
2021-02-01 18:02:32 +01:00
Wim Taymans
be6410909f audioadapter: remove some unused code 2021-02-01 15:16:39 +01:00
Wim Taymans
5e15411af4 alsa-monitor: use max channels on non-ACP devices
Otherwise, they might still negotiate to something less than the
max channels.
2021-02-01 15:16:39 +01:00
Wim Taymans
80368ab8ae pulse-server: remove unused macro 2021-02-01 15:16:39 +01:00
Huang-Huang
b9f2e6a8c4
bluez5: disable HSP AG by default in native backend 2021-02-01 03:39:49 +08:00
Huang-Huang
f6cc45f736 bluez5: allow headset roles selecting 2021-01-31 18:12:07 +00:00
Huang-Huang
b66e67db14
bluez5: unregister HSP dbus object paths when current HSP/HFP registration fails 2021-02-01 00:01:23 +08:00
Huang-Huang
c778bd734c
a2dp: improve codec specific transport socket send buffer size setting 2021-01-31 09:01:40 +08:00
Wim Taymans
60aef11072 pulse-server: if prebuf == 0, keep increasing playing_for
Or else the client pauses and time stops. Makes GStreamer
pipelines complete.
2021-01-30 21:04:07 +01:00
Wim Taymans
d1c0244512 pulser-server: keep updating missing bytes if prebuf == 0 2021-01-30 20:38:47 +01:00
Wim Taymans
d37742b410 pulse-server: handle prebuf better
prebuf == 0 should keep the read pointer updating
prebuf > 0 should pause
2021-01-30 19:48:01 +01:00
Wim Taymans
98dab7903a pulse-server: add buffer attributes as properties 2021-01-30 19:32:13 +01:00
Wim Taymans
28376d1db2 bluez: avoid warning 2021-01-30 19:31:52 +01:00
Pauli Virtanen
494194c4bf bluez5: allow selecting codecs to use in config file
For debugging, it may be useful to disable some of the codecs.  Enable
configuring this in config file, to make it more convenient for users,
who may not know how to recompile/install pipewire.
2021-01-30 17:23:07 +00:00
Pauli Virtanen
f7db158bd6 media-session: give bluez5 objects driver.priority
Makes bluez devices as automatic default devices, with priority slightly
larger than alsa devices.  The priority.driver is also used by
pulse-server on determining automatic default devices, when no default
has been manually set.
2021-01-30 15:00:33 +02:00
Wim Taymans
8fd120cb23 media-session: recheck route status when != available
Save the new state so we can detect changes
Check for available != yes to also recheck when the state becomes
unknown.
2021-01-29 17:23:02 +01:00
Wim Taymans
f43bcca35e media-session: implement route selection and restore
Disable automatic port configuration in acp and move the logic
to the session manager.
Implement initial port selection and restore on profile activation.
Implement route switch when unavailable
Implement port settings save.
2021-01-29 16:59:17 +01:00
Wim Taymans
7cc5026c02 pulse-server: remove useless _pop() 2021-01-29 16:58:17 +01:00
Wim Taymans
2a1875fc35 bluez: disable pause on idle by default 2021-01-29 15:37:32 +01:00
Wim Taymans
ab5059cd07 alsa: add array of devices in EnumProfile
So that we can enumerate the possible Routes per device for
this profile as well.
2021-01-29 15:27:25 +01:00
Wim Taymans
1ea8282a24 pulse-server: don't update ringbuffer in underrun 2021-01-29 10:45:26 +01:00
Wim Taymans
6370d75efd json: init value to ->cur instead of NULL
Or else we end up with a return value of ->cur - NULL, which might look
lik a positive result and cause a crash later on.

Fixes #641
2021-01-29 09:18:59 +01:00
Jakub Adam
c64bf36e8e gst: avoid crash with zero SPA_PARAM_BUFFERS_size
With sending and receiving pipelines:

  gst-launch videotestsrc ! tee !  pipewiresink mode=provide

  gst-launch pipewiresrc path=<node_id> ! videoconvert ! autovideosink

The first pipeline crashes when the other connects.

It happens because SPA_PARAM_BUFFERS_size passed to
pw_stream_update_params() upon pipewiresink's buffer pool activation is
zero. As a consequence, in gst_pipewire_pool_wrap_buffer(), d->type will
be SPA_ID_INVALID and the created GstBuffer will have no memory
appended. This ultimately leads to segfault in do_send_buffer().

If size hasn't been set in GstPipeWirePool's config before the
first buffer is to be rendered by pipewiresink, configure the pool with
the size of that first incoming buffer and activate the pool.
2021-01-28 20:50:07 +01:00
Wim Taymans
f8d57d03ca pulse-server: keep separate counter for missing bytes
And only increment when consumed from ringbuffer. In underrun we
play silence and don't ask for the missing bytes.

Fixes #616
2021-01-28 20:00:48 +01:00
Wim Taymans
09f423922d pulse-server: don't crash when alloc fails 2021-01-28 19:30:32 +01:00
Wim Taymans
0b69b92dc8 json: init value with NULL
Fixes #641
2021-01-28 19:19:59 +01:00
Wim Taymans
8636c509f5 pulser-server: revert attempt to flush more
size is later used as the buffer size and might be too large.
2021-01-28 19:17:50 +01:00
Wim Taymans
b65b291bb2 pulse-server: make sure to count played samples
On underrun we need to keep on counting playing_for so fill this
in underrun and don't add this to missing to avoid double counting.

See #639
2021-01-28 18:59:03 +01:00
Wim Taymans
ac3555d6fc pulse-server: skip underrun more aggressively
Skip all of the underrun bytes immediately.

See #638
2021-01-28 17:56:32 +01:00
Wim Taymans
e172effe71 pulse-server: log the amount of underrun bytes 2021-01-28 17:56:07 +01:00
Jonas Holmberg
0ccad38df1 alsa-pcm: Fix target calculation
Use threshold instead of last_threshold so that early wakeup is detected
in handle_capture() when duration changes.
2021-01-28 16:18:35 +00:00
Wim Taymans
c0ed88f2f9 media-session: always try to activate the saved profile
When the current profile is not the saved profile, check if the
saved profile is available again and try to activate it.
2021-01-28 16:56:27 +01:00
Wim Taymans
f03deb5324 media-session: try to avoid switching away from hdmi
When HDMI goes to sleep the profile becomes unavailable. Avoid
switching to Off in that case.
2021-01-28 15:41:14 +01:00
Wim Taymans
fc08c79dad media-session: start timeout only when something changed 2021-01-28 14:36:29 +01:00
Wim Taymans
072d3a191c media-session: keep track of all active routes
Keep track of active profile in default-routes so that we can restore
the prefered routes later.
Keep track of all active routes in an array. There can be more than
one active route per direction.
New routes will get their volume restored. Route changes will be saved.
2021-01-28 14:28:46 +01:00
Wim Taymans
b8bac95dad media-session: add info logging to profile restore logic 2021-01-28 11:43:17 +01:00
Wim Taymans
b2e4f1358d bluez5: clean up some profile names 2021-01-27 20:50:23 +01:00
Wim Taymans
7fa1833310 bluez5: use function to get profile name 2021-01-27 20:39:02 +01:00
Nicolai Syvertsen
ebcdfe8f5d pipewire-pulse: better default null sink description
This includes the sink_name and media class.
2021-01-27 19:09:21 +01:00
Nicolai Syvertsen
c092f0c1c4 pipewire-pulse: null sink must have a description
Certain pulseaudio clients crash if this is unset
2021-01-27 15:31:54 +00:00
Wim Taymans
5dc2a7b793 policy-node: reverse config direction for virtual devices
For a virtual source we want to configure it like a sink with
input ports and the monitor ports as the capture ports.
2021-01-27 16:27:06 +01:00
Wim Taymans
295cba8404 policy-node: a virtual source is an output node 2021-01-27 16:14:39 +01:00
Wim Taymans
82bc0710f0 media-session: use a default volume if unknown
Set a safe volume when there is no previously saved volume.
2021-01-27 15:44:52 +01:00
Wim Taymans
0be851739f improve config parsing
Use get_string to get object keys in a more generic way.
2021-01-27 15:36:32 +01:00